Micro-service data processing method and device, computer equipment, readable storage medium and program product

By using the service cache service data of service cache components in microservices cluster, the problem of decline in the performance of micro -service clusters and difficulty investigation of fault detection, and realizing the continuous and stable operation of the microservice system and the improvement of service availability.

CN119363549APending Publication Date: 2025-01-24SHENZHEN COMTOP INFORMATION TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411386685.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

As the scale of microservice clusters expands, the performance of microservice clusters based on existing frameworks is degraded and troubleshooting is difficult, which affects the availability of microservice clusters.

Method used

The service data of the microservice cluster server is cached through the service cache component. When the microservice cluster server fails, the cached data is searched for processing to ensure normal response to service requests.

Benefits of technology

It improves the availability of microservice clusters, ensures the continuous and stable operation of the microservice system, and improves the continuity and availability of services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363549A_ABST
    Figure CN119363549A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-service data processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: caching service data of a micro-service cluster server through a service cache component; when it is monitored that the micro-service cluster server breaks down, service data cached by a service cache component are searched; under the condition that a micro-service portal server corresponding to the micro-service cluster server receives the service request, processing the service request based on the service data cached by the service cache component to obtain a service processing result; and feeding back a service processing result. According to the application, the service data of the micro-service cluster server is cached through the service cache component, so that when the micro-service cluster server fails, the service cache component can support normal operation of the service, continuous and stable operation of the micro-service system is guaranteed, and the continuity and availability of the service are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a microservice data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of computer technology and software development, microservice technology has emerged. Microservices (or microservice architecture) is a cloud-native architecture approach that contains many loosely coupled and independently deployable small components or services in a single application. These services usually have their own technology stack, including databases and data management models; communicate with each other through a combination of REST API, event streams, and message brokers; and are organized according to business capabilities, with service separation lines usually called bounded contexts. With the development of cloud computing and microservice architecture, more and more applications are split into small microservice units, which brings challenges to application deployment, operation and expansion. Therefore, microservice registration and discovery has become an important technology in microservice architecture. By using a registration center, microservices can automatically register and manage their own metadata, while other microservices can also discover and call the required services through the registration center, thereby achieving decoupling and dynamic expansion between services.

[0003] Currently, various types of microservice registration and discovery tools and frameworks, such as Consul, Etcd, Zookeeper, and Eureka, can be used to implement microservice registration and discovery-related processing. However, as the scale of the cluster expands, microservice clusters based on these frameworks will also experience performance degradation and difficulty in troubleshooting, thereby affecting the availability of the microservice cluster. Summary of the invention

[0004] Based on this, it is necessary to provide a microservice data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the availability of a microservice cluster in response to the above technical problems.

[0005] In a first aspect, the present application provides a microservice data processing method, which is applied to a microservice system based on a microservice architecture, wherein the microservice system includes a terminal, a microservice entry server, and a microservice cluster server, including:

[0006] Cache the service data of the microservice cluster server through the service cache component;

[0007] When a microservice cluster server is detected to have a fault, search for service data cached by the service cache component;

[0008] When the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result;

[0009] Feedback the service processing result.

[0010] In one embodiment, caching the service data of the microservice cluster server by the service cache component includes:

[0011] Based on the preset update cycle, the service cache component periodically initiates data polling requests to the microservice cluster server;

[0012] When receiving the data update information fed back by the microservice cluster server, the service data cached in the service cache component is updated based on the data update information.

[0013] In one embodiment, the method further comprises:

[0014] Obtaining instance status information in the microservice cluster server;

[0015] When it is determined based on the instance status information that all instances of the microservice cluster server are in an unavailable state, searching for a target instance closest to the current time point in time sequence according to the instance status information;

[0016] Determine the last heartbeat time of the target instance, and identify the protection time range corresponding to the last heartbeat time;

[0017] The instance status information of the target instance within the protection time range is modified to be in an available state.

[0018] In one embodiment, the method further comprises:

[0019] Record the heartbeat writing success rate of the microservice cluster server, and generate a disaster recovery record point when the heartbeat writing success rate is lower than the success rate threshold;

[0020] Identify success rate change information corresponding to the heartbeat writing success rate;

[0021] A strategy generation process is performed according to the success rate change information and the disaster recovery record points to obtain a service disaster recovery strategy.

[0022] In one embodiment, the method further comprises:

[0023] When a directory change occurs on the microservice cluster registration server through the directory monitoring thread, a data synchronization request is sent from the microservice cluster entry server to the microservice cluster registration server;

[0024] Based on the data synchronization request, the service data of the microservice cluster registration server is cached to the microservice cluster entry server.

[0025] In one embodiment, the method further comprises:

[0026] Obtain monitoring data of the microservice cluster registration server and microservice cluster entry server;

[0027] Perform page generation processing based on the monitoring data to obtain a global configuration information page;

[0028] Push the global configuration information page.

[0029] In a second aspect, the present application further provides a microservice data processing device, which is arranged in a microservice system based on a microservice architecture, wherein the microservice system includes a terminal, a microservice entry server and a microservice cluster server, including:

[0030] The data cache module is used to cache the service data of the microservice cluster server through the service cache component;

[0031] The status monitoring module is used to find the service data cached by the service cache component when a failure is detected in the microservice cluster server;

[0032] The emergency service processing module is used to process the service request based on the service data cached by the service cache component to obtain a service processing result when the microservice entry server corresponding to the microservice cluster server receives the service request;

[0033] The result feedback module is used to feedback the service processing result.

[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0035] Cache the service data of the microservice cluster server through the service cache component;

[0036] When a microservice cluster server is detected to have a fault, search for service data cached by the service cache component;

[0037] When the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result;

[0038] Feedback the service processing result.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0040] Cache the service data of the microservice cluster server through the service cache component;

[0041] When a microservice cluster server is detected to have a fault, search for service data cached by the service cache component;

[0042] When the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result;

[0043] Feedback the service processing result.

[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0045] Cache the service data of the microservice cluster server through the service cache component;

[0046] When a microservice cluster server is detected to have a fault, search for service data cached by the service cache component;

[0047] When the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result;

[0048] Feedback the service processing result.

[0049] The above-mentioned microservice data processing method, device, computer equipment, computer-readable storage medium and computer program product cache the service data of the microservice cluster server through the service cache component; when a failure of the microservice cluster server is detected, search for the service data cached by the service cache component; when the microservice entry server corresponding to the microservice cluster server receives a service request, process the service request based on the service data cached by the service cache component to obtain a service processing result; and feed back the service processing result. In this application, the service data of the microservice cluster server is cached through the service cache component, so that when a failure of the microservice cluster server occurs, the service cache component can be used to support the normal operation of the service, thereby ensuring the continuous and stable operation of the microservice system, thereby improving the continuity and availability of the service. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0051] FIG1 is an application environment diagram of a microservice data processing method in one embodiment;

[0052] FIG2 is a schematic diagram of a flow chart of a microservice data processing method in one embodiment;

[0053] FIG3 is a schematic diagram of a flow chart of a data caching step in one embodiment;

[0054] FIG4 is a schematic diagram of a flow chart of a zero instance protection step in one embodiment;

[0055] FIG5 is a schematic diagram of a process flow of directory monitoring and cache synchronization processing steps in one embodiment;

[0056] FIG6 is a schematic diagram of a global configuration information page in one embodiment;

[0057] FIG7 is a structural block diagram of a microservice data processing device in one embodiment;

[0058] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] The microservice data processing method provided in the embodiment of the present application can be applied to the application environment of the microservice system as shown in Figure 1. Among them, the microservice is implemented based on Consul. In the microservice system, the microservice application (Application) is a mobile application. The terminal where the microservice application is located communicates with the microservice entry server (tsf-consul-access) through the network. The microservice entry server can communicate with servers that implement various microservice architecture functions, including servers that implement service registration, discovery, and heartbeat (tsf-consul-register), servers that implement distributed configuration (tsf-consul-config), servers that implement service authentication configuration (tsf-consul-authen), servers that implement quota queries (license-server), servers that implement token verification (tsf-token), and servers that implement global namespace queries (tsf-resource). The microservice system caches the service data of the microservice cluster server through the service cache component of the terminal; when a microservice cluster server is detected to have a fault, the service data cached by the service cache component is searched; when the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain the service processing result; and the service processing result is directly fed back to the user. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server involved can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0061] In an exemplary embodiment, as shown in FIG2 , a microservice data processing method is provided, which is described by taking the method applied to the microservice system in FIG1 as an example, and includes the following steps 201 to 207. Among them:

[0062] Step 201: Cache the service data of the microservice cluster server through the service cache component of the terminal.

[0063] Among them, the service cache component refers to a component specifically used to cache service data. The service cache component can be implemented through the SDK (Software Development Kit) on the terminal application. SDK is generally a collection of development tools that software development engineers use to build application software for specific software packages, software frameworks, hardware platforms, hardware systems, etc., so as to achieve a specific function. For this application, the service data of the microservice cluster server is cached directly by writing the SDK in the application. These service data can be used as the data basis for the emergency handling process.

[0064] For example, in some cases, a microservice cluster may require manual intervention to recover and repair when a failure occurs. However, at this time, the service data used for service processing is stored in the server of the microservice cluster, which will cause trouble for the related data processing work of the microservice, so in order to improve the efficiency of processing. The present application provides data support in the event of a microservice cluster failure by caching service data. A service cache component can be established through SDK and other methods. By introducing a mechanism for caching service data (memory + local files), even if a microservice cluster server fails, the service cache component can still maintain the stability of service data and continue to provide services, ensuring the continuous operation of the microservice system. In order to ensure the validity of service data, a service cache component is required to cache the service data of the microservice cluster server.

[0065] Step 203: When a failure of the microservice cluster server is detected, the service data cached by the service cache component is searched.

[0066] For example, when a microservice cluster server fails and can no longer provide the corresponding service data processing function, in order to ensure the continued availability of the microservice, it is necessary to find the service data cached by the service cache component. Then, based on this service data, microservice support is provided in the event of a failure.

[0067] Step 205: When the microservice entry server corresponding to the microservice cluster server receives the service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result.

[0068] Step 207: Feedback the service processing result.

[0069] Exemplarily, after the service data is cached by the service cache component, if a failure is detected in the microservice cluster server, under normal circumstances, these failures will cause the entire microservice system to be completely unavailable. In the solution of the present application, in order to ensure the availability of the service, after the microservice entry server receives the service request that needs to be processed, it does not directly feedback the result of the processing failure, but processes the service request based on the service data cached by the service cache component and obtains the corresponding service processing result. These service processing results will also be fed back to the client accordingly, realizing support for the normal operation of the service in the event of a failure of the microservice cluster server, ensuring the continuous and stable operation of the microservice system, thereby improving the continuity and availability of the service.

[0070] The above-mentioned microservice data processing method caches the service data of the microservice cluster server through the service cache component; when a failure of the microservice cluster server is detected, the service data cached by the service cache component is searched; when the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result; and the service processing result is fed back. In this application, the service data of the microservice cluster server is cached through the service cache component, so that when a failure of the microservice cluster server occurs, the service cache component can be used to support the normal operation of the service, thereby ensuring the continuous and stable operation of the microservice system, thereby improving the continuity and availability of the service.

[0071] In an exemplary embodiment, step 201 includes: based on a preset update cycle, periodically initiating a data polling request to the microservice cluster server through the service cache component; upon receiving data update information fed back by the microservice cluster server, updating the service data cached in the service cache component based on the data update information.

