CN114697339A - Load balancing method and device under centralized architecture - Google Patents

Load balancing method and device under centralized architecture Download PDF

Info

Publication number
CN114697339A
CN114697339A CN202210366069.0A CN202210366069A CN114697339A CN 114697339 A CN114697339 A CN 114697339A CN 202210366069 A CN202210366069 A CN 202210366069A CN 114697339 A CN114697339 A CN 114697339A
Authority
CN
China
Prior art keywords
address
load balancing
centralized architecture
request
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210366069.0A
Other languages
Chinese (zh)
Inventor
刘文超
余飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210366069.0A priority Critical patent/CN114697339A/en
Publication of CN114697339A publication Critical patent/CN114697339A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1014Server selection for load balancing based on the content of a request
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application provides a load balancing method and device under a centralized architecture, which can be used in the field of finance, and the method comprises the following steps: receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system; routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm; according to the method and the device, the request initiator can independently perform request distribution and load balancing operation, the complexity and software and hardware costs of the cluster system are reduced, and the data transmission efficiency of the cluster system is improved.

Description

Load balancing method and device under centralized architecture
Technical Field
The application relates to the field of data processing and can also be used in the field of finance, in particular to a load balancing method and device under a centralized architecture.
Background
The centralized architecture is mostly used in the traditional industries of banks, telecommunications, transportation, medical treatment and the like, basic software such as an operating system, middleware, a database and the like is mostly a closed-source commercial system, stability and safety are almost the terms of the centralized architecture, and all services are centrally deployed.
Under a traditional centralized architecture, all services are deployed in a centralized manner, and requests are often distributed among systems through loads. Conventional load balancing techniques include: software load balancing, hardware load balancing, and DNS load balancing, all suffer from different drawbacks. For example, a newly introduced load often becomes a new single point, which easily causes a single point of failure and cannot well solve the problem of disaster recovery in the same city. In addition, the loads often need additional software and hardware resources, which easily increases the complexity of deployment and has higher cost.
Disclosure of Invention
In order to solve the problems in the prior art, the application provides a load balancing method and device under a centralized architecture, which can implement independent request distribution and load balancing operations of a request initiator, reduce the complexity and hardware and software costs of a cluster system, and improve the data transmission efficiency of the cluster system.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a load balancing method under a centralized architecture, including:
receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of service providers of a cluster system;
and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
Further, after the receiving the external request, the method includes:
if the application flow of the current request initiator exceeds a flow threshold, determining that the corresponding data sending mode is asynchronous sending and sending a flow alarm to a set operation and maintenance end;
and if the application flow of the current request initiator does not exceed the flow threshold, determining that the corresponding data transmission mode is synchronous transmission.
Further, before the scanning the local service agent list and determining the corresponding service provider agent address, the method includes:
traversing a local service agent list according to a set frequency and determining the health state of the agent address of each service provider through heartbeat detection;
and establishing the association relation between each agent address and the health state in the local service agent list.
Further, the scanning the local service agent list to determine a corresponding service provider agent address includes:
scanning a local service agent list to determine a service provider agent address corresponding to the external request;
and if the health state associated with the service provider proxy address is an abnormal state, returning a request initiation failure signal.
In a second aspect, the present application provides a load balancing apparatus under a centralized architecture, including:
the local proxy address determining module is used for receiving an external request, scanning a local service proxy list and determining a corresponding proxy address of a service provider, wherein the service proxy list comprises the proxy addresses of all the service providers of the cluster system;
and the request routing distribution module is used for routing the external request to the corresponding service provider proxy address according to a preset balanced load algorithm.
Further, the proxy address local determination module includes:
the asynchronous sending unit is used for determining that the corresponding data sending mode is asynchronous sending and sending a flow alarm to the set operation and maintenance terminal if the application flow of the current request initiator exceeds a flow threshold;
and the synchronous sending unit is used for determining that the corresponding data sending mode is synchronous sending if the application flow of the current request initiator does not exceed the flow threshold.
Further, the local proxy address determining module further includes:
the health state monitoring unit is used for traversing the local service proxy list according to the set frequency and determining the health state of the proxy address of each service provider through heartbeat detection;
and the health state association unit is used for establishing the association relationship between each agent address and the health state in the local service agent list.
Further, the local proxy address determining module further includes:
a target provider address determining unit for scanning a local service agent list to determine a service provider agent address corresponding to the external request;
and the address health exception processing unit is used for returning a request initiation failure signal if the health state associated with the service provider proxy address is an abnormal state.
In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the load balancing method in the centralized architecture when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the load balancing method in a centralized architecture.
In a fifth aspect, the present application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the load balancing method under a centralized architecture.
According to the technical scheme, the load balancing method and device under the centralized architecture are provided, the balanced load processing is embedded into the application of the request initiator, so that the advantages of the centralized architecture are reserved, the defects of the traditional load in the aspects of single point, disaster recovery, complexity, cost and the like can be overcome, the request initiator can independently perform request distribution and load balancing operation, the complexity and software and hardware cost of a cluster system are reduced, and the data transmission efficiency of the cluster system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a load balancing method under a centralized architecture in an embodiment of the present application;
fig. 2 is a second flowchart illustrating a load balancing method under a centralized architecture according to an embodiment of the present application;
fig. 3 is a third schematic flow chart of a load balancing method under a centralized architecture in the embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a load balancing method under a centralized architecture in the embodiment of the present application;
fig. 5 is one of the structural diagrams of a load balancing apparatus under a centralized architecture in the embodiment of the present application;
fig. 6 is a second block diagram of a load balancing apparatus under a centralized architecture in an embodiment of the present application;
fig. 7 is a third structural diagram of a load balancing apparatus under a centralized architecture in an embodiment of the present application;
fig. 8 is a fourth structural diagram of a load balancing apparatus under a centralized architecture in the embodiment of the present application;
FIG. 9 is a diagram of a load balancing system under a centralized architecture in an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet the relevant regulations of national laws and regulations.
In consideration of the fact that a newly introduced load balancing node under a traditional centralized architecture often becomes a new single point, single point failure is easily caused, and the problem of disaster recovery in the same city cannot be well solved, the application provides a load balancing method and device under the centralized architecture.
In order to implement independent request distribution and load balancing operations of a request initiator, reduce complexity and software and hardware costs of a cluster system, and improve data transmission efficiency of the cluster system, the present application provides an embodiment of a load balancing method under a centralized architecture, which specifically includes the following contents, with reference to fig. 1:
step S101: receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system.
Optionally, an execution main body of the method may be a request initiator application/node in the cluster system, and a local service agent list is built in the request initiator application/node, where the service agent list includes agent addresses of service providers in the cluster system.
For example, the local service agent list may be a database-based run-time multi-protocol service agent list, and the data items of the list include: service identification, service agreement, service IP, service port, service path, health status, timestamp, etc.
Specifically, the list is empty before the service is started, and when a new target service is started, several records of different service identifiers (possibly providing multiple services at the same time) are inserted. When the requester calls different services, the requester firstly queries the list to obtain the available target services, and if a plurality of services can select a proper algorithm, such as random or polling, and finally selects one healthy service to request. And if the requested service list is empty, prompting a corresponding error. The health state of the service is based on health monitoring, when the monitoring finds that the number of times of unavailable service exceeds a certain threshold value, the health state of the service is set as unavailable, the timestamp is updated, and at the moment, methods of sending short messages or mails and the like can be set to inform a service provider. When service restoration is monitored, the health status is updated to be available again. And combining the time stamp, and directly deleting the corresponding service record when the service is monitored to be unavailable for a long time.
Optionally, after receiving an external request sent from outside the cluster system, the request initiator of the present application may scan the local service agent list first, so as to determine a service provider and an agent address thereof corresponding thereto.
Step S102: and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
Optionally, a balanced load algorithm, such as a polling method, a random method, and a source address hashing method, is further built in the request initiator of the present application, and is used to route the external request to the corresponding service provider proxy address through a preset balanced load algorithm after the corresponding service provider proxy address is determined, so that routing distribution of the message is achieved without separately setting a balanced load node.
As can be seen from the above description, the load balancing method under the centralized architecture provided in the embodiments of the present application can embed the balanced load processing into the application of the request initiator, which not only retains the advantages of the centralized architecture, but also can solve the defects of the traditional load in the aspects of single point, disaster recovery, complexity, cost, and the like, thereby enabling the request initiator to independently perform request distribution and load balancing operations, reducing the complexity and hardware and software costs of the cluster system, and improving the data transmission efficiency of the cluster system.
In order to ensure reliability when the request initiator distributes the request, in an embodiment of the load balancing method under the centralized architecture of the present application, referring to fig. 2, step S101 may further specifically include the following contents:
step S201: and if the application flow of the current request initiator exceeds the flow threshold, determining that the corresponding data sending mode is asynchronous sending and sending a flow alarm to the set operation and maintenance end.
Step S202: and if the application flow of the current request initiator does not exceed the flow threshold, determining that the corresponding data transmission mode is synchronous transmission.
Optionally, before performing route distribution, the request initiator of the present application may determine a corresponding data sending method by combining with the current own traffic.
Optionally, if the application traffic of the current request initiator exceeds the traffic threshold, an asynchronous sending manner is adopted, and a traffic alarm may be sent to the relevant operation and maintenance end, and if the application traffic does not exceed the traffic threshold, a synchronous sending manner is usually adopted.
In order to ensure that the request is distributed to the service provider in a normal state, in an embodiment of the load balancing method under the centralized architecture of the present application, referring to fig. 3, the step S101 may further specifically include the following steps:
step S301: and traversing the local service agent list according to the set frequency and determining the health state of the agent address of each service provider through heartbeat detection.
Step S302: and establishing the association relation between each agent address and the health state in the local service agent list.
Optionally, in order to ensure that the request is distributed to the service provider in a normal state, the request initiator of the application may determine in advance a health state of the proxy address of the service provider to be sent, that is, a health state of the service provider before performing route distribution.
Optionally, the present application may traverse the local service agent list according to a set frequency, and perform heartbeat detection on the agent address in the local service agent list, so as to determine the corresponding health status.
Meanwhile, the detected health state and each service provider proxy address can be associated and bound in the local service proxy list, namely, the local service proxy list not only contains the proxy address of each service provider, but also contains the health state corresponding to the proxy address.
In order to ensure that the request is distributed to the service provider in a normal state, in an embodiment of the load balancing method under the centralized architecture of the present application, referring to fig. 4, the step S101 may further specifically include the following steps:
step S401: scanning a local service agent list to determine a service provider agent address corresponding to the external request.
Step S402: and if the health state associated with the service provider proxy address is an abnormal state, returning a request initiation failure signal.
Optionally, in order to ensure that the request is distributed to the service provider in the normal state, the request initiator of the present application may determine in advance a health state of the proxy address of the service provider to be sent before performing route distribution, and if the health state is an abnormal state, a subsequent route distribution operation may not be performed at this time, and the present application returns a request initiation failure signal.
In order to implement independent request distribution and load balancing operations by a request initiator, reduce the complexity and hardware and software costs of a cluster system, and improve the data transmission efficiency of the cluster system, the present application provides an embodiment of a load balancing apparatus under a centralized architecture for implementing all or part of the content of the load balancing method under the centralized architecture, and referring to fig. 5, the load balancing apparatus under the centralized architecture specifically includes the following contents:
the local proxy address determining module 10 is configured to receive an external request, scan a local service proxy list, and determine a corresponding proxy address of a service provider, where the service proxy list includes proxy addresses of service providers of the cluster system.
And the request routing distribution module 20 is configured to route the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
As can be seen from the above description, the load balancing apparatus under a centralized architecture provided in the embodiments of the present application can embed the balanced load processing into the application of the request initiator, which not only retains the advantages of the centralized architecture, but also can solve the defects of the traditional load in the aspects of single point, disaster recovery, complexity, cost, and the like, thereby enabling the request initiator to independently perform request distribution and load balancing operations, reducing the complexity and hardware and software costs of the cluster system, and improving the data transmission efficiency of the cluster system.
In order to ensure the reliability of the request when the request initiator distributes the request, in an embodiment of the load balancing apparatus under the centralized architecture of the present application, referring to fig. 6, the proxy address local determining module 10 includes:
and the asynchronous sending unit 11 is configured to determine that the corresponding data sending mode is asynchronous sending and send a traffic alarm to the set operation and maintenance end if the application traffic of the current request initiator exceeds a traffic threshold.
The synchronous sending unit 12 is configured to determine that a corresponding data sending manner is synchronous sending if the application traffic of the current request initiator does not exceed the traffic threshold.
In order to ensure that the request is distributed to the service provider in a normal state, in an embodiment of the load balancing apparatus under the centralized architecture of the present application, referring to fig. 7, the proxy address local determining module 10 further includes:
and the health state monitoring unit 13 is used for traversing the local service proxy list according to the set frequency and determining the health state of the proxy address of each service provider through heartbeat detection.
And the health state association unit 14 is configured to establish an association relationship between each agent address and a health state in the local service agent list.
In order to ensure that the request is distributed to the service provider in a normal state, in an embodiment of the load balancing apparatus under the centralized architecture of the present application, referring to fig. 8, the proxy address local determining module 10 further includes:
a target provider address determining unit 15, configured to scan the local service agent list to determine a service provider agent address corresponding to the external request.
And the address health exception processing unit 16 is configured to return a request initiation failure signal if the health status associated with the service provider agent address is an exception status.
To further explain the present solution, the present application further provides a specific application example of implementing the load balancing method under the centralized architecture by using the load balancing apparatus under the centralized architecture, which is shown in fig. 9 and specifically includes the following contents: a current limit module, a service agent list, route forwarding and health monitoring.
The service agent list mainly stores a service agent address list, and can be loaded based on a configuration file or a database. Each service agent address can be correspondingly configured with a service state and an access amount, and the state is maintained based on the health check of the service of the receiver and can be manually modified, so that the manual isolation of the server of the receiver is facilitated.
The route forwarding is internally provided with a load balancing algorithm (a polling method, a random method, a source address hashing method and the like), and a request initiator can be configured independently. The module implements the distribution of requests in conjunction with the service agent list. Different initiators under the same cluster suggest configuring the same load balancing algorithm.
The health monitoring is used for traversing the service agent list, monitoring the health state of the service through heartbeat detection, and synchronously updating the service state of the service agent.
The current limiting module is used for synchronously sending the current system flow when the concurrency is low, and asynchronously sending the current system flow when the concurrency is higher than a certain threshold value, wherein the threshold value can be configured through parameters. And alarming when the flow is abnormal to prompt related operation and maintenance personnel.
As can be seen from the above, each application embedded with the modules in the present application is not only subordinate to a request initiator, but also can independently perform request distribution, and does not require additional software and hardware resources, and there is no single point of failure, thereby implementing a decentralized method under a centralized architecture.
In terms of hardware, in order to implement independent request distribution and load balancing operations by a request initiator, reduce the complexity and hardware and software costs of a cluster system, and improve the data transmission efficiency of the cluster system, the present application provides an embodiment of an electronic device for implementing all or part of the contents in the load balancing method under the centralized architecture, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the load balancing device and relevant equipment such as a core service system, a user terminal and a relevant database under a centralized architecture; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may refer to an embodiment of the load balancing method under the centralized architecture and an embodiment of the load balancing apparatus under the centralized architecture in the embodiments for implementation, and the contents thereof are incorporated herein, and repeated details are not repeated.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the load balancing method under the centralized architecture may be performed on the electronic device side as described above, or all operations may be performed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 10 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 10, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 10 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the load balancing method function in the centralized architecture may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step S101: receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system.
Step S102: and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
As can be seen from the above description, in the electronic device provided in the embodiment of the present application, by embedding the balanced load processing into the application of the request initiator, not only the advantage of the centralized architecture is retained, but also the defects of the traditional load in the aspects of single point, disaster recovery, complexity, cost, and the like can be solved, so that the request initiator can independently perform request distribution and balanced load operation, the complexity and the software and hardware costs of the cluster system are reduced, and the data transmission efficiency of the cluster system is improved.
In another embodiment, the load balancing apparatus under the centralized architecture may be configured separately from the central processor 9100, for example, the load balancing apparatus under the centralized architecture may be configured as a chip connected to the central processor 9100, and the function of the load balancing method under the centralized architecture is realized by the control of the central processor.
As shown in fig. 10, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 10; in addition, the electronic device 9600 may further include components not shown in fig. 10, which can be referred to in the prior art.
As shown in fig. 10, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes referred to as an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the load balancing method under the centralized architecture in which the execution subject in the foregoing embodiment is the server or the client, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the load balancing method under the centralized architecture in which the execution subject is the server or the client, for example, when the processor executes the computer program, the processor implements the following steps:
step S101: receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system.
Step S102: and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present application, by embedding the balanced load processing into the application of the request initiator, not only retains the advantage of a centralized architecture, but also can solve the defects of the traditional load in terms of single point, disaster recovery, complexity, cost, and the like, thereby enabling the request initiator to independently perform request distribution and balanced load operations, reducing the complexity and hardware and software costs of the cluster system, and improving the data transmission efficiency of the cluster system.
Embodiments of the present application further provide a computer program product capable of implementing all steps in the load balancing method under a centralized architecture in which an execution subject in the foregoing embodiments is a server or a client, where when executed by a processor, the computer program/instruction implements the steps of the load balancing method under the centralized architecture, for example, the computer program/instruction implements the following steps:
step S101: receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system.
Step S102: and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
As can be seen from the above description, in the computer program product provided in the embodiment of the present application, by embedding the balanced load processing into the application of the request initiator, not only the advantage of the centralized architecture is retained, but also the defects of the traditional load in the aspects of single point, disaster recovery, complexity, cost, and the like can be solved, so that the request initiator can independently perform request distribution and balanced load operation, the complexity and the software and hardware costs of the cluster system are reduced, and the data transmission efficiency of the cluster system is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (11)

1. A load balancing method under a centralized architecture is applied to a request initiator in a cluster system, and the method comprises the following steps:
receiving an external request, scanning a local service agent list, and determining a corresponding service provider agent address, wherein the service agent list comprises agent addresses of all service providers of the cluster system;
and routing the external request to a corresponding service provider proxy address according to a preset balanced load algorithm.
2. The method for load balancing under a centralized architecture according to claim 1, after the receiving the external request, comprising:
if the application flow of the current request initiator exceeds a flow threshold, determining that the corresponding data sending mode is asynchronous sending and sending a flow alarm to a set operation and maintenance end;
and if the application flow of the current request initiator does not exceed the flow threshold, determining that the corresponding data transmission mode is synchronous transmission.
3. The method of load balancing under a centralized architecture according to claim 1, wherein before said scanning the local service agent list to determine the corresponding service provider agent address, comprising:
traversing a local service agent list according to a set frequency and determining the health state of the agent address of each service provider through heartbeat detection;
and establishing the association relation between each agent address and the health state in the local service agent list.
4. The method for load balancing under a centralized architecture according to claim 3, wherein the scanning the local service agent list to determine the corresponding service provider agent address comprises:
scanning a local service proxy list to determine a service provider proxy address corresponding to the external request;
and if the health state associated with the service provider proxy address is an abnormal state, returning a request initiation failure signal.
5. A load balancing apparatus under a centralized architecture, comprising:
the local proxy address determining module is used for receiving an external request, scanning a local service proxy list and determining a corresponding proxy address of a service provider, wherein the service proxy list comprises the proxy addresses of all the service providers of the cluster system;
and the request routing distribution module is used for routing the external request to the corresponding service provider proxy address according to a preset balanced load algorithm.
6. The apparatus for load balancing under a centralized architecture as claimed in claim 5, wherein the proxy address local determination module comprises:
the asynchronous sending unit is used for determining that the corresponding data sending mode is asynchronous sending and sending a flow alarm to the set operation and maintenance terminal if the application flow of the current request initiator exceeds a flow threshold;
and the synchronous sending unit is used for determining that the corresponding data sending mode is synchronous sending if the application flow of the current request initiator does not exceed the flow threshold.
7. The apparatus for load balancing under a centralized architecture as recited in claim 5, wherein the local determining module of the agent address further comprises:
the health state monitoring unit is used for traversing the local service proxy list according to the set frequency and determining the health state of the proxy address of each service provider through heartbeat detection;
and the health state association unit is used for establishing the association relationship between each agent address and the health state in the local service agent list.
8. The apparatus for load balancing under a centralized architecture as recited in claim 7, wherein the proxy address local determination module further comprises:
a target provider address determining unit for scanning a local service agent list to determine a service provider agent address corresponding to the external request;
and the address health exception processing unit is used for returning a request initiation failure signal if the health state associated with the service provider proxy address is an abnormal state.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the method of load balancing under a centralized architecture as claimed in any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for load balancing under a centralized architecture according to any one of claims 1 to 4.
11. A computer program product comprising computer programs/instructions for implementing the steps of the method of load balancing under a centralized architecture according to any one of claims 1 to 4 when executed by a processor.
CN202210366069.0A 2022-04-08 2022-04-08 Load balancing method and device under centralized architecture Pending CN114697339A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210366069.0A CN114697339A (en) 2022-04-08 2022-04-08 Load balancing method and device under centralized architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210366069.0A CN114697339A (en) 2022-04-08 2022-04-08 Load balancing method and device under centralized architecture

Publications (1)

Publication Number Publication Date
CN114697339A true CN114697339A (en) 2022-07-01

Family

ID=82142124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210366069.0A Pending CN114697339A (en) 2022-04-08 2022-04-08 Load balancing method and device under centralized architecture

Country Status (1)

Country Link
CN (1) CN114697339A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115391215A (en) * 2022-08-31 2022-11-25 江苏安超云软件有限公司 Method and application for debugging full link under micro-service architecture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070171842A1 (en) * 2006-01-23 2007-07-26 Microsoft Corporation Discovery Of Network Nodes And Routable Addresses
CN105024938A (en) * 2015-06-11 2015-11-04 北京思源置地科技有限公司 Mobile load balancing method and system
CN109542641A (en) * 2018-11-14 2019-03-29 中国联合网络通信集团有限公司 Service calling method, apparatus and system
CN111464592A (en) * 2020-03-09 2020-07-28 平安科技(深圳)有限公司 Load balancing method, device, equipment and storage medium based on microservice

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070171842A1 (en) * 2006-01-23 2007-07-26 Microsoft Corporation Discovery Of Network Nodes And Routable Addresses
CN105024938A (en) * 2015-06-11 2015-11-04 北京思源置地科技有限公司 Mobile load balancing method and system
CN109542641A (en) * 2018-11-14 2019-03-29 中国联合网络通信集团有限公司 Service calling method, apparatus and system
CN111464592A (en) * 2020-03-09 2020-07-28 平安科技(深圳)有限公司 Load balancing method, device, equipment and storage medium based on microservice

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115391215A (en) * 2022-08-31 2022-11-25 江苏安超云软件有限公司 Method and application for debugging full link under micro-service architecture
CN115391215B (en) * 2022-08-31 2023-11-17 江苏安超云软件有限公司 Method and application for full link debugging under micro-service architecture

