WO2013143285A1 - 流量控制方法、装置和集群系统 - Google Patents

流量控制方法、装置和集群系统 Download PDF

Info

Publication number
WO2013143285A1
WO2013143285A1 PCT/CN2012/084188 CN2012084188W WO2013143285A1 WO 2013143285 A1 WO2013143285 A1 WO 2013143285A1 CN 2012084188 W CN2012084188 W CN 2012084188W WO 2013143285 A1 WO2013143285 A1 WO 2013143285A1
Authority
WO
WIPO (PCT)
Prior art keywords
token
message
sent
node
ring
Prior art date
Application number
PCT/CN2012/084188
Other languages
English (en)
French (fr)
Inventor
何敏
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013143285A1 publication Critical patent/WO2013143285A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/42Loop networks
    • H04L12/427Loop networks with decentralised control
    • H04L12/433Loop networks with decentralised control with asynchronous transmission, e.g. token ring, register insertion

Definitions

  • the present invention relates to the field of token ring technology, and in particular, to a flow control method, apparatus, and cluster system. Background technique
  • the core idea of the Token Ring mechanism is that when a node in a cluster obtains a token, it has the right to send a message to the outside, and the token is transmitted on a node-by-node basis according to the topology of the ring network, thereby ensuring that the message is sent globally in the cluster. Order.
  • the open source product corosync adopts the Token Ring protocol, which is a mature product.
  • the nodes in the cluster operate as follows: After each node receives the token, it takes a message from the message sending queue for numbering, and then sends the number. After the message arrives in the cluster, repeat the previous numbering and sending two steps until the number of messages allowed to be sent by the local node in the local area is transmitted, and the token is delivered to the next node in the cluster.
  • the embodiment of the present invention provides a flow control method, device, and cluster system.
  • the technical solution is as follows:
  • a flow control method includes:
  • One node in the token ring receives the token, wherein the token ring includes at least two nodes; And according to the information about the node sending the message in the token ring included in the token, the message to be sent is numbered;
  • the numbered message is sent to each node in the token ring.
  • a flow control device is located on a node in a token ring, the token ring includes at least two nodes, and the device includes:
  • a receiving module configured to receive a token; information, numbering the message to be sent;
  • An update module configured to update the token according to the number of the message to be sent
  • a sending module configured to deliver the updated token to a next node in the token ring, and send the numbered message to the next node after the updated token is delivered to the next node Each node in the token ring.
  • a cluster system the cluster system includes a plurality of nodes, and the plurality of nodes form a token ring, wherein:
  • Each of the nodes is configured to receive a token delivered by a previous node in the Token Ring, and perform a message to be sent according to the information about a node sending a message in the token ring included in the token. No. updating the token according to the number of the message to be sent, and transmitting the updated token to a next node in the token ring; transmitting the updated token to the next node The numbered message is then sent to each node in the cluster system.
  • the technical solution provided by the embodiment of the present invention has the following beneficial effects: when a node in the token ring receives the token, performs a message number, sends the token to the next node, and then sends the numbered message to the node.
  • the time for the token to be transferred on the token ring is greatly shortened, and the number of token-to-number messages is fixed. Therefore, the number of tokens transferred per unit time will be greatly increased, thereby improving the message throughput of the token ring cluster, achieving the effect of nodes transmitting messages in parallel, and solving the problem that the Token Ring cluster message throughput is too low.
  • the time for sending the token is advanced, the time for the next message sent by the node to wait for the token is also shortened, thereby reducing the delay of sending the message and improving the real-time performance of the message.
  • FIG. 1 is a schematic diagram of a network topology structure of a token ring according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a flow control method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another flow control method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a message sent by a node on a Token Ring in parallel according to an embodiment of the present invention
  • FIG. 5 is a structural diagram of a flow control apparatus according to an embodiment of the present invention.
  • FIG. 6 is a structural diagram of another flow control device according to an embodiment of the present invention.
  • FIG. 7 is a structural diagram of a cluster system according to an embodiment of the present invention. detailed description
  • Embodiments of the present invention relate to token ring technology. See Figure 1 for a schematic diagram of the network topology of the Token Ring.
  • node 1 to node 5 consist of 5 nodes to form a token ring cluster, which uses token ring mechanism to transmit tokens and send and receive messages.
  • the token passed on the token ring is a set of parameter information, including but not limited to: Token Ring ID, timestamp, upper limit of the number of messages sent by the node in the Token Ring, and maximum number of messages sent by the Token Ring. , resend the message list, and more.
  • the token's turnaround time consists of two parts: the time the token is on the token ring network, and the time the token was processed on the node.
  • the processing of a node means that the node receives the token, numbers the message, sends the token, and sends the message.
  • an embodiment of the present invention provides a flow control method, including:
  • a node in the token ring receives the token, where the token ring includes at least two nodes; 202: number the message to be sent according to the information about the message sent by the node in the token ring included in the token ;
  • step 202 After sending the updated token to the next node, send the numbered message to each node in the Token Ring.
  • the maximum number of the sent message may specifically include:
  • the determined messages to be sent are sequentially numbered from the maximum number.
  • the number of messages to be sent this time is less than or equal to the upper limit value.
  • step 203 may specifically include:
  • the token after changing the maximum number is sent to the next node in the token ring.
  • the message number is sent, and after the token is sent to the next node, the numbered message is sent to the token ring, because the node There is no need to wait for the message to be sent before sending the token, which greatly shortens the time the token is transferred on the token ring, and the number of tokens transferred to the token number is fixed, so the token is in unit time.
  • the number of turns will be greatly improved, thereby improving the message throughput of the Token Ring cluster, achieving the effect of nodes sending messages in parallel, and solving the problem that the Token Ring cluster message throughput is too low.
  • an embodiment of the present invention further provides another flow control method, including:
  • a node in the token ring receives the token, where the token ring includes at least two nodes.
  • the token in this embodiment is a set of parameters transmitted in the network of the command card ring. The description in the embodiment is not described here. The order of the tokens in the token ring is fixed.
  • One node in the token ring in the embodiment is any node on the command ring, which is not limited by the present invention.
  • the node determines, according to the upper limit value of the number of messages sent by the node in the token ring included in the received token, the message to be sent in the message sending queue.
  • the token ring is pre-set with an upper limit value of the number of messages sent by the node, and the upper limit value is applicable to each node in the token ring, and each node in the token ring sends a message each time. The number cannot exceed this number Upper limit.
  • the number of messages to be sent currently determined by the node is less than or equal to the upper limit value. For example, if the number of sent messages of the node preset by the token ring is 5, the number of messages sent by each node in the token ring may be 1, 2, 3, or 4 Or 5, but no more than 5.
  • the message sending queue refers to a message sending queue that is generated locally by the node and is to be sent to the token ring cluster, and may include one or more messages, and the messages in the message sending queue are unsent messages.
  • a node can send a message in the queue to send the message one or more times. Each time the node receives the token, it will take the message to be sent from the message sending queue. The number of the message to be sent does not exceed the upper limit of the number of messages sent by the node preset by the token ring. value.
  • the upper limit value is 5, after the node receives the token, 5 messages are fetched from the message sending queue and sent in the current message, and the rest of the messages are waiting. Send it after receiving the token.
  • the node according to the maximum number of the sent message of the Token Ring that is included in the token, is sequentially incremented from the maximum number to the determined message to be sent.
  • the token received by the node includes various parameters, including the maximum number of messages sent by the Token Ring.
  • the messages sent by each node in the token ring are numbered according to the global rules. Each node is incremented and numbered based on the message number sent by the previous node.
  • the incremental step size can be set as needed. For example, after the node receives the token, the maximum number of the sent message of the token ring is 2, and the number of the message to be sent is numbered from 3, and the number is 1 according to the step size. 3, 4, 5, etc.; or, the number of the messages to be sent may be numbered from 4 to 4, 6, 8, etc. according to the step size 2.
  • the present invention is not limited thereto.
  • the node records the maximum number of the message to be sent, and changes the maximum number of the sent message of the Token Ring contained in the token to the maximum number of the record. At this time, the maximum number of the record The number represents the largest number of messages sent by the Token Ring for the next node on the Token Ring;
  • the node sends the token with the changed maximum number to the next node in the token ring, so that the next node continues to perform global numbering;
  • the node After sending the token after changing the maximum number to the next node in the token ring, the node sends the numbered message to each node in the token ring, and the node processes this time. The process ends.
  • the node sends each message one by one, and the sending is multicast, and each part in the token ring
  • the node can receive the message, and the specific process is not described in the present invention.
  • the message number is sent, and after the token is sent to the next node, the numbered message is sent to the token ring, because the node There is no need to wait for the message to be sent before sending the token, which greatly shortens the time the token is transferred on the token ring, and the number of tokens transferred to the token number is fixed, so the token is in unit time.
  • the number of turns will be greatly improved, thereby improving the message throughput of the Token Ring cluster, achieving the effect of nodes sending messages in parallel, and solving the problem that the Token Ring cluster message throughput is too low.
  • the time for sending the token is advanced, the time for the next message sent by the node to wait for the token is also shortened, thereby reducing the delay of sending the message and improving the real-time performance of the message.
  • each node on the token ring can send a message in parallel. Because there is a limit on the number of messages sent by the node on the token ring, all nodes on the token ring usually do not appear. In the case of sending a message at the same time, there may be a scenario in which some nodes simultaneously send a message. For example, see Figure 4, which is a schematic diagram of sending messages in parallel for some of the nodes on the Token Ring. There are five nodes on the token ring, which are node 1 to node 5.
  • the message to be sent is numbered as #10; the token is sent to the next node, node 3, which includes the maximum number of messages sent by the token ring.
  • the number is #10; Send #10 message to the Token Ring.
  • node 3 starts the message number according to the largest number #10, the number is #20, and changes the maximum number of the token ring sent message in the token to #20, and then sends the token.
  • node 4 will send the message number, number #30, and change the maximum number of the token ring sent message in the token to # After 30, the token is sent to node 5.
  • the token ends in the token ring and ends the process.
  • node 2, node 3 and node 4 send messages in parallel, which shortens the time that the token is transmitted in the token ring and improves the message throughput of the token ring.
  • an embodiment of the present invention can be applied to a large-scale cluster environment.
  • the processing time of the node can be shortened to 20%, and the time of the token is changed. It is also shortened to the original 65%, so the message throughput of the Token Ring cluster can be increased by 54%.
  • the message throughput of corosync can be increased from 6 ⁇ 8MB/s to 9 ⁇ 12MB/s.
  • an embodiment of the present invention further provides a flow control device, where the device is located on a node in a token ring, the token ring includes at least two nodes, and the device includes:
  • the receiving module 501 is configured to receive a token;
  • a numbering module 502 configured to number, according to related information about a node sending a message in the token ring included in the token, a message to be sent;
  • An update module 503, configured to update the token according to a number of the message to be sent;
  • the sending module 504 is configured to deliver the updated token to the next node in the token ring, and after sending the updated token to the next node, send the numbered message to each of the token rings. node.
  • the numbering module 502 may specifically include:
  • the determining unit 502a is configured to determine, according to the upper limit value of the number of messages sent by the node in the token ring included in the token, the message to be sent in the message sending queue;
  • the numbering unit 502b is configured to, according to the maximum number of the Token Ring sent messages included in the token received by the receiving module 501, increment the number from the maximum number to the determined current to-be-sent message.
  • the number of the messages to be sent that are determined by the determining unit 502a is less than or equal to the upper limit value.
  • the update module 503 is specifically configured to record the maximum number of the message to be sent, and change the maximum number of the sent message of the Token Ring contained in the token to the maximum number of the record; correspondingly, the sending module 504 is specifically configured to pass the token with the changed maximum number to the next node in the token ring, and send the numbered message to the token ring after sending the updated token to the next node.
  • the sending module 504 is specifically configured to pass the token with the changed maximum number to the next node in the token ring, and send the numbered message to the token ring after sending the updated token to the next node.
  • the flow control device may be an independent physical device; in another implementation manner, the flow control device may be a network element with a flow control function.
  • the device may be a router, a gateway device, or a network firewall device. It should be understood that the flow control device supports independent external connection, can be connected to existing devices, or can be built in the network element device of the existing network. .
  • the foregoing apparatus after receiving the token, performs a message number, sends the token to the next node in the token ring, and then sends the numbered message to the token ring, because The node where the device is located does not need to wait for the message to be sent before sending the token, which greatly shortens the time that the token is transferred on the token ring, and the number of tokens transferred to the number is fixed, so the unit The number of tokens transferred during the time will be greatly increased, thereby improving the message throughput of the token ring cluster, achieving the effect of nodes sending messages in parallel, and solving the problem that the Token Ring cluster message throughput is too low.
  • an embodiment of the present invention further provides a cluster system, including a plurality of nodes 701, where the plurality of nodes 701 constitute a token ring, where:
  • Each of the nodes 701 is configured to receive a token delivered by a previous node in the token ring, and number the message to be sent according to the information about the node sending the message in the token ring included in the token; The number of the message to be sent updates the token, and passes the updated token to the next node in the Token Ring; after sending the updated token to the next node, the numbered message is sent to Each node in the cluster system.
  • the node is specifically configured to receive a token that is sent by a previous node in the token ring, and send the token according to the node in the token ring included in the token.
  • the upper limit value of the number of messages, the message to be sent in the message sending queue is determined, and the maximum number of the message that has been sent by the token ring included in the token is incremented from the maximum number
  • the determined message to be sent is numbered; and the token is updated according to the number of the message to be sent, and the updated token is delivered to the next node in the token ring; After the updated token is passed to the next node, the numbered message is sent to each node in the cluster system.
  • Each of the nodes in the embodiment is integrated with the flow control device provided in the foregoing embodiment, and the flow control method provided in the foregoing embodiment may be executed.
  • the flow control method provided in the foregoing embodiment may be executed.
  • Each node in this embodiment is a physical node device, and its product form may be a network element device such as a router, a gateway device, or a network firewall device.
  • the system provided by this embodiment after receiving the token, performs a message number, sends the token to the next node in the token ring, and then sends the numbered message to the token ring, because The node where the device is located does not need to wait for the message to be sent before sending the token, which greatly shortens the time that the token is transferred on the token ring, and the number of tokens transferred to the number is fixed, so the unit The number of tokens transferred during the time will be greatly increased, thereby improving the message throughput of the token ring cluster, achieving the effect of nodes sending messages in parallel, and solving the problem that the Token Ring cluster message throughput is too low.
  • the time for sending the token is advanced, the time for the next message sent by the node to wait for the token is also shortened, thereby reducing the transmission delay of the message and improving the real-time performance of the message.
  • the completion of the hardware may also be performed by a program to instruct related hardware.
  • the program may be stored in a computer readable storage medium.
  • the storage medium mentioned above may be a read only memory, a magnetic disk or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种流量控制方法、装置和集群系统,属于令牌环技术领域。所述方法包括:令牌环中的一个节点接收令牌,其中该令牌环包括至少两个节点;根据令牌中包含的令牌环中节点发送消息的相关信息,对待发送的消息进行编号;根据待发送的消息的编号更新所述令牌,并将更新后的令牌传递给令牌环中的下一个节点;在将更新后的令牌发送到下一个节点之后,将编号过的消息依次发送到令牌环中的各节点。所述装置包括:接收模块、编号模块、更新模块和发送模块。所述集群系统包括构成令牌环的多个节点。本发明极大地缩短了令牌在令牌环上转一圈的时间,提高了令牌环集群的消息吞吐量,并且减少了消息的发送延时,提高了消息的实时性。

Description

流量控制方法、 装置和集群系统
本申请要求于 2012 年 3 月 28 日提交中国专利局、 申请号为 201210086301.1、 发明名称为 "流量控制方法、 装置和集群系统" 的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及令牌环技术领域, 特别涉及一种流量控制方法、 装置和集群系 统。 背景技术
在集群里, 要保证消息的全局有序性, 一种 4艮好的方法就是采用令牌环机 制。 令牌环机制的核心思想是当集群中的节点拿到令牌时, 才有权利对外发送 消息, 而令牌按照环形网络的拓朴结构逐个节点传递, 从而保证了集群中消息 发送的全局有序性。
开源产品 corosync采用了令牌环协议, 是一个成熟的产品, 其集群中的节 点操作流程如下: 当每个节点收到令牌后, 从消息发送队列中取出一个消息进 行编号, 然后发送该编号后的消息到集群中, 重复前面编号和发送两个步骤, 直到发送完本圏内本节点允许发送的消息数量为止,传递令牌给集群中的下一 个节点。
但是上述现有技术的缺点是,在任意时刻,只有一个节点在对外发送消息, 这样严重限制了集群的消息吞吐量, 而消息吞吐量是衡量集群能力的关键指 标。 发明内容
为了提高令牌环集群的消息吞吐量, 本发明实施例提供了一种流量控制方 法、 装置和集群系统。 所述技术方案如下:
一方面, 一种流量控制方法, 包括:
令牌环中的一个节点接收令牌, 其中所述令牌环包括至少两个节点; 根据所述令牌中包含的所述令牌环中节点发送消息的相关信息, 对待发送 的消息进行编号;
根据所述待发送的消息的编号更新所述令牌, 并将更新后的令牌传递给所 述令牌环中的下一个节点;
在将所述更新后的令牌传递到下一个节点之后, 将所述编号过的消息发送 到所述令牌环中的各节点。
另一方面, 一种流量控制装置, 所述装置位于令牌环中的一个节点上, 所 述令牌环包括至少两个节点, 所述装置包括:
接收模块, 用于接收令牌; 信息, 对待发送的消息进行编号;
更新模块, 用于根据所述待发送的消息的编号更新所述令牌;
发送模块, 用于将更新后的令牌传递给所述令牌环中的下一个节点, 在将 所述更新后的令牌传递给下一个节点之后, 将所述编号过的消息发送到所述令 牌环中的各节点。
再一方面, 一种集群系统, 所述集群系统包括多个节点, 所述多个节点构 成令牌环, 其中:
所述每个节点用于接收所述令牌环中的上一个节点传递来的令牌,根据所 述令牌中包含的所述令牌环中节点发送消息的相关信息,对待发送的消息进行 编号; 根据所述待发送消息的编号更新所述令牌, 并将更新后的令牌传递给所 述令牌环中的下一个节点; 在将所述更新后的令牌传递给下一个节点之后, 将 所述编号过的消息发送到所述集群系统中的各节点。
本发明实施例提供的技术方案带来的有益效果是: 当令牌环中的节点接收 到令牌后, 进行消息编号, 将令牌发送给下一个节点后, 再把编号过的消息发 送到令牌环中, 由于节点无需等待消息发送完成后再发送令牌, 从而极大地缩 短了令牌在令牌环上转一圏的时间, 而令牌转一圏编号的消息数量是固定的, 因此在单位时间内令牌转的圏数会大幅提高,从而提高了令牌环集群的消息吞 吐量, 达到了节点并行发送消息的效果, 解决了令牌环集群消息吞吐量太低的 问题。 另外, 由于令牌发送的时间提前了, 节点下次发送的消息等待令牌的时 间也缩短了, 从而减少了消息的发送延时, 提高了消息的实时性。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的令牌环的网络拓朴结构示意图;
图 2是本发明实施例提供的一种流量控制方法流程图;
图 3是本发明实施例提供的另一种流量控制方法流程图;
图 4是本发明实施例提供的令牌环上节点并行发送消息的示意图; 图 5是本发明实施例提供的一种流量控制装置结构图;
图 6是本发明实施例提供的另一种流量控制装置结构图;
图 7是本发明实施例提供的一种集群系统结构图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明 实施方式作进一步地详细描述。
本发明实施例涉及令牌环技术。 参见图 1 , 为令牌环的网络拓朴结构示意 图。 其中, 节点 1至节点 5共 5个节点组成了令牌环集群, 采用令牌环机制传 递令牌和收发消息。 令牌环上传递的令牌为一组参数信息, 包括但不限于: 令 牌环 ID、 时间戳、令牌环中节点发送消息个数的上限值、令牌环已发送消息的 最大编号、 重发消息列表等等。 令牌的周转时间包括两部分: 令牌在令牌环网 络上的时间, 以及令牌在节点处理上的时间。 节点的处理是指节点接收令牌、 对消息进行编号、 发送令牌和发送消息等。
参见图 2, 本发明实施例提供了一种流量控制方法, 包括:
201: 令牌环中的一个节点接收令牌, 其中该令牌环包括至少两个节点; 202: 根据该令牌中包含的令牌环中节点发送消息的相关信息, 对待发送 的消息进行编号;
203: 根据待发送的消息的编号更新该令牌, 并将更新后的令牌传递给令 牌环中的下一个节点;
204: 在将更新后的令牌发送到下一个节点之后, 将编号过的消息发送到 令牌环中的各节点。 发送消息的最大编号, 步骤 202可以具体包括:
根据该令牌中包含的令牌环中节点发送消息个数的上限值,在消息发送队 列中确定本次待发送的消息;
根据所述令牌中包含的令牌环已发送消息的最大编号,从所述最大编号起 依次递增给已确定的本次待发送的消息进行编号。
优选地, 所述本次待发送的消息个数小于或等于所述上限值。
进一步地, 步骤 203可以具体包括:
记录本次待发送的消息的最大编号;
将所述令牌中包含的令牌环已发送消息的最大编号更改为已记录的最大 编号;
将更改最大编号后的所述令牌发送给所述令牌环中的下一个节点。
本实施例提供的上述方法, 当令牌环中的节点接收到令牌后, 进行消息编 号, 将令牌发送给下一个节点后, 再把编号过的消息发送到令牌环中, 由于节 点无需等待消息发送完成后再发送令牌,从而极大地缩短了令牌在令牌环上转 一圏的时间, 而令牌转一圏编号的消息数量是固定的, 因此在单位时间内令牌 转的圏数会大幅提高, 从而提高了令牌环集群的消息吞吐量, 达到了节点并行 发送消息的效果, 解决了令牌环集群消息吞吐量太低的问题。 另外, 由于令牌 发送的时间提前了, 节点下次发送的消息等待令牌的时间也缩短了, 从而减少 了消息的发送延时, 提高了消息的实时性。 参见图 3 , 本发明实施例还提供了另一种流量控制方法, 包括:
301 : 令牌环中的一个节点接收令牌, 其中该令牌环包括至少两个节点; 本实施例中的所述令牌是指令牌环网络中传递的一组参数, 具体内容详见 上述实施例中的描述, 此处不赘述。 令牌在令牌环中的传递顺序是固定的, 本 实施例中所述令牌环中的一个节点是指令牌环上的任一个节点, 本发明对此不 限定。
302: 所述节点根据收到的令牌中包含的令牌环中节点发送消息个数的上 限值, 在消息发送队列中确定本次待发送的消息;
本实施例中, 令牌环预设有节点发送消息个数的上限值, 该上限值对令牌 环中的每个节点均适用,令牌环中的每个节点每次发送消息的个数不能超过该 上限值。
具体地, 所述节点确定的本次待发送的消息个数小于或等于所述上限值。 例如, 令牌环预设的节点发送消息的个数上限值为 5 , 则该令牌环中的每个节 点每次发送消息的个数可以为 1个、 2个、 3个、 4个或者 5个, 但是不能超过 5个。
所述消息发送队列是指所述节点在本地产生的将要发送到令牌环集群中 的消息发送队列, 其中可以包括一条或者多条消息, 该消息发送队列中的消息 均是未发送的消息, 节点可以通过一次或者多次发送该消息发送队列中的消 息。 每次节点收到令牌后, 都会从消息发送队列中取出本次待发送的消息, 所 述本次待发送的消息的个数不超过令牌环预设的节点发送消息个数的上限值。 例如, 节点的消息发送队列中有 10条消息等待发送, 所述上限值为 5 , 则节点 收到令牌后, 从该消息发送队列中取出 5条消息在本次发送, 其余消息则等待 在后续收到令牌后再发送。
303: 所述节点根据该令牌中包含的该令牌环已发送消息的最大编号, 从 该最大编号起依次递增给已确定的本次待发送的消息进行编号;
所述节点收到的令牌中包括多种参数, 其中包括令牌环已发送消息的最大 编号。 令牌环中各个节点发送的消息是按照全局规则进行编号的, 每个节点都 是在之前的节点已发送的消息编号的基础上继续递增进行编号的, 递增的步长 可以根据需要设置。 例如, 所述节点收到令牌后, 获取其中的令牌环已发送消 息的最大编号为 2, 则对本次待发送的消息进行编号时从 3开始编号, 按照步 长为 1依次编号为 3、 4、 5等等; 或者, 还可以对本次待发送的消息进行编号 时从 4开始, 按照步长为 2依次编号为 4、 6、 8等等; 本发明对此不限定。
304: 所述节点记录该本次待发送的消息的最大编号, 将该令牌中包含的 该令牌环已发送消息的最大编号更改为该记录的最大编号, 此时, 所述记录的 最大编号对令牌环上的下一个节点而言代表了令牌环已发送消息的最大编号;
305: 所述节点将更改最大编号后的该令牌发送给该令牌环中的下一个节 点, 从而以便于该下一个节点继续进行全局编号;
306: 在将更改最大编号后的该令牌发送给该令牌环中的下一个节点之后, 所述节点将编号过的消息发送到令牌环中的各节点, 所述节点本次的处理流程 结束。
其中, 所述节点是逐条发送各消息的, 所述发送为组播, 令牌环中的各个 节点均能收到该消息, 具体过程, 本发明不做过多说明。
本实施例提供的上述方法, 当令牌环中的节点接收到令牌后, 进行消息编 号, 将令牌发送给下一个节点后, 再把编号过的消息发送到令牌环中, 由于节 点无需等待消息发送完成后再发送令牌,从而极大地缩短了令牌在令牌环上转 一圏的时间, 而令牌转一圏编号的消息数量是固定的, 因此在单位时间内令牌 转的圏数会大幅提高, 从而提高了令牌环集群的消息吞吐量, 达到了节点并行 发送消息的效果, 解决了令牌环集群消息吞吐量太低的问题。 另外, 由于令牌 发送的时间提前了, 节点下次发送的消息等待令牌的时间也缩短了, 从而减少 了消息的发送延时, 提高了消息的实时性。
本实施例提供的上述方法中, 令牌环上的各个节点可以并行发送消息, 由 于令牌环上有节点发送消息个数上限值的限制, 因此, 通常不会出现令牌环上 所有节点同时发送消息的情况,可能出现部分节点同时发送消息的场景。例如, 参见图 4, 为令牌环上的部分节点并行发送消息的示意图。 其中, 令牌环上共 有 5个节点, 分别为节点 1至节点 5。 当节点 2收到令牌时, 进行如下操作: 给本次待发送的消息进行编号为 #10;发送令牌给下一个节点即节点 3 ,该令牌 中包括令牌环已发送消息的最大编号为 #10; 发送 #10消息到令牌环中。 节点 3 收到令牌后, 根据其中的最大编号 #10开始进行消息编号, 编号为 #20, 并将令 牌中的令牌环已发送消息的最大编号更改为 #20, 然后发送该令牌给节点 4,再 发送编号为 #20的消息; 同理, 节点 4收到令牌后进行消息编号, 编号为 #30, 并将令牌中的令牌环已发送消息的最大编号更改为 #30后发送令牌给节点 5。 依次类推, 令牌在令牌环中转一圏后结束本次流程。 其中, 节点 2、 节点 3和 节点 4并行发送消息, 缩短了令牌在令牌环中传递的时间, 提高了令牌环的消 息吞吐量。
本发明实施例提供的技术方案可以应用于大规模的集群环境, 通过改变节 点发送令牌和发送消息的顺序, 可以把节点处理的时间缩短为原来的 20%, 同 时令牌转一圏的时间也缩短为原来的 65% ,从而令牌环集群的消息吞吐量可以 提高 54%。 以 5个节点的令牌环为例, corosync的消息吞吐量可以由 6~8MB/s 提高到 9~12MB/s。 参见图 5 , 本发明实施例还提供了一种流量控制装置, 该装置位于令牌环 中的一个节点上, 所述令牌环包括至少两个节点, 该装置包括: 接收模块 501 , 用于接收令牌;
编号模块 502, 用于根据该令牌中包含的所述令牌环中节点发送消息的相 关信息, 对待发送的消息进行编号;
更新模块 503 , 用于根据待发送的消息的编号更新所述令牌;
发送模块 504, 用于将更新后的令牌传递给令牌环中的下一个节点, 在将 更新后的令牌发送到下一个节点之后,将编号过的消息发送到令牌环中的各节 点。
参见图 6, 其中, 编号模块 502可以具体包括:
确定单元 502a,用于根据令牌中包含的令牌环中节点发送消息个数的上限 值, 在消息发送队列中确定本次待发送的消息;
编号单元 502b,用于根据接收模块 501收到的令牌中包含的令牌环已发送 消息的最大编号,从该最大编号起依次递增给已确定的本次待发送的消息进行 编号。
优选地, 确定单元 502a确定的所述本次待发送的消息个数小于或等于所 述上限值。
进一步地, 更新模块 503具体用于记录本次待发送的消息的最大编号, 将 该令牌中包含的该令牌环已发送消息的最大编号更改为该记录的最大编号; 相 应地,发送模块 504具体用于将更改最大编号后的令牌传递给令牌环中的下一 个节点, 在将更新后的令牌发送到下一个节点之后, 将所述编号过的消息发送 到令牌环中的各节点。
本发明实施例中, 应当理解的是, 在一种实现方式下, 所述流量控制装置 可以为独立的物理装置; 在另一种实现方式下, 流量控制装置可以是具有流量 控制功能的网元设备, 其产品形态可以是路由器, 网关设备或者网络防火墙设 备等等;应当理解的是, 流量控制装置支持独立外置, 能与现有设备进行对接, 也可以内置于现网的网元设备上。
本实施例提供的上述装置, 当接收到令牌后, 进行消息编号, 将令牌发送 给令牌环中的下一个节点后, 再把编号过的消息发送到令牌环中, 由于所述装 置所在的节点无需等待消息发送完成后再发送令牌,从而极大地缩短了令牌在 令牌环上转一圏的时间, 而令牌转一圏编号的消息数量是固定的, 因此在单位 时间内令牌转的圏数会大幅提高, 从而提高了令牌环集群的消息吞吐量, 达到 了节点并行发送消息的效果,解决了令牌环集群消息吞吐量太低的问题。另夕卜, 由于令牌发送的时间提前了, 节点下次发送的消息等待令牌的时间也缩短了, 从而减少了消息的发送延时, 提高了消息的实时性。 参见图 7, 本发明实施例还提供了一种集群系统, 包括多个节点 701 , 所 述多个节点 701构成令牌环, 其中:
所述每个节点 701用于接收令牌环中的上一个节点传递来的令牌,根据该 令牌中包含的令牌环中节点发送消息的相关信息, 对待发送的消息进行编号; 根据该待发送消息的编号更新所述令牌, 并将更新后的令牌传递给令牌环中的 下一个节点; 在将更新后的令牌发送到下一个节点之后, 将编号过的消息发送 到所述集群系统中的各节点。
其中, 在一种实现方式下, 所述每个节点具体用于接收所述令牌环中的上 一个节点传递来的令牌,根据所述令牌中包含的所述令牌环中节点发送消息个 数的上限值, 在消息发送队列中确定本次待发送的消息, 根据所述令牌中包含 的所述令牌环已发送消息的最大编号,从所述最大编号起依次递增给所述确定 的本次待发送的消息进行编号; 以及根据所述待发送消息的编号更新所述令 牌, 并将更新后的令牌传递给所述令牌环中的下一个节点; 在将所述更新后的 令牌传递给下一个节点之后,将所述编号过的消息发送到所述集群系统中的各 节点。
本实施例中的每一个节点均集成有上述实施例提供的流量控制装置, 可以 执行上述实施例提供的流量控制方法,详见上述实施例中的描述,此处不赘述。
本实施例中的每一个节点均为物理节点设备, 其产品形态可以是路由器, 网关设备或者网络防火墙设备等网元设备。
本实施例提供的上述系统, 当接收到令牌后, 进行消息编号, 将令牌发送 给令牌环中的下一个节点后, 再把编号过的消息发送到令牌环中, 由于所述装 置所在的节点无需等待消息发送完成后再发送令牌,从而极大地缩短了令牌在 令牌环上转一圏的时间, 而令牌转一圏编号的消息数量是固定的, 因此在单位 时间内令牌转的圏数会大幅提高, 从而提高了令牌环集群的消息吞吐量, 达到 了节点并行发送消息的效果,解决了令牌环集群消息吞吐量太低的问题。另夕卜, 由于令牌发送的时间提前了, 节点下次发送的消息等待令牌的时间也缩短了, 从而减少了消息的发送延时, 提高了消息的实时性。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通 过硬件来完成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存储 于一种计算机可读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘 或光盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的 精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的 保护范围之内。

Claims

权 利 要 求 书
1、 一种流量控制方法, 其特征在于, 所述方法包括:
令牌环中的一个节点接收令牌, 其中所述令牌环包括至少两个节点; 根据所述令牌中包含的所述令牌环中节点发送消息的相关信息, 对待发送 的消息进行编号;
根据所述待发送的消息的编号更新所述令牌, 并将更新后的令牌传递给所 述令牌环中的下一个节点;
在将所述更新后的令牌传递到下一个节点之后, 将所述编号过的消息发送 到所述令牌环中的各节点。
2、 根据权利要求 1所述的方法, 其特征在于, 根据所述令牌中包含的所述 令牌环中节点发送消息的相关信息, 对待发送的消息进行编号, 包括:
根据所述令牌中包含的所述令牌环中节点发送消息个数的上限值, 在消息 发送队列中确定本次待发送的消息;
根据所述令牌中包含的所述令牌环已发送消息的最大编号, 从所述最大编 号起依次递增给所述确定的本次待发送的消息进行编号。
3、 根据权利要求 2所述的方法, 其特征在于, 所述本次待发送的消息个数 小于或等于所述上限值。
4、 根据权利要求 2所述的方法, 其特征在于, 根据所述待发送的消息的编 号更新所述令牌, 并将更新后的令牌传递给所述令牌环中的下一个节点, 包括: 记录所述本次待发送的消息的最大编号;
将所述令牌中包含的所述令牌环已发送消息的最大编号更改为所述记录的 最大编号;
将更改最大编号后的所述令牌发送给所述令牌环中的下一个节点。
5、一种流量控制装置, 其特征在于, 所述装置位于令牌环中的一个节点上, 所述令牌环包括至少两个节点, 所述装置包括:
接收模块, 用于接收令牌; 信息, 对待发送的消息进行编号;
更新模块, 用于根据所述待发送的消息的编号更新所述令牌; 所述更新后的令牌传递给下一个节点之后, 将所述编号过的消息发送到所述令 牌环中的各节点。
6、 根据权利要求 5所述的装置, 其特征在于, 所述编号模块包括: 上限值, 在消息发送队列中确定本次待发送的消息;
编号单元, 用于根据所述令牌中包含的所述令牌环已发送消息的最大编号, 从所述最大编号起依次递增给所述确定的本次待发送的消息进行编号。
7、 根据权利要求 6所述的装置, 其特征在于, 所述更新模块具体用于记录 所述本次待发送的消息的最大编号, 将所述令牌中包含的所述令牌环已发送消 息的最大编号更改为所述记录的最大编号;
所述发送模块具体用于将更改最大编号后的所述令牌传递给所述令牌环中 的下一个节点, 在将所述更新后的令牌发送到下一个节点之后, 将所述编号过 的消息发送到所述令牌环中的各节点。
8、 一种集群系统, 其特征在于, 所述集群系统包括多个节点, 所述多个节 点构成令牌环, 其中:
所述每个节点用于接收所述令牌环中的上一个节点传递来的令牌, 根据所 述令牌中包含的所述令牌环中节点发送消息的相关信息, 对待发送的消息进行 编号; 根据所述待发送消息的编号更新所述令牌, 并将更新后的令牌传递给所 述令牌环中的下一个节点; 在将所述更新后的令牌传递给下一个节点之后, 将 所述编号过的消息发送到所述集群系统中的各节点。
9、 根据权利要求 8所述的集群系统, 其特征在于, 所述每个节点具体用于 接收所述令牌环中的上一个节点传递来的令牌, 根据所述令牌中包含的所述令 牌环中节点发送消息个数的上限值, 在消息发送队列中确定本次待发送的消息, 根据所述令牌中包含的所述令牌环已发送消息的最大编号, 从所述最大编号起 依次递增给所述确定的本次待发送的消息进行编号; 以及根据所述待发送消息 的编号更新所述令牌, 并将更新后的令牌传递给所述令牌环中的下一个节点; 在将所述更新后的令牌传递给下一个节点之后, 将所述编号过的消息发送到所 述集群系统中的各节点。
PCT/CN2012/084188 2012-03-28 2012-11-07 流量控制方法、装置和集群系统 WO2013143285A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210086301.1A CN102647323B (zh) 2012-03-28 2012-03-28 流量控制方法、装置和集群系统
CN201210086301.1 2012-03-28

Publications (1)

Publication Number Publication Date
WO2013143285A1 true WO2013143285A1 (zh) 2013-10-03

Family

ID=46659908

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/084188 WO2013143285A1 (zh) 2012-03-28 2012-11-07 流量控制方法、装置和集群系统

Country Status (2)

Country Link
CN (1) CN102647323B (zh)
WO (1) WO2013143285A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017162059A1 (zh) * 2016-03-23 2017-09-28 阿里巴巴集团控股有限公司 消息管理方法及装置、消息预读方法及装置
CN109150746A (zh) * 2018-07-06 2019-01-04 苏宁易购集团股份有限公司 一种全局流控方法及装置
EP3629524A1 (en) * 2018-09-25 2020-04-01 Siemens Schweiz AG Method and network node for communicating over a token passing network

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647323B (zh) * 2012-03-28 2015-01-07 华为技术有限公司 流量控制方法、装置和集群系统
CN105991463B (zh) * 2015-02-13 2020-12-25 创新先进技术有限公司 实现流量控制的方法、消息主节点、令牌服务器及系统
CN106559458A (zh) * 2015-09-30 2017-04-05 中兴通讯股份有限公司 异构集群的通讯优化方法及装置
CN107276774B (zh) * 2016-04-08 2020-07-24 华为技术有限公司 一种组播报文传输方法以及转发设备
CN107528678B (zh) * 2016-06-22 2021-10-29 大唐移动通信设备有限公司 一种系统消息更新的方法和设备
EP3402293A1 (en) * 2017-05-12 2018-11-14 R3 - Reliable Realtime Radio Communications GmbH Wireless token ring system mobility
CN107181626B (zh) * 2017-07-18 2020-05-26 苏州浪潮智能科技有限公司 分布式存储集群系统网络带宽监测方法及系统
CN113824796B (zh) * 2021-10-22 2023-06-30 杭州宏杉科技股份有限公司 令牌传递方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671116A (zh) * 2004-03-19 2005-09-21 富士通株式会社 在通信网络中令牌控制的数据传输
CN102291309A (zh) * 2011-08-26 2011-12-21 华为技术有限公司 一种基于令牌环的网络流量控制方法、节点及系统
CN102647323A (zh) * 2012-03-28 2012-08-22 华为技术有限公司 流量控制方法、装置和集群系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242564A (zh) * 2007-02-05 2008-08-13 田蕊 移动无线自组网消息广播和接收的方法及所用终端节点
CN102118269A (zh) * 2011-02-28 2011-07-06 华为技术有限公司 一种令牌发放方法和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671116A (zh) * 2004-03-19 2005-09-21 富士通株式会社 在通信网络中令牌控制的数据传输
CN102291309A (zh) * 2011-08-26 2011-12-21 华为技术有限公司 一种基于令牌环的网络流量控制方法、节点及系统
CN102647323A (zh) * 2012-03-28 2012-08-22 华为技术有限公司 流量控制方法、装置和集群系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017162059A1 (zh) * 2016-03-23 2017-09-28 阿里巴巴集团控股有限公司 消息管理方法及装置、消息预读方法及装置
US11165740B2 (en) 2016-03-23 2021-11-02 Alibaba Group Holding Limited Message sending method and terminal device
CN109150746A (zh) * 2018-07-06 2019-01-04 苏宁易购集团股份有限公司 一种全局流控方法及装置
CN109150746B (zh) * 2018-07-06 2022-08-30 南京星云数字技术有限公司 一种全局流控方法及装置
EP3629524A1 (en) * 2018-09-25 2020-04-01 Siemens Schweiz AG Method and network node for communicating over a token passing network

Also Published As

Publication number Publication date
CN102647323B (zh) 2015-01-07
CN102647323A (zh) 2012-08-22

Similar Documents

Publication Publication Date Title
WO2013143285A1 (zh) 流量控制方法、装置和集群系统
CN102197627B (zh) 组播流量收敛的改善
CN103944828B (zh) 一种协议报文的传输方法和设备
JP2008545356A5 (zh)
CN105684382A (zh) 报文的控制方法、交换机及控制器
JP2010122848A (ja) バリア同期装置、バリア同期処理システム及び方法、リダクション演算装置、リダクション演算処理システム及び方法
JP2016005247A (ja) ネットワーク伝送システム、そのマスタノード、スレーブノード
JP2006173785A (ja) ループ検出方法及び装置
CN101945031B (zh) 一种高速现场总线从站相互通信的实现方法
WO2016045056A1 (zh) 交换机及业务请求报文的处理方法
US8848739B2 (en) Efficient switch fabric bandwidth distribution
CN106411741B (zh) 介质访问控制mac地址学习方法、控制器及交换设备
Kamali et al. Formal analysis of proactive, distributed routing
CN106789723A (zh) 多核网络转发限速的方法和装置
WO2015192483A1 (zh) 一种路由节点、路由交换方法、系统及计算机存储介质
CN102546399A (zh) 一种智能变电站过程层报文线性处理架构及其处理方法
CN106372013B (zh) 远程内存访问方法、装置和系统
WO2016101490A1 (zh) 更新处理方法及装置
WO2012103704A1 (zh) 组播复制方法、装置及系统
CN104615101B (zh) 一种舞台多维系统同步控制方法
CN114422453A (zh) 一种在线规划时间敏感流的方法、装置及存储介质
US20140089529A1 (en) Management Data Input/Output Protocol With Page Write Extension
CN103873386A (zh) 管理网络传输顺序的方法
CN103812633B (zh) 工业以太网控制系统及其网络诱导延时计算方法
CN114070714B (zh) 一种网络设备配置问题的解决方案信息确定方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12872588

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12872588

Country of ref document: EP

Kind code of ref document: A1