[0072] Among them, the preset update cycle refers to the cycle for updating the cached data. Since the service data stored in the microservice cluster server will be continuously updated over time, in order to ensure the synchronization of the cached data and the real-time service data, it is necessary to set an update cycle to synchronize the two. Polling is a way for the CPU to decide how to provide peripheral device services. It is mainly for the CPU to issue inquiries at regular intervals, asking each peripheral device in sequence whether it needs its service, and then providing services. After the service is completed, ask the next peripheral, and then repeat it over and over again. Data synchronization update processing can be performed by polling to maintain data consistency. In a specific embodiment, the present application implements data update by long polling. Compared with the polling of the round-robin, long polling is an improved polling technology, which is mainly used to reduce the communication burden between the client and the server. In long polling, the client sends an HTTP request to the server, and the server returns a response to the client only when there is new data or an event. If the server has no new data, it will keep the connection open until there is new data or the timeout period is reached. This method reduces the number of invalid requests and improves resource utilization.

[0073] Exemplarily, in the scheme of the present application, in order to realize data synchronization processing between the service cache component and the microservice cluster server, the data update cycle can be pre-set, and then in each cycle, the service cache component can periodically initiate a data polling request to the microservice cluster server. The microservice cluster server will feedback data update information to the service cache component when the data is updated, and then the service data cached in the service cache component can be updated based on the data update information. If there is no data update, the data in the memory can be replaced and the cache can be refreshed. Because if the microservice cluster is unavailable, or cold start, or other unpredictable scenarios, pulling back an empty list will have a huge impact. If there is no update, wait for a while and then return. In a specific embodiment, the data caching process of the present application can be shown in Figure 3, wherein the service cache component is implemented by SDK, the microservice cluster server is implemented by Consul, and the SDK initiates long polling through a scheduled task. If the service data is updated, Consul returns immediately, and each service data list pulled back will be stored locally, so that if the Consul cluster is unavailable due to machine failure or for some reason, it will not cause the entire microservice system to be completely unavailable. If the list pulled from Consul is empty, the data in the memory will not be replaced, and the cache will not be refreshed. This is because if the Consul cluster is unavailable, or cold-started, or in other unpredictable scenarios, pulling back an empty list will have a huge impact. If there is no update, wait for 55 seconds before returning. In this embodiment, by setting a preset update cycle to complete the update processing of the data in the service cache component, the synchronization of the cache data and the real-time service data can be effectively guaranteed, thereby improving the accuracy of data processing in the event of a failure.

[0074] In one embodiment, as shown in FIG4 , the method further includes:

[0075] Step 401, obtain instance status information in the microservice cluster server.

[0076] Step 403: When it is determined based on the instance status information that all instances of the microservice cluster server are in an unavailable state, the target instance closest to the current time point in time sequence is searched according to the instance status information.

[0077] Step 405, determine the last heartbeat time of the target instance, and identify the protection time range corresponding to the last heartbeat time.

[0078] Step 407: Modify the instance status information of the target instance within the protection time range to an available status.

[0079] Exemplarily, the present application can also ensure the continuity of service provision by means of zero instance protection. By continuously monitoring the instance status information in the microservice cluster server in the system. The instance status information can be used to determine whether each instance is available, and when the instances of the microservice cluster server are all in an unavailable state, the target instance closest to the current time point in time sequence is found according to the instance status information. And determine the last heartbeat time of the target instance and its corresponding protection time range. By taking the last heartbeat time of the most recently unavailable instance node as the baseline, the previous heartbeat cycle (the default survival time TTL is 60 seconds, and the heartbeat cycle is 40 seconds) as the protection time range, the instance status information within the protection time range will be modified to an available state. In this embodiment, when all instances of the microservice cluster server are unavailable, the protection time range is searched and the instance status is set to normal to ensure that the client can continue to obtain services. Effectively deal with the situation where all instances are unavailable, avoid the problem of service unavailability or returning an empty list, and improve the processing capacity of services in zero instance scenarios.