Similar Documents

Publication Publication Date Title
CN111031058A (en) Websocket-based distributed server cluster interaction method and device
CN110764881A (en) Distributed system background retry method and device
CN112328413B (en) Application service calling method, device and system
CN111953785B (en) Data transmission method, system and server
CN111858050B (en) Server cluster hybrid deployment method, cluster management node and related system
CN111510493B (en) Distributed data transmission method and device
CN112953908A (en) Network isolation configuration method, device and system
CN114257532B (en) Method and device for detecting state of server
CN112689012A (en) Cross-network proxy communication method and device
CN110912805B (en) Message reading state synchronization method, terminal, server and system
CN114697339A (en) Load balancing method and device under centralized architecture
CN111522650A (en) Service request processing method and device of distributed system and electronic equipment
CN111767558B (en) Data access monitoring method, device and system
CN111338905A (en) Application node data processing method and device
CN116185755A (en) Data processing method and device for distributed load balancing system
CN114374614B (en) Network topology configuration method and device
CN115562898A (en) Distributed payment system exception handling method and device
CN115914375A (en) Disaster tolerance processing method and device for distributed message platform
CN111698337B (en) Method, device and equipment for establishing communication connection
CN113676894B (en) Service processing method and equipment
CN113452776A (en) PaaS platform service scheduling method and device and PaaS platform
CN113050974B (en) Online upgrading method and device for cloud computing infrastructure
CN116069855A (en) Distributed service routing method and device
CN111885148B (en) Session synchronization method and device
CN116860453A (en) Distributed message platform data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination