Data processing method and device, electronic equipment and computer readable storage medium

By obtaining the target availability range and information of service registration requests in the microservice architecture for registration, and switching availability zones in case of anomalies, combined with traffic allocation rules and service registration components, the problem of setting service availability range in the microservice architecture is solved, improving service call response speed and management efficiency, and reducing code editing and maintenance costs.

CN117768533BActive Publication Date: 2026-11-24XINGIN INFORMATION TECH (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211131338.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2026-11-24
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

The existing microservice architecture cannot configure the availability scope of services, which makes it impossible to effectively switch and allocate traffic when service instances fail.

Method used

By obtaining the target availability range and registration information from the service registration request, the service is registered, and the system switches to the second availability zone when the first availability zone is abnormal. At the same time, traffic allocation rules are used to determine the instance from the target availability range to allocate call requests, and the service registration component is used to decouple the code management.

Benefits of technology

This reduces the likelihood of service instances failing to respond to requests when they are not functioning correctly, improves the response speed and management efficiency of service requests, and reduces the difficulty of code editing and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117768533B_ABST
    Figure CN117768533B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method and apparatus, an electronic device, and a computer-readable storage medium. The method includes: obtaining a registration request for a first service; the registration request includes a target availability range of the first service and registration information of the first service; using the registration information, registering the first service to obtain a second service; the availability range of the second service is the target availability range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method and apparatus, electronic device and computer-readable storage medium. Background Technology

[0002] With the development of internet technology, the amount of data processed by network services is increasing dramatically. Therefore, to improve the processing efficiency of network services, a microservice architecture is commonly used to build server clusters to provide network services. However, current microservice architectures do not allow for setting the availability scope of services. Summary of the Invention

[0003] This application provides a data processing method and apparatus, an electronic device, and a computer-readable storage medium.

[0004] Firstly, a data processing method is provided, the method comprising:

[0005] Obtain a registration request for the first service; the registration request includes the target availability range of the first service and the registration information of the first service;

[0006] Using the registration information, the first service is registered to obtain the second service; the availability range of the second service is the target availability range.

[0007] In this respect, when the registration request for the first service includes the target availability range of the first service and the registration information of the first service, the availability range of the second service can be set to the target availability range while registering the first service using the registration information of the first service to obtain the second service, thereby completing the setting of the availability range of the second service.

[0008] In any embodiment of this application, the target availability range includes a first availability zone and a second availability zone different from the first availability zone;

[0009] After obtaining the second service, the method further includes:

[0010] If all instances in the first availability zone are in an abnormal state, the call requests for the second service will be switched to the second availability zone.

[0011] In this implementation, all instances within the first availability zone are in an abnormal state, indicating that none of the instances within the first availability zone can provide normal service. Since both the first and second availability zones fall within the target availability range, when all instances in the first availability zone are unable to provide normal service, the data processing device redirects the call requests for the second service to the second availability zone. This reduces the likelihood of the second service call requests not being responded to.

[0012] In any embodiment of this application, the registration request further includes the traffic allocation rules of the first service;

[0013] The method further includes:

[0014] Obtain the call request sent by the client for the second service;

[0015] Based on the traffic allocation rules and the client's first network address, a first instance is determined from the target availability range;

[0016] Send the second network address of the first instance to the client.

[0017] In this implementation, the registration request for the first service includes the traffic allocation rules for the first service. After registering the first service to obtain the second service, the data processing device can determine the first instance from the target availability range based on the traffic allocation rules and the first network (internet protocol address, IP) address of the client sending the call request for the second service. Then, it sends the second IP address of the first instance to the client, thereby completing the traffic allocation for the call request for the second service. Furthermore, since the traffic allocation rules are part of the registration request for the first service, users can customize the traffic allocation rules when registering services with the data processing device through the client.

[0018] In any embodiment of this application, the traffic allocation rule includes: allocating instances within a third availability zone to the call request, wherein the third availability zone is an availability zone that matches the first network address;

[0019] The step of determining the first instance from the target availability range based on the traffic allocation rules and the client's first network address includes:

[0020] If it is determined that the third availability zone exists within the target availability range, an instance is selected from the third availability zone as the first instance.

[0021] In any embodiment of this application, the traffic allocation rule further includes: allocating instances within a target availability zone to the call request when no availability zone matches the first network address; the target availability zone is an availability zone that matches the first network address, and the availability zone is a larger unit of division than the availability zone;

[0022] The method further includes:

[0023] If it is determined that the third availability zone does not exist within the target availability zone, an instance is selected from the target availability zone as the first instance.

[0024] In this implementation, if the data processing device determines that there is no availability zone matching the first IP address within the target availability range, it can select an instance from the target availability zone as the first instance to complete the traffic allocation for the call request to the second service.

[0025] In any embodiment of this application, registering the first service using the registration information to obtain the second service includes:

[0026] The service registration component uses the registration information to register the first service and obtain the second service.

[0027] In this implementation, the service registration component is a software component used for service registration. This separates the code used for service registration from the business logic code, thus decoupling them and reducing the time and difficulty for relevant personnel to edit the code used for service registration.

[0028] In any embodiment of this application, the first service includes a second instance and a third instance, wherein the second instance and the third instance are provided by different users;

[0029] The service registration component uses the registration information to register the first service and obtain the second service.

[0030] The service registration component uses the registration information to register the second instance and the third instance respectively, thereby obtaining the second service.

[0031] In this implementation, the data processing device can register different instances of the first service through a service registration component to obtain the second service. That is, the instances in the first service are provided by different clients. If the instances providing the first service are referred to as a business cluster, then any client in the business cluster can register through the service registration component. This reduces the time and difficulty for the business cluster to edit the code used for service registration.

[0032] In any embodiment of this application, after obtaining the second service, the method further includes: monitoring the health status of the second service through the service registration component.

[0033] In conjunction with any embodiment of this application, the method further includes: deleting the registration information of the third instance if it is determined that the health status of the third instance of the second service is abnormal or that the third instance has been deleted.

[0034] Secondly, a data processing apparatus is provided, the apparatus comprising:

[0035] An acquisition unit is configured to acquire a registration request for a first service; the registration request includes the target availability range of the first service and the registration information of the first service.

[0036] The processing unit is configured to use the registration information to register the first service to obtain the second service; the availability range of the second service is the target availability range.

[0037] In any embodiment of this application, the target availability range includes a first availability zone and a second availability zone different from the first availability zone;

[0038] The processing unit is further configured to switch the call request for the second service to the second availability zone when all instances in the first availability zone are in an abnormal state.

[0039] In any embodiment of this application, the registration request further includes the traffic allocation rules of the first service;

[0040] The acquisition unit is further configured to acquire the call request for the second service sent by the client;

[0041] The processing unit is further configured to determine a first instance from the target availability range based on the traffic allocation rules and the client's first network address;

[0042] The processing unit is also configured to send the second network address of the first instance to the client.

[0043] In any embodiment of this application, the traffic allocation rule includes: allocating instances within a third availability zone to the call request, wherein the third availability zone is an availability zone that matches the first network address;

[0044] The processing unit is configured to select an instance from the third availability zone as the first instance if it is determined that the third availability zone exists within the target availability range.

[0045] In any embodiment of this application, the traffic allocation rule further includes: allocating instances within a target availability zone to the call request when no availability zone matches the first network address; the target availability zone is an availability zone that matches the first network address, and the availability zone is a larger unit of division than the availability zone;

[0046] The processing unit is further configured to select an instance from the target availability domain as the first instance if it is determined that the third availability zone does not exist within the target availability range.

[0047] In any embodiment of this application, the processing unit is configured to register the first service using the registration information through a service registration component to obtain the second service.

[0048] In any embodiment of this application, the first service includes a second instance and a third instance, wherein the second instance and the third instance are provided by different users;

[0049] The processing unit is configured to use the registration information through the service registration component to register the second instance and the third instance respectively, thereby obtaining the second service.

[0050] In any embodiment of this application, the processing unit is further configured to monitor the health status of the second service through the service registration component.

[0051] In conjunction with any embodiment of this application, the processing unit is further configured to delete the registration information of the third instance if it is determined that the health status of the third instance of the second service is abnormal or that the third instance has been deleted.

[0052] Thirdly, an electronic device is provided, characterized in that it comprises: a processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs a method as described in the first aspect above and any possible implementation thereof.

[0053] Fourthly, another electronic device is provided, comprising: a processor, a transmitting device, an input device, an output device, and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs the method as described in the first aspect above and any possible implementation thereof.

[0054] Fifthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, the computer program including program instructions that, when executed by a processor, cause the processor to perform a method as described in the first aspect above and any possible implementation thereof.

[0055] In a sixth aspect, a computer program product is provided, the computer program product comprising a computer program or instructions, wherein, when the computer program or instructions are executed on a computer, the computer performs the method described in the first aspect and any possible implementation thereof.

[0056] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.

[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0059] Figure 1 A service architecture diagram provided for an embodiment of this application;

[0060] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0061] Figure 3 A schematic diagram illustrating service management as provided in an embodiment of this application;