[0080] In one embodiment, the method also includes: recording the heartbeat write success rate of the microservice cluster server, and generating a disaster recovery record point when the heartbeat write success rate is lower than the success rate threshold; identifying the success rate change information corresponding to the heartbeat write success rate; performing strategy generation processing based on the success rate change information and the disaster recovery record point to obtain a service disaster recovery strategy.

[0081] Exemplarily, for the disaster recovery strategy of the server, the present application can perform disaster recovery protection by recording the heartbeat write success rate of the microservice cluster server. Specifically, the heartbeat write success rate of the microservice cluster server can be recorded on the microservice entry server, and when it is identified that the heartbeat write success rate is lower than the success rate threshold, a disaster recovery record point is directly generated, and the success rate change information corresponding to the heartbeat write success rate is identified; the strategy generation process is performed according to the success rate change information and the disaster recovery record point to obtain the service disaster recovery strategy, and based on. Under the disaster recovery strategy, if a consumer client comes to discover the service, all service instances whose heartbeat TTL is greater than the disaster recovery time point will be returned to the consumer, thereby ensuring that an empty list will not be returned due to a large-scale failure of heartbeat writing to the microservice cluster, thereby improving the availability of the service discovery system. In this embodiment, through the disaster recovery protection mechanism, the situation where all instances are unavailable can be effectively dealt with, avoiding the problem of service unavailability or returning an empty list.

[0082] In an exemplary embodiment, the microservice system further includes a microservice cluster registration server. The method further includes: when a directory change of the microservice cluster registration server is detected through a directory monitoring thread, sending a data synchronization request from the microservice cluster entry server to the microservice cluster registration server; based on the data synchronization request, caching the service data of the microservice cluster registration server to the microservice cluster entry server.

[0083] Exemplarily, the present application also provides a caching mechanism based on the microservice cluster entry server access, and the microservice cluster entry server can monitor the directory changes in the microservice cluster registration server through the directory monitoring thread. Because when the service data in the microservice cluster registration server changes, the directory information in the microservice cluster registration server will also be modified accordingly, by monitoring the directory changes of the microservice cluster registration server. When a change occurs, a data synchronization request can be sent from the microservice cluster entry server to the microservice cluster registration server, thereby realizing data caching and synchronization. In one of the embodiments, as shown in Figure 5, the microservice of the present application is implemented based on consul, where the microservice cluster registration server is consul-register and the microservice cluster entry server is consul-access. When the service data in consul-register changes, the directory index in the register will be directly and passively modified. There is a monitoring thread watch in consul-access that monitors the changes in the directory index in consul-register. If a change is found in the index, the cached data in access will be refreshed, and access will issue a synchronization request to synchronize the latest service data from the register to the cache. In this embodiment, by monitoring the directory changes of the microservice cluster registration server and caching and synchronizing data based on the directory changes, the efficiency of data processing can be effectively guaranteed.

[0084] In an exemplary embodiment, the method also includes: obtaining monitoring data of the microservice cluster registration server and the microservice cluster entry server; performing page generation processing based on the monitoring data to obtain a global configuration information page; and pushing the global configuration information page.

[0085] Exemplarily, the present application is also applicable to the operation and maintenance monitoring of microservices. By obtaining the monitoring data of the microservice cluster registration server and the microservice cluster entry server, the monitoring data obtained can be mainly from the following dimensions: resource usage (CPU, memory), interface usage, cache usage, KV number, number of registered instances, etc. Based on the monitoring data, page generation processing is performed to obtain a global configuration information page; and these global configuration information pages are pushed to the user end. The specific global configuration information page can be shown in Figure 6. Through the global configuration information page, you can view the global configuration, application configuration usage, file configuration usage, etc. according to the tenant dimension, and judge the health of the current configuration center based on the online time, read and write frequency, update frequency, and monitoring data. Thereby effectively ensuring the continuity and availability provided by microservices.

