CN109150753B - Message distribution method and device - Google Patents
Message distribution method and device Download PDFInfo
- Publication number
- CN109150753B CN109150753B CN201810866203.7A CN201810866203A CN109150753B CN 109150753 B CN109150753 B CN 109150753B CN 201810866203 A CN201810866203 A CN 201810866203A CN 109150753 B CN109150753 B CN 109150753B
- Authority
- CN
- China
- Prior art keywords
- queue
- message
- messages
- sub
- vnf
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosure relates to a message distribution method and a device, comprising obtaining a first message of a queue to be distributed; after the first message is added into a first queue in an available state, if the number of the messages in the first queue is a specified number, determining a current VNF corresponding to a current message currently being processed in the first queue, wherein in the available state, all the messages distributed to the first queue can be added into the first queue; and reserving the messages of the current VNF in the first queue for processing, and performing queue allocation again for the messages of the VNFs except the current VNF in the first queue. By keeping the messages of the VNF causing the blocking of the first queue in the first queue for processing and reallocating the messages of the other VNFs to the other queues for processing, the message distribution method and the message distribution device according to the embodiments of the present disclosure can reduce the range of the abnormal influence and improve the fault tolerance of the message queue.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for distributing messages.
Background
The VNF (Virtualization Network Function node) manager is NFV (Network Function Virtualization) deployment, configuration, and management software conforming to ETSI (European Telecommunications Standards Institute) specifications, and can manage a plurality of physical servers, flexibly calculate required resources according to user service requirements, complete creation and deployment of a VNF, and send required initial configuration to the VNF, so as to ensure that a management platform can remotely manage the VNF after the VNF is started. The VNF manager is a message hub of the management platform and the VNF, and is responsible for distributing all VNF messages.
The VNF manager and the VNF are in a complex and variable environment, the response speed of information by different VNFs is different, and the number of VNFs to be hung by the VNF manager may be huge. The VNF manager realizes the distribution of the messages by introducing the message queues, and achieves the purpose of stably and efficiently managing the VNF.
In the related art, a fixed number of message queues may be maintained, and a hash value of an IP address of each VNF is modulo-operated to determine a message queue number corresponding to the VNF, so that messages of each VNF are distributed to a corresponding message queue. Messages belonging to the same queue are processed in sequence, and when the processing of the preamble message is slow (including the situations of network blockage or VNF abnormity and the like), all the subsequent messages in the queue can be blocked, so that the fault tolerance is poor.
Disclosure of Invention
In view of this, the present disclosure provides a message distribution method and device, which can improve the fault tolerance of a message queue.
According to a first aspect of the present disclosure, there is provided a message distribution method, including: acquiring a first message of a queue to be distributed; after the first message is added into a first queue in an available state, if the number of messages in the first queue is a specified number, determining a current virtual network function node (VNF) corresponding to a current message currently being processed in the first queue, wherein in the available state, all messages distributed to the first queue can be added into the first queue; and reserving the messages of the current VNF in the first queue for processing, and performing queue allocation again for the messages of the VNFs except the current VNF in the first queue.
According to a second aspect of the present disclosure, there is provided a message distribution apparatus including: the message acquisition module is used for acquiring a first message of a queue to be distributed; a VNF determining module, configured to determine, after the first message is added to a first queue in an available state, a current virtualized network function node VNF corresponding to a current message currently being processed in the first queue if the number of messages in the first queue is a specified number, where, in the available state, all messages allocated to the first queue can be added to the first queue; a message allocating module, configured to reserve the message of the current VNF in the first queue for processing, and re-allocate the queue for the messages of the VNFs other than the current VNF in the first queue.
According to a third aspect of the present disclosure, there is provided a message distribution apparatus including: a processor; a machine-readable storage medium for storing processor-executable instructions; wherein the processor is configured to perform the method of the first aspect.
According to a fourth aspect of the present disclosure there is provided a machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of the first aspect described above.
In this embodiment of the present disclosure, after a first message is added to a first queue in an available state, if the number of messages in the first queue is a specified number, a current VNF corresponding to a current message being processed in the first queue is determined, the message of the current VNF in the first queue is retained in the first queue for processing, and queue allocation is performed again for messages of VNFs other than the current VNF in the first queue, so that a message of a VNF that causes a first queue to be blocked is retained in the first queue for processing, and messages of other VNFs are reallocated to other queues for processing, which can reduce the influence of the current VNF that has an abnormality on other queues and the influence on messages of other VNFs in the same queue, and can effectively reduce an abnormal influence range and improve the fault tolerance of a message queue.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 2 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 3 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 4 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 5 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 6 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 7 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 8 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
FIG. 9 illustrates an exemplary queue splitting diagram in accordance with embodiments of the disclosure.
Fig. 10 shows a flow chart of a message distribution method according to an embodiment of the present disclosure.
Fig. 11 shows a block diagram of a message distribution apparatus according to an embodiment of the present disclosure.
Fig. 12 shows a block diagram of a message distribution apparatus according to an embodiment of the present disclosure.
Fig. 13 is a block diagram illustrating an apparatus for message distribution according to an example embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. The method may be applied to a VNF manager. As shown in fig. 1, the message distribution method may include:
step S101, a first message of a queue to be distributed is obtained.
The VNF manager is a message hub of the management platform and the VNF. The queue may be used to cache messages sent by the VNF manager to the VNF. The VNF manager may hang a large number of VNFs, and may allocate a queue to messages of each VNF, and each queue sequentially processes the messages in the queue according to an order in which the messages enter the queue.
The virtualized network function node VNF in the present disclosure may include any one or more of a Virtual machine VM (Virtual machine), a Virtual Router (Virtual Services Router), a Virtual Switch (Virtual Switch), and a Virtual Security Gateway VSG ((Virtual _ Security _ Gateway). although the VNF may be other virtualized network function nodes, which are given here by way of example and not by way of limitation.
Step S102, after the first message is added to a first queue in an available state, if the number of messages in the first queue is a specified number, determining a current VNF corresponding to a current message currently being processed in the first queue, where in the available state, all messages allocated to the first queue can be added to the first queue. The first queue may be used to represent a queue allocated by the VNF manager for the first message. When the first queue is available, messages assigned to the first queue can all be added to the first queue. That is, when the VNF manager allocates the first message to the first queue, the first message may join the first queue if the first queue is available.
The number of messages that can be added to the first queue is limited, and in the embodiment of the disclosure, the specified number corresponding to the first queue is used to determine whether the first queue is blocked; when the number of messages in the first queue reaches a specified number, it may be determined that the first queue is blocked; when the number of messages in the first queue does not reach the specified number, it may be determined that the first queue is not blocked. Wherein the specified number can be determined as desired. In one example, the specified number corresponding to the first queue may be a maximum capacity of the first queue, i.e., a number of messages that the first queue is capable of joining at most.
In a possible implementation manner, after the first message is added to the first queue in the available state, the VNF manager may determine whether the number of messages in the first queue is a specified number, and when the number of messages in the first queue is the specified number, obtain a current VNF corresponding to a current message currently being processed in the first queue.
Wherein the current message of the first queue may represent a message currently being processed in the first queue when the VNF manager determines that the number of messages in the first queue is the specified number. The current VNF of the first queue may represent a VNF to which the current message of the first queue corresponds. Messages in the same queue are processed according to the sequence of entering the queue, and when the preamble message is processed slowly, all subsequent messages in the queue are blocked, so that the subsequent messages in the queue cannot be processed. Because the current message in the first queue is the top-ranked message in the first queue, the first queue is blocked because the current message is processed more slowly.
Step S103, retaining the message of the current VNF in the first queue for processing, and performing queue allocation again for the messages of VNFs other than the current VNF in the first queue.
When an abnormality occurs in the current VNF (including network congestion or the VNF being abnormal), the current message may be processed slowly, so that the first queue may be blocked. In this case, messages of the current VNF may be processed slowly, and the messages may also cause queue blocking in other queues. Therefore, in the embodiment of the present disclosure, the VNF manager may keep the message of the current VNF in the first queue for processing, so as to reduce the influence on other queues and reduce the abnormal influence range. Meanwhile, in the embodiment of the present disclosure, the VNF manager may re-allocate the queues for the messages of the VNFs other than the current VNF in the first queue, so as to avoid the message of the current VNF from blocking the messages of the other VNFs, reduce the influence on the messages of the other VNFs, and reduce the abnormal influence range.
In the embodiment of the present disclosure, by still retaining the message of the current VNF that causes the first queue to be blocked in the first queue for processing, and reallocating the messages of the other VNFs to the other queues for processing, the influence of the abnormal message of the current VNF on the other queues and the influence of the abnormal message of the other VNFs in the same queue can be reduced, so that the abnormal influence range is reduced, and the fault tolerance of the message queue is improved.
Fig. 2 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 2, the method may further include:
step S104, when it is determined that the number of messages in the first queue is a specified number, setting the state of the first queue to an abnormal state, where in the abnormal state, the messages of the current VNF in the messages allocated to the first queue can be added to the first queue, and the messages of VNFs other than the current VNF cannot be added to the first queue.
The number of messages in the first queue is a specified number, which indicates that the first queue is blocked and the current VNF is abnormal. When the first queue is in an abnormal state, messages of a current VNF in the messages distributed to the first queue can be added to the first queue, and messages of VNFs except the current VNF cannot be added to the first queue. Therefore, when determining that the number of messages in the first queue is the designated number, the VNF manager may set the state of the first queue to an abnormal state, so that the first queue may not join messages of VNFs other than the current VNF, thereby achieving the purpose of isolating messages of abnormal VNFs.
In addition, when the current VNF is abnormal, the VNF manager keeps the messages of the current VNF in the first queue for processing, and allows the messages of the current VNF allocated to the first queue to join the first queue, so that the ordering of the messages of the abnormal VNF (including the messages of the newly joined current VNF and the messages of the current VNF existing in the first queue) can be ensured.
Fig. 3 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 3, the method may further include:
step S105, after the message in the first queue in the abnormal state is processed, setting the state of the first queue to an initial state, where in the initial state, none of the messages allocated to the first queue can join the first queue.
The first queue in the abnormal state can be used to process the message of the current VNF, and the completion of the message processing in the first queue in the abnormal state indicates that the message processing of the current VNF is completed, and at this time, the first queue is not required to be continuously used for isolating the message of the current VNF. Thus, after the processing of the message in the first queue in the abnormal state is completed, the VNF manager may set the state of the first queue to an initial state for subsequent use.
Fig. 4 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 4, after acquiring the first message of the queue to be allocated in step S101, the method may further include:
step S106, determining the first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues.
When acquiring the first message of the queue to be allocated, the VNF manager needs to allocate the queue for processing the first message. In this embodiment of the disclosure, the VNF manager may determine the first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues.
In one possible implementation, the message of the VNF may be stored in a queue in a key-value (key-value) form, and the sequence number N of the first queue of the message may be calculated using the formula N ═ key% slot _ num. The key is a hash value of the IP address of the VNF, and may be recorded as key hash (IP), value is a message of the VNF, slot _ num is the number of the current queue, and% represents a modulo operation. The VNF manager may determine, according to the IP address of the VNF corresponding to the first message and the number of the current queues, a sequence number of the first queue of the first message through the above formula, and further determine the first queue of the first message.
In one example, assuming that the key of the first message is 5 and the number of current queues, slot _ num, is 4 (including queue 0, queue 1, queue 2, and queue 3), then according to the formula N ═ key% slot _ num, it may be determined that the need of the first queue is 5% 4 ═ 1, which means that queue 1 is the first queue.
Step S107, when the first queue is in an available state, adding the first message into the first queue.
Since all messages can be added to the first queue in the available state, the VNF manager may add the first message to the first queue while the first queue is in the available state.
In the embodiment of the disclosure, when no abnormal condition occurs, before the first message is added to the first queue, compared with a static queue in the related art, only one state judgment is added, and the high efficiency can be ensured.
Fig. 5 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 5, after determining the first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues in step S106, the method may further include:
step S108, when the first queue is in an abnormal state and the current message of the first queue and the first message correspond to the same VNF, adding the first message into the first queue.
Since messages corresponding to the same VNF as the current message can be added to the first queue when the first queue is in an abnormal state, and messages corresponding to a different VNF from the current message cannot be added to the first queue, the VNF manager may add the first message to the first queue when the first queue is in an abnormal state and the current message of the first queue corresponds to the same VNF as the first message.
When the first queue is in an abnormal state, the first queue is blocked, the current message of the first queue and the first message correspond to the same VNF, the first message is a message of an abnormal VNF, and the VNF manager adds the first message into the first queue, so that the message of the abnormal VNF can be isolated, and the abnormal influence range is reduced.
Fig. 6 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 6, after determining the first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues in step S106, the method may further include:
step S109, when the first queue is in an abnormal state and the current message of the first queue and the first message correspond to different VNFs, or when the first queue is in an initial state, searching a second queue of the first message in a circular sub-queue of the first queue, where a difference between a sequence number of the first queue and a sequence number of the circular sub-queue is the number of the initial queues.
Step S110, adding the first message into the second queue.
The second queue may represent one of the circular sub-queues of the first queue to which the first message can join. And the difference value between the sequence number of the circulation sub-queue of the first queue and the sequence number of the first queue is the number of the initial queues. In one example, assuming that the number init _ slot _ num of the initial queue is 4 and the sequence number of the first queue is 6, the queue with sequence number 2 and the queue with sequence number 10 may both be referred to as a circular sub-queue of the first queue, and the second queue is one queue into which the first message in the two queues can join.
When the first queue is in an abnormal state and a current message of the first queue and the first message correspond to different VNFs, the first message cannot be added into the first queue. The first message may not be able to join the first queue when the first queue is in the initial state. At this time, the VNF manager may look up the second queue of the first message in the circular sub-queue of the first queue, and add the first message to the second queue after finding the second queue.
In one possible implementation, searching for the second queue of the first message in the circular sub-queue of the first queue includes:
searching an abnormal sub-queue in a circular sub-queue of the first queue, wherein the abnormal sub-queue is in an abnormal state, and the current message of the abnormal sub-queue and the first message correspond to the same VNF; if the abnormal sub-queue is found in the circular sub-queue of the first queue, determining the abnormal sub-queue as the second queue;
if the abnormal sub-queue is not found in the circular sub-queue of the first queue, searching an available sub-queue in the circular sub-queue of the first queue, wherein the available sub-queue is a circular sub-queue in an available state; if the available sub-queue is found in the circular sub-queue of the first queue, determining the first found available sub-queue as the second queue; if the available sub-queue is not found in the circular sub-queue of the first queue, finding an initial sub-queue in the circular sub-queue of the first queue, wherein the initial sub-queue is in an initial state; and setting the state of the first found initial sub-queue as an available state and determining the initial sub-queue as the second queue.
The abnormal sub-queue is a circular sub-queue in an abnormal state, and the current message of the abnormal sub-queue and the first message correspond to the same VNF. When the current message of the abnormal subqueue corresponds to the same VNF as the first message, it indicates that the first message is a message of an abnormal VNF, and adding the first message to the abnormal subqueue can isolate the message of the abnormal VNF, thereby reducing the influence range.
The available sub-queue is a circular sub-queue that is in an available state. When the abnormal sub-queue meeting the condition is not found, the first message is indicated to be a message of a normal VNF, and at this time, the VNF manager may add the first message to the available sub-queue.
The initial sub-queue is a circular sub-queue in an initial state. When the available sub-queue is not found, indicating that the first message cannot join the enabled circular sub-queue, the VNF manager may set a state in which the first message is joined to the first found initial sub-queue to an available state, so as to join the first message to the circular sub-queue. Referring to step S105, after the message processing in the queue in the abnormal state is completed, the state of the queue changes to the initial state. Referring to the subsequent step S112, when the queue split is triggered, the state of the newly generated queue is the initial state.
It should be noted that before triggering a new queue split, the first queues of different messages (including the message for first queue assignment and the message for second queue assignment) corresponding to the same VNF are the same, the circular sub-queues are the same, and the second queues are the same, so that the ordering of different messages of the same VNF can be ensured.
Fig. 7 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 7, the method may further include:
step S111, if the second queue does not exist in the circular sub-queue of the first queue, triggering queue splitting.
When the second queue does not exist in the circular sub-queue of the first queue, it indicates that there is no queue to which the first message can be added currently, and in order to perform normal processing on the first message, the VNF manager may generate a new queue by triggering queue splitting, so as to add the first message to the newly generated queue for processing.
Fig. 8 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 8, the method may further include:
step S112, when the queue splitting is triggered, a corresponding child queue is generated for each existing queue splitting, each existing queue and the corresponding child queue are circular child queues, and a default state of the child queue generated by splitting is set as an initial state.
In one example, assume that prior to triggering a queue split, the existing queue includes queue 0 and queue 1. When the queue split is triggered, a child queue is generated for queue 0 and is recorded as queue 2, and a child queue is generated for queue 1 and is recorded as queue 3. Queue 0 and queue 2 are each a round robin subqueue, and queue 1 and queue 3 are each a round robin subqueue. The default states of queue 2 and queue 3 are set to the initial states.
Application example
FIG. 9 illustrates an exemplary queue splitting diagram in accordance with embodiments of the disclosure. As shown in fig. 9, before the queue split is triggered, the number slot _ num of the current queue is 4, and the existing queues include queue 0, queue 1, queue 2, and queue 3. After the queue splitting is triggered, the number slot _ num of the current queue is 8, and the existing queues include queue 0, queue 1, queue 2, queue 3, queue 4, queue 5, queue 6 and queue 7. There are 3 messages in queue 0, which are a key-20 message, a key-12 message, and a key-12 message in sequence. If the number of messages in queue 0 is found to be greater than the specified number after the message with key 20 is added in queue 0, then queue 0 is set to be in an abnormal state. At this time, the message being processed in the queue 0 is a message with a key of 20, the VNF manager performs queue allocation again for messages with keys not of 20, and when an available queue cannot be found, triggers splitting, and performs queue allocation again for two messages with keys of 12 after splitting. When re-allocating, the number of queues slot _ num is 4 × 2 — 8, and the new first queue has a sequence number N of 12% 8 — 4. Thus, queue 0 is isolated, effectively controlling the range of influence of the key 20 message.
In addition, according to the message distribution method disclosed by the embodiment of the disclosure, by triggering queue splitting, 50% of messages can directly hit a newly generated queue, and then the newly generated queue is added, so that the processing efficiency can be further improved.
For example, as shown in fig. 9, it is assumed that the number of slots _ num of the current queue is 4 before the queue split is triggered, and the existing queues include queue 0, queue 1, queue 2, and queue 3. After the queue splitting is triggered, the number slot _ num of the current queue is 8, and the existing queues include queue 0, queue 1, queue 2, queue 3, queue 4, queue 5, queue 6 and queue 7.
Assume that the key of the message n is the n-1 power of 4, and the key of the message 1 is 4, the key of the message 2 is 8, the key of the message 3 is 12, and the key of the message 4 is 16. Before the split is triggered, the sequence number N of the first queue of message 1 is 4% 0, the sequence number N of the first queue of message 2 is 8% 4% 0, the sequence number N of the first queue of message 3 is 12% 4% 0, and the sequence number N of the first queue of message 4 is 16% 4 0. After the message with the key-20 is added into the queue with the sequence number of 0, and the number of the messages in the queue is the specified number, the messages (such as message 1, message 2, message 3 and message 4) except the message with the key-20 in the queue with the sequence number of 0 are re-allocated. If no available queues can be found for these messages at this time, queue allocation is triggered. After the split is triggered, the sequence number N of the first queue of message 1 is 4% 8% 4, the sequence number N of the first queue of message 2 is 8% 0, the sequence number N of the first queue of message 3 is 12% 8% 4, and the sequence number N of the first queue of message 4 is 16% 8 0. It can be seen that message 1 and message 3 can hit the newly generated queue 4 directly, and message 2 and message 4 will hit the original queue 0. By analogy, it can be determined that 50% of messages can directly hit the newly generated queue by triggering queue splitting, and then the newly generated queue is added, so that the processing efficiency is further improved.
Fig. 10 shows a flow chart of a message distribution method according to an embodiment of the present disclosure. As shown in fig. 10, in step S103, the step of retaining the message of the current VNF in the first queue for processing, and performing queue reallocation for the messages of VNFs other than the current VNF in the first queue includes:
step S1031, retaining the message of the current VNF in the first queue for processing, and taking the message of the VNF other than the current VNF in the first queue as a first message.
After step S1031, the VNF may acquire, through step S101, messages of VNFs other than the current VNF in the first queue, and perform queue allocation on the messages of the VNFs other than the current VNF in the first queue through one of the message distribution methods shown in fig. 1 to fig. 7.
In this embodiment of the present disclosure, when the VNF manager re-allocates queues for messages of VNFs other than the current VNF in the first queue in step S103, the messages may be allocated as the first message. The VNF manager re-queues the message in the same way as it queues the message for the first time. After the VNF manager takes the message of the VNF other than the current VNF in the first queue as the first message, the VNF manager may perform step S101.
Fig. 11 shows a block diagram of a message distribution apparatus according to an embodiment of the present disclosure. As shown in fig. 11, the apparatus 200 may include:
a message obtaining module 201, configured to obtain a first message of a queue to be allocated;
a VNF determining module 202, configured to determine, after the first message is added to a first queue in an available state, if the number of messages in the first queue is a specified number, a current virtualized network function node VNF corresponding to a current message currently being processed in the first queue, where in the available state, all messages allocated to the first queue can be added to the first queue;
a message allocating module 203, configured to reserve the message of the current VNF in the first queue for processing, and perform queue allocation again for the messages of VNFs other than the current VNF in the first queue.
Fig. 12 shows a block diagram of a message distribution apparatus according to an embodiment of the present disclosure. As shown in fig. 12, in a possible implementation, the apparatus 200 further includes:
a first state setting module 204, configured to set, when it is determined that the number of messages in the first queue is a specified number, a state of the first queue to an abnormal state, where in the abnormal state, a message of the current VNF can be added to the first queue in the messages allocated to the first queue, and a message of a VNF other than the current VNF cannot be added to the first queue.
In one possible implementation, the apparatus 200 further includes:
a second state setting module 205, configured to set, after the message in the first queue in the abnormal state is processed, the state of the first queue to an initial state, where in the initial state, none of the messages allocated to the first queue can be added to the first queue.
In one possible implementation, the apparatus 200 further includes:
a queue determining module 206, configured to determine a first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues;
a first message adding module 207, configured to add the first message to the first queue when the first queue is in an available state.
In one possible implementation, the apparatus 200 further includes:
a second message adding module 208, configured to add the first message to the first queue when the first queue is in an abnormal state and a current message of the first queue corresponds to the same VNF as the first message.
In one possible implementation, the apparatus 200 further includes:
a queue searching module 209, configured to search a second queue of the first message in a circular sub-queue of the first queue when the first queue is in an abnormal state and a current message of the first queue and the first message correspond to different VNFs, or when the first queue is in an initial state, where a difference between a sequence number of the first queue and a sequence number of the circular sub-queue is the number of the initial queues;
a third message adding module 210, configured to add the first message to the second queue.
In one possible implementation, the apparatus 200 further includes:
a trigger splitting module 211, configured to trigger a queue splitting if the second queue does not exist in the circular sub-queue of the first queue.
In one possible implementation, the apparatus 200 further includes:
the queue splitting module 212 is configured to, when the queue splitting is triggered, split each existing queue to generate a corresponding child queue, where each existing queue and the corresponding child queue are circular child queues, and a default state of the child queue generated by splitting is set to be an initial state.
In one possible implementation, the queue lookup module 2019 is further configured to:
searching an abnormal sub-queue in a circular sub-queue of the first queue, wherein the abnormal sub-queue is in an abnormal state, and the current message of the abnormal sub-queue and the first message correspond to the same VNF;
if the abnormal sub-queue is found in the circular sub-queue of the first queue, determining the abnormal sub-queue as the second queue;
if the abnormal sub-queue is not found in the circular sub-queue of the first queue, searching an available sub-queue in the circular sub-queue of the first queue, wherein the available sub-queue is a circular sub-queue in an available state;
if the available sub-queue is found in the circular sub-queue of the first queue, determining the first found available sub-queue as the second queue;
if the available sub-queue is not found in the circular sub-queue of the first queue, finding an initial sub-queue in the circular sub-queue of the first queue, wherein the initial sub-queue is in an initial state;
and setting the state of the first found initial sub-queue as an available state and determining the initial sub-queue as the second queue.
In a possible implementation manner, the first message includes a message for performing queue allocation for the first time and/or a message for performing queue allocation again.
In this embodiment of the present disclosure, after a first message is added to a first queue in an available state, if the number of messages in the first queue is a specified number, a current VNF corresponding to a current message being processed in the first queue is determined, the message of the current VNF in the first queue is retained in the first queue for processing, and queue allocation is performed again for messages of VNFs other than the current VNF in the first queue, so that a message of a VNF that causes a first queue to be blocked is retained in the first queue for processing, and messages of other VNFs are reallocated to other queues for processing, which can reduce the influence of the current VNF that has an abnormality on other queues and the influence on messages of other VNFs in the same queue, and can effectively reduce an abnormal influence range and improve the fault tolerance of a message queue.
Fig. 13 is a block diagram illustrating an apparatus 900 for message distribution according to an example embodiment. Referring to fig. 13, the apparatus 900 may include a processor 901, a machine-readable storage medium 902 having stored thereon machine-executable instructions. The processor 901 and the machine-readable storage medium 902 may communicate via a system bus 903. Also, the processor 901 performs the message distribution method described above by reading machine-executable instructions in the machine-readable storage medium 902 corresponding to the message distribution logic.
The machine-readable storage medium 902 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (12)
1. A method of message distribution, the method comprising:
acquiring a first message of a queue to be distributed;
after the first message is added into a first queue in an available state, if the number of messages in the first queue is a specified number, determining a current virtual network function node (VNF) corresponding to a current message currently being processed in the first queue, wherein in the available state, all messages distributed to the first queue can be added into the first queue;
and reserving the messages of the current VNF in the first queue for processing, and performing queue allocation again for the messages of the VNFs except the current VNF in the first queue.
2. The method of claim 1, further comprising:
and when the number of the messages in the first queue is determined to be a designated number, setting the state of the first queue to be an abnormal state, wherein in the abnormal state, the messages of the current VNF in the messages distributed to the first queue can be added into the first queue, and the messages of VNFs except the current VNF cannot be added into the first queue.
3. The method of claim 1, further comprising:
after the message processing in the first queue in the abnormal state is completed, setting the state of the first queue to an initial state, wherein in the initial state, none of the messages allocated to the first queue can be added to the first queue, in the abnormal state, none of the messages allocated to the first queue can be added to the first queue, and the messages of the VNFs other than the current VNF can not be added to the first queue.
4. The method of claim 1, wherein after obtaining the first message of the queue to be allocated, the method further comprises:
determining a first queue of the first message according to the IP address of the VNF corresponding to the first message and the number of current queues;
adding the first message to the first queue while the first queue is available.
5. The method of claim 4, wherein after determining the first queue of the first message, the method further comprises:
adding the first message into the first queue when the first queue is in an abnormal state and current messages of the first queue and the first message correspond to the same VNF, wherein in the abnormal state, messages of the current VNF in the messages distributed to the first queue can be added into the first queue, and messages of VNFs except the current VNF cannot be added into the first queue.
6. The method of claim 5, wherein after determining the first queue for the first message, the method further comprises:
when the first queue is in an abnormal state and the current message of the first queue and the first message correspond to different VNFs, or when the first queue is in an initial state, searching a second queue of the first message in a circular sub-queue of the first queue, wherein the difference value between the sequence number of the first queue and the sequence number of the circular sub-queue is the number of the initial queues, and in the initial state, no message distributed to the first queue can be added into the first queue;
adding the first message to the second queue.
7. The method of claim 6, further comprising:
and if the second queue does not exist in the circular sub-queue of the first queue, triggering queue splitting.
8. The method of claim 7, further comprising:
when the queue splitting is triggered, generating a corresponding child queue for each existing queue splitting, wherein each existing queue and the corresponding child queue are circular child queues, and the default state of the child queue generated by splitting is set to be the initial state.
9. The method of claim 8, wherein said looking up a second queue of the first message in a circular sub-queue of the first queue comprises:
searching an abnormal sub-queue in a circular sub-queue of the first queue, wherein the abnormal sub-queue is in an abnormal state, and the current message of the abnormal sub-queue and the first message correspond to the same VNF;
if the abnormal sub-queue is found in the circular sub-queue of the first queue, determining the abnormal sub-queue as the second queue;
if the abnormal sub-queue is not found in the circular sub-queue of the first queue, searching an available sub-queue in the circular sub-queue of the first queue, wherein the available sub-queue is a circular sub-queue in an available state;
if the available sub-queue is found in the circular sub-queue of the first queue, determining the first found available sub-queue as the second queue;
if the available sub-queue is not found in the circular sub-queue of the first queue, finding an initial sub-queue in the circular sub-queue of the first queue, wherein the initial sub-queue is in an initial state;
and setting the state of the first found initial sub-queue as an available state and determining the initial sub-queue as the second queue.
10. The method according to any one of claims 1 to 9, wherein the first message comprises a first queue assignment message and/or a second queue assignment message.
11. A message distribution apparatus, comprising:
a processor and a machine-readable storage medium having stored thereon machine-executable instructions, the processor executing the machine-executable instructions to implement the method of any one of claims 1 to 10.
12. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810866203.7A CN109150753B (en) | 2018-08-01 | 2018-08-01 | Message distribution method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810866203.7A CN109150753B (en) | 2018-08-01 | 2018-08-01 | Message distribution method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109150753A CN109150753A (en) | 2019-01-04 |
CN109150753B true CN109150753B (en) | 2022-04-22 |
Family
ID=64799607
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810866203.7A Active CN109150753B (en) | 2018-08-01 | 2018-08-01 | Message distribution method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109150753B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106851014A (en) * | 2017-03-10 | 2017-06-13 | 广东欧珀移动通信有限公司 | Adjust method, device and the terminal of broadcast message queue |
CN106878197A (en) * | 2017-02-22 | 2017-06-20 | 郑州云海信息技术有限公司 | A kind of management system and method for the transmission of cloud platform message |
CN108200134A (en) * | 2017-12-25 | 2018-06-22 | 腾讯科技(深圳)有限公司 | Request message management method and device, storage medium |
US10027605B2 (en) * | 2013-08-26 | 2018-07-17 | Vmware, Inc. | Traffic and load aware dynamic queue management |
CN108337116A (en) * | 2018-01-30 | 2018-07-27 | 新华三技术有限公司 | Message order-preserving method and device |
-
2018
- 2018-08-01 CN CN201810866203.7A patent/CN109150753B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10027605B2 (en) * | 2013-08-26 | 2018-07-17 | Vmware, Inc. | Traffic and load aware dynamic queue management |
CN106878197A (en) * | 2017-02-22 | 2017-06-20 | 郑州云海信息技术有限公司 | A kind of management system and method for the transmission of cloud platform message |
CN106851014A (en) * | 2017-03-10 | 2017-06-13 | 广东欧珀移动通信有限公司 | Adjust method, device and the terminal of broadcast message queue |
CN108200134A (en) * | 2017-12-25 | 2018-06-22 | 腾讯科技(深圳)有限公司 | Request message management method and device, storage medium |
CN108337116A (en) * | 2018-01-30 | 2018-07-27 | 新华三技术有限公司 | Message order-preserving method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109150753A (en) | 2019-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11960915B2 (en) | Method and apparatus for creating virtual machine based on parameter information of a virtual network interface card | |
US10686756B2 (en) | Method and apparatus for managing MAC address generation for virtualized environments | |
EP3800926B1 (en) | Alarm method and device | |
US11895577B2 (en) | Network slice selection method and apparatus | |
US9571374B2 (en) | Dynamically allocating compute nodes among cloud groups based on priority and policies | |
CN109684092B (en) | Resource allocation method and device | |
US9866450B2 (en) | Methods and apparatus related to management of unit-based virtual resources within a data center environment | |
US9465641B2 (en) | Selecting cloud computing resource based on fault tolerance and network efficiency | |
CN113037794B (en) | Method, device and system for computing resource allocation scheduling | |
CN108737224B (en) | Message processing method and device based on micro-service architecture | |
EP3905588A1 (en) | Cloud platform deployment method and apparatus, server and storage medium | |
EP3442201B1 (en) | Cloud platform construction method and cloud platform | |
CN109032533B (en) | Data storage method, device and equipment | |
US9792146B2 (en) | Iterative anti-collocation of network resources using prioritized graph coloring | |
US20180167326A1 (en) | Method and system for limiting data traffic | |
CN112424749A (en) | On-demand code execution with limited memory footprint | |
US10901637B2 (en) | Allocating storage system ports to virtual machines | |
CN109150753B (en) | Message distribution method and device | |
CN112015515B (en) | Instantiation method and device of virtual network function | |
CN107408058B (en) | Virtual resource deployment method, device and system | |
CN109933959B (en) | License control method and related equipment | |
US9417900B2 (en) | Method and system for automatic assignment and preservation of network configuration for a virtual machine | |
CN110300068B (en) | ARP resource management method and device and electronic equipment | |
US20210334001A1 (en) | Host-aware discovery and backup configuration for storage assets within a data protection environment | |
US20060089986A1 (en) | Method and system for processing concurrent events in a provisional network |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230616 Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd. Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466 Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd. |