CN115277573A - Load balancing processing method and device for issuing application tasks - Google Patents
Load balancing processing method and device for issuing application tasks Download PDFInfo
- Publication number
- CN115277573A CN115277573A CN202210951474.9A CN202210951474A CN115277573A CN 115277573 A CN115277573 A CN 115277573A CN 202210951474 A CN202210951474 A CN 202210951474A CN 115277573 A CN115277573 A CN 115277573A
- Authority
- CN
- China
- Prior art keywords
- load balancing
- information
- application task
- parameters
- logic information
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 20
- 238000000034 method Methods 0.000 claims abstract description 31
- 238000012545 processing Methods 0.000 claims abstract description 29
- 238000004891 communication Methods 0.000 claims description 16
- 230000004044 response Effects 0.000 claims description 11
- 239000004744 fabric Substances 0.000 claims 2
- 230000008569 process Effects 0.000 description 12
- 238000009826 distribution Methods 0.000 description 6
- 239000002699 waste material Substances 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000011144 upstream manufacturing Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multi Processors (AREA)
Abstract
The invention discloses a load balancing processing method and device for issuing application tasks, relates to the technical field of internet, and mainly aims to solve the problem that the load balancing processing capability of the existing issuing application tasks is poor. The method comprises the following steps: when an application task issuing request is received, acquiring a load balancing configuration file, wherein path information related to a load balancing configuration directory is stored in the load balancing configuration file, and the load balancing configuration directory is obtained by compiling a lightweight scripting language; searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information; and acquiring the load balancing parameters matched with the load balancing logic information from a target cache database, and issuing the application task by combining the load balancing logic information and the load balancing parameters.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a load balancing processing method and apparatus.
Background
Load Balance (LB) is an indispensable key component of a high-concurrency and high-availability system, so as to try to distribute network traffic to a plurality of servers evenly, and improve the response speed and availability of the whole system. The load balancing comprises hardware load balancing and software load balancing, the seven-layer Nginx load balancing is software load balancing, and the client request agent can be forwarded to a group of upstream virtual service pools.
At present, in order to ensure the throughput of mass data, each large application party usually adopts seven layers of Nginx load balancing to process data requests, but as application systems are gradually increased, the number of requests in a server is more and more, and more load balancing configuration files are required, when new application tasks are issued, the server needs to be requested to operate, a large number of and frequent Nginx upstream load balancing configuration operations are loaded, serious resource loss is caused to the system, the issuing system cannot process the issued application tasks in parallel, and the load balancing processing capability of the issued application tasks is influenced.
Disclosure of Invention
In view of the above, the present invention provides a load balancing processing method and device for issuing an application task, and mainly aims to solve the problem that the load balancing processing capability of the existing application task issuing is poor.
According to an aspect of the present invention, there is provided a load balancing processing method for issuing an application task, including:
when an application task issuing request is received, acquiring a load balancing configuration file, wherein path information related to a load balancing configuration directory is stored in the load balancing configuration file, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information;
and acquiring the load balancing parameters matched with the load balancing logic information from a target cache database, and issuing the application task by combining the load balancing logic information and the load balancing parameters.
Further, before the obtaining the load balancing configuration file, the method further includes:
acquiring load balancing configuration information to be updated, splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated;
storing the load balancing parameters to be updated, and sending a directory compiling instruction carrying the load balancing logic information to be updated to a load balancing server, so that the load balancing server compiles and constructs a load balancing configuration directory according to the load balancing logic information;
and acquiring path information corresponding to the load balancing configuration directory compiled and constructed by the load balancing server, and updating and configuring the path information in load balancing configuration files corresponding to different application task issuing requests.
Further, the obtaining of the load balancing configuration information to be updated and splitting the load balancing configuration information to obtain the load balancing logic information to be updated and the load balancing parameters to be updated includes:
sending a load balancing configuration instruction to an application task system to indicate the application task system to receive load balancing configuration information input by a user;
acquiring load balancing configuration information fed back by the application task system;
and splitting the load balancing configuration information according to the character string type and the data format to obtain the load balancing logic information to be updated and the load balancing parameters to be updated.
Further, before the updating and configuring the path information in the load balancing configuration file corresponding to the different application task issuing requests, the method further includes:
storing historical path information of the load balancing configuration file into a non-cache database, and recording historical load balancing logic information corresponding to different searching times in the non-cache database;
and emptying the load balancing configuration file.
Further, after the load balancing logic information matched with the request parameter carried in the application task issuing request in the load balancing configuration directory is searched through the path information, the method further includes:
if the load balancing logic information matched with the request parameters in the load balancing configuration directory is not found through the path information, acquiring historical path information in the non-cache database;
and searching historical load balancing logic information with the maximum frequency through the historical path information, and acquiring historical load balancing parameters matched with the historical load balancing logic information from a target cache database to execute the release of the application task.
Further, the obtaining of the load balancing parameter matching with the load balancing logic information from the target cache database includes:
and if the load balancing parameters matched with the load balancing logic information are not stored in the target cache database, acquiring the historical load balancing parameters so as to execute the release of the application task by combining the load balancing logic information and the historical load balancing parameters.
Further, the performing the publishing of the application task in combination with the load balancing logic information and the load balancing parameters includes:
sending an application task issuing execution instruction to a target load balancing server to instruct the target load balancing server to create a coroutine matched with the application task according to the load balancing logic information and the load balancing parameters;
when a response of creating the coroutine is received, the load balancing logic information and the load balancing parameters are sent to the target load balancing server side, and application tasks are issued in the corresponding coroutines according to the load balancing logic information and the load balancing parameters.
According to another aspect of the present invention, there is provided a load balancing processing apparatus for distributing application tasks, including:
the system comprises an acquisition module, a load balancing configuration module and a load balancing configuration module, wherein the acquisition module is used for acquiring a load balancing configuration file when an application task issuing request is received, the load balancing configuration file stores path information related to a load balancing configuration directory, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
the searching module is used for searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information;
and the execution module is used for acquiring the load balancing parameters matched with the load balancing logic information from a target cache database and executing the release of the application task by combining the load balancing logic information and the load balancing parameters.
Further, the apparatus further comprises:
the splitting module is used for acquiring load balancing configuration information to be updated and splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated;
the sending module is used for storing the load balancing parameters to be updated and sending a directory compiling instruction carrying the load balancing logic information to be updated to a load balancing server so that the load balancing server compiles and constructs a load balancing configuration directory according to the load balancing logic information;
and the updating module is used for acquiring the path information corresponding to the load balancing configuration directory compiled and constructed by the load balancing server side and updating and configuring the path information in the load balancing configuration files corresponding to different application task issuing requests.
Further, the splitting module is specifically configured to send a load balancing configuration instruction to an application task system to instruct the application task system to receive load balancing configuration information entered by a user; acquiring load balancing configuration information fed back by the application task system; and splitting the load balancing configuration information according to the character string type and the data format to obtain load balancing logic information to be updated and load balancing parameters to be updated.
Further, the apparatus further comprises:
the recording module is used for storing the historical path information of the load balancing configuration file into a non-cache database and recording historical load balancing logic information corresponding to different searching times in the non-cache database;
and the emptying module is used for emptying the load balancing configuration file.
Further, the obtaining module is further configured to obtain historical path information in the non-cache database if the load balancing logic information matching the request parameter in the load balancing configuration directory is not found through the path information; and searching historical load balancing logic information with the maximum times through the historical path information, and acquiring historical load balancing parameters matched with the historical load balancing logic information from a target cache database so as to execute the release of the application task.
Further, the obtaining module is specifically configured to obtain the historical load balancing parameter if the load balancing parameter matching the load balancing logic information is not stored in the target cache database, so as to execute the issuing of the application task by combining the load balancing logic information and the historical load balancing parameter.
Further, the sending module is further configured to send an application task issuing execution instruction to a target load balancing server to instruct the target load balancing server to create a coroutine matched with the application task according to the load balancing logic information and the load balancing parameters; when a response of creating the coroutine is received, the load balancing logic information and the load balancing parameters are sent to the target load balancing server side, and application tasks are issued in the corresponding coroutines according to the load balancing logic information and the load balancing parameters.
According to another aspect of the present invention, a storage medium is provided, where at least one executable instruction is stored, and the executable instruction causes a processor to perform an operation corresponding to the load balancing processing method for issuing an application task as described above.
According to still another aspect of the present invention, there is provided a computer apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the load balancing processing method for issuing the application task.
By means of the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
the invention provides a load balancing processing method and device for issuing an application task, compared with the prior art, the load balancing configuration file is obtained when an application task issuing request is received, path information related to a load balancing configuration directory is stored in the load balancing configuration file, and the load balancing configuration directory is obtained by compiling a lightweight scripting language; searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information; the load balancing parameters matched with the load balancing logic information are obtained from the target cache database, and the application task is issued by combining the load balancing logic information and the load balancing parameters, so that the load balancing logic information is obtained based on the path information in the configuration file when the application task issuing operation is executed, the load balancing parameters matched with the load balancing logic information are obtained from the target cache database according to the load balancing logic information, the application task is issued, the load balancing configuration in the load balancing virtual service pool is not required to be frequently loaded, the problem of resource waste is avoided, the issued application tasks can be processed in real time and in parallel, and the load balancing processing performance of the issued application tasks is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flowchart of a load balancing processing method for issuing an application task according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another load balancing processing method for issuing application tasks according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a further load balancing processing method for issuing an application task according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating a load balancing processing apparatus for issuing an application task according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Aiming at the problem that at present, in order to ensure the throughput of mass data, each large application party usually adopts seven layers of Nginx load balancing to process data requests, but as application systems are gradually increased, the number of requests in a server is increased, and configuration files for load balancing are increased, when a new application task is issued, a request operation is required on the server, the Nginx upstream load balancing configuration operation is frequently and massively loaded, serious resource loss is caused to the system, the issuing system cannot process the issued application task in parallel, and the load balancing processing capability of the issued application task is influenced, the embodiment of the invention provides a load balancing processing method for issuing the application task, and the method comprises the following steps of:
101. and when an application task issuing request is received, acquiring a load balancing configuration file.
In the embodiment of the invention, the execution main body is a server for executing configuration operation related to load balancing, and the distributed application task load balancing processing system is formed by the execution main body and the distributed application task system. It should be noted that, in order to distribute a large number of requests from the client and/or the browser to the multiple servers for response so as to improve the throughput and the request performance of the network system, a request distribution operation needs to be executed based on load balancing configuration.
Specifically, after receiving the application task issuing request, the execution main body acquires a load balancing configuration file so as to acquire load balancing configuration logic information and load balancing parameters according to the configuration file, and determines load balancing associated configuration issued by the current application task based on the load balancing configuration logic information and the load balancing parameters. The application task issuing request may be an issuing request of an application issued for the first time, or may also be an issuing request for executing an online or offline to an issued application, for example, the application task issuing request may be application layer information such as a protocol request (http, https, DNS, and the like) based on a URL, but is not limited thereto.
Further, the configuration file stores path information associated to the load balancing configuration directory, and the path information is used for indicating a storage location of the load balancing configuration directory, so as to obtain the load balancing configuration directory based on the path information. Specifically, the load balancing directory in the embodiment of the application is compiled based on the Lua lightweight script language, and the Lua lightweight script is embedded into the load balancing to execute the Lua lightweight script in the process of realizing the load balancing, so that a large number of requests can be processed in a high-concurrency and non-blocking manner, and the load balancing processing performance of issuing application tasks is improved.
102. And searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information.
The load balancing logic information may be load balancing logic information required when the load balancing operation is executed for the application task issuing, for example, a mapping relationship between task issuing and a server of each application module when the application task is issued, call logic of a plurality of servers in load balancing, a server state response logic, and the like, and the request parameter issued by the application task may be a unique identifier used for identifying the application, such as an application name, a preset code corresponding to the application one to one, an issuing address corresponding to the application, and the like.
According to the above description in step 101, based on the path information associated with the load balancing configuration directory stored in the configuration file, the load balancing configuration directory may be obtained, so that the load balancing logic information corresponding to the current application task issuing request may be obtained through query based on the load balancing configuration directory. In a specific implementation process, load balancing logic information corresponding to different request parameters may be stored in a load balancing configuration directory compiled based on a Lua lightweight scripting language, for example, a mapping relationship between the request parameters and the load balancing logic parameters is established, or an index used for searching for corresponding load balancing logic information according to the request parameters is generated, so that an execution subject obtains the load balancing logic information from the load balancing configuration directory according to the request parameters, but the present application is only an example, and the specific implementation manner of step 102 is not limited in this embodiment.
103. And acquiring the load balancing parameters matched with the load balancing logic information from a target cache database, and issuing the application task by combining the load balancing logic information and the load balancing parameters.
The target cache database may be a Redis cache database, and in a specific implementation process, when an application task to be issued exists in an application task load balancing processing system, the updated load balancing configuration information is stored in the Redis cache database in a deployment process, in particular, load balancing configuration parameters, such as time parameters and throughput parameters for executing application task issuing by each server executing current application task issuing. And storing the updated load balancing configuration information into a Redis cache database, so that timeliness of the configuration balancing configuration information can be guaranteed, and the issuing of the application task can be executed based on the real-time load balancing parameters. In addition, by embedding the Lua lightweight script in the configuration file, the execution body can link the Redis cache database and acquire the load balancing parameters based on the Lua lightweight script after acquiring the configuration file.
In the embodiment of the application, the updated load balancing parameters are stored in the target database, so that when the application task to be issued exists, the execution main body can acquire the path information stored with the load balancing configuration directory, search the load balancing logic corresponding to the current application task issuing from the load balancing configuration directory based on the path information, and then query the load balancing parameters matched with the load balancing logic from the target database, so that the load balancing application task issuing operation is executed according to the load balancing logic and the load balancing parameters, the load balancing configuration in the load balancing virtual service pool is not required to be frequently loaded, the problem of resource waste is avoided, the issued application tasks can be processed in real time and in parallel, and the load balancing processing performance of the issued application tasks is improved.
In another embodiment of the present invention, for further limitation and explanation, as shown in fig. 2, before the obtaining a load balancing configuration file in step 101, the method further includes:
201. acquiring load balancing configuration information to be updated, splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated.
202. And storing the load balancing parameters to be updated, and sending a directory compiling instruction carrying the load balancing logic information to be updated to a load balancing server.
203. And acquiring path information corresponding to the load balancing configuration directory compiled and constructed by the load balancing server, and updating and configuring the path information in load balancing configuration files corresponding to different application task issuing requests.
The load balancing configuration information is all information related to load balancing when the application task issuing operation is executed, and further the load balancing configuration information at least comprises load balancing logic information, such as one or more service ends executing the application task issuing and the call logic of the one or more service ends, and load balancing parameters, such as state response parameters of each service end, application task issuing time parameters, throughput parameters, and the like. Specifically, the load balancing information may be obtained through a preset port, or may be obtained through transmission of a data transmission medium, which is not specifically limited in this embodiment of the present application. Therefore, in order to avoid the problems of resource waste and poor load balancing processing performance caused by frequently loading all the load balancing configuration file information in the virtual service pool when an application task is issued, in the embodiment of the application, after the load balancing configuration information to be updated is obtained, the load balancing configuration information is split to obtain the load balancing logic information and the load balancing parameters, so that the two parts of load balancing configuration information are respectively obtained to improve the load balancing processing performance. The splitting manner of the load balancing configuration information may be a preset splitting algorithm, a preset splitting rule, and the like for splitting the load balancing configuration information into the load balancing logic and the load balancing parameters, which is not limited in the embodiments of the present application.
Further, after the execution main body splits the load balancing configuration information to be updated to obtain the load balancing logic and the load balancing parameters, the generation of the load balancing configuration directory according to the load balancing logic is triggered, specifically, the load balancing configuration directory may be automatically generated for the load balancing server based on the load balancing logic information, or after the load balancing server receives a directory compiling instruction sent by the execution main body, the directory compiling prompt information is sent to relevant workers through terminal equipment, and the load balancing configuration directory based on manual feedback is received, so that the load balancing server compiles and constructs the load balancing configuration directory according to the load balancing logic information. Meanwhile, the load balancing parameters to be updated are stored in the target cache database, so that the load balancing parameters matched with the load balancing logic information are searched in the target cache database, and the system pressure of the system for updating data is greatly reduced.
It should be noted that, in order to concurrently execute the distribution of multiple application tasks in the distribution application task load balancing processing system, multiple load balancing configuration directories serving for different application task distributions are stored in the database corresponding to the load balancing configuration server, so as to ensure the accuracy of distribution and execution of the load balancing application tasks, after the execution main body obtains the load balancing configuration directory corresponding to the load balancing configuration information, a storage path of the load balancing configuration directory is further obtained, and the path information is updated and configured in the load balancing configuration file corresponding to different application task distribution requests, so that when the load balancing configuration operation is executed, the matched load balancing configuration directory is accurately obtained based on the storage path, and the accuracy of load balancing processing when the application tasks are distributed is improved.
In another embodiment of the present invention, for further limitation and description, the step of obtaining load balancing configuration information to be updated and splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated includes:
sending a load balancing configuration instruction to an application task system to indicate the application task system to receive load balancing configuration information input by a user;
acquiring load balancing configuration information fed back by the application task system;
and splitting the load balancing configuration information according to the character string type and the data format to obtain load balancing logic information to be updated and load balancing parameters to be updated.
In the embodiment of the application, when the execution main body executes the load balancing processing operation of issuing the application task based on the load balancing configuration information corresponding to the application task, and the load balancing configuration information is input by a user based on an application task system, in the specific implementation process, the execution main body sends a load balancing configuration information configuration instruction to the application task system, so that the application task system receives the load balancing configuration information input by the user and feeds the load balancing configuration information back to the execution main body after receiving the configuration instruction, and the execution main body splits the received load balancing configuration information according to the character string type, the data format and the like to obtain the load balancing logic information to be updated and the load balancing parameters to be updated.
In another embodiment of the present invention, for further limitation and description, before the step of updating and configuring the path information in the load balancing configuration file corresponding to the different application task issuing requests, the method further includes:
storing historical path information of the load balancing configuration file into a non-cache database, and recording historical load balancing logic information corresponding to different searching times in the non-cache database;
and emptying the load balancing configuration file.
When the execution main body is split according to the load balancing configuration information to be updated to obtain the load balancing logic information and the load balancing parameters corresponding to the application task release, the two load balancing data are stored in different positions respectively, and the path information generated according to the load balancing logic information is stored in the load balancing configuration file. However, in a specific practical process, path information corresponding to the last time of issuing the application task may be stored in the load balancing configuration file, and therefore, in order to ensure accuracy of data in the load balancing process, historical stored data in the load balancing configuration file needs to be deleted before the path information corresponding to the current application task issuing is stored in the load balancing configuration file.
Furthermore, in order to ensure the comprehensiveness of the application task issuing data and improve the data loss response performance of the load balancing processing, the historical path information is stored in the non-cache database for path information backup before the historical path information of the load balancing configuration file is deleted, meanwhile, the access times of the historical path information in the load balancing configuration file are accumulated, and the access times and the historical path information are correspondingly stored in the non-cache database, so that when the current path information is lost or the load balancing logic information is failed to be acquired based on the current path information, the historical path information can be called from the non-cache database, and the fault tolerance performance of the application task issuing load balancing processing system is improved.
In another embodiment of the present invention, for further limitation and description, after the step of searching for load balancing logic information in the load balancing configuration directory, which matches the request parameter carried in the application task issuing request, through the path information, the method further includes:
if the load balancing logic information matched with the request parameters in the load balancing configuration directory is not found through the path information, acquiring historical path information in the non-cache database;
and searching historical load balancing logic information with the maximum frequency through the historical path information, and acquiring historical load balancing parameters matched with the historical load balancing logic information from a target cache database to execute the release of the application task.
In the embodiment of the application, before the historical path information in the load balancing configuration file is cleared, the historical path information and the number of times of accessing the historical path information are correspondingly stored in the non-cache database for historical path information backup, so that when the execution main body cannot inquire corresponding load balancing logic information from the load balancing configuration directory based on the currently acquired path information which is associated with the load balancing configuration directory, the backup historical path information can be further acquired, the load balancing configuration directory corresponding to the historical path information can be acquired based on the historical path information, and the load balancing logic information can be inquired based on the load balancing configuration directory, so that the load balancing processing of application task release is realized.
It should be noted that, when the load balancing configuration file issued by the application task is updated, the updated part is usually the load balancing parameter, and the load balancing logic information remains unchanged, so that the load balancing configuration directory can be obtained based on the historical path information when the current path information is invalid, and the load balancing logic information is further queried from the load balancing configuration directory. When the application task issues the corresponding historical path information, screening can be performed according to the access times capable of identifying the reliability of the historical path information, namely, the historical path information with more access times has stronger corresponding reliability, and the load balancing logic information is acquired based on the historical path information with the most search times when the backup data is acquired, so that the fault tolerance of the load balancing processing issued by the application task is improved, and the accuracy of the load balancing processing is improved.
In another embodiment of the present invention, for further definition and explanation, the step of obtaining the load balancing parameter matching the load balancing logic information from the target cache database comprises:
and if the load balancing parameters matched with the load balancing logic information are not stored in the target cache database, acquiring the historical load balancing parameters so as to execute the release of the application task by combining the load balancing logic information and the historical load balancing parameters.
After the execution main body acquires the load balancing logic information based on the path information in the current load balancing file, it is necessary to further acquire load balancing parameters matched with the load balancing logic information. Since the load logic information and the load balancing parameters matched therewith are obtained by splitting the same load balancing configuration information to be updated, the query can be performed based on the preset configuration file information identifier when the load balancing parameters are queried, but the query is not limited thereto. Similarly, when the execution main body does not inquire the updated load balancing parameters in the target cache data, the backup historical load balancing parameters can be acquired, so that the issuing of the application task can be executed according to the historical load balancing parameters and the current load balancing logic information, and the fault tolerance of the load balancing processing of the issuing of the application task can be improved.
In another embodiment of the present invention, for further limitation and explanation, as shown in fig. 3, the step 103 of performing the publishing of the application task by combining the load balancing logic information and the load balancing parameters includes:
301. and sending an application task issuing execution instruction to a target load balancing server to instruct the target load balancing server to create a coroutine matched with the application task according to the load balancing logic information and the load balancing parameters.
302. When a response of creating the coroutine is received, the load balancing logic information and the load balancing parameters are sent to the target load balancing server side, and application tasks are issued in the corresponding coroutines according to the load balancing logic information and the load balancing parameters.
In the embodiment of the application, when the issuing application task load balancing processing system receives an application task issuing request, the execution main body can send an application task issuing execution instruction to the target load balancing server in the triggering issuing application system after completing the application task issuing load balancing processing according to the steps so as to trigger the issuing application task issuing operation. Specifically, the target load balancing server creates corresponding Worker coroutines according to load balancing logic information and load balancing parameters, which are acquired by the execution main body and correspond to the current application task release, wherein each Worker coroutine corresponds to a virtual server, and data among the Worker coroutines are isolated, so that the accuracy and the safety of data in the load balancing processing process of the application task release are ensured.
When the execution main body receives the response information of the Worker co-project creation completion of the target load balancing server, the obtained load balancing logic information and load balancing parameters corresponding to the current application task issuance are sent to the target load balancing server, so that the issuance operation of the application task is executed in the corresponding Worker co-project.
Compared with the prior art, the load balancing processing method for issuing the application task obtains a load balancing configuration file when an application task issuing request is received, wherein the load balancing configuration file stores path information related to a load balancing configuration directory, and the load balancing configuration directory is obtained by compiling a lightweight scripting language; searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information; the load balancing parameters matched with the load balancing logic information are obtained from the target cache database, and the application task is issued by combining the load balancing logic information and the load balancing parameters, so that the load balancing logic information is obtained based on the path information in the configuration file when the application task issuing operation is executed, the load balancing parameters matched with the load balancing logic information are obtained from the target cache database according to the load balancing logic information, the application task is issued, the load balancing configuration in the load balancing virtual service pool is not required to be frequently loaded, the problem of resource waste is avoided, the issued application tasks can be processed in real time and in parallel, and the load balancing processing performance of the issued application tasks is improved.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides an apparatus, as shown in fig. 4, the apparatus includes:
an obtaining unit 41, configured to obtain a load balancing configuration file when an application task issuing request is received, where the load balancing configuration file stores path information associated with a load balancing configuration directory, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
a searching unit 42, configured to search, through the path information, load balancing logic information in the load balancing configuration directory, where the load balancing logic information is matched with the request parameter carried in the application task issuing request;
an executing unit 43, configured to obtain a load balancing parameter matching the load balancing logic information from a target cache database, and execute the issuing of the application task by combining the load balancing logic information and the load balancing parameter.
Further, the apparatus further comprises:
the splitting module is used for acquiring load balancing configuration information to be updated and splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated;
the sending module is used for storing the load balancing parameters to be updated and sending a directory compiling instruction carrying the load balancing logic information to be updated to a load balancing server so that the load balancing server compiles and constructs a load balancing configuration directory according to the load balancing logic information;
and the updating module is used for acquiring the path information corresponding to the load balancing configuration directory compiled and constructed by the load balancing server, and updating and configuring the path information in the load balancing configuration files corresponding to different application task issuing requests.
Further, the splitting module is specifically configured to send a load balancing configuration instruction to an application task system to instruct the application task system to receive load balancing configuration information entered by a user; acquiring load balancing configuration information fed back by the application task system; and splitting the load balancing configuration information according to the character string type and the data format to obtain the load balancing logic information to be updated and the load balancing parameters to be updated.
Further, the apparatus further comprises:
the recording module is used for storing the historical path information of the load balancing configuration file into a non-cache database and recording historical load balancing logic information corresponding to different searching times in the non-cache database;
and the emptying module is used for emptying the load balancing configuration file.
Further, the obtaining module is further configured to obtain historical path information in the non-cache database if the load balancing logic information matching the request parameter in the load balancing configuration directory is not found through the path information; and searching historical load balancing logic information with the maximum times through the historical path information, and acquiring historical load balancing parameters matched with the historical load balancing logic information from a target cache database so as to execute the release of the application task.
Further, the obtaining module is specifically configured to obtain the historical load balancing parameter if the load balancing parameter matching the load balancing logic information is not stored in the target cache database, so as to execute the issuing of the application task by combining the load balancing logic information and the historical load balancing parameter.
Further, the sending module is further configured to send an application task issuing execution instruction to a target load balancing server to instruct the target load balancing server to create a coroutine matched with the application task according to the load balancing logic information and the load balancing parameters; when a response of creating the coroutine is received, the load balancing logic information and the load balancing parameters are sent to the target load balancing server side, and application tasks are issued in the corresponding coroutines according to the load balancing logic information and the load balancing parameters.
Compared with the prior art, the load balancing processing method and device for issuing the application tasks acquire the load balancing configuration file when an application task issuing request is received, wherein the load balancing configuration file stores path information related to a load balancing configuration directory, and the load balancing configuration directory is obtained by compiling a lightweight scripting language; searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information; the load balancing parameters matched with the load balancing logic information are obtained from the target cache database, and the application task is issued by combining the load balancing logic information and the load balancing parameters, so that the load balancing logic information is obtained based on the path information in the configuration file when the application task issuing operation is executed, the load balancing parameters matched with the load balancing logic information are obtained from the target cache database according to the load balancing logic information, the application task is issued, the load balancing configuration in the load balancing virtual service pool is not required to be frequently loaded, the problem of resource waste is avoided, the issued application tasks can be processed in real time and in parallel, and the load balancing processing performance of the issued application tasks is improved.
According to an embodiment of the present invention, a storage medium is provided, where at least one executable instruction is stored in the storage medium, and the computer executable instruction may execute the load balancing processing method for issuing the application task in any method embodiment described above.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where the embodiment of the present invention does not limit the specific implementation of the computer device.
As shown in fig. 5, the computer apparatus may include: a processor (processor) 502, a Communications Interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above load balancing processing method embodiment for issuing the application task.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The computer device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically configured to cause the processor 502 to perform the following operations:
when an application task issuing request is received, acquiring a load balancing configuration file, wherein path information related to a load balancing configuration directory is stored in the load balancing configuration file, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information;
and acquiring the load balancing parameters matched with the load balancing logic information from a target cache database, and issuing the application task by combining the load balancing logic information and the load balancing parameters.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made without departing from the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A load balancing processing method for issuing application tasks is characterized by comprising the following steps:
when an application task issuing request is received, acquiring a load balancing configuration file, wherein path information related to a load balancing configuration directory is stored in the load balancing configuration file, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information;
and acquiring load balancing parameters matched with the load balancing logic information from a target cache database, and issuing the application task by combining the load balancing logic information and the load balancing parameters.
2. The method of claim 1, wherein prior to obtaining the load balancing profile, the method further comprises:
acquiring load balancing configuration information to be updated, splitting the load balancing configuration information to obtain load balancing logic information to be updated and load balancing parameters to be updated;
storing the load balancing parameters to be updated, and sending a directory compiling instruction carrying the load balancing logic information to be updated to a load balancing server, so that the load balancing server compiles and constructs a load balancing configuration directory according to the load balancing logic information;
and acquiring path information corresponding to the load balancing configuration directory compiled and constructed by the load balancing server, and updating and configuring the path information in load balancing configuration files corresponding to different application task issuing requests.
3. The method of claim 2, wherein the obtaining the load balancing configuration information to be updated and splitting the load balancing configuration information to obtain the load balancing logic information to be updated and the load balancing parameters to be updated comprises:
sending a load balancing configuration instruction to an application task system to indicate the application task system to receive load balancing configuration information input by a user;
acquiring load balancing configuration information fed back by the application task system;
and splitting the load balancing configuration information according to the character string type and the data format to obtain load balancing logic information to be updated and load balancing parameters to be updated.
4. The method according to claim 2, wherein before the updating and configuring the path information in the load balancing configuration file corresponding to the different application task issuing requests, the method further comprises:
storing historical path information of the load balancing configuration file into a non-cache database, and recording historical load balancing logic information corresponding to different searching times in the non-cache database;
and emptying the load balancing configuration file.
5. The method according to claim 4, wherein after the load balancing logic information matching the request parameter carried in the application task issuing request in the load balancing configuration directory is searched for through the path information, the method further comprises:
if the load balancing logic information matched with the request parameters in the load balancing configuration directory is not found through the path information, acquiring historical path information in the non-cache database;
and searching historical load balancing logic information with the maximum times through the historical path information, and acquiring historical load balancing parameters matched with the historical load balancing logic information from a target cache database so as to execute the release of the application task.
6. The method of claim 5, wherein the obtaining load balancing parameters from the target cache database that match the load balancing logic information comprises:
and if the load balancing parameters matched with the load balancing logic information are not stored in the target cache database, acquiring the historical load balancing parameters so as to execute the release of the application task by combining the load balancing logic information and the historical load balancing parameters.
7. The method according to any of claims 1-6, wherein the performing the publishing of the application task in conjunction with the load balancing logic information and the load balancing parameters comprises:
sending an application task issuing execution instruction to a target load balancing server to instruct the target load balancing server to create a coroutine matched with the application task according to the load balancing logic information and the load balancing parameters;
when a response of creating the coroutine is received, the load balancing logic information and the load balancing parameters are sent to the target load balancing server side, and application tasks are issued in the corresponding coroutines according to the load balancing logic information and the load balancing parameters.
8. A load balancing processing apparatus for distributing an application task, comprising:
the system comprises an acquisition module, a load balancing configuration module and a load balancing configuration module, wherein the acquisition module is used for acquiring a load balancing configuration file when an application task issuing request is received, the load balancing configuration file stores path information related to a load balancing configuration directory, and the load balancing configuration directory is obtained by compiling a lightweight scripting language;
the searching module is used for searching load balancing logic information matched with the request parameters carried in the application task issuing request in the load balancing configuration directory through the path information;
and the execution module is used for acquiring the load balancing parameters matched with the load balancing logic information from a target cache database and executing the release of the application task by combining the load balancing logic information and the load balancing parameters.
9. A storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the load balancing processing method of a fabric application task according to any one of claims 1 to 7.
10. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the load balancing processing method of the cloth application task in any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210951474.9A CN115277573A (en) | 2022-08-09 | 2022-08-09 | Load balancing processing method and device for issuing application tasks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210951474.9A CN115277573A (en) | 2022-08-09 | 2022-08-09 | Load balancing processing method and device for issuing application tasks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115277573A true CN115277573A (en) | 2022-11-01 |
Family
ID=83751496
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210951474.9A Pending CN115277573A (en) | 2022-08-09 | 2022-08-09 | Load balancing processing method and device for issuing application tasks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115277573A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080028456A1 (en) * | 2000-12-29 | 2008-01-31 | Cisco Technology, Inc. | Method for Protecting a Firewall Load Balancer From a Denial of Service Attack |
US20100325252A1 (en) * | 2009-06-18 | 2010-12-23 | Software Ag | Broker system for a plurality of brokers, clients and servers in a heterogeneous network |
CN105871588A (en) * | 2015-12-11 | 2016-08-17 | 乐视云计算有限公司 | Load balance configuration method, device and system |
CN108965381A (en) * | 2018-05-31 | 2018-12-07 | 康键信息技术(深圳)有限公司 | Implementation of load balancing, device, computer equipment and medium based on Nginx |
US20190102746A1 (en) * | 2017-10-02 | 2019-04-04 | Servicenow, Inc. | Systems and method for dynamic scheduling of service appointments |
CN110262872A (en) * | 2019-05-17 | 2019-09-20 | 平安科技(深圳)有限公司 | Load balancing application management method, device, computer equipment and storage medium |
CN111064626A (en) * | 2020-01-02 | 2020-04-24 | 广州虎牙科技有限公司 | Configuration updating method, device, server and readable storage medium |
CN112104679A (en) * | 2019-06-17 | 2020-12-18 | 北京京东尚科信息技术有限公司 | Method, apparatus, device and medium for processing hypertext transfer protocol request |
CN112261153A (en) * | 2020-03-04 | 2021-01-22 | 腾讯科技(深圳)有限公司 | Network resource management method and related device |
CN113485999A (en) * | 2021-08-04 | 2021-10-08 | 中国工商银行股份有限公司 | Data cleaning method and device and server |
CN113741868A (en) * | 2020-05-29 | 2021-12-03 | 腾讯科技(深圳)有限公司 | Business calculation task processing method and device, computer equipment and storage medium |
-
2022
- 2022-08-09 CN CN202210951474.9A patent/CN115277573A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080028456A1 (en) * | 2000-12-29 | 2008-01-31 | Cisco Technology, Inc. | Method for Protecting a Firewall Load Balancer From a Denial of Service Attack |
US20100325252A1 (en) * | 2009-06-18 | 2010-12-23 | Software Ag | Broker system for a plurality of brokers, clients and servers in a heterogeneous network |
CN105871588A (en) * | 2015-12-11 | 2016-08-17 | 乐视云计算有限公司 | Load balance configuration method, device and system |
US20190102746A1 (en) * | 2017-10-02 | 2019-04-04 | Servicenow, Inc. | Systems and method for dynamic scheduling of service appointments |
CN108965381A (en) * | 2018-05-31 | 2018-12-07 | 康键信息技术(深圳)有限公司 | Implementation of load balancing, device, computer equipment and medium based on Nginx |
CN110262872A (en) * | 2019-05-17 | 2019-09-20 | 平安科技(深圳)有限公司 | Load balancing application management method, device, computer equipment and storage medium |
CN112104679A (en) * | 2019-06-17 | 2020-12-18 | 北京京东尚科信息技术有限公司 | Method, apparatus, device and medium for processing hypertext transfer protocol request |
CN111064626A (en) * | 2020-01-02 | 2020-04-24 | 广州虎牙科技有限公司 | Configuration updating method, device, server and readable storage medium |
CN112261153A (en) * | 2020-03-04 | 2021-01-22 | 腾讯科技(深圳)有限公司 | Network resource management method and related device |
CN113741868A (en) * | 2020-05-29 | 2021-12-03 | 腾讯科技(深圳)有限公司 | Business calculation task processing method and device, computer equipment and storage medium |
CN113485999A (en) * | 2021-08-04 | 2021-10-08 | 中国工商银行股份有限公司 | Data cleaning method and device and server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103391312B (en) | Resource offline method for down loading and device | |
US20050228855A1 (en) | Acquisition system for distributed computing resources | |
US8825750B2 (en) | Application server management system, application server management method, management apparatus, application server and computer program | |
US10908834B2 (en) | Load balancing for scalable storage system | |
WO2015021178A1 (en) | System and method for processing web service transactions using timestamp data | |
CN114615135B (en) | Front-end gray level publishing method, system and storage medium | |
JP2003058376A (en) | Distribution system, distribution server and its distribution method, and distribution program | |
CN108595505A (en) | The method and apparatus of data query | |
CN110231956A (en) | The method, system and device of application version building | |
CN113014611A (en) | Load balancing method and related equipment | |
CN114422331B (en) | Disaster recovery switching method, device and system | |
CN104618388A (en) | Quick registration and login method and corresponding reset server and information server | |
CN107172149A (en) | Big data instant scheduling method | |
CN111008064B (en) | Virtual machine resource scheduling method and device, and cluster deployment method and device | |
JP6008964B2 (en) | Information processing system, method and program | |
CN115277573A (en) | Load balancing processing method and device for issuing application tasks | |
KR20210097560A (en) | Block chain transaction processing method | |
CN111049945A (en) | Network request optimization method, device, equipment and medium based on HTTP (hyper text transport protocol) | |
US10171570B2 (en) | Information processing apparatus | |
EP3829139A1 (en) | Distributed storage system for storing context data | |
CN114584545A (en) | Data management method, device, system, storage medium and electronic equipment | |
JP2008065611A (en) | Software update method and software update program | |
CN115623081A (en) | Data downloading method, data uploading method and distributed storage system | |
JP4532946B2 (en) | Application replacement method and program | |
CN112988126A (en) | CDN service customization method and system |
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 |