[0062] Figure 4 This is a schematic diagram of a data processing structure provided in an embodiment of this application;

[0063] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0064] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0065] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0066] It should be understood that in this application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can indicate three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " can indicate that the related objects before and after are in an "or" relationship, referring to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.

[0067] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0068] With the development of internet technology, the data processing volume of network services is increasing dramatically. Therefore, to improve the processing efficiency of network services, a microservice architecture is commonly used to build server clusters to provide network services. However, current microservice architectures cannot configure the availability scope of services. Based on this, this application provides a technical solution to enable the configuration of the availability scope of services.

[0069] The execution subject of this application embodiment is a data processing device, which can be any electronic device capable of executing the technical solutions disclosed in the method embodiments of this application. Optionally, the data processing device can be one of the following: a computer or a server.

[0070] It should be understood that a data processing device may include one or more electronic devices. For example, a data processing device may be a single server. Another example is a server cluster, meaning the data processing device includes at least two servers.

[0071] Figure 1 The diagram shows the service architecture built upon the aforementioned data processing device, as follows: Figure 1As shown, the service architecture 1 includes a data processing device 11 and a client 12. The client 12 can be divided into a service provider 121 and a service consumer 122. The service provider 121 is the client that provides services, and the service consumer 122 is the client that consumes services.

[0072] Users can send service registration requests to data processing device 11 through service provider 121, and data processing device 11 will register the service upon detecting the service registration request. Users can also send service invocation requests to data processing device 11 through service consumer 122, and data processing device 11 will allocate the corresponding service instance to service consumer 122 upon detecting the service invocation request.

[0073] It should be understood that the method embodiments of this application can also be implemented by a processor executing computer program code. The embodiments of this application are described below with reference to the accompanying drawings. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application.

[0074] 201. Obtain the registration request for the first service.

[0075] In this embodiment of the application, the first service is any network service. For example, the first service is a network service for implementing text recognition. Another example is a network service for implementing text search.

[0076] In this embodiment, the registration request for the first service includes the target availability range of the first service and the registration information of the first service. The target availability range refers to the available range of the first service; that is, after successful registration, the first service can be assigned to service call requests within the target availability range. For example, if the target availability range is the geographical area of ​​city A, then after successful registration, the first server can assign service call requests with IP addresses located within city A.

[0077] The registration information for the first service includes the address and network port of the first service.

[0078] In one possible implementation, the data processing device receives a registration request for the first service sent by the client, i.e., the client requests to complete the registration for the first service through the data processing device.

[0079] 202. Using the above registration information, register for the first service to obtain the second service.

[0080] When the data processing device receives a registration request for the first service, it can use the registration information of the first service to register the first service and obtain the second service, that is, the second service is a registered service.

[0081] In this embodiment, the availability range of the second service is the target availability range, meaning the second service can be assigned to service call requests within the target availability range. For example, if the target availability range is the geographical area of ​​city A, then the second server can assign service call requests with IP addresses located within city A.

[0082] In this embodiment of the application, when the registration request for the first service includes the target availability range of the first service and the registration information of the first service, the availability range of the second service can be set to the target availability range while registering the first service using the registration information of the first service to obtain the second service, thereby completing the setting of the availability range of the second service.

[0083] As an optional implementation, the target availability range includes a first availability zone and a second availability zone that is different from the first availability zone. In other words, both the first and second availability zones belong to the availability range of the second service, but the availability range represented by the first availability zone is different from that represented by the second availability zone. For example, if the target availability range is Guangdong Province, then the availability range of the second service is Guangdong Province. The first availability zone is Shenzhen City, and the second availability zone is Guangzhou City.

[0084] After receiving the second service, the data processing device also performs the following steps:

[0085] 301. If all instances in the first availability zone are in an abnormal state, the call requests for the second service will be switched to the second availability zone.

[0086] In this embodiment of the application, an availability zone includes at least one instance. The status of an instance includes an abnormal status and a normal status. An instance in an abnormal status indicates that the instance cannot provide services normally, while an instance in a normal status indicates that the instance can provide services normally.

[0087] All instances in the first availability zone are in an abnormal state, indicating that none of the instances in the first availability zone can provide normal service. Since the first availability zone is within the target availability range, the data processing device can redirect service requests to the second availability zone when all instances in the first availability zone are unable to provide normal service. This reduces the probability of service requests not being responded to.

[0088] As an optional implementation, the registration request for the first service may also include a traffic allocation rule for the first service, wherein the traffic allocation rule is a rule for allocating traffic to service call requests within the available range of the first service.

[0089] In one possible implementation, the traffic allocation rule for the first service is to allocate instances belonging to the same availability zone as the IP address of the service call request to the service call request.

[0090] In another possible implementation, the traffic allocation rule for the first service is to assign the service call request to the instance closest to it.

[0091] In another possible implementation, the traffic allocation rule for the first service is to allocate the instance that last provided the service the longest to the service call request.

[0092] In this embodiment, the data processing device further performs the following steps:

[0093] 401. Obtain the call request sent by the client for the second service mentioned above.

[0094] The data processing device receives a call request for the second service, indicating that the client expects to call the second service.

[0095] 402. Based on the above traffic allocation rules and the first IP address of the above client, determine the first instance from the above target availability range.

[0096] In this embodiment, the first IP address is the client's IP address. Since the second service is a registered service through the first service, the traffic allocation rules of the first service apply to allocating traffic to the second service. Therefore, the data processing device determines the first instance from the availability range of the second service based on the traffic allocation rules and the client's first IP address.

[0097] In one possible implementation, the traffic allocation rule for the first service is to allocate instances belonging to the same availability zone as the IP address of the service call request to the service call request. In this case, the data processing device determines an availability zone from the target availability range as the target availability zone. An instance is then selected from the target availability zone as the first instance. This shortens the time required to determine the first instance, thereby improving the response speed of the service call request.

[0098] It should be understood that an availability zone is the smallest unit of division within a target availability area. For example, the target availability area can be divided into region A and region B. Region A can be further divided into availability zones C and D, and region B can be further divided into availability zones E and F. In this case, both region and availability zone are units of division, with the availability zone being the smallest unit of division.

[0099] In another possible implementation, the traffic allocation rule for the first service is to assign the service call request to the instance closest to it. In this case, the data processing device determines the instance with the closest IP address to the first IP address from the target availability range and uses it as the first instance, thus improving the response speed of the service call request.

[0100] In another possible implementation, the traffic allocation rule for the first service is to allocate the service call request to the instance that last provided service the longest. In this case, the data processing device determines the instance that last provided service the longest from the target availability range as the first instance. This balances the load on instances within the target availability range.

[0101] For example, within the target's available range, there are instances A, B, and C. Instance A last provided service at 2:02 PM on August 21, 2022; instance B last provided service at 10:43 AM on August 15, 2022; and instance C last provided service at 5:16 PM on August 26, 2022. If the current time is 10:23 AM on August 29, 2022, then instance B has the longest time since its last service. In this case, the data processing device will use instance B as the first instance.

[0102] 403. Send the second IP address of the first instance to the aforementioned client.

[0103] In this embodiment, the second IP address is the network address of the first instance, meaning the first instance can be invoked via the second IP address. When the data processing device sends the second IP address of the first instance to the client, the client can invoke the first instance to provide the second service via the second IP address.

[0104] In this implementation, the registration request for the first service includes the traffic allocation rules for the first service. After registering the first service to obtain the second service, the data processing device can determine the first instance from the target availability range based on the traffic allocation rules and the first IP address of the client sending the call request for the second service. Then, it sends the second IP address of the first instance to the client, thereby completing the traffic allocation for the call request for the second service. Furthermore, since the traffic allocation rules are part of the registration request for the first service, users can customize the traffic allocation rules when registering the service with the data processing device through the client.

[0105] As an optional implementation, the traffic allocation rule includes allocating instances within a third availability zone to the call request, wherein the third availability zone is the availability zone that matches the first IP address. For example, if the first IP address is street A, then the third availability zone is the availability zone that includes street A.

[0106] In this embodiment, the data processing device performs the following steps during step 402:

[0107] 501. If it is determined that the third availability zone exists within the above target availability range, select an instance from the third availability zone as the first instance.

[0108] According to the traffic allocation rules, if a third availability zone exists within the target availability range, instances within the third availability zone should be allocated to call requests for the second service. Therefore, if the data processing device determines that a third availability zone exists within the target availability range, it selects an instance from the third availability zone as the first instance.

[0109] For example, if the first IP address is a street in Shenzhen, and the target availability zone includes Shenzhen, then Shenzhen is the third availability zone. The data processing device then selects an instance from the Shenzhen availability zone as the third instance.

[0110] As an optional implementation, the traffic allocation rule further includes: in the absence of an availability zone matching the first IP address, allocating instances within a target availability domain to the call request, wherein the target availability domain is the availability domain matching the first IP address, and an availability domain is a larger unit of division than an availability zone.

[0111] For example, an availability zone is a region divided based on a city, while an availability domain is a region divided based on a region that includes at least one city. For example, availability zones include Shenzhen availability zones and Guangzhou availability zones, while availability domains include Guangdong Province availability domains and Hunan Province availability domains.

[0112] In this embodiment, the data processing device further performs the following steps:

[0113] 601. If it is determined that the third availability zone does not exist within the target availability zone, select an instance from the target availability zone as the first instance.

[0114] According to the traffic allocation rules, if there is no availability zone matching the first IP address within the target availability range, the instance within the target availability zone should be allocated to the call request for the second service. Therefore, when the data processing device determines that there is no availability zone matching the first IP address within the target availability range, it selects an instance from the target availability zone as the first instance.

[0115] For example, the target availability range includes the Guangdong Province availability domain, which in turn includes the Guangzhou availability zone. If the first IP address is a street in Shenzhen, since the Shenzhen availability zone does not exist within the target availability range, the availability domain matching the first IP address is determined. Because Shenzhen belongs to the Guangdong Province availability domain, the target availability domain is the Guangdong Province availability domain. The data processing device then selects an instance from the Guangdong Province availability domain as the first instance, that is, selects an instance from the Guangzhou availability zone as the first instance.

[0116] In this implementation, if the data processing device determines that there is no availability zone matching the first IP address within the target availability range, it can select an instance from the target availability zone as the first instance to complete the traffic allocation for the call request to the second service.

[0117] As an optional implementation, the data processing device performs the following steps during step 202: 701. Register the first service using the registration information through the service registration component to obtain the second service.

[0118] In this embodiment, the service registration component is a software component used for service registration. This separates the code used for service registration from the business code, thus decoupling them and reducing the time and difficulty for relevant personnel to edit the code used for service registration.

[0119] As an optional implementation, the first service mentioned above includes a second instance and a third instance, wherein the second instance and the third instance are provided by different clients.

[0120] During the execution of step 701, the data processing device performs the following steps: 801. Using the registration information through the service registration component, the device registers the first instance and the second instance respectively to obtain the second service.

[0121] In this step, the data processing device can register different instances of the first service through the service registration component to obtain the second service. That is, the instances in the first service are provided by different clients. If the instances providing the first service are referred to as a business cluster, then any client in the business cluster can register through the service registration component. This reduces the time and difficulty for the business cluster to edit the code used for service registration.

[0122] Optionally, the third service and the first service can also share a single service registration component, where the first service and the third service are different. That is, different services can complete registration through the same service registration component, which reduces the maintenance cost of the code used for service registration.

[0123] As an optional implementation, after receiving the second service, the data processing device further performs the following steps: 901. Monitoring the health status of the second service through the service registration component.

[0124] In this embodiment, monitoring the health status of the service is to determine whether the service is operating normally. The health status of a service includes abnormal and normal states. An abnormal health status indicates that the service cannot provide services normally, for example, the service has crashed or is dead. A normal health status indicates that the service is operating normally.

[0125] In one possible implementation, the data processing device monitors the health status of the second service via a heartbeat check.

[0126] As an optional implementation, the data processing device further performs the following steps: 1001. If it is determined that the health status of the third instance of the second service is abnormal or that the third instance has been deleted, the registration information of the third instance is deleted.

[0127] In this embodiment, the registration information of the third instance includes the IP address of the third instance. If the data processing device determines that the health status of the third instance is abnormal, it deletes the IP address of the third instance from the registered instances; or if it determines that the health status of the third instance is deleted, it deletes the IP address of the third instance from the registered instances. The registered instances include the network addresses of the registered instances.

[0128] In this embodiment, if the data processing device determines that the health status of the third instance is abnormal or that the third instance has been deleted by the service registration component, it completes the update of the registered instance data by deleting the registration information of the third instance.

[0129] Based on the technical solutions provided in the embodiments of this application, the embodiments of this application also provide a possible application scenario.

[0130] With the rapid development of cloud services, more and more services are now being implemented through the cloud. Typically, a cloud server includes multiple availability zones. When there are a large number of cloud servers and availability zones under a cloud server, effective service management becomes crucial.

[0131] By differentiating and managing services based on availability zones, management efficiency can be improved, and the technical solution provided in this application can achieve this differentiation of services. Specifically, Figure 3 The diagram shown is a schematic diagram of service management based on the technical solution provided in the embodiments of this application.

[0132] like Figure 3 As shown, service providers can communicate with the data processing device via a client. The data processing device can run the registry control plane, which includes registration information for all registered services, availability range for all registered services, and traffic allocation rules for all registered services.

[0133] Service providers can log in to the registry control plane running on the data processing device via a client, and then edit the availability scope and traffic allocation rules of registered services through the registry control plane. When the data processing device detects an edit request from the client regarding the availability scope of a registered service, it edits the availability scope; when it detects an edit request from the client regarding the traffic allocation rules of a registered service, it edits the traffic allocation rules. In other words, service providers can customize the availability scope and traffic allocation rules of registered services through the client.

[0134] The data processing device can also monitor the health status of services in the business cluster through the service registration component, and then update the registration information of registered services according to the health status of the services (see steps 901 and 1001 for details).

[0135] Optionally, the business cluster is built based on containerized (Kubernetes, k8s) applications. Optionally, a business cluster belongs to a single availability zone, meaning that services within the same business cluster all reside in the same availability zone.

[0136] Optionally, different service clusters use different service registration components. Therefore, when a service in a service cluster registers through the service registration component, the data processing device can determine the availability range of the service to be registered through the availability zone information carried by the service registration component.

[0137] Consumers can log in to the registration center control panel running on the data processing device through a client to query information about registered services.

[0138] Optionally, the service consumer sends a service call request for the registered service to the data processing device through the client, wherein the client sends the service call request to the data processing device through the gRPC interface.

[0139] After detecting a service call request for a registered service, the data processing device allocates an instance for the service call request based on the traffic allocation rules of the registered service and the IP address of the client that sent the service call request.

[0140] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0141] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, while using clear signs / information to inform users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, personal information processing may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0142] The methods of the embodiments of this application have been described in detail above, and the apparatus of the embodiments of this application is provided below.

[0143] Please see Figure 4 , Figure 4 This is a schematic diagram of a data processing device provided in an embodiment of this application. The data processing device 2 includes an acquisition unit 21 and a processing unit 22. Specifically:

[0144] The acquisition unit 21 is used to acquire a registration request for the first service; the registration request includes the target availability range of the first service and the registration information of the first service;

[0145] Processing unit 22 is used to register the first service using the registration information to obtain a second service; the availability range of the second service is the target availability range.

[0146] In any embodiment of this application, the target availability range includes a first availability zone and a second availability zone different from the first availability zone;

[0147] The processing unit 22 is further configured to switch the call request for the second service to the second availability zone when all instances in the first availability zone are in an abnormal state.

[0148] In any embodiment of this application, the registration request further includes the traffic allocation rules of the first service;

[0149] The acquisition unit 21 is further configured to acquire the call request for the second service sent by the client;

[0150] The processing unit 22 is further configured to determine a first instance from the target available range based on the traffic allocation rules and the first network address of the client;

[0151] The processing unit 22 is also configured to send the second network address of the first instance to the client.

[0152] In any embodiment of this application, the traffic allocation rule includes: allocating instances within a third availability zone to the call request, wherein the third availability zone is an availability zone that matches the first network address;

[0153] The processing unit 22 is configured to select an instance from the third availability zone as the first instance if it is determined that the third availability zone exists within the target availability range.

[0154] In any embodiment of this application, the traffic allocation rule further includes: allocating instances within a target availability zone to the call request when no availability zone matches the first network address; the target availability zone is an availability zone that matches the first network address, and the availability zone is a larger unit of division than the availability zone;

[0155] The processing unit 22 is further configured to select an instance from the target availability domain as the first instance if it is determined that the third availability zone does not exist within the target availability range.

[0156] In any embodiment of this application, the processing unit 22 is used to register the first service using the registration information through a service registration component to obtain the second service.

[0157] In any embodiment of this application, the first service includes a second instance and a third instance, wherein the second instance and the third instance are provided by different users;

[0158] The processing unit 22 is used to register the second instance and the third instance respectively through the service registration component using the registration information, so as to obtain the second service.

[0159] In any embodiment of this application, the processing unit 22 is further configured to monitor the health status of the second service through the service registration component.

[0160] In conjunction with any embodiment of this application, the processing unit 22 is further configured to delete the registration information of the third instance if it is determined that the health status of the third instance of the second service is abnormal or that the third instance has been deleted.

[0161] In this embodiment of the application, when the registration request for the first service includes the target availability range of the first service and the registration information of the first service, the availability range of the second service can be set to the target availability range while registering the first service using the registration information of the first service to obtain the second service, thereby completing the setting of the availability range of the second service.

[0162] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0163] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device 3 includes a processor 31 and a memory 32. Optionally, the electronic device 3 also includes an input device 33 and an output device 34. The processor 31, memory 32, input device 33, and output device 34 are coupled together via connectors, which include various interfaces, transmission lines, or buses, etc., and are not limited in this embodiment. It should be understood that in the various embodiments of this application, coupling refers to mutual connection in a specific way, including direct connection or indirect connection through other devices, such as through various interfaces, transmission lines, buses, etc.

[0164] Processor 31 may include one or more processors, such as one or more central processing units (CPUs). If the processor is a CPU, it may be a single-core CPU or a multi-core CPU. Optionally, processor 31 may be a processor group composed of multiple GPUs, with the multiple processors coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in this embodiment.

[0165] The memory 32 can be used to store computer program instructions, as well as various types of computer program code, including program code for executing the scheme of this application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), which is used for related instructions and data.

[0166] Input device 33 is used to input data and / or signals, and output device 34 is used to output data and / or signals. Input device 33 and output device 34 can be independent devices or an integrated device.

[0167] It is understood that in this embodiment of the application, the memory 32 can be used not only to store related instructions, but also to store related data. For example, the memory 32 can be used to store the registration request of the first service obtained through the input device 33. This embodiment of the application does not limit the specific data stored in the memory.

