CN115695435A - Method and device for dynamically adjusting node flow, electronic equipment and storage medium - Google Patents

Method and device for dynamically adjusting node flow, electronic equipment and storage medium Download PDF

Info

Publication number
CN115695435A
CN115695435A CN202211316567.0A CN202211316567A CN115695435A CN 115695435 A CN115695435 A CN 115695435A CN 202211316567 A CN202211316567 A CN 202211316567A CN 115695435 A CN115695435 A CN 115695435A
Authority
CN
China
Prior art keywords
available
node
load factor
weight value
available node
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
CN202211316567.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.)
Jilin Yillion Bank Co ltd
Original Assignee
Jilin Yillion Bank Co 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 Jilin Yillion Bank Co ltd filed Critical Jilin Yillion Bank Co ltd
Priority to CN202211316567.0A priority Critical patent/CN115695435A/en
Publication of CN115695435A publication Critical patent/CN115695435A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method, a device, electronic equipment and a storage medium for dynamically adjusting node flow, wherein in the method for dynamically adjusting the node flow, load factor data of each available node is obtained according to a preset time period. Then, for each available node, based on the load factor data, a weight value of each load factor of the available node is calculated. Then, for each available node, calculating a weight value of the available node based on the weight value of each load factor. And finally, if a service scheduling request is received, performing flow distribution on each available node based on the weight value of each available node. Therefore, by using the method of the application, the load factor data of the server nodes can be periodically acquired, and the weight value which each current server node should have can be dynamically calculated, so that the node flow can be dynamically adjusted.

Description

Method and device for dynamically adjusting node flow, electronic equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a method and an apparatus for dynamically adjusting node traffic, an electronic device, and a storage medium.
Background
After the payment transaction is sent to the channel, if the payment transaction is in a processing state, the query request needs to be sent to the service node for multiple times until a transaction end state is obtained.
In the prior art, a random round-training mode is usually adopted for traffic distribution, that is, a service node is randomly selected to send a query request. However, the same service may be deployed in different hardware environments, and different performance may occur. If the simple polling scheduling algorithm is directly used to give the same load to each service node, the situation of resource waste inevitably occurs.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, an electronic device, and a storage medium for dynamically adjusting node traffic, so as to solve the problem in the prior art that a simple polling scheduling algorithm is directly used to provide the same load to each service node, which results in resource waste.
In order to achieve the above purpose, the present application provides the following technical solutions:
the first aspect of the present application discloses a method for dynamically adjusting node traffic, including:
acquiring load factor data of each available node according to a preset time period, wherein the available nodes are nodes with index integral sum meeting a preset threshold;
calculating a weight value of each load factor of each available node according to the load factor data for each available node;
calculating the weight value of each available node based on the weight value of each load factor;
and if a service scheduling request is received, performing flow distribution on each available node based on the weight value of each available node.
Optionally, in the method, after the load factor data of each available node is obtained, the method further includes:
and storing the load factor data into a memory cache.
Optionally, in the foregoing method, after the calculating the weight value of the available node, the method further includes:
and carrying out abnormity detection on the weight value of the available node.
Optionally, the method further includes:
and if the weight values of all the available nodes are the same or abnormal, performing flow distribution on all the available nodes in a polling mode.
The second aspect of the present application discloses a device for dynamically adjusting node traffic, including:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring load factor data of each available node according to a preset time period, and the available nodes are nodes with index integral sum meeting a preset threshold;
a first calculating unit, configured to calculate, for each available node, a weight value of each load factor of the available node based on the load factor data;
a second calculating unit, configured to calculate, for each available node, a weight value of the available node based on the weight value of each load factor;
and the first allocation unit is used for performing flow allocation on each available node based on the weight value of each available node if a service scheduling request is received.
Optionally, the above apparatus further includes:
and the storage unit is used for storing the load factor data into a memory cache.
Optionally, the above apparatus further includes:
and the detection unit is used for carrying out abnormity detection on the weight values of the available nodes.
Optionally, the above apparatus further comprises:
and the second allocating unit is used for allocating the traffic to each available node in a polling manner if the weight values of all the available nodes are the same or the weight values of all the available nodes are abnormal.
A third aspect of the present application discloses an electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects of the present application.
A fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any of the first aspects of the present application.
According to the technical scheme, the method for dynamically adjusting the node flow includes the steps that load factor data of each available node is obtained according to a preset time period, wherein the available nodes are nodes with index integral sum meeting a preset threshold value. Then, for each available node, based on the load factor data, a weight value of each load factor of the available node is calculated. Then, for each available node, calculating a weight value of the available node based on the weight value of each load factor. And finally, if a service scheduling request is received, performing flow distribution on each available node based on the weight value of each available node. Therefore, by using the method of the application, the load factor data of the server nodes can be periodically acquired, and the weight value which each current server node should have can be dynamically calculated, so that the node flow can be dynamically adjusted. The problem of in the prior art directly use simple polling scheduling algorithm, give every service node the same load, lead to appearing the wasting of resources is solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for dynamically adjusting node traffic according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a banking system acquiring node traffic according to another embodiment of the present application;
FIG. 3 is a code diagram of a calculation of available node weights as disclosed in another embodiment of the present application;
fig. 4 is a schematic diagram of an apparatus for dynamically adjusting node traffic according to another embodiment of the present disclosure;
fig. 5 is a schematic diagram of an electronic device according to another embodiment of the disclosure.
Detailed Description
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 only a part of the embodiments of the present application, and not all of the 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.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
Moreover, in this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
As can be seen from the background art, in the prior art, a random round-robin method is usually used for traffic distribution, and then the same service is deployed in different hardware environments, resulting in different performance. If the simple polling scheduling algorithm is directly used and each service node is given the same load, the situation of resource waste inevitably occurs.
In view of this, the present application provides a method, an apparatus, an electronic device, and a storage medium for dynamically adjusting node traffic, so as to solve the problem in the prior art that a simple polling scheduling algorithm is directly used, and the same load is applied to each service node, which results in resource waste.
An embodiment of the present application provides a method for dynamically adjusting a node flow, which is specifically shown in fig. 1 and specifically includes:
s101, acquiring load factor data of each available node according to a preset time period, wherein the available nodes are nodes with index integral sum meeting a preset threshold value.
It should be noted that, with reference to fig. 2, the registration server obtains load factor data of each available node according to a preset time period, where the time period may be set according to an actual situation, for example, 5 minutes; setting load factors according to actual conditions, such as average interface consumption time of 5 minutes, interface timeout rate of 5 minutes, interface exception rate of 5 minutes, CPU load, memory utilization rate, network card load and the like; the available nodes are servers with index integral summation meeting a preset threshold value. Specifically, the registration server obtains information such as timeout rate and average consumed time from the monitoring center according to a preset time period, and obtains machine load information such as cpu load/memory usage from other platforms (such as CMDB). And the remote data capture node acquires the state information of each node and uploads the state information to the state server, and the state server uploads the state information to the monitoring center.
Optionally, in another embodiment of the present application, after the step S101 is executed, the method may further include:
and storing the load factor data into a memory cache.
It should be noted that after the load factor data of each available node is acquired according to a preset time period, the load factor data is stored in the memory cache, so that the data can be checked at any time.
And S102, calculating the weight value of each load factor of each available node according to the load factor data for each available node.
It should be noted that, after the load factor data of each available node is obtained according to a preset time period, for each available node, the weight value of each load factor of the available node is calculated according to a preset weight calculation formula based on the load factor data of the current available node. For example, the formula for calculating the time-consuming weight of an available node is as follows:
time-consuming weight = initial weight (sum of consumed time-average consumed time of single machine)/sum of consumed time
Wherein the initial weight defaults to 10.
The formula for calculating the timeout rate weight of the available nodes is as follows:
timeout rate weight = initial weight-timeout rate initial weight 90%
The initial weight is default to 10, and the 90% is reduced because the 100% overtime may be caused by too large traffic, and the small traffic probe request is reserved.
And S103, calculating the weight value of each available node based on the weight value of each load factor.
It should be noted that, after the weight value of each load factor of the available node is calculated for each available node based on the load factor data, the weight value of the available node is calculated for each available node based on the weight value of each load factor of the current available node according to a preset node weight value calculation formula, and a code of the calculation is as shown in fig. 3. The node weight value calculation formula is as follows:
node weight = first load factor weight + second load factor weight + N load factor weight.
Specifically, assuming that the time consumption weight is 10, the timeout rate weight is 20, and the corresponding importance degrees are 40% and 60%, respectively, the node weight value may be 10 × 0.4+20 × 0.6=16 at present.
Optionally, in another embodiment of the present application, after the step S103 is executed, the method may further include:
and carrying out abnormity detection on the weight values of the available nodes.
It should be noted that, after the weight value of each available node is calculated based on the weight value of each load factor, for the purpose of data accuracy, abnormality detection is performed on the weight value of each available node, for example, whether the weight value of the available node is greater than a preset threshold is detected, and if the weight value of the available node is greater than the preset threshold, the node is abnormal, and the threshold may be set according to an actual situation, for example, 1.
And S104, if the service scheduling request is received, carrying out flow distribution on each available node based on the weight value of each available node.
It should be noted that, if a service scheduling request is received, traffic is allocated to each available node based on the weight value of each available node, so as to dynamically adjust the traffic of each available node.
Optionally, in another embodiment of the present application, the method for dynamically adjusting node traffic may further include:
and if the weight values of all the available nodes are the same or abnormal, performing flow distribution on all the available nodes in a polling mode.
It should be noted that, if the weight values of the available nodes are the same or the weight values of the available nodes are abnormal, the traffic is distributed to the available nodes in a polling manner.
In the method for dynamically adjusting node traffic provided in the embodiment of the present application, load factor data of each available node is first obtained according to a preset time period, where the available node is a node whose index integral sum meets a preset threshold. Then, for each available node, based on the load factor data, a weight value of each load factor of the available node is calculated. Then, for each available node, calculating a weight value of the available node based on the weight value of each load factor. And finally, if a service scheduling request is received, performing flow distribution on each available node based on the weight value of each available node. Therefore, by using the method of the application, the load factor data of the server nodes can be periodically acquired, and the weight value which each current server node should have can be dynamically calculated, so that the node flow can be dynamically adjusted. The problem of in the prior art directly use simple polling scheduling algorithm, give every service node the same load, lead to appearing the wasting of resources is solved.
Another embodiment of the present application further discloses a device for dynamically adjusting node traffic, as shown in fig. 4, specifically including:
the obtaining unit 401 is configured to obtain load factor data of each available node according to a preset time period, where the available node is a node whose index integral sum satisfies a preset threshold.
A first calculating unit 402, configured to calculate, for each available node, a weight value of each load factor of the available node based on the load factor data.
A second calculating unit 403, configured to calculate, for each available node, a weight value of the available node based on the weight value of each load factor.
A first allocating unit 404, configured to, if a service scheduling request is received, allocate traffic to each available node based on a weight value of each available node.
In this embodiment, for specific implementation processes of the obtaining unit 401, the first calculating unit 402, the second calculating unit 403, and the first allocating unit 404, reference may be made to the content of the method embodiment corresponding to fig. 1, and details are not described here.
In the device for dynamically adjusting node traffic provided in the embodiment of the present application, first, the obtaining unit 401 obtains load factor data of each available node according to a preset time period, where the available node is a node whose index integral sum satisfies a preset threshold. Then, the first calculating unit 402 calculates, for each of the available nodes, a weight value of each load factor of the available node based on the load factor data. Then, the second calculating unit 403 calculates, for each of the available nodes, a weight value of the available node based on the weight value of the respective load factor. Finally, if receiving a service scheduling request, the first allocating unit 404 allocates traffic to each of the available nodes based on the weight value of each of the available nodes. Therefore, by using the method of the application, the load factor data of the server nodes can be periodically acquired, and the weight value which each current server node should have can be dynamically calculated, so that the node flow can be dynamically adjusted. The problem of in the prior art directly use simple polling scheduling algorithm, give every service node the same load, lead to appearing the condition of wasting of resources is solved.
Optionally, in another embodiment of the present application, the apparatus for dynamically adjusting node traffic may further include:
and the storage unit is used for storing the load factor data into the memory cache.
In this embodiment, for the specific execution process of the storage unit, reference may be made to the contents of the above method embodiments, and details are not described here.
Optionally, in another embodiment of the present application, the apparatus for dynamically adjusting node traffic may further include:
and the detection unit is used for carrying out abnormity detection on the weight values of the available nodes.
In this embodiment, for the specific implementation process of the detection unit, reference may be made to the contents of the above method embodiments, and details are not described here.
Optionally, in another embodiment of the present application, the apparatus for dynamically adjusting node traffic may further include:
and the second distribution unit is used for distributing the flow to each available node in a polling mode if the weight values of all the available nodes are the same or abnormal.
In this embodiment, for a specific execution process of the second allocating unit, reference may be made to the contents of the above method embodiments, and details are not described herein again.
Another embodiment of the present application further provides an electronic device, as shown in fig. 5, specifically including:
one or more processors 501.
A storage device 502 on which one or more programs are stored.
The one or more programs, when executed by the one or more processors 501, cause the one or more processors 501 to implement the method of any of the embodiments described above.
Another embodiment of the present application further provides a computer storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method in any one of the above embodiments.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments, which are substantially similar to the method embodiments, are described in a relatively simple manner, and reference may be made to some descriptions of the method embodiments for relevant points. The above-described system and system embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for dynamically adjusting node traffic, comprising:
acquiring load factor data of each available node according to a preset time period, wherein the available nodes are nodes with index integral sum meeting a preset threshold;
calculating a weight value of each load factor of each available node according to the load factor data for each available node;
for each available node, calculating a weight value of the available node based on the weight value of each load factor;
and if a service scheduling request is received, carrying out flow distribution on each available node based on the weight value of each available node.
2. The method of claim 1, wherein after obtaining the load factor data of each available node, the method further comprises:
and storing the load factor data into a memory cache.
3. The method of claim 1, wherein after the calculating the weight values of the available nodes, further comprising:
and carrying out abnormity detection on the weight value of the available node.
4. The method of claim 1, further comprising:
and if the weight values of all the available nodes are the same or the weight values of all the available nodes are abnormal, performing flow distribution on all the available nodes in a polling mode.
5. An apparatus for dynamically adjusting node traffic, comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring load factor data of each available node according to a preset time period, and the available nodes are nodes with index integral sum meeting a preset threshold;
a first calculating unit, configured to calculate, for each available node, a weight value of each load factor of the available node based on the load factor data;
a second calculating unit, configured to calculate, for each available node, a weight value of the available node based on the weight value of each load factor;
and the first allocation unit is used for performing flow allocation on each available node based on the weight value of each available node if a service scheduling request is received.
6. The apparatus of claim 5, further comprising:
and the storage unit is used for storing the load factor data into a memory cache.
7. The apparatus of claim 5, further comprising:
and the detection unit is used for carrying out abnormity detection on the weight value of the available node.
8. The apparatus of claim 5, further comprising:
and the second allocating unit is used for allocating the flow to each available node in a polling mode if the weight values of all the available nodes are the same or the weight values of all the available nodes are abnormal.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-4.
10. A computer storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of any of claims 1 to 4.
CN202211316567.0A 2022-10-26 2022-10-26 Method and device for dynamically adjusting node flow, electronic equipment and storage medium Pending CN115695435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211316567.0A CN115695435A (en) 2022-10-26 2022-10-26 Method and device for dynamically adjusting node flow, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211316567.0A CN115695435A (en) 2022-10-26 2022-10-26 Method and device for dynamically adjusting node flow, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115695435A true CN115695435A (en) 2023-02-03

