CN111756833A - Node processing method and device, electronic equipment and computer readable medium - Google Patents

Node processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111756833A
CN111756833A CN202010575421.2A CN202010575421A CN111756833A CN 111756833 A CN111756833 A CN 111756833A CN 202010575421 A CN202010575421 A CN 202010575421A CN 111756833 A CN111756833 A CN 111756833A
Authority
CN
China
Prior art keywords
node
nodes
group
node group
processing
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.)
Granted
Application number
CN202010575421.2A
Other languages
Chinese (zh)
Other versions
CN111756833B (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010575421.2A priority Critical patent/CN111756833B/en
Publication of CN111756833A publication Critical patent/CN111756833A/en
Application granted granted Critical
Publication of CN111756833B publication Critical patent/CN111756833B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1031Controlling of the operation of servers by a load balancer, e.g. adding or removing servers that serve requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a node processing method and device, electronic equipment and a computer readable medium, and relates to the technical field of computers. The method comprises the following steps: receiving a node processing request; and correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced. According to the embodiment of the disclosure, when the node processing request is received, the nodes in the node groups are processed according to the node processing request and the node number of each node group, so that the balance of the node number of each node group is ensured, the node number of each node group can be accurately mastered, the nodes are processed according to the node number of each node group and the specific node processing request, the condition that the node number of each node group is unbalanced due to too many or too few nodes in a certain node group is effectively prevented, the working capacity of each node group in the whole system is ensured to be equivalent, and the overall performance is improved.

Description

Node processing method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a node processing method and apparatus, an electronic device, and a computer-readable medium.
Background
With the development of the information age, computer networks have become widespread, many existing fields cannot depart from computer networks, and computer networks generally comprise a plurality of computer devices or other external devices, wherein each device forms a node in the computer network and is used for resource sharing and information transmission of computer network information.
In the existing computer network, nodes are usually managed in groups, and the number of nodes in each node group is usually changed dynamically, for example, new devices need to be added or devices need to be deleted continuously, so that for different node groups, the number of nodes in the node group may be greatly different, which causes imbalance in the number of nodes in the node group, and causes the whole computer network system to encounter performance bottlenecks due to the limitation of the number of machines in some node groups.
Therefore, in the prior art, for the management of node groups, the situation of unbalanced number of nodes in a node group may occur, so that the whole computer network system may encounter performance bottleneck due to the limitation of the number of machines of some node groups.
Disclosure of Invention
The present disclosure is directed to at least one of the above technical drawbacks, and particularly, to a technical drawback that, in the prior art, for the management of node groups, the number of nodes in a node group may be unbalanced, so that the entire computer network system may encounter performance bottlenecks due to the limitation of the number of machines of some node groups.
In a first aspect, a node processing method is provided, where the method includes:
receiving a node processing request;
and carrying out corresponding processing on the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
In a second aspect, a node processing apparatus is provided, the apparatus comprising:
a node processing request receiving module, configured to receive a node processing request;
and the node processing module is used for correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: the above-described node processing method is performed.
In a fourth aspect, a computer readable medium is provided, which stores at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the above-mentioned node processing method.
According to the embodiment of the disclosure, when a node processing request is received, the nodes in the node groups are processed according to the node processing request and the node number of each node group, so that the balance of the node number of each node group is ensured, after the node number of each node group is obtained, the node number of each node group can be accurately mastered, the nodes are processed according to the node number of each node group and a specific node processing request, the condition that the node number of each node group is unbalanced due to too many or too few nodes in a certain node group is effectively prevented, the working capacity of each node group in the whole system is ensured to be equivalent, and the overall performance is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments of the present disclosure will be briefly described below.
Fig. 1 is a schematic flowchart of a node processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a node adding method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for determining whether a node needs to be processed according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a node processing apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Detailed Description
Reference will now be made in detail to embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein the embodiments of the disclosure are described in greater detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing the devices, modules or units, and are not used for limiting the devices, modules or units to be different devices, modules or units, and also for limiting the sequence or interdependence relationship of the functions executed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
The embodiment of the present disclosure provides a node processing method, which is executed by a scheduler, where the scheduler can be used to manage communication of each node group device, as shown in fig. 1, where the method includes:
step S101, receiving a node processing request;
and step S102, carrying out corresponding processing on the nodes of at least one node group according to the node processing request and the node number of each node group, so that the node number in each node group is kept balanced.
The node processing method provided by the embodiment of the disclosure is applied to a computer network system, wherein a plurality of computer devices or other networking-enabled devices exist in the computer network system, each computer device or networking device is a node in the system, and in order to facilitate management of the system, a certain number of nodes form a node group, and the nodes in the node group are uniformly managed, so that uniform management of the computer devices or the networking devices is facilitated.
In step S101, a node processing request is received.
In the embodiment of the present disclosure, the node processing request refers to a request for processing a node in a computer network system, such as a node adding request, a node deleting request, and the like, where the node adding request is to add a node in the computer network system, and accordingly, a computer device or other networking devices need to be added, and the node deleting request is to delete an originally existing node in the computer network system, that is, delete an original computer device or networking device.
For the embodiment of the present disclosure, the node processing request may include one or more of a type of the node request, a type of the processing request, node group information that needs to be processed, and node information of a target node that needs to be processed (for example, for a node deletion request, the target node is a node that needs to be deleted), where the type of the node request includes a node deletion request and/or a node addition request.
In step S102, according to the node processing request and the number of nodes in each node group, corresponding processing is performed on the nodes in at least one node group, so that the number of nodes in each node group is balanced.
In the disclosed embodiments, there are typically multiple node groups in a computer network system, and the number of nodes in each node group is actually the number of computer devices or other networking devices in each node group.
For the embodiment of the present disclosure, after receiving a node processing request, the node is processed according to the node request type in the node processing request, the node group information that needs to be processed, and the number of nodes in each node group, so as to ensure that the number of nodes in each node group after processing is balanced. For convenience of description, taking the example of adding nodes in one node group as an example, when a node processing request is received as a node adding request, the node numbers in all the node groups are obtained, and then the nodes needing to be added are added to the node group with the minimum node number, so as to keep the node number of each node group balanced. For the case of deleting a node, the number of nodes in each node group may need to be adjusted according to the number of nodes in each node group after the node is deleted, so as to ensure that the number of nodes in each node group is kept balanced.
According to the embodiment of the disclosure, when a node processing request is received, the nodes in the node groups are processed according to the node processing request and the node number of each node group, so that the balance of the node number of each node group is ensured, after the node number of each node group is obtained, the node number of each node group can be accurately mastered, the nodes are processed according to the node number of each node group and a specific node processing request, the condition that the node number of each node group is unbalanced due to too many or too few nodes in a certain node group is effectively prevented, the working capacity of each node group in the whole system is ensured to be equivalent, and the overall performance is improved.
As shown in fig. 2, if the node processing request includes a node increase request, performing corresponding processing on nodes of at least one node group according to the node processing request and the number of nodes of each node group includes:
step S201, acquiring the number of nodes of each node group;
step S202, determining a first target node group with the least number of nodes in each node group according to the number of nodes in each node group;
step S203, adding the node to be added to the first target node group according to the node addition request.
In the embodiment of the present disclosure, the processing of the node is different when the node processing request is a node addition request or a node deletion request. It should be noted that, in the embodiment of the present disclosure, the node processing request may only include one type of request, such as a node deletion request or a node addition request, or may include multiple types of requests, such as a node processing request including a node deletion request and a node addition request, at this time, each type of request may be respectively processed, and a specific processing sequence is not limited in the present disclosure.
In step S201, the number of nodes of each node group is acquired.
In the embodiment of the present disclosure, when the node processing request includes the node addition request, the number of nodes of each node group in each computer network system is acquired. The triggering condition of the node adding request may be that a computer device or other networking devices are added to the computer network system, that is, a node is added to the computer network system and needs to be grouped. For convenience of illustration, taking a specific embodiment as an example, a computer network system has 3 node groups A, B, C altogether, and the number of nodes in each node group is 8, 9, and 10, so when it is determined that the node processing request is an add node, the number of nodes in node group a is 8, the number of nodes in node group B is 9, and the number of nodes in node group C is 10 are respectively obtained.
In step S202, a first target node group with the smallest number of nodes in each node group is determined according to the number of nodes in each node group.
In the embodiment of the present disclosure, the first target node group refers to a node group with the smallest number of nodes in the computer network system. After the number of nodes of all node groups in the computer network system is obtained, the node group with the least number of nodes is determined to be a first target node group by comparing the number of nodes between every two node groups. For convenience of explanation, in the above embodiment as an example, after the node number of the node group a is acquired to be 8, the node number of the node group B is acquired to be 9, and the node number of the node group C is acquired to be 10, the node group a is determined to be the first target node group by comparing the node groups that can be determined to have the least number of nodes to be the node group a.
In step S203, the node to be added is added to the first target node group according to the node addition request.
In the embodiment of the present disclosure, after the node group with the minimum number of nodes is determined, the node to be added is added to the node group according to the node addition request.
When the newly added node is processed, the node group with the minimum node number is determined by acquiring the node numbers of all the node groups, and the node needing to be added is added to the node group with the minimum node number, so that the node number in the node group after the node is added is ensured to be balanced with the node numbers of other node groups as much as possible, and the condition that the system performance is influenced due to node imbalance is prevented.
As shown in fig. 3, if the node processing request includes a node deletion request, performing corresponding processing on nodes of at least one node group according to the node processing request and the number of nodes of each node group includes:
step S301, deleting the target nodes of the second target node group corresponding to the node deletion request according to the node deletion request;
step S302, determining the number of nodes of each node group subjected to deletion processing;
step S303, if the number of nodes in each node group meets a first preset condition, the nodes in the node group are not adjusted
Step S304, if the number of the nodes in each node group does not meet the first preset condition, adjusting the nodes in at least one node group.
In the embodiment of the present disclosure, when the node processing request is a node deletion request, the node is processed according to the steps shown in fig. 3.
In step S301, according to the node deletion request, the target node of the second target node group corresponding to the node deletion request is deleted.
In this embodiment of the present disclosure, the second target node group refers to a node group that needs to delete a node, and when the node processing request is a node deletion request, the corresponding node group that needs to be deleted is obtained according to the node deletion request. For convenience of description, taking a specific embodiment as an example, the node deletion request at least includes node information of a node to be deleted and node group information of a node group in which the node is located, and when the node deletion request is acquired, the node group in which the node is to be deleted is determined according to the node group information in the node deletion request. If there are three node groups D, E, F in a computer network system, when a node deletion request is obtained, the node deletion request is included in the node deletion requestIf the node group information is E and the node information is node E3, determining that the node group E is a second target node group, and setting the node E in the node group E as a second target node group3Deletion is performed.
In step S302, the number of nodes of each node group subjected to the deletion process is determined.
In the embodiment of the present disclosure, after deleting a node according to a node deletion request, the number of nodes of each node group subjected to deletion processing may be acquired. For convenience of explanation, the above embodiment is described as an example, and if the number of nodes in the node group D, E, F before node deletion is 10, 8, and 12, respectively, the node E in the node group E is deleted3After the deletion, the numbers of nodes in the node group D, E, F are determined to be 10, 7, and 12, respectively.
In step S303 and step S304, if the number of nodes in each node group satisfies a first preset condition, the nodes in the node group are not adjusted; and if the number of the nodes in each node group does not meet the first preset condition, adjusting the nodes in at least one node group.
In the embodiment of the present disclosure, a condition for ensuring that the number of nodes between each node group is balanced is preset in the first preset condition, and when the number of nodes of each node group after deleting a node does not satisfy the first preset condition, the nodes in each group need to be adjusted to ensure that the number of nodes between each node group is balanced.
For the embodiment of the disclosure, when the number of nodes in each node group after deleting the node meets the first preset condition, the nodes in the node group are not processed; when the number of nodes in each node group after deleting the node does not satisfy the first preset condition, processing the nodes in at least one group. For convenience of explanation, the description is continued by taking the previous embodiment as an example, and the node E in the node group E is3After the deletion, the node numbers in the node group D, E, F are respectively determined to be 10, 7, and 12, and if the first preset condition is that the difference between the node numbers of the two node groups is not greater than 3, it is obvious that the difference between the node numbers of the node E and the node F does not satisfy the first preset condition, and the nodes in the node group need to be processed, and the processing at this time may be performedSo as to transfer one node in the node group F to the node group E to ensure the balance of the node numbers among the node groups.
According to the embodiment of the disclosure, in the case of deleting the node, the number of nodes in each node group is obtained after the node is deleted, and whether the node in the node group needs to be deleted is judged according to whether the number of nodes in each node group meets the first preset condition, so that the balance of the number of nodes in each node group is ensured, and the workload of the computer network system is reduced.
The embodiment of the present disclosure provides a possible implementation manner, where the first preset condition includes:
the difference value between the maximum node number and the minimum node number in each node group is not more than a first set value; and/or
And the difference value between the node number in each node group and the node average value is not more than a second set value, wherein the node average value is the average value of the node numbers of the node groups.
The specific values of the first set value and the second set value are not limited in the embodiment of the present disclosure, and may be configured or adjusted according to actual needs.
For the embodiments of the present disclosure, for convenience of description, the above embodiment is continued to be exemplified, and the node E in the node group E is3After the deletion, it is determined that the number of nodes in the node group D, E, F is 10, 7, and 12, respectively, then the maximum value of the number of nodes in the computer network system is 12, and the minimum value is 7, then the difference between the maximum value and the minimum value is 5, when the first set value is less than 5, it indicates that the number of nodes in the node group does not satisfy the first preset condition, and when the first set value is greater than or equal to 5, it indicates that the number of nodes in the node group satisfies the first preset condition.
In another embodiment provided by the present disclosure, the first preset condition may be that a difference between the number of nodes in each node group and the average value of the nodes is not greater than the second set value, for convenience of description, for example, in the above embodiment, after deleting the node E3 in the node group E, respectively determining the number of nodes in the node group D, E, F as 10, 7, and 12, respectively, and then determining that the average value of the number of nodes in each node group is about 9.7. Further, the rounding value may be 10, and the maximum difference between the node number in the node group and the average value is 3, when the second set value is less than 3, it indicates that the node number in the node group does not satisfy the first preset condition, and when the second set value is greater than or equal to 3, it indicates that the node number in the node group satisfies the first preset condition.
The embodiment of the disclosure can ensure that the difference of the number of nodes in each node group is within a preset range by quantitatively limiting the first preset condition, and ensure the balance of the number of nodes in the node group as much as possible.
The embodiment of the present disclosure provides a possible implementation manner, where adjusting nodes of at least one node group includes:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
In the embodiment of the present disclosure, when the number of nodes in each node group does not satisfy the first preset condition, the nodes of at least one node group need to be processed to ensure that the number of nodes in each node group is balanced. Optionally, it may be determined which node of the one or more node groups needs to be processed according to a second preset condition. The second preset condition may be configured according to actual requirements.
In the embodiment of the present disclosure, for convenience of description, one embodiment is taken as an example for description, and the second preset condition includes: the number of the nodes is greater than a third set value; and/or the difference value between the node number and the node average value is larger than a fourth set value, wherein the node average value is the average value of the node numbers of all the node groups. If the second preset condition is that the difference between the node number and the node average value is not greater than a third set value, and the average value of the node number in each node group is determined to be 10 in the previous step, the difference between the node number and the average value is used as a judgment rule for judging whether the node group meets the requirement or not for each node group, and when the difference between the node number of the node group and the average value is greater than the third set value, the node of the node group is processed in a specific processing mode that at least one node in the node group is deleted until the node number in the node group and the average value are greater than the third set valueThe difference of the average values is not more than the second set value, wherein the second set value can be set by the user. For convenience of explanation, the above embodiment is continued by referring to the node E in the node group E3After the deletion, it is respectively determined that the number of nodes in the node group D, E, F is 10, 7, and 12, respectively, if the second setting value is 1, the difference between the number of nodes in the node group F and the average value is 2 greater than 1, one node in the node group F needs to be deleted, and it is ensured that the difference between the number of nodes in the node group F and the average value is not greater than 1, where it needs to be noted that the difference refers to the difference between the number of nodes and the average value of the nodes, and the difference greater than 1 refers to the number of nodes greater than the average value of the nodes by at least 1.
According to the embodiment of the invention, the nodes in the node groups meeting the preset conditions are deleted, so that the difference between the node number in each node group and the average value of the node numbers of all the node groups is ensured to be within a controllable range, and the node number balance of each node group is ensured as much as possible.
The embodiment of the present disclosure provides a possible implementation manner, where the second preset condition includes:
the number of the nodes is greater than a third set value; and/or
The difference value between the node number and the node average value is larger than a fourth set value.
In the embodiment of the present disclosure, when there is a node group in each node group that does not satisfy the first preset condition, it is necessary to process nodes in the node group that satisfies a second preset condition, where the second preset condition may be that the number of nodes in the node group is greater than a third set value, and/or that a difference between the number of nodes and an average value of the nodes is greater than a fourth set value.
For convenience of explanation, the embodiment of the present disclosure is explained by taking the foregoing embodiment as an example, and the node E in the node group E is used as an example3After the deletion, the number of nodes in the node group D, E, F is respectively determined to be 10, 7, and 12, if the second preset condition is that the number of nodes is greater than the third set value, if the third set value is 10, the number of nodes in the node group F is 12, and if the third set value is greater than 10, the nodes in the node group F are operated; if the second preset condition is that the difference value between the node number and the node average value is larger than a fourth set value, the second preset condition is thatIf the four set values are 1, the number of the nodes in the node group F is 12, the difference value between the number of the nodes in the node group F and the average value 10 of the nodes is 2, and if the difference value is greater than 1, the nodes in the node group F are processed.
According to the embodiment of the disclosure, the second preset condition is limited, the nodes in the node groups meeting the preset condition are processed, the difference between the node number in each node group and the average value of the node numbers of all the node groups is ensured to be within a controllable range, and the node number balance of each node group is ensured as much as possible.
Of course, in practical applications, other limiting conditions for adjusting the nodes of at least one node group may also be configured, for example, the nodes of at least one node group are adjusted, so that the adjusted number of nodes of each node group satisfies a third preset condition, for example, the difference between the adjusted number of nodes of each node group is smaller than a set value.
In the embodiment of the present disclosure, a possible implementation manner is provided, and if there is less than a fourth setting value in each node group, at least one deleted node is added to the setting value in the node group whose number of nodes is less than the fourth setting value.
In the embodiment of the present disclosure, when it is determined that the number of nodes in each node group does not satisfy the first preset condition, before the nodes in the node groups are processed, the number of nodes in each node group is counted to see whether there is a node group whose number of nodes is smaller than a fourth set value, where the fourth set value may be set by a user, and when there is a node group whose number of nodes is smaller than the fourth set value, at least one node in the node group that satisfies the second preset condition is moved to the node group whose number of nodes is smaller than the fourth set value. For convenience of explanation, the description continues with the above one embodiment, where node E in node group E is3After the deletion, it is determined that the number of nodes in the node group D, E, F is 10, 7, 12, respectively, and at this time, if the second setting value is 10 and the second preset condition is that the number of nodes in the node group is greater than the average value of the number of nodes in all the node groups, the number of nodes in the node group E is less than 10 and the number of nodes in the node group F is greater than 10, so that two nodes in the node group F need to be transferred to the node group E, and then each node after the processing is determined to be 10, 7, 12, respectivelyThe nodes of the node groups are 10 nodes for the node group D respectively, the node group E is 9 nodes, the node group F is 10 nodes, and the distribution of the number of the nodes in each node group is more balanced.
The embodiment of the disclosure can obviously improve the balance degree of the number of nodes in each node group by transferring the nodes in the node group with more nodes to fewer node groups, and reduce the possibility of performance reduction of a computer network system caused by unbalanced node numbers of each node group.
According to the embodiment of the disclosure, when a node processing request is received, the nodes in the node groups are processed according to the node processing request and the node number of each node group, so that the balance of the node number of each node group is ensured, after the node number of each node group is obtained, the node number of each node group can be accurately mastered, the nodes are processed according to the node number of each node group and a specific node processing request, the condition that the node number of each node group is unbalanced due to too many or too few nodes in a certain node group is effectively prevented, the working capacity of each node group in the whole system is ensured to be equivalent, and the overall performance is improved.
An embodiment of the present disclosure provides a node processing apparatus, and as shown in fig. 4, the node processing apparatus 40 may include: a node processing request receiving module 401, and a node processing module 402, wherein,
a node processing request receiving module 401, configured to receive a node processing request;
the node processing module 402 is configured to perform corresponding processing on nodes of at least one node group according to the node processing request and the number of nodes of each node group, so that the number of nodes in each node group is kept balanced.
Optionally, in this embodiment of the present disclosure, if the node processing request includes a node increase request, the node processing module 402 may be configured to, when performing corresponding processing on a node of at least one node group according to the node processing request and the number of nodes of each node group:
acquiring the number of nodes of each node group;
determining a first target node group with the least number of nodes in each node group according to the number of nodes in each node group;
and adding the node to be added to the first target node group according to the node adding request.
Optionally, if the node processing request includes a node deletion request, the node processing module 402 may be configured to, when performing corresponding processing on a node of at least one node group according to the node processing request and the number of nodes of each node group:
deleting the target nodes of the second target node group corresponding to the node deletion request according to the node deletion request;
determining the number of nodes of each node group subjected to deletion processing;
if the number of the nodes in each node group meets a first preset condition, the nodes in the node group are not adjusted;
and if the number of the nodes in each node group does not meet the first preset condition, adjusting the nodes in at least one node group.
Optionally, the first preset condition may include:
the difference value between the maximum node number and the minimum node number in each node group is not more than a first set value; and/or
The difference value between the number of nodes in each node group and the average value of the nodes is not more than a second set value, wherein the average value of the nodes is the average value of the number of the nodes in each node group.
Optionally, the node processing module 402, when adjusting the nodes of at least one node group, may be configured to:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
Optionally, the second preset condition may include:
the number of the nodes is greater than a third set value; and/or
The difference value between the node number and the node average value is larger than a fourth set value.
Optionally, when the node processing module 402 processes a node, it may further be configured to:
and if the number of the nodes in each node group is less than the fourth set value, adding the deleted at least one node into the node group with the number of the nodes less than the fourth set value.
The node processing apparatus in the embodiment of the disclosure can execute the node processing method shown in the foregoing embodiment of the disclosure, and the implementation principles thereof are similar, and are not described herein again.
Referring now to FIG. 5, a block diagram of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The electronic device includes: a memory and a processor, wherein the processor may be referred to as the processing device 501 hereinafter, and the memory may include at least one of a Read Only Memory (ROM)502, a Random Access Memory (RAM)503 and a storage device 508 hereinafter, which are specifically shown as follows:
as shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable medium or any combination of the two. A computer readable medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node processing request; and correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments provided by the present disclosure, there is provided a node processing method including:
receiving a node processing request;
and correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
In an optional embodiment of the present disclosure, if the node processing request includes a node addition request, performing corresponding processing on a node of at least one node group according to the node processing request and the number of nodes of each node group, includes:
acquiring the number of nodes of each node group;
determining a first target node group with the least number of nodes in each node group according to the number of nodes in each node group;
and adding the node to be added to the first target node group according to the node adding request.
Further, the node processing request includes a node deletion request, and corresponding processing is performed on the node of at least one node group according to the node processing request and the number of nodes of each node group, including:
deleting the target nodes of the second target node group corresponding to the node deletion request according to the node deletion request;
determining the number of nodes of each node group subjected to deletion processing;
if the number of the nodes in each node group meets a first preset condition, the nodes in the node group are not adjusted;
and if the number of the nodes in each node group does not meet the first preset condition, adjusting the nodes in at least one node group.
Further, the first preset condition includes:
the difference value between the maximum node number and the minimum node number in each node group is not more than a first set value; and/or
And the difference value between the node number in each node group and the node average value is not more than a second set value, wherein the node average value is the average value of the node number of each node group. .
Further, adjusting the nodes of at least one of the node groups includes:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
Further, the second preset condition includes:
the number of the nodes is greater than a third set value; and/or
The difference value between the node number and the node average value is larger than a fourth set value.
Further, the node processing method provided by the embodiment of the present disclosure further includes:
and if the number of the nodes in each node group is less than the fourth set value, adding the deleted at least one node into the node group with the number of the nodes less than the fourth set value.
According to one or more embodiments provided by the present disclosure, there is provided a node processing apparatus including:
a node processing request receiving module, configured to receive a node processing request;
and the node processing module is used for correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
Optionally, when the node processing module provided in the embodiment of the present disclosure performs corresponding processing on a node of at least one node group according to the node processing request and the number of nodes of each node group, the node processing module may be configured to:
acquiring the number of nodes of each node group;
determining a first target node group with the least number of nodes in each node group according to the number of nodes in each node group;
and adding the node to be added to the first target node group according to the node adding request.
Optionally, when the node processing module provided in the embodiment of the present disclosure performs corresponding processing on a node of at least one node group according to the node processing request and the number of nodes of each node group, the node processing module may be configured to:
deleting the target nodes of the second target node group corresponding to the node deletion request according to the node deletion request;
determining the number of nodes of each node group subjected to deletion processing;
if the number of the nodes in each node group meets a first preset condition, the nodes in the node group are not adjusted;
and if the number of the nodes in each node group does not meet the first preset condition, adjusting the nodes in at least one node group.
Optionally, when the node processing module provided in the embodiment of the present disclosure processes a node, the first preset condition may be:
the difference value between the maximum node number and the minimum node number in each node group is not more than a first set value and/or
The difference value between the number of nodes in each node group and the average value of the nodes is not more than a second set value, wherein the average value of the nodes is the average value of the number of the nodes in each node group.
Optionally, when adjusting a node of at least one node group, the node processing module provided in the embodiment of the present disclosure may be configured to:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
Optionally, when the node processing module provided in the embodiment of the present disclosure processes a node, the second preset condition may be:
the number of the nodes is greater than a third set value; and/or
The difference value between the node number and the node average value is larger than a fourth set value.
Optionally, when the node processing module provided in the embodiment of the present disclosure processes a node, the node processing module may further be configured to:
and if the number of the nodes in each node group is less than the fourth set value, adding the deleted at least one node into the node group with the number of the nodes less than the fourth set value.
In accordance with one or more embodiments provided by the present disclosure, there is provided an electronic device comprising one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: the node processing method according to the foregoing is performed.
According to one or more embodiments provided by the present disclosure, a computer-readable medium is provided, in which at least one instruction, at least one program, code set, or instruction set is stored, and the at least one instruction, the at least one program, code set, or instruction set is loaded and executed by a processor to implement the aforementioned node processing method.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A node processing method, comprising:
receiving a node processing request;
and carrying out corresponding processing on the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
2. The method of claim 1, wherein if the node processing request includes a node addition request, the performing corresponding processing on the nodes of at least one of the node groups according to the node processing request and the number of nodes of each node group comprises:
acquiring the number of nodes of each node group;
determining a first target node group with the least number of nodes in each node group according to the number of nodes in each node group;
and adding the node to be added to the first target node group according to the node adding request.
3. The method according to claim 1, wherein if the node processing request includes a node deletion request, the performing corresponding processing on the nodes of at least one of the node groups according to the node processing request and the number of nodes of each node group comprises:
deleting the target nodes of the second target node group corresponding to the node deletion request according to the node deletion request;
determining the number of nodes of each node group subjected to deletion processing;
if the number of the nodes in each node group meets a first preset condition, the nodes in the node groups are not adjusted;
and if the number of the nodes of each node group does not meet the first preset condition, adjusting the nodes of at least one node group.
4. The method according to claim 3, wherein the first preset condition comprises:
the difference value between the maximum node number and the minimum node number in each node group is not more than a first set value; and/or
And the difference value between the node number of each node group in each node group and the node average value is not more than a second set value, wherein the node average value is the average value of the node numbers of each node group.
5. The method of claim 3, wherein said adjusting the nodes of at least one of said node groups comprises:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
6. The method according to claim 5, wherein the second preset condition comprises:
the number of the nodes is greater than a third set value; and/or
And the difference value between the node number and the node average value is larger than a fourth set value, wherein the node average value is the average value of the node number of each node group.
7. The method of claim 5, further comprising:
and if the number of nodes of the node group existing in each node group is less than a fourth set value, adding the deleted at least one node into the node group with the number of nodes less than the fourth set value.
8. A node processing apparatus, comprising:
a node processing request receiving module, configured to receive a node processing request;
and the node processing module is used for correspondingly processing the nodes of at least one node group according to the node processing request and the node number of each node group so as to keep the node number in each node group balanced.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: performing the node processing method according to any of claims 1 to 7.
10. A computer readable medium storing at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the node handling method according to any one of claims 1 to 7.
CN202010575421.2A 2020-06-22 2020-06-22 Node processing method, node processing device, electronic equipment and computer readable medium Active CN111756833B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010575421.2A CN111756833B (en) 2020-06-22 2020-06-22 Node processing method, node processing device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010575421.2A CN111756833B (en) 2020-06-22 2020-06-22 Node processing method, node processing device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN111756833A true CN111756833A (en) 2020-10-09
CN111756833B CN111756833B (en) 2023-04-28

Family

ID=72675685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010575421.2A Active CN111756833B (en) 2020-06-22 2020-06-22 Node processing method, node processing device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111756833B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791914A (en) * 2021-11-17 2021-12-14 腾讯科技(深圳)有限公司 Object processing method, device, computer equipment, storage medium and product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731663A (en) * 2015-03-31 2015-06-24 北京奇艺世纪科技有限公司 Task processing method and system
CN106375395A (en) * 2016-08-30 2017-02-01 厦门中学西渐信息科技有限公司 Load balancing method and system for node servers
CN107483643A (en) * 2017-09-26 2017-12-15 深圳市神云科技有限公司 A kind of method of the automatic management node load based on cloud platform
CN110545450A (en) * 2019-09-09 2019-12-06 深圳市网心科技有限公司 Node distribution method, system, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731663A (en) * 2015-03-31 2015-06-24 北京奇艺世纪科技有限公司 Task processing method and system
CN106375395A (en) * 2016-08-30 2017-02-01 厦门中学西渐信息科技有限公司 Load balancing method and system for node servers
CN107483643A (en) * 2017-09-26 2017-12-15 深圳市神云科技有限公司 A kind of method of the automatic management node load based on cloud platform
CN110545450A (en) * 2019-09-09 2019-12-06 深圳市网心科技有限公司 Node distribution method, system, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791914A (en) * 2021-11-17 2021-12-14 腾讯科技(深圳)有限公司 Object processing method, device, computer equipment, storage medium and product

Also Published As

Publication number Publication date
CN111756833B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN111240834B (en) Task execution method, device, electronic equipment and storage medium
CN112256231B (en) Volume control method, device, terminal and storage medium
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111209306A (en) Business logic judgment method and device, electronic equipment and storage medium
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN111756833B (en) Node processing method, node processing device, electronic equipment and computer readable medium
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN111262907B (en) Service instance access method and device and electronic equipment
CN112910975A (en) Request processing method and device and electronic equipment
CN110489219B (en) Method, device, medium and electronic equipment for scheduling functional objects
CN111459893B (en) File processing method and device and electronic equipment
CN112416887B (en) Information interaction method and device and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN113778850A (en) Data processing method and device, electronic equipment and computer readable medium
CN111538717A (en) Data processing method and device, electronic equipment and computer readable medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN111241443A (en) Method and device for pushing information and electronic equipment
CN111324387A (en) Application task control method, device, terminal and system
CN111399730A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN116755889B (en) Data acceleration method, device and equipment applied to server cluster data interaction
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer medium
CN111694679B (en) Message processing method and device and electronic equipment
CN111626787B (en) Resource issuing method, device, medium and equipment
CN115994120B (en) Data file merging method, device, electronic equipment and computer readable medium

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
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant