Business processing method, device, storage medium and electronic device
By using the load balancer to forward access requests in the cluster resource scheduling system, the problem of low resident service generation efficiency caused by the performance bottleneck of the business controller is solved, and the purpose of improving the generation efficiency is achieved.
Patent Information
- Application Number
- CN202210032753.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-12
AI Technical Summary
In the cluster resource scheduling system, the generation efficiency of resident services is low, mainly because the service controller becomes the performance bottleneck.
When receiving the startup instruction to start the target service, start the business controller, create a load balancer after the target service is started, mount the target service in the load balancer, and forward the access request through the load balancer to avoid the business controller performance bottleneck.
It improves the efficiency of the cluster resource scheduling system in generating resident services and solves the problem of low generation efficiency caused by the performance bottleneck of the business controller.
Smart Images

Figure CN114356456B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a business processing method, device, storage medium and electronic device. Background Art
[0002] In the prior art, when starting a resident service on a cluster resource scheduling system, it is usually necessary to start a business controller first, and then the business controller starts the resident service. After that, the business controller registers its own IP address, port and the name of the resident service to the service discovery module, and the client can request the resident service from the service discovery module.
[0003] However, in the above method, the business controller as a controller not only needs to monitor the resident services, but also may become a performance bottleneck due to the limitation of quantity, resulting in low efficiency in generating resident services. Summary of the invention
[0004] The embodiments of the present invention provide a service processing method, device, storage medium and electronic device to at least solve the technical problem of low efficiency in generating resident services by a cluster resource scheduling system.
[0005] According to one aspect of an embodiment of the present invention, a business processing method is provided, comprising: upon receiving a startup instruction to start a target service, starting a business controller; controlling the business controller to start the target service; after starting the target service, creating a load balancer; mounting the target service in the load balancer; and upon receiving an access request to the target service, forwarding the access request to the target service by the load balancer.
[0006] According to another aspect of an embodiment of the present invention, a business processing device is provided, including: a startup unit, which is used to start a business controller when a startup instruction for starting a target service is received; a control unit, which is used to control the above-mentioned business controller to start the above-mentioned target service; a creation unit, which is used to create a load balancer after starting the above-mentioned target service; a mounting unit, which is used to mount the above-mentioned target service in the above-mentioned load balancer; and a forwarding unit, which is used to forward the above-mentioned access request to the above-mentioned target service by the above-mentioned load balancer when an access request for the target service is received.
[0007] As an optional example, the above-mentioned device also includes: a first registration unit, used to register the IP address, port number and name of the above-mentioned target service of the above-mentioned load balancer to the service discovery module after mounting the above-mentioned target service in the above-mentioned load balancer, wherein the above-mentioned service discovery module is used to obtain the above-mentioned access request; or a second registration unit, used to register the IP address of the above-mentioned load balancer and the service domain name of the above-mentioned target service provided by the above-mentioned target service to the domain name resolution server, wherein the above-mentioned service discovery module is used to obtain the above-mentioned access request.
[0008] As an optional example, the forwarding unit includes: an acquisition module, which is used for the service discovery module to obtain the IP address of the load balancer when the service discovery module receives the access request; a forwarding module, which is used for the service discovery module to send the access request to the load balancer based on the IP address of the load balancer, and the load balancer forwards the access request.
[0009] As an optional example, the acquisition module includes: a first determination submodule, used for determining the target service requested to be accessed by the access request by the service discovery module; a search submodule, used for searching the load balancer where the target service is located to obtain the IP address of the load balancer.
[0010] As an optional example, the forwarding unit includes: a second determination submodule, used to determine the target service to be accessed by the access request when the domain name resolution server receives the access request; a resolution submodule, used to resolve the target service by the domain name resolution server to obtain the IP address of the load balancer; a sending submodule, used to send the access request to the load balancer according to the IP address, and the load balancer forwards the access request.
[0011] As an optional example, the control unit includes: a first control module, used to control the business controller to send a request to the resource manager to request to start the target resources used by the target service; and a second control module, used to control the business controller to create the target service when receiving the target resources.
[0012] According to another aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned business processing method when running.
[0013] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the business processing method through the computer program.
[0014] In an embodiment of the present invention, a method is adopted in which, upon receiving a startup instruction to start a target service, a business controller is started; the business controller is controlled to start the target service; after starting the target service, a load balancer is created; the target service is mounted in the load balancer; upon receiving an access request to the target service, the load balancer forwards the access request to the target service. Since in the above method, after generating the target service, the target service is mounted in the load balancer, and the load balancer forwards the access request to the target service, the problem of the performance bottleneck of the business controller affecting the generation of resident services is avoided, thereby achieving the purpose of improving the efficiency of the cluster resource scheduling system in generating resident services, and further solving the technical problem of low efficiency of the cluster resource scheduling system in generating resident services. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flow chart of an optional service processing method according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of a cluster resource scheduling system according to an optional service processing method of an embodiment of the present invention;
[0018] Figure 3 It is a schematic diagram of the correspondence between the service program name and the load balancer IP and port number of an optional service processing method according to an embodiment of the present invention;
[0019] Figure 4 is a system diagram of an optional service processing method according to an embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of the structure of an optional service processing device according to an embodiment of the present invention;
[0021] Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] According to a first aspect of an embodiment of the present invention, a service processing method is provided. Optionally, as follows: Figure 1 As shown, the above method includes:
[0025] S102, when receiving a start instruction to start the target service, start the service controller;
[0026] S104, controlling the service controller to start the target service;
[0027] S106, after starting the target service, creating a load balancer;
[0028] S108, mounting the target service in the load balancer;
[0029] S110, when receiving an access request to a target service, the load balancer forwards the access request to the target service.
[0030] Optionally, in this embodiment, the service controller may be a controller for starting a service program, and the service controller may start one or more service programs. The service program in this embodiment may be used to provide different services.
[0031] After the business controller starts the target service, the target service can be mounted in the load balancer. If an access request from a user to access the target service is received, the load balancer forwards the access request to the target service.
[0032] In this embodiment, the cluster resource scheduling system can be YARN. YARN is an ecological cluster resource scheduling system that can run distributed computing and storage tasks. The business controller can be AppMaster. AppMaster is the controller of the business program scheduled in Yarn, which is used to start and manage specific services (App). Management process: Through heartbeat, collect App status information and monitor App. The service can be App. App represents the specific service content and can have multiple copies. The program of each copy is the same. YARN can also include NodeManager. NodeManager is a controlled slave node used to run specific services (AppMaster, Apps)
[0033] Optionally, in this embodiment, the cluster resource scheduling system can provide a resident service for the client. The resident service can be completed by a business program. Therefore, the business program can be deployed on the cluster resource scheduling system, and the business program provides the resident service. Figure 2 This is a schematic diagram of providing a resident service in this embodiment.
[0034] Through this embodiment and the above method, when a business program is deployed in a cluster resource scheduling system, the business program can be mounted in a load balancer, and the load balancer completes the forwarding of access requests, thereby avoiding the problem of the performance bottleneck of the business controller affecting the generation of resident services, and achieving the purpose of improving the efficiency of the cluster resource scheduling system in generating resident services.
[0035] As an optional example, after mounting the target service in the load balancer, the method further includes:
[0036] Register the load balancer's IP address, port number, and target service name with a service discovery module, where the service discovery module is used to obtain access requests; or
[0037] The IP address of the load balancer and the service domain name of the target service provided by the target service are registered in the domain name resolution server, wherein the service discovery module is used to obtain the access request.
[0038] Optionally, in this embodiment, the Internet protocol (IP), port number of the load balancer and the name of the target service can be registered in the service discovery module. The service discovery module can record the relationship between the name of the business program and the IP address and port number of the load balancer. Figure 3 As shown, Figure 3This is a schematic diagram of the relationship between the service program name and the IP address and port number of the load balancer that can be optionally recorded. The IP address and port number of the corresponding load balancer can be obtained through the service program name. It should be noted that Figure 3 The service program name, IP address and port number are for reference only. The actual name, address and port number should be set according to the actual situation.
[0039] As an optional example, when receiving an access request to a target service, forwarding the access request to the target service by the load balancer includes:
[0040] When the service discovery module receives the access request, the service discovery module obtains the IP address of the load balancer;
[0041] According to the IP address of the load balancer, the service discovery module sends the access request to the load balancer, which forwards the access request.
[0042] Optionally, in this embodiment, if the service discovery module receives an access request sent by the client for accessing the target service, the service discovery module may Figure 3 The relationship in finds the IP address and port number of the corresponding load balancer, and then sends the access request to the corresponding load balancer, which sends the access request to the corresponding target service, and the target service provides services to the client.
[0043] As an optional example, when the service discovery module receives an access request, the service discovery module obtains the IP address of the load balancer including:
[0044] The service discovery module determines the target service requested by the access request;
[0045] Find the load balancer where the target service is located to obtain the IP address of the load balancer.
[0046] Optionally, in this embodiment, if the service discovery module obtains an access request to the target service sent by the client, the service discovery module first searches for the load balancer based on the relationship between the business program it saves and the IP address and port number of the load balancer. After finding the corresponding load balancer, the access request is sent to the load balancer, and the load balancer forwards the access request to the corresponding target service. The target service processes the access request and returns the processing result.
[0047] As an optional example, when receiving an access request to a target service, forwarding the access request to the target service by the load balancer includes:
[0048] When the domain name resolution server receives the access request, it determines the target service to be accessed by the access request;
[0049] The domain name resolution server resolves the target service and obtains the IP address of the load balancer;
[0050] According to the IP address, the access request is sent to the load balancer, which forwards the access request.
[0051] Optionally, in this embodiment, the client can also send the access request to a domain name resolution server (Domain Name System, DNS). The DNS can resolve the target service and directly resolve the IP address of the load balancer. Then, the DNS can send the access request to the load balancer, and the load balancer sends the access request to the corresponding target service.
[0052] As an optional example, controlling the business controller to start the target service includes:
[0053] Control the service controller to send a request to the resource manager to request to start the target resource used by the target service;
[0054] Upon receiving the target resource, the service controller is controlled to create the target service.
[0055] Optionally, in this embodiment, when the business controller starts the target service, the business controller may apply to the resource manager for the target resource used to start the target service. Different business programs may use different resources. When the target resource is requested, the business controller creates the target service.
[0056] As an optional example, after starting the target service, creating a load balancer includes:
[0057] Call the target interface of the load balancing server;
[0058] Create a load balancer with the target interface.
[0059] Optionally, in this embodiment, when creating a load balancer, the interface of the load balancing server can be called to create the load balancer. There can be multiple load balancers of different types. Different load balancers are created according to the called interface.
[0060] Figure 4 It is a system schematic diagram of this embodiment. Figure 4In YARN, ResourceManager and NodeManager are included. NodeManager is a controlled slave node, while ResourceManager is a Master node, which is used for global resource management and control and helps businesses start AppMaster. When starting a resident service, YARN can first start an AppMaster, which is used to start the resident service (App copy) and monitor and manage it. Figure 4 In the process, YARN starts an AppMaster in NodeManager through ResourceManager. AppMaster will apply for resources from ResourceManager and start the service replica App replica 1 on NodeManager. In addition, it will start the service replica App replica 2 in other NodeManager nodes until the specified number of App replicas are started. When the services of the specified number of App replicas are started, AppMaster will call the interface of the load balancer server LB service to create a load balancer LB and mount all App services. Then, AppMaster will register the LB's ip, port, and service name to the YARN service discovery module, and register the service domain name and LB ip to DNS.
[0061] When the service is called, business 1 (connected to the YARN service discovery module) sends a request to the YARN service discovery module to obtain the IP and port of the LB, and then sends a request to the LB. After receiving the request, the LB forwards it to the specific App replica 1 or to the App replica 2, and finally responds to the business request.
[0062] Business 2 (not connected to the YARN service discovery module) can directly access the LB and request the service by configuring the domain name of the service and performing DNS resolution.
[0063] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0064] According to another aspect of the embodiment of the present application, a service processing device is also provided. Figure 5 As shown, including:
[0065] A starting unit 502, configured to start the service controller upon receiving a start instruction for starting a target service;
[0066] A control unit 504 is used to control the service controller to start the target service;
[0067] A creation unit 506, configured to create a load balancer after starting the target service;
[0068] A mounting unit 508, used to mount the target service in the load balancer;
[0069] The forwarding unit 510 is configured to forward the access request to the target service by the load balancer when receiving the access request to the target service.
[0070] Optionally, in this embodiment, the service controller may be a controller for starting a service program, and the service controller may start one or more service programs. The service program in this embodiment may be used to provide different services.
[0071] After the business controller starts the target service, the target service can be mounted in the load balancer. If an access request from a user to access the target service is received, the load balancer forwards the access request to the target service.
[0072] In this embodiment, the cluster resource scheduling system can be YARN. YARN is an ecological cluster resource scheduling system that can run distributed computing and storage tasks. The business controller can be AppMaster. AppMaster is the controller of the business program scheduled in Yarn, which is used to start and manage specific services (App). Management process: Through heartbeat, collect App status information and monitor App. The service can be App. App represents the specific service content and can have multiple copies. The program of each copy is the same. YARN can also include NodeManager. NodeManager is a controlled slave node used to run specific services (AppMaster, Apps)
[0073] Optionally, in this embodiment, the cluster resource scheduling system can provide a resident service for the client. The resident service can be completed by a business program. Therefore, the business program can be deployed on the cluster resource scheduling system, and the business program provides the resident service. Figure 2 This is a schematic diagram of providing a resident service in this embodiment.
[0074] Through this embodiment and the above method, when a business program is deployed in a cluster resource scheduling system, the business program can be mounted in a load balancer, and the load balancer completes the forwarding of access requests, thereby avoiding the problem of the performance bottleneck of the business controller affecting the generation of resident services, and achieving the purpose of improving the efficiency of the cluster resource scheduling system in generating resident services.
[0075] As an optional example, the above device further includes:
[0076] A first registration unit is used to register the IP address, port number and name of the target service of the load balancer to a service discovery module after the target service is mounted in the load balancer, wherein the service discovery module is used to obtain the access request; or
[0077] The second registration unit is used to register the IP address of the load balancer and the service domain name of the target service provided by the target service in the domain name resolution server, wherein the service discovery module is used to obtain the access request.
[0078] Optionally, in this embodiment, the IP address, port number and target service name of the load balancer can be registered to the service discovery module. The service discovery module can record the relationship between the name of the business program and the IP address and port number of the load balancer. Figure 3 As shown, Figure 3 This is a schematic diagram of the relationship between the service program name and the IP address and port number of the load balancer that can be optionally recorded. The IP address and port number of the corresponding load balancer can be obtained through the service program name. It should be noted that Figure 3 The service program name, IP address and port number are for reference only. The actual name, address and port number should be set according to the actual situation.
[0079] As an optional example, the forwarding unit includes:
[0080] An acquisition module, configured to obtain the IP address of the load balancer by the service discovery module when the service discovery module receives an access request;
[0081] The forwarding module is used to send the access request to the load balancer according to the IP address of the load balancer. The load balancer forwards the access request.
[0082] Optionally, in this embodiment, if the service discovery module receives an access request sent by the client for accessing the target service, the service discovery module may, based on the target service that provides the target service, Figure 3The relationship in finds the IP address and port number of the corresponding load balancer, and then sends the access request to the corresponding load balancer, which sends the access request to the corresponding target service, and the target service provides services to the client.
[0083] As an optional example, the acquisition module includes:
[0084] A first determination submodule, configured to determine, by the service discovery module, a target service requested to be accessed by the access request;
[0085] The search submodule is used to find the load balancer where the target service is located to obtain the IP address of the load balancer.
[0086] Optionally, in this embodiment, if the service discovery module obtains an access request to the target service sent by the client, the service discovery module first searches for the load balancer based on the relationship between the business program it saves and the IP address and port number of the load balancer. After finding the corresponding load balancer, the access request is sent to the load balancer, and the load balancer forwards the access request to the corresponding target service. The target service processes the access request and returns the processing result.
[0087] As an optional example, the forwarding unit includes:
[0088] The second determination submodule is used to determine the target service to be accessed by the access request when the domain name resolution server receives the access request;
[0089] The resolution submodule is used to resolve the target service through the domain name resolution server to obtain the IP address of the load balancer;
[0090] The sending submodule is used to send the access request to the load balancer according to the IP address, and the load balancer forwards the access request.
[0091] Optionally, in this embodiment, the client can also send the access request to a domain name resolution server DNS. The DNS can resolve the target service and directly resolve the IP address of the load balancer. Then, the DNS can send the access request to the load balancer, and the load balancer sends the access request to the corresponding target service.
[0092] As an optional example, the control unit includes:
[0093] A first control module, used to control the service controller to send a request to the resource manager to request to start a target resource used by a target service;
[0094] The second control module is used to control the business controller to create a target service when the target resource is received.
[0095] Optionally, in this embodiment, when the business controller starts the target service, the business controller may apply to the resource manager for the target resource used to start the target service. Different business programs may use different resources. When the target resource is requested, the business controller creates the target service.
[0096] For other examples of this embodiment, please refer to the above examples and will not be repeated here.
[0097] Figure 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, it includes a processor 602, a communication interface 604, a memory 606 and a communication bus 608, wherein the processor 602, the communication interface 604 and the memory 606 communicate with each other through the communication bus 608, wherein,
[0098] Memory 606, used to store computer programs;
[0099] The processor 602 is used to implement the following steps when executing the computer program stored in the memory 606:
[0100] When receiving a start instruction to start the target service, start the service controller;
[0101] Control the business controller to start the target service;
[0102] After starting the target service, create a load balancer;
[0103] Mount the target service in the load balancer;
[0104] When an access request to a target service is received, the load balancer forwards the access request to the target service.
[0105] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The communication interface is used for communication between the above electronic device and other devices.
[0106] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0107] As an example, the memory 606 may include, but is not limited to, the startup unit 502, the control unit 504, the creation unit 506, the mounting unit 508, and the forwarding unit 510 in the request processing device. In addition, other module units in the request processing device may also be included but are not limited to, which will not be repeated in this example.
[0108] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0109] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0110] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only. The device for implementing the above request processing method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations shown.
[0111] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0112] According to another aspect of the embodiments of the present invention, there is further provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above-mentioned business processing method when running.
[0113] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0114] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0115] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0116] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0117] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0120] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A business processing method, characterized in that: include: When receiving a start instruction to start the target service, start the service controller; Controlling the service controller to start the target service; After starting the target service, create a load balancer; Mounting the target service in the load balancer; In the case of receiving an access request to the target service, the load balancer forwards the access request to the target service, including: in the case of receiving the access request by the domain name resolution server, determining the target service to be accessed by the access request; The domain name resolution server resolves the target service to obtain the IP address of the load balancer; according to the IP address, the access request is sent to the load balancer, and the load balancer forwards the access request.
2. The method according to claim 1, characterized in that After mounting the target service in the load balancer, the method further includes: registering the IP address, port number and name of the target service of the load balancer to a service discovery module, wherein the service discovery module is used to obtain the access request; or The IP address of the load balancer and the service domain name of the target service provided by the target service are registered in a domain name resolution server, wherein the service discovery module is used to obtain the access request.
3. The method according to claim 2, characterized in that In the case of receiving an access request to a target service, forwarding the access request to the target service by the load balancer includes: When the service discovery module receives the access request, the service discovery module obtains the IP address of the load balancer; According to the IP address of the load balancer, the service discovery module sends the access request to the load balancer, and the load balancer forwards the access request.
4. The method according to claim 3, characterized in that When the service discovery module receives the access request, obtaining the IP address of the load balancer by the service discovery module includes: Determining, by the service discovery module, the target service requested to be accessed by the access request; Find the load balancer where the target service is located to obtain the IP address of the load balancer.
5. The method according to any one of claims 1 to 4, characterized in that: Controlling the service controller to start the target service includes: Controlling the service controller to send a request to the resource manager to request to start the target resource used by the target service; In case of receiving the target resource, the service controller is controlled to create the target service.
6. The method according to any one of claims 1 to 4, characterized in that: After starting the target service, creating a load balancer involves: Call the target interface of the load balancing server; The load balancer is created through the target interface.
7. A service processing device, characterized in that: include: A starting unit, configured to start the service controller upon receiving a start instruction to start the target service; A control unit, configured to control the service controller to start the target service; A creation unit, used to create a load balancer after starting the target service; A mounting unit, used for mounting the target service in the load balancer; A forwarding unit, configured to forward the access request to the target service by the load balancer when receiving the access request, comprising: determining the target service to be accessed by the access request when the domain name resolution server receives the access request; The domain name resolution server resolves the target service to obtain the IP address of the load balancer; according to the IP address, the access request is sent to the load balancer, and the load balancer forwards the access request.
8. A computer-readable storage medium storing a computer program, characterized in that: The computer program executes the method described in any one of claims 1 to 6 when executed.
9. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Flow control method, device and system, electronic equipment and storage medium
CN113608865A
Domain name resolution method and apparatus, and computer-readable storage medium
WO2019237288A1