Family

ID=85099426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211316567.0A Pending CN115695435A (en) 2022-10-26 2022-10-26 Method and device for dynamically adjusting node flow, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115695435A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842784A (en) * 2023-02-20 2023-03-24 广东广宇科技发展有限公司 Multi-node adjusting method for ultra-large data volume transmission

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842784A (en) * 2023-02-20 2023-03-24 广东广宇科技发展有限公司 Multi-node adjusting method for ultra-large data volume transmission

Similar Documents

Publication Publication Date Title
CN109597685B (en) Task allocation method, device and server
US11546644B2 (en) Bandwidth control method and apparatus, and device
US7882230B2 (en) Method and system for dynamically allocating servers to compute-resources using capacity thresholds
US7523454B2 (en) Apparatus and method for routing a transaction to a partitioned server
CN112162865B (en) Scheduling method and device of server and server
EP2193472B1 (en) Method and apparatus for managing license capacity in a telecommunication network
CN106452818B (en) Resource scheduling method and system
CN108205541B (en) Method and device for scheduling distributed web crawler tasks
CN110519183B (en) Node speed limiting method and device, electronic equipment and storage medium
CN109815019B (en) Task scheduling method and device, electronic equipment and readable storage medium
CN107302580B (en) Load balancing method and device, load balancer and storage medium
CN107819797B (en) Access request processing method and device
CN104239150B (en) A kind of method and device of hardware resource adjustment
CN115695435A (en) Method and device for dynamically adjusting node flow, electronic equipment and storage medium
CN110336888B (en) Server distribution method, device, system and medium
CN114371931A (en) Service cluster resource allocation method and device and computer equipment
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN113885794A (en) Data access method and device based on multi-cloud storage, computer equipment and medium
CN113159463A (en) Traffic monitoring method and device
CN116382892B (en) Load balancing method and device based on multi-cloud fusion and cloud service
CN112463361A (en) Method and equipment for distributing elastic resources of distributed computation
CN108200185B (en) Method and device for realizing load balance
CN111813546B (en) Resource allocation method, system and related device for multi-network connection application
CN106131187B (en) Authorization control method and device
CN111092959B (en) Request processing method, system and related device for servers in cluster

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