[0086] In one embodiment, the microservice data processing method of the present application is applied to a microservice system of a microservice architecture, the microservice system includes a terminal, a microservice entry server, a microservice registration server and a microservice cluster server, and the method includes: based on a preset update cycle, a data polling request is periodically initiated to the microservice cluster server through a service cache component; when data update information fed back by the microservice cluster server is received, the service data cached in the service cache component is updated based on the data update information. In the case of monitoring that a microservice cluster server fails, the service data cached by the service cache component is searched; when the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result; and the service processing result is fed back. The instance status information in the microservice cluster server is obtained; when it is determined based on the instance status information that the instances of the microservice cluster server are all in an unavailable state, the target instance closest to the current time point in time sequence is searched based on the instance status information; the last heartbeat time of the target instance is determined, and the protection time range corresponding to the last heartbeat time is identified; the instance status information of the target instance within the protection time range is modified to an available state. Record the heartbeat write success rate of the microservice cluster server, and generate a disaster recovery record point when the heartbeat write success rate is lower than the success rate threshold; identify the success rate change information corresponding to the heartbeat write success rate; perform strategy generation processing based on the success rate change information and the disaster recovery record point to obtain a service disaster recovery strategy. When the directory changes on the microservice cluster registration server are monitored through the directory monitoring thread, a data synchronization request is sent from the microservice cluster entry server to the microservice cluster registration server; based on the data synchronization request, the service data of the microservice cluster registration server is cached to the microservice cluster entry server. Obtain the monitoring data of the microservice cluster registration server and the microservice cluster entry server; perform page generation processing based on the monitoring data to obtain a global configuration information page; and push the global configuration information page. This application improves the availability of the service data processing process through data caching, zero instance protection mechanism and disaster recovery protection mechanism. Under the joint action of multiple optimization measures, the overall enterprise-level capabilities of the microservice platform are improved, the availability of the entire service discovery system is enhanced, the user experience is further improved, and the stable operation of the system is guaranteed.

[0087] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0088] Based on the same inventive concept, the embodiment of the present application also provides a microservice data processing device for implementing the microservice data processing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more microservice data processing device embodiments provided below can refer to the limitations of the microservice data processing method above, and will not be repeated here.

[0089] In an exemplary embodiment, as shown in FIG. 7 , a microservice data processing device is provided, which is arranged in a microservice system based on a microservice architecture, wherein the microservice system includes a terminal, a microservice entry server, and a microservice cluster server, and the device includes:

[0090] The data cache module 702 is used to cache the service data of the microservice cluster server through the service cache component.

[0091] The status monitoring module 704 is used to search for service data cached by the service cache component when a failure of the microservice cluster server is detected.

[0092] The emergency service processing module 706 is used to process the service request based on the service data cached by the service cache component to obtain a service processing result when the microservice entry server corresponding to the microservice cluster server receives the service request.

[0093] The result feedback module 708 is used to feedback the service processing result.

[0094] In an exemplary embodiment, the data cache module 702 is specifically used to: based on a preset update cycle, periodically initiate a data polling request to the microservice cluster server through the service cache component; when receiving data update information fed back by the microservice cluster server, update the service data cached in the service cache component based on the data update information.

[0095] In an exemplary embodiment, a zero instance processing module is also included, which is used to: obtain instance status information in the microservice cluster server; when it is determined based on the instance status information that all instances of the microservice cluster server are in an unavailable state, search for the target instance closest to the current time point in time sequence according to the instance status information; determine the last heartbeat time of the target instance, and identify the protection time range corresponding to the last heartbeat time; modify the instance status information of the target instance within the protection time range to an available state.

[0096] In an exemplary embodiment, it also includes a disaster recovery processing module, which is used to: record the heartbeat write success rate of the microservice cluster server, and generate a disaster recovery record point when the heartbeat write success rate is lower than the success rate threshold; identify the success rate change information corresponding to the heartbeat write success rate; perform strategy generation processing according to the success rate change information and the disaster recovery record point to obtain a service disaster recovery strategy.

[0097] In an exemplary embodiment, the microservice system also includes a microservice cluster registration server; the device also includes a data synchronization module, which is used to: when a directory change in the microservice cluster registration server is detected through a directory monitoring thread, send a data synchronization request from the microservice cluster entry server to the microservice cluster registration server; based on the data synchronization request, cache the service data of the microservice cluster registration server to the microservice cluster entry server.

[0098] In an exemplary embodiment, it also includes a page generation module, which is used to: obtain monitoring data of the microservice cluster registration server and the microservice cluster entry server; perform page generation processing based on the monitoring data to obtain a global configuration information page; and push the global configuration information page.

[0099] Each module in the above-mentioned microservice data processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0100] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store microservice data processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a microservice data processing method is implemented.

[0101] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0102] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0103] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0104] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0105] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0106] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0107] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0108] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A microservice data processing method, characterized in that: Applied to a microservice system based on a microservice architecture, the microservice system includes a terminal, a microservice entry server and a microservice cluster server, and the method includes: Cache the service data of the microservice cluster server through the service cache component of the terminal; When a microservice cluster server is detected to have a fault, search for service data cached by the service cache component; When the microservice entry server corresponding to the microservice cluster server receives a service request, the service request is processed based on the service data cached by the service cache component to obtain a service processing result; Feedback the service processing result.

2. The method according to claim 1, characterized in that The method of caching the service data of the microservice cluster server by the service cache component includes: Based on the preset update cycle, the service cache component periodically initiates data polling requests to the microservice cluster server; When receiving the data update information fed back by the microservice cluster server, the service data cached in the service cache component is updated based on the data update information.

3. The method according to claim 1, characterized in that: The method further comprises: Obtaining instance status information in the microservice cluster server; When it is determined based on the instance status information that all instances of the microservice cluster server are in an unavailable state, searching for a target instance closest to the current time point in time sequence according to the instance status information; Determine the last heartbeat time of the target instance, and identify the protection time range corresponding to the last heartbeat time; The instance status information of the target instance within the protection time range is modified to be in an available state.

4. The method according to claim 1, characterized in that: The method further comprises: Record the heartbeat writing success rate of the microservice cluster server, and generate a disaster recovery record point when the heartbeat writing success rate is lower than the success rate threshold; Identify success rate change information corresponding to the heartbeat writing success rate; A strategy generation process is performed according to the success rate change information and the disaster recovery record points to obtain a service disaster recovery strategy.

5. The method according to any one of claims 1 to 4, characterized in that: The microservice system also includes a microservice cluster registration server; The method further comprises: When a directory change occurs on the microservice cluster registration server through the directory monitoring thread, a data synchronization request is sent from the microservice cluster entry server to the microservice cluster registration server; Based on the data synchronization request, the service data of the microservice cluster registration server is cached to the microservice cluster entry server.

6. The method according to claim 1, characterized in that The method further comprises: Obtain monitoring data of the microservice cluster registration server and microservice cluster entry server; Perform page generation processing based on the monitoring data to obtain a global configuration information page; Push the global configuration information page.

7. A microservice data processing device, characterized in that: A microservice system based on a microservice architecture is provided, wherein the microservice system includes a terminal, a microservice entry server and a microservice cluster server, and the device includes: The data cache module is used to cache the service data of the microservice cluster server through the service cache component; The status monitoring module is used to find the service data cached by the service cache component when a failure is detected in the microservice cluster server; The emergency service processing module is used to process the service request based on the service data cached by the service cache component to obtain a service processing result when the microservice entry server corresponding to the microservice cluster server receives the service request; The result feedback module is used to feedback the service processing result.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Mobile-device-oriented service cache system architecture and development method

    CN102624881A

  • Service calling method and device, electronic equipment and storage medium

    CN110311900A

  • Service implementation method, device and equipment based on micro-service cluster, and storage medium

    CN111756841A

  • Data processing method and system, data reading method and system, storage medium and electronic equipment

    CN115964210A

  • Read request dynamic adjustment method and device and computer equipment

    CN118260263A