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

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

Info

Publication number
CN111756833B
CN111756833B CN202010575421.2A CN202010575421A CN111756833B CN 111756833 B CN111756833 B CN 111756833B CN 202010575421 A CN202010575421 A CN 202010575421A CN 111756833 B CN111756833 B CN 111756833B
Authority
CN
China
Prior art keywords
node
group
node group
nodes
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.)
Active
Application number
CN202010575421.2A
Other languages
Chinese (zh)
Other versions
CN111756833A (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.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision 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 Douyin Vision Co Ltd filed Critical Douyin Vision 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)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a node processing method, a node processing 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 according to the node processing request and the node number of each node group, carrying out corresponding processing on the nodes of at least one 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 node number of each node group is balanced, the node number of each node group can be accurately controlled, 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 one node group is effectively prevented, the working capacity of each node group in the whole system is guaranteed to be equivalent, and the overall performance is improved.

Description

Node processing method, node processing device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a node processing method, a node processing device, an electronic device, and a computer readable medium.
Background
With the development of the information age, computer networks have become popular, and many existing fields are not separated from computer networks, and the computer networks generally comprise a plurality of computer devices or other external devices, and 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 units of groups, the number of the nodes of each node group is usually dynamically changed, and if new equipment is required to be continuously added or equipment is required to be deleted, the situation that the number of the nodes is quite different can occur for different node groups, so that the number of the nodes in the node groups is unbalanced, and the whole computer network system can encounter performance bottlenecks due to the limitation of the number of machines of certain node groups.
It can be seen that in the prior art, for the management of node groups, there may be an uneven number of nodes in the node groups, so that the entire computer network system may encounter performance bottlenecks due to the limitation of the number of machines in some node groups.
Disclosure of Invention
The present disclosure aims to solve at least one of the above technical drawbacks, especially the technical drawbacks of the prior art that the number of nodes in a node group may be unbalanced, resulting in that the whole computer network system may suffer from performance bottlenecks due to the limitation of the number of machines in some node groups.
In a first aspect, a node processing method is provided, the method including:
receiving a node processing request;
and according to the node processing request and the node number of each node group, performing corresponding processing on the nodes of at least one node group so as to keep the node number in each node group balanced.
In a second aspect, there is provided a node processing apparatus, the apparatus comprising:
the node processing request receiving module is used for receiving the 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, the 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 applications configured to: the node processing method is executed.
In a fourth aspect, a computer readable medium is provided, the storage medium storing at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the node processing method described above.
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 node number of each node group is balanced, the node number of each node group can be accurately controlled after the node number of each node group is acquired, 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 one node group is effectively prevented, the working capacity of each node group in the whole system is guaranteed 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 that are required to be used in the description of the embodiments of the present disclosure will be briefly introduced below.
Fig. 1 is a schematic flow chart of a node processing method according to an embodiment of the disclosure;
fig. 2 is a flow chart of a node adding method according to an embodiment of the disclosure;
fig. 3 is a 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 embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the embodiments of the present disclosure are described in more detail below with reference to the drawings. While certain embodiments of the present disclosure have been shown in the accompanying 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 are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
In an embodiment of the present disclosure, a node processing method is provided, which is executed by a scheduler, where the scheduler can be used to manage communications of node group devices, as shown in fig. 1, and the method includes:
step S101, a node processing request is received;
step S102, according to the node processing request and the node number of each node group, corresponding processing is carried out on the nodes of at least one node group so as to keep the node number in each node group balanced.
The node processing method provided by the embodiment of the disclosure is applied to a computer network system, a plurality of computer devices exist in the computer network system, or other networking only devices exist in the computer network system, each computer device or networking device is a node in the system, a certain number of nodes can be formed into a node group for facilitating the management of the system, and the nodes in the node group are uniformly managed so as to facilitate the uniform management of the computer devices or networking devices.
In step S101, the receiving node processes the request.
In the embodiment of the 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 correspondingly, a computer device or other networking device needs to be added, and the node deleting request is to delete a node that is originally existing 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 to be processed, and node information of a target node to be processed (for example, for a node deletion request, the target node is a node 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 node number of each node group, corresponding processing is performed on the nodes of at least one node group, so as to keep the node number in each node group balanced.
In the disclosed embodiments, there are typically multiple node groups in a computer network system, with the number of nodes in each node group being in fact the number of computer devices or other networking devices in each node group.
For the embodiment of the disclosure, after a node processing request is received, the nodes are processed according to the node request type in the node processing request, the node group information to be processed and the node number in each node group, so as to ensure that the node number in each node group after processing is kept balanced. For convenience of explanation, taking adding nodes in a node group as an example, when a node processing request is received as a node adding request, the node number in all the node groups is obtained, and then the node needing to be added is added into the node group with the minimum node number, so as to keep the node number of each node group balanced. In the case of deleting the 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 deleting the node, so as to ensure that the number of nodes in each node group remains balanced, which will be specifically described in the embodiments later in the disclosure.
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 node number of each node group is balanced, the node number of each node group can be accurately controlled after the node number of each node group is acquired, 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 one node group is effectively prevented, the working capacity of each node group in the whole system is guaranteed to be equivalent, and the overall performance is improved.
In an embodiment of the present disclosure, as shown in fig. 2, if a node processing request includes a node adding request, according to the node processing request and the node number of each node group, performing corresponding processing on the nodes of at least one node group includes:
step S201, obtaining the node number of each node group;
step S202, determining a first target node group with the least node number in each node group according to the node number of 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 embodiments of the present disclosure, the processing of a node is different when the node processes a request for a node addition or a request for a node deletion. It should be noted that in the embodiment of the present disclosure, the node processing request may include only 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, where each request may be processed correspondingly, and the specific processing sequence is not limited in this disclosure.
In step S201, the number of nodes of each node group is acquired.
In an embodiment of the present disclosure, the number of nodes of each node group in each computer network system is obtained when the node processing request includes a node addition request. The triggering condition for the node addition request may be that a computer device or other networking device is added to the computer network system, i.e. a node is newly added to the computer network system, and this node needs to be grouped. For convenience of explanation, taking a specific embodiment as an example, there are 3 node groups A, B, C in a computer network system, and the node number in each node group is divided into 8, 9, and 10, when it is determined that the node processing request is an increasing node, the node number of the node group a is 8, the node number of the node group B is 9, and the node number of the node group C is 10.
In step S202, a first target node group having the smallest number of nodes in each node group is determined based on 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 least number of nodes in the computer network system. After the node numbers of all the node groups in the computer network system are obtained, the node group with the least node number is determined to be the first target node group by comparing the node numbers between every two node groups. For convenience of explanation, taking the above embodiment as an example, after the node number of the node group a is 8, the node number of the node group B is 9, and the node number of the node group C is 10, the node group with the smallest node number can be determined as the node group a by comparison, and then the node group a is determined as the first target node group.
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 disclosure, after determining the node group with the least node number, according to the node adding request, the node needing to be added is added into the node group.
When the newly added node is processed, the node group with the least node number is determined by acquiring the node numbers of all the node groups, and the node which needs to be added is added into the node group with the least node number, so that the node numbers in the node group after the node addition and the node numbers of other node groups are balanced as much as possible, and the condition that the system performance is influenced due to unbalanced node is prevented.
In an embodiment of the present disclosure, as shown in fig. 3, if a node processing request includes a node deletion request, according to the node processing request and the node number of each node group, performing corresponding processing on the nodes of at least one node group includes:
step S301, deleting the target nodes of the second target node group corresponding to the node deleting request according to the node deleting request;
step S302, determining the node number of each node group after deletion processing;
step S303, if the number of nodes in each node group meets the first preset condition, not adjusting the nodes in the node group
Step S304, if the node number of each node group does not meet the first preset condition, the node of at least one node group is adjusted.
In the embodiment of the present disclosure, when the node processing request is a node deletion request, the node is processed in accordance with the steps shown in fig. 3.
In step S301, according to the node deletion request, the target nodes of the second target node group corresponding to the node deletion request are deleted.
In the embodiment of the present disclosure, the second target node group refers to a node group requiring deletion of a node, and when the node processing request is a node deletion request, the corresponding node group requiring node deletion is obtained according to the node deletion request. For convenience of explanation, taking a specific embodiment as an example, the node deletion request should at least include node information of a node to be deleted and node group information of a node group where the node is located, and when the node deletion request is acquired, determining a node group to be deleted 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 a certain time, the node group information in the node deletion request is E, the node information is node E3, then the node group E is determined to be a second target node group, and the node E in the node group E is determined to be 3 And deleting.
In step S302, the number of nodes in each node group after the deletion process is determined.
In the embodiment of the present disclosure, after deleting the node according to the node deletion request, the node number of each node group after the deletion processing may be obtained. For convenience of explanation, the above embodiment is exemplified by the case that before deleting the nodes, if the number of nodes in the node group D, E, F is 10, 8, 12, respectively, then the node E in the node group E is 3 After deletion, the number of nodes in the node group D, E, F is determined to be 10, 7, 12, respectively.
In step S303 and step S304, if the number of nodes in each node group meets a first preset condition, the nodes in the node group are not adjusted; and if the node number of each node group does not meet the first preset condition, adjusting the nodes of at least one node group.
In the embodiment of the present disclosure, a condition for ensuring that the number of nodes among each node group is balanced is preset when the first preset condition is met, and when the number of nodes among each node group after deleting the nodes does not meet the first preset condition, the nodes in each group need to be adjusted to ensure that the number of nodes among each node group is balanced.
For the embodiment of the disclosure, when the number of nodes of each node group after deleting the nodes meets a first preset condition, the nodes in the node group are not processed; when the number of nodes of each node group after deleting the nodes does not meet the first preset condition, the nodes of at least one group need to be processed. For convenience of description, continuing with the previous embodiment as an example, node E in node group E will be described as 3 After deletion, the number of nodes in the node group D, E, F is respectively determined to be 10, 7 and 12, if the first preset condition is that the difference between the number of nodes between the two node groups is not greater than 3, it is obvious that the difference between the number of nodes E and the number of nodes F does not meet the first preset condition, and the nodes in the node group need to be processed, and at this time, one node in the node group F can be transferred to the node group E to ensure the balance of the number of nodes between the node groups.
According to the embodiment of the disclosure, aiming at the condition of node deletion, the node number of each node group is acquired after the node is deleted, whether the node in the node group needs to be deleted is judged according to whether the node number of each node group meets a first preset condition, the balance colleagues of the node number in each node group is ensured, and the workload of a computer network system is reduced.
In an embodiment of the present disclosure, a possible implementation manner is provided, 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 larger than a first set value; and/or
The difference value between the node number in each node group and the node average value is not greater 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 setting value and the second setting value are not limited in the embodiment of the disclosure, and may be configured or adjusted according to actual needs.
For the embodiments of the present disclosure, for convenience of explanation, continuing with the above one embodiment for illustration, node E in node group E will be 3 After deletion, determining that the number of nodes in the node group D, E, F is 10, 7 and 12 respectively, wherein the maximum value of the node number in the computer network system is 12, the minimum value is 7, the difference between the maximum value and the minimum value is 5, when the first set value is smaller than 5, the node number in the node group is not satisfied with the first preset condition, and when the first set value is greater than or equal to 5, the node number in the node group is satisfied with the first preset condition.
In another embodiment provided in the present disclosure, the first preset condition may be that the 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 explanation, in the above embodiment, after deleting the node E3 in the node group E, it is determined that the number of nodes in the node group D, E, F is 10, 7, and 12, respectively, and then it is determined that the average value of the number of nodes in each node group is about 9.7. Further, the rounding may be performed to a value of 10, where the difference between the number of nodes in the node group and the average value is 3, and when the second set value is smaller than 3, it indicates that the number of nodes 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 number of nodes in the node group satisfies the first preset condition.
According to the embodiment of the disclosure, the first preset condition is quantitatively limited, so that the difference of the node numbers in each node group can be ensured to be within the preset range, and the balance of the node numbers in the node group can be ensured as much as possible.
In an embodiment of the present disclosure, a possible implementation manner is provided to adjust nodes of at least one node group, including:
and deleting at least one node in the node groups meeting the second preset condition in each node group.
In the embodiment of the disclosure, when the number of nodes in each node group does not meet 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. Wherein, optionally, it can be determined which node or nodes of the node group need to be processed according to the second preset condition. The second preset condition can be configured according to actual requirements.
In the embodiments of the present disclosure, for convenience of description, an embodiment is taken as an example to describe the second preset condition includes: the number of nodes is larger 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 number of each node group. If the second preset condition is that the difference between the node number and the average value of the nodes is not greater than a third set value, determining that the average value of the node number in each node group is 10 in the foregoing step, regarding each node group, using the difference between the node number and the average value as a judging rule of whether the node group meets the requirement, and when the difference between the node number and the average value of the node group is greater than the third set value, processing the nodes of the node group, wherein a specific processing mode is to delete at least one node in the node group until the difference between the node number and the average value in the node group is not greater than the second set value, where the second set can be set by a user. For convenience of explanation, continuing with the description of one embodiment above, node E in node group E 3 After deletion, the number of nodes in the node group D, E, F is respectively determined to be 10, 7 and 12, if the second set value is 1, the difference between the number of nodes in the node group F and the average value is 2 or more and 1, and one node in the node group F needs to be deleted, so that the difference between the number of nodes in the node group F and the average value is not more than 1, wherein, it is required 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 is greater than 1 and means that the number of nodes is at least 1 greater than the average value of the nodes.
According to the embodiment of the disclosure, 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 in a controllable range, and the node number balance of each node group is ensured as much as possible.
The embodiment of the disclosure provides a possible implementation manner, and the second preset condition includes:
the number of nodes is larger than a third set value; and/or
The difference between the node number and the node average value is larger than a fourth set value.
In the embodiment of the present disclosure, in a case where there is a node group in each node group that does not satisfy the first preset condition, the nodes in the node group that satisfy the second preset condition need to be processed, 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 a difference between the number of nodes and a node average value is greater than a fourth set value.
For the embodiment of the present disclosure, the foregoing embodiment is taken as an example for the convenience of description, and the node E in the node group E is 3 After deletion, respectively determining that the node numbers in the node group D, E, F are 10, 7 and 12, if the second preset condition is that the node number is larger than a third set value, if the third set value is 10, the node number in the node group F is 12 and is larger than 10, and operating the nodes in the node group F; if the second preset condition is that the difference between the node number and the node average value is greater than the fourth set value, the fourth set value is 1, the node number in the node group F is 12, the difference between the node number and the node average value 10 is 2 and greater than 1, and 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 in a controllable range, and the node number balance of each node group is ensured as much as possible.
Of course, in practical applications, other constraint conditions for adjusting the nodes of at least one node group may be configured, for example, adjusting the nodes of at least one node group, so that the adjusted node number of each node group meets a third preset condition, for example, the difference between the adjusted node numbers of each node group is smaller than a set value.
In one possible implementation manner, if the node group exists in each node group and is smaller than the fourth set value, adding the deleted at least one node to the node group set value with the node number smaller than the fourth set value.
In the embodiment of the disclosure, when it is determined that the number of nodes in each node group does not meet the first preset condition, before processing the nodes in the node groups, the number of nodes in each node group is counted to see whether there is a node group with the number of nodes smaller than a fourth set value, where the fourth set value may be set by a user, and when there is a node group with the number of nodes smaller than the fourth set value, at least one node in the node group meeting the second preset condition is moved to a node group with the number of nodes smaller than the fourth set value. For convenience of explanation, continuing with the description of one embodiment above, node E in node group E 3 After the deletion, the number of nodes in the node group D, E, F is respectively determined to be 10, 7 and 12, at this time, if the second set 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 numbers of nodes in all the node groups, the number of nodes in the node group E is smaller than 10, and the number of nodes in the node F is greater than the average value 10, so that two nodes in the node group F need to be transferred to the node group E, and after the processing, the nodes in each node group are respectively 10 nodes in the node group D, 9 nodes in the node group E, 10 nodes in the node group F, and the distribution of the number of nodes in each node group is more balanced.
According to the embodiment of the disclosure, the nodes in the node groups with more nodes are transferred to the fewer node groups, so that the balance degree of the node numbers in each node group can be obviously improved, and the possibility of performance degradation of the computer network system caused by unbalanced node numbers of each node group is reduced.
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 node number of each node group is balanced, the node number of each node group can be accurately controlled after the node number of each node group is acquired, 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 one node group is effectively prevented, the working capacity of each node group in the whole system is guaranteed to be equivalent, and the overall performance is improved.
The embodiment of the present disclosure provides a node processing apparatus, 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 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, in the embodiment of the present disclosure, if the node processing request includes a node adding request, the node processing module 402 may be configured to, when performing 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:
acquiring the node number of each node group;
determining a first target node group with the least node number in each node group according to the node number of each node group;
according to the node addition request, the node to be added is added to the first target node group.
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 the nodes of at least one node group according to the node processing request and the node number of each node group:
deleting the target nodes of the second target node group corresponding to the node deleting request according to the node deleting request;
determining the node number of each node group after deletion;
If the node number of each node group meets a first preset condition, not adjusting the nodes in the node group;
and if the node number of each node group does not meet the first preset condition, adjusting the nodes of 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 larger than a first set value; and/or
The difference between the node number in each node group and the node average value is not greater than a second set value, wherein the node average value is the average value of the node number in each node group.
Alternatively, 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 nodes is larger than a third set value; and/or
The difference between the node number and the node average value is larger than a fourth set value.
Optionally, the node processing module 402 may be further configured to, when processing a node:
if the node groups are smaller than the fourth set value, adding the deleted at least one node into the node groups with the node number smaller than the fourth set value.
The node processing device according to the embodiments of the present disclosure may perform the node processing method shown in the foregoing embodiments of the present disclosure, and the implementation principle is similar, and will not be described herein.
Referring now to fig. 5, a schematic diagram of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 501 hereinafter, 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, as shown in detail below:
as shown in fig. 5, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to 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 required 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 via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 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 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable medium, or any combination of the two. The computer readable medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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 according to the node processing request and the node number of each node group, carrying out corresponding processing on the nodes of at least one node group so as to keep the node number in each node group balanced.
Computer program code for carrying out operations of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware.
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), 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. The 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 according to the node processing request and the node number of each node group, carrying out corresponding processing on the nodes of at least one node group so as to keep the node number in each node group balanced.
In an alternative embodiment of the present disclosure, if the node processing request includes a node adding request, according to the node processing request and the node number of each node group, performing corresponding processing on the nodes of at least one node group, including:
acquiring the node number of each node group;
determining a first target node group with the least node number in each node group according to the node number of each node group;
according to the node addition request, the node to be added is added to the first target node group.
Further, the node processing request includes a node deletion request, and according to the node processing request and the node number of each node group, the node processing method correspondingly processes the nodes of at least one node group, including:
deleting the target nodes of the second target node group corresponding to the node deleting request according to the node deleting request;
Determining the node number of each node group after deletion;
if the node number of each node group meets a first preset condition, not adjusting the nodes in the node group;
and if the node number of each node group does not meet the first preset condition, adjusting the nodes of 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 larger than a first set value; and/or
The difference value between the node number in each node group and the node average value is not greater 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 nodes is larger than a third set value; and/or
The difference 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:
if the node groups are smaller than the fourth set value, adding the deleted at least one node into the node groups with the node number smaller than the fourth set value.
According to one or more embodiments provided by the present disclosure, there is provided a node processing apparatus including:
the node processing request receiving module is used for receiving the 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 performing 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, the node processing module provided in the embodiment of the present disclosure may be used to:
acquiring the node number of each node group;
determining a first target node group with the least node number in each node group according to the node number of each node group;
according to the node addition request, the node to be added is added to the first target node group.
Optionally, when performing 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, the node processing module provided in the embodiment of the present disclosure may be used to:
deleting the target nodes of the second target node group corresponding to the node deleting request according to the node deleting request;
Determining the node number of each node group after deletion;
if the node number of each node group meets a first preset condition, not adjusting the nodes in the node group;
and if the node number of each node group does not meet the first preset condition, adjusting the nodes of 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 between the maximum node number and the minimum node number in each node group is not greater than a first set value and/or
The difference between the node number in each node group and the node average value is not greater than a second set value, wherein the node average value is the average value of the node number in each node group.
Optionally, the node processing module provided in the embodiment of the present disclosure may be used to, when adjusting a node of at least one node group:
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 nodes is larger than a third set value; and/or
The difference between the node number and the node average value is larger than a fourth set value.
Optionally, when processing a node, the node processing module provided in the embodiment of the present disclosure may be further configured to:
if the node groups are smaller than the fourth set value, adding the deleted at least one node into the node groups with the node number smaller than the fourth set value.
According to one or more embodiments provided by the present disclosure, there is provided an electronic device including 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 applications configured to: the node processing method according to the foregoing is performed.
According to one or more embodiments provided by the present disclosure, there is provided a computer readable medium storing at least one instruction, at least one program, code set, or instruction set, the at least one instruction, at least one program, code set, or instruction set being loaded and executed by a processor to implement the foregoing node processing method.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although 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. In 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 limiting the scope of the present 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 example forms of implementing the claims.

Claims (8)

1. A method of processing a node, comprising:
receiving a node processing request;
according to the node processing request and the node number of each node group, carrying out corresponding processing on the nodes of at least one node group so as to keep the node number in each node group balanced;
If the node processing request includes a node deletion request, the processing, according to the node processing request and the node number of each node group, the corresponding processing on the node of at least one node group includes:
deleting target nodes of a second target node group corresponding to the node deleting request according to the node deleting request;
determining the node number of each node group after deletion processing;
if the node number of each node group meets a first preset condition, not adjusting the nodes in the node group;
if the node number of each node group does not meet the first preset condition, adjusting the nodes of at least one node group;
wherein the first preset condition includes:
the difference value between the maximum node number and the minimum node number in each node group is not larger than a first set value; and/or
The difference value between the node number of each node group in the node groups and the node average value is not greater than a second set value, wherein the node average value is the average value of the node number of each node group.
2. The method of claim 1, wherein if the node processing request includes a node addition request, the processing the nodes of at least one of the node groups according to the node processing request and the node number of each node group includes:
Acquiring the node number of each node group;
determining a first target node group with the least node number in each node group according to the node number of 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 of claim 1, 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.
4. A method according to claim 3, wherein the second preset condition comprises:
the number of nodes is larger 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 number of each node group.
5. A method according to claim 3, characterized in that the method further comprises:
and if the node number of the node groups in each node group is smaller than the fourth set value, adding the deleted at least one node into the node groups with the node number smaller than the fourth set value.
6. A node processing apparatus, comprising:
The node processing request receiving module is used for receiving the node processing request;
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;
if the node processing request includes a node deletion request, the processing, according to the node processing request and the node number of each node group, the corresponding processing on the node of at least one node group includes:
deleting target nodes of a second target node group corresponding to the node deleting request according to the node deleting request;
determining the node number of each node group after deletion processing;
if the node number of each node group meets a first preset condition, not adjusting the nodes in the node group;
if the node number of each node group does not meet the first preset condition, adjusting the nodes of at least one node group;
wherein the first preset condition includes:
the difference value between the maximum node number and the minimum node number in each node group is not larger than a first set value; and/or
The difference value between the node number of each node group in the node groups and the node average value is not greater than a second set value, wherein the node average value is the average value of the node number of each node group.
7. 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 applications configured to: a node processing method according to any one of claims 1 to 5 is performed.
8. A computer readable medium having stored thereon at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by a processor to implement a node processing method according to any of claims 1 to 5.
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 CN111756833A (en) 2020-10-09
CN111756833B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791914B (en) * 2021-11-17 2022-03-11 腾讯科技(深圳)有限公司 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

Also Published As

Publication number Publication date
CN111756833A (en) 2020-10-09

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
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN111209306A (en) Business logic judgment method and device, electronic equipment and storage medium
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
CN112910975A (en) Request processing method and device and electronic equipment
CN116302271A (en) Page display method and device and electronic equipment
CN113518183B (en) Camera calling method and device and electronic equipment
CN111459893B (en) File processing method and device and electronic equipment
CN115378878B (en) CDN scheduling method, device, equipment and storage medium
CN111694670B (en) Resource allocation method, apparatus, device and computer readable medium
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer medium
CN116755889B (en) Data acceleration method, device and equipment applied to server cluster data interaction
CN111404824B (en) Method, apparatus, electronic device, and computer-readable medium for forwarding request
CN115379243B (en) CDN scheduling method, device, equipment and storage medium
CN111626787B (en) Resource issuing method, device, medium and equipment
CN111694679B (en) Message processing method and device and electronic equipment
CN112148448B (en) Resource allocation method, apparatus, device and computer readable medium
CN111835848B (en) Data fragmentation method and device, electronic equipment and computer readable medium
CN113472565B (en) Method, apparatus, device and computer readable medium for expanding server function
CN111949833A (en) Index construction method, data processing method, device, electronic equipment and medium
CN117349003A (en) Memory adjustment method and device and electronic equipment
CN114785794A (en) Resource allocation method, device, equipment, medium, program product and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
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.

GR01 Patent grant
GR01 Patent grant