[0168] Understandable Figure 5 This is merely a simplified design of an electronic device. In practical applications, the electronic device may also include other necessary components, including, but not limited to, any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of this application are within the protection scope of this application.

[0169] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0170] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will also readily understand that the various embodiments of this application have different focuses, and for the sake of convenience and brevity, the same or similar parts may not be repeated in different embodiments. Therefore, parts not described or not described in detail in one embodiment can be referred to the descriptions in other embodiments.

[0171] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0172] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0173] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0174] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0175] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A data processing method, characterized by, The method includes: Obtain a registration request for a first service; the registration request includes the target availability range of the first service and the registration information of the first service, and the registration request also includes the traffic allocation rules of the first service, which include allocating the instance with the longest time since the last service to the service call request; the traffic allocation rules also include: in the case that there is no availability zone matching the first network address, allocating the call request to an instance within the target availability domain; the target availability domain is the availability domain matching the first network address, and the availability domain is a larger unit of division than the availability zone; Using the registration information, the first service is registered to obtain the second service; the availability range of the second service is the target availability range; the process of using the registration information to register the first service to obtain the second service includes: using the registration information through a service registration component to register the first service to obtain the second service; Obtain the call request sent by the client for the second service; Based on the traffic allocation rules and the client's first network address, a first instance is determined from the target availability range; If it is determined that there is no third availability zone within the target availability range, an instance is selected from the target availability range as the first instance, and the third availability zone is the availability zone that matches the first network address; Send the second network address of the first instance to the client.

2. The method according to claim 1, characterized in that, The target availability range includes a first availability zone and a second availability zone that is different from the first availability zone; After obtaining the second service, the method further includes: If all instances in the first availability zone are in an abnormal state, the call requests for the second service will be switched to the second availability zone.

3. The method according to claim 1, characterized in that, The traffic allocation rule includes: allocating instances within the third availability zone to the invocation request; The step of determining the first instance from the target availability range based on the traffic allocation rules and the client's first network address includes: If it is determined that the third availability zone exists within the target availability range, an instance is selected from the third availability zone as the first instance.

4. The method according to claim 1, characterized in that, The first service includes a second instance and a third instance, which are provided by different users; The service registration component uses the registration information to register the first service and obtain the second service. The service registration component uses the registration information to register the second instance and the third instance respectively, thereby obtaining the second service.

5. The method according to claim 1, characterized in that, After obtaining the second service, the method further includes: monitoring the health status of the second service through the service registration component.

6. The method according to claim 5, characterized in that, The method further includes: deleting the registration information of the third instance if the health status of the third instance of the second service is determined to be abnormal or if the third instance has been deleted.

7. A data processing apparatus, characterized in that, The device includes: An acquisition unit is configured to acquire a registration request for a first service; the registration request includes the target availability range of the first service and the registration information of the first service, and the registration request also includes traffic allocation rules for the first service, the traffic allocation rules of the first service including allocating the instance with the longest time since the last service to the service invocation request; the traffic allocation rules also include: in the case that there is no availability zone matching the first network address, allocating the instance within the target availability domain to the invocation request; the target availability domain is the availability domain matching the first network address, and the availability domain is a larger division unit than the availability zone; A processing unit is configured to use the registration information to register the first service to obtain a second service; the availability range of the second service is the target availability range; the step of using the registration information to register the first service to obtain the second service includes: using the registration information through a service registration component to register the first service to obtain the second service; The acquisition unit is further configured to acquire the call request for the second service sent by the client; The processing unit is further configured to determine a first instance from the target availability range based on the traffic allocation rules and the client's first network address; The processing unit is further configured to select an instance from the target availability domain as the first instance when it is determined that there is no third availability zone within the target availability range, wherein the third availability zone is an availability zone that matches the first network address; The processing unit is also configured to send the second network address of the first instance to the client.

8. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Service calling method and device

    CN112612625A

  • Service calling method and device and load balancing equipment

    CN114048046A

  • Gray release method and device and storage medium

    CN114237693A