CN105760235B - Message processing method and device - Google Patents
Message processing method and device Download PDFInfo
- Publication number
- CN105760235B CN105760235B CN201610168441.1A CN201610168441A CN105760235B CN 105760235 B CN105760235 B CN 105760235B CN 201610168441 A CN201610168441 A CN 201610168441A CN 105760235 B CN105760235 B CN 105760235B
- Authority
- CN
- China
- Prior art keywords
- core
- user group
- message
- group
- processed
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application provides a kind of message processing method and device, this method is applied on the network equipment including multi-core processor, at least one user group is answered in each verification of the multi-core processor, each user group is assigned corresponding weight by each core corresponding with the user group, comprising: receives at least one message;It determines the corresponding user group of each message, and each message is distributed to corresponding user group;The maximum user group of weight in the corresponding user group of the first core of the multi-core processor is determined as user group to be processed, and handles the message in the user group to be processed using first core.Therefore, the application is in multiple users share multi-core processor, each core of multi-core processor can handle the message of identical or different user group respectively according to the weight of corresponding user group, the accounting for more reasonably controlling each nuclear resource of user occupancy multi-core processor, can also improve the efficiency and reliability of Message processing.
Description
Technical field
This application involves network communication technology field more particularly to a kind of message processing methods and device.
Background technique
Virtualization is a kind of resource management techniques, is showed after the various actual resources of computer are abstracted, are converted
Come, breaks the not cleavable obstacle between entity structure, allow user than the configuration better way of script to apply these
Resource.
In the prior art, thread isolation can be carried out according to different user, for the specific ratio of each user thread distribution
The multi-core processor time of example, limits the size that memory can be used at the input/output time, provides equipment access control, allows every
A user thinks oneself exclusive whole system.Also, for the distribution and isolation for realizing multi-core processor, operating system needs are
Each user thread setting multi-core processor compatibility comes which multi-core processor regulation user can occupy.
But it is unable to control the accounting of each nuclear resource of user occupancy multi-core processor in the prior art, lead to not full
Demand of the sufficient user for virtual machine processing capacity.
Summary of the invention
The application provides a kind of message processing method and device, with more reasonable control user occupancy multi-core processor
The accounting of each nuclear resource.
According to the embodiment of the present application in a first aspect, provide a kind of message processing method,
The method is applied on the network equipment including multi-core processor, and each verification of the multi-core processor should be extremely
A few user group, each user group are assigned corresponding weight by each core corresponding with the user group, comprising:
Receive at least one message;
It determines the corresponding user group of each message, and each message is distributed to corresponding user group;
The maximum user group of weight in the corresponding user group of the first core of the multi-core processor is determined as use to be processed
Family group, and the message in the user group to be processed is handled using first core.
According to the second aspect of the embodiment of the present application, provide a kind of message process device, described device be applied to include
On the network equipment of multi-core processor, at least one user group, each user group quilt are answered in each verification of the multi-core processor
Each core corresponding with the user group is assigned corresponding weight, comprising:
Receiving unit, for receiving at least one message;
User group determination unit is distributed for determining the corresponding user group of each message, and by each message
To corresponding user group;
Message process unit, for the maximum user of weight in the corresponding user group of the first core by the multi-core processor
Group is determined as user group to be processed, and handles the message in the user group to be processed using first core.
Using the embodiment of the present application, by receiving at least one message;Determine the corresponding user group of each message, and will be each
A message is distributed to corresponding user group;The maximum user group of weight in the corresponding user group of the first core of multi-core processor is true
It is set to user group to be processed, and handles the message in user group to be processed using the first core, so that the network equipment is total in multi-user
When enjoying multi-core processor, each core of multi-core processor can handle identical or not respectively according to the weight of corresponding user group
With the message of user group, the accounting of each nuclear resource of user occupancy multi-core processor is more reasonably controlled, to improve report
The efficiency and reliability of text processing.
Detailed description of the invention
Fig. 1 is the application scenarios schematic diagram using the embodiment of the present application Message processing;
Fig. 2 is one embodiment flow chart of the application message processing method;
Fig. 3 is another embodiment flow chart of the application message processing method;
Fig. 4 is another embodiment flow chart of the application message processing method;
Fig. 5 is the schematic diagram of one of the application message processing method processing mode;
Fig. 6 is the schematic diagram of another processing mode in the application message processing method;
Fig. 7 is the schematic diagram of another processing mode in the application message processing method;
Fig. 8 is the schematic diagram of another processing mode in the application message processing method;
Fig. 9 is a kind of hardware structural diagram of equipment where the application message process device;
Figure 10 is one embodiment block diagram of the application message process device.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application.
It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority
Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application
A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from
In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination ".
Referring to Fig. 1, for the application scenarios schematic diagram of application the embodiment of the present application Message processing.The application scenarios include user
With the network equipment including multicore (core) processor.Wherein, each core and in multi-core processor corresponds at least one
User group (group), each group are assigned corresponding weight by each core.Wherein, weight can be timeslice.
In the embodiment of the present application, the network equipment can first determine that each user's message is corresponding when receiving user's message
User group, and each user's message is distributed to corresponding user group, then by the corresponding use of any core of multi-core processor
The maximum user group of weight is determined as the corresponding user group to be processed of any core in the group of family, finally utilizes any core processing pair
The message in user group to be processed answered.
Wherein, the processing message standard of each core of multi-core processor is all the corresponding use of priority processing itself all
Message in the group of family in the maximum user group of timeslice.
Therefore, the message processing method in the embodiment of the present application, can more rationally by the timeslice of each user group
Control user occupancy multi-core processor each nuclear resource accounting.
Message processing embodiment of the present invention is described in detail with reference to the accompanying drawing.
It referring to fig. 2, is one embodiment flow chart of the application message processing method, this method can be applied to include more
On the network equipment of core processor, at least one user group is answered in each verification of the multi-core processor, each user group by with this
The corresponding each core of user group is assigned corresponding weight, and the power that the user group is distributed by each core corresponding with the user group
It may be the same or different again.The message processing method may comprise steps of:
Step 210, at least one message is received.
Specifically, the received message of the network equipment can be the message that same user sends, and be also possible to different user hair
The message sent.
Step 220, it determines the corresponding user group of each message, and each message is distributed to corresponding user group.
Specifically, after receiving message, first the message can be parsed, obtain parsing result, which can
To include one of source IP address, source port, purpose IP address, destination port and transport layer protocol or a variety of.Such as: source IP
Address can be the IP address of user, can determine the message which user sends according to source IP address.
It, can be by institute if being matched to the corresponding user group of parsing result of message in preset user group matching list item
The user group being matched to is determined as the corresponding user group of the message.
Step 230, the maximum user group of weight in the corresponding user group of the first core of multi-core processor is determined as wait locate
User group is managed, and handles the message in user group to be processed using the first core.
Specifically, the first core also refers to any one core in multi-core processor.If the corresponding user group of the first core
The middle maximum user group of weight is one, the maximum user group of the weight can be determined directly as user group to be processed;If the
The maximum user group of weight is multiple in the corresponding user group of one core, can arbitrarily be chosen from the maximum user group of these weights
One is determined as user group to be processed.
In addition, for for multiple cores, can according to the maximum user group of weight in the corresponding user group of each core whether
The message amount that includes in the maximum user group of identical and weight determines user group to be processed, comprising:
From one user group of selection is determined as target user in the maximum user group of weight in the corresponding user group of the first core
Group.
It specifically, can be directly by the power if the maximum user group of weight is one in the corresponding user group of the first core
The maximum user group of weight is as targeted group;If the maximum user group of weight is multiple in the corresponding user group of the first core,
A user group can be selected as targeted group from the maximum user group of these weights.
When the corresponding targeted group of other cores that the corresponding targeted group of the first core is multi-core processor, and the first core
When the message amount for including in corresponding targeted group is not less than the sum of the first core and the quantity of other cores, then by the first verification
The targeted group answered is determined as user group to be processed.
Such as: multi-core processor include core 1, core 2 ..., core n.Wherein, the corresponding targeted group of core 1 is user group 1,
The corresponding targeted group of core 2 is also user group 1, in addition to the corresponding targeted group of other cores is not user to core 1 other than core 2
Group 1;Also, the message amount for including in user group 1 is not less than 2, shows the enough core 1 of the message amount for including in user group 1
It is handled simultaneously with core 2, user group 1 can be determined as to the user group to be processed of core 1 and core 2 at this time, is i.e. core 1 and core 2 can be with
Handle the different messages in user group 1 respectively simultaneously.
When the corresponding targeted group of other cores that the corresponding targeted group of the first core is multi-core processor, and the first core
When the message amount for including in corresponding targeted group is less than the sum of the first core and the quantity of other cores, if the first core with it is other
Core competes successfully, then the corresponding targeted group of the first core is determined as user group to be processed.
Such as: multi-core processor include core 1, core 2 ..., core n.Wherein, the corresponding targeted group of core 3 is user group 2,
The corresponding targeted group of core 4 is also user group 2, in addition to the corresponding targeted group of other cores is not user to core 3 other than core 4
Group 2;Also, the message amount for including in user group 2 shows inadequate 3 He of core of the message amount for including in user group 2 less than 2
Core 4 is handled simultaneously, and core 3 and core 4 is needed to be at war at this time, if core 3 compete successfully, by user group 2 be determined as core 3 wait locate
User group is managed, and handles the message in user group 2 using core 3;If core 4 compete successfully, by user group 2 be determined as core 3 to
User group is handled, and handles the message in user group 2 using core 4.
It needs to reaffirm after the Message processing it should be noted that each core only handles a message every time
Then user group to be processed handles the message in the user group to be processed reaffirmed.
As seen from the above-described embodiment, by receiving at least one message;Determine the corresponding user group of each message, and will be each
A message is distributed to corresponding user group;The maximum user group of weight in the corresponding user group of the first core of multi-core processor is true
It is set to user group to be processed, and handles the message in user group to be processed using the first core, so that the network equipment is total in multi-user
When enjoying multi-core processor, each core of multi-core processor can handle identical or not respectively according to the weight of corresponding user group
With the message of user group, the accounting of each nuclear resource of user occupancy multi-core processor is more reasonably controlled, to improve report
The efficiency and reliability of text processing.
Be another embodiment flow chart of the application message processing method referring to Fig. 3, this method can be applied to include
On the network equipment of multi-core processor, at least one user group is answered in each verification of the multi-core processor, and each user group is each
A core is assigned corresponding weight, may comprise steps of:
Step 310, at least one message is received.The step is identical as step 210, repeats no more herein.
Step 320, it determines the corresponding user group of each message, and each message is distributed to corresponding user group.The step
Suddenly identical as step 220, it repeats no more herein.
Step 330, the maximum user group of weight in the corresponding user group of the first core of multi-core processor is determined as wait locate
User group is managed, and handles the message in user group to be processed using the first core.The step is identical as step 230, herein no longer
It repeats.
Step 340, it examines and makes cuts to wait a little while,please using first and handles the weight of user group distributed by the first core.
Specifically, the corresponding each user group of the first core all has the weight distributed by the first core, and the maximum use of weight
Family group is user group to be processed, and after the message in the user group to be processed is processed, the first core can reduce this accordingly
The weight of user group to be processed, the user group for reducing weight may be still weight maximum in the corresponding each user group of the first core
User group, it is also possible to be not the maximum user group of weight in the corresponding each user group of the first core.
Step 350, when the weight of the corresponding each user group of the first core distributed by the first core is all zero, first is utilized
Core is that the corresponding each user group of the first core distributes preset weight respectively.
Specifically, the preset power of itself corresponding each user group can be arranged in the first core in advance according to the actual situation
Weight, can also according to the actual situation adjust each preset weight in real time.Wherein, each user group of the first core setting
Preset weight can be identical, can not also be identical.
As seen from the above-described embodiment, after handling the message in user group to be processed using the first core, it can use
One, which examines and makes cuts, waits a little while,please and handles the weight of user group distributed by the first core, and when the first core corresponding each user group is by the first core
When the weight of distribution is all zero, preset weight is distributed respectively for the corresponding each user group of the first core using the first core, so that
The network equipment after handling message, can also the weight of each user group corresponding to the first core adjusted in real time, to mention
The high practicability of Message processing.
Referring to fig. 4, be the application message processing method another embodiment flow chart, this method can be applied to include
On the network equipment of multi-core processor, at least one user group is answered in each verification of the multi-core processor, and each user group is each
A core is assigned corresponding timeslice, may comprise steps of:
Step 410, at least one message is received.The step is identical as step 210, repeats no more herein.
Step 420, it determines the corresponding user group of each message, and each message is distributed to corresponding user group.The step
Suddenly identical as step 220, it repeats no more herein.
Step 430, by the maximum user group of timeslice in the corresponding user group of the first core of multi-core processor be determined as to
User group is handled, and handles the message in user group to be processed using the first core.
It specifically, can be by the timeslice if the maximum user group of timeslice is one in the corresponding user group of the first core
Maximum user group is determined directly as user group to be processed;If the maximum user group of timeslice is in the corresponding user group of the first core
It is multiple, one can be arbitrarily chosen from the maximum user group of these timeslices be determined as user group to be processed.
In addition, can be according to the maximum user group of timeslice in the corresponding user group of each core for for multiple cores
The message amount for including in the maximum user group of no identical and timeslice determines user group to be processed, comprising: from the first core
A user group is selected to be determined as targeted group in the maximum user group of timeslice in corresponding user group.
Specifically, it if the maximum user group of timeslice is one in the corresponding user group of the first core, will can directly be somebody's turn to do
The maximum user group of timeslice is as targeted group;If the maximum user group of timeslice is more in the corresponding user group of the first core
It is a, then a user group can be selected as targeted group from the maximum user group of these timeslices.
When the corresponding targeted group of other cores that the corresponding targeted group of the first core is multi-core processor, and the first core
When the message amount for including in corresponding targeted group is not less than the sum of the first core and the quantity of other cores, then by the first verification
The targeted group answered is determined as user group to be processed.
When the corresponding targeted group of other cores that the corresponding targeted group of the first core is multi-core processor, and the first core
When the message amount for including in corresponding targeted group is less than the sum of the first core and the quantity of other cores, if the first core with it is other
Core competes successfully, then the corresponding targeted group of the first core is determined as user group to be processed.
It needs to reaffirm after the Message processing it should be noted that each core only handles a message every time
Then user group to be processed handles the message in the user group to be processed reaffirmed.
Such as: shown in Fig. 5, the first user group is that (first user group is not and except for the corresponding user group of the first core
Other verifications other than one core are answered), then the maximum use of timeslice in first user group or the corresponding user group of the first core
Family group can use the message in the first core the first user group of processing at this time.
For another example: as shown in fig. 6, second user group is both the corresponding user group of the second core and the corresponding use of third core
Family group (the second user group is not answered with other verifications in addition to the second core, third core), and, when second user group is only second
In the corresponding user group of core when the maximum user group of timeslice, the message in second user group can be handled by the second core;When
When two user groups are only the maximum user groups of timeslice in the corresponding user group of third core, second user can be handled by third core
Message in group;When second user group is both the maximum user group of timeslice and third core in the corresponding user group of the second core
It, can if the message amount in second user group is not less than two in corresponding user group when the maximum user group of timeslice
To handle the different messages in second user group respectively simultaneously by the second core and third core;If the message amount in second user group
Less than two, then the second core and third core is needed to be at war with, and utilizes the message for competing successful core processing second user group.
For another example: as shown in fig. 7, third user group and fourth user group are all the corresponding user group (thirds of the 4th core
User group and fourth user group are not answered with other verifications in addition to the 4th core), if third user group is the corresponding use of the 4th core
The maximum user group of timeslice in the group of family, and fourth user group is not the maximum user of timeslice in the corresponding user group of the 4th core
Group then can use the message in the 4th core processing third user group;Similarly, if fourth user group is the corresponding user of the 4th core
The maximum user group of timeslice in group, and third user group is not the maximum user of timeslice in the corresponding user group of the 4th core
Group then can use the message in the 4th core processing fourth user group;In addition, if third user group and fourth user group are all
The maximum user group of timeslice in the corresponding user group of four cores then can use the 4th core processing third user group and fourth user
The message of any one user group in group.
For another example: as shown in figure 8, the 5th user group and the 6th user group are both the corresponding user group of the 5th core and
The corresponding user group of six cores (the 5th user group and the 6th user group not with other verifications in addition to the 5th core, the 6th core
Answer), the process of message is handled, as shown in table 1.G5 in table 1 is the 5th user group, and G6 is the 6th user group, and C5 is the 5th
Core, C6 are the 6th core, and Rule of judgment one is sentenced for characterizing whether G5 is the maximum user group of timeslice in the corresponding user group of C5
Broken strip part two is for characterizing whether G5 is the maximum user group of timeslice in the corresponding user group of C6, and Rule of judgment three is for characterizing
Whether G6 is the maximum user group of timeslice in the corresponding user group of C5, and Rule of judgment four is for characterizing whether G6 is C6 corresponding
The maximum user group of timeslice in user group.
Table 1
In above-mentioned table 1:
Processing mode one includes: (1) when C5 selects G5 for itself corresponding targeted group, and the targeted group of C6 is
G6 can use the message in C5 processing G5 at this time, and utilize the message in C6 processing G6;(2) when C5 selects G6 right for itself
The targeted group answered, and the targeted group of C6 is also G6, if the message amount in G6 is not less than two, be can use at this time
C5 and C6 handles the different messages in G6 respectively simultaneously;(3) when C5 selects G6 for itself corresponding targeted group, and the mesh of C6
Marking user group is also G6, if the message amount in G6, less than two, and C5 compete successfully, can use C5 at this time and handles in G6
Message;(4) when C5 selects G6 for itself corresponding targeted group, and the targeted group of C6 is also G6, if the message in G6
Quantity is less than two, and C6 is competed successfully, can use the message in C6 processing G6 at this time.
Processing mode two includes: (1) when C6 selects G5 for itself corresponding targeted group, and the targeted group of C5 is
G6 can use the message in C6 processing G5 at this time, and utilize the message in C5 processing G6;(2) when C6 selects G6 right for itself
The targeted group answered, and the targeted group of C5 is also G6, if the message amount in G6 is not less than two, be can use at this time
C5 and C6 handles the different messages in G6 respectively simultaneously;(3) when C6 selects G6 for itself corresponding targeted group, and the mesh of C5
Marking user group is also G6, if the message amount in G6, less than two, and C5 compete successfully, can use C5 at this time and handles in G6
Message;(4) when C6 selects G6 for itself corresponding targeted group, and the targeted group of C5 is also G6, if the message in G6
Quantity is less than two, and C6 is competed successfully, can use the message in C6 processing G6 at this time.
Processing mode three includes: (1) when C5 selects G6 for itself corresponding targeted group, and the targeted group of C6 is
G5 can use the message in C5 processing G6 at this time, and utilize the message in C6 processing G5;(2) when C5 selects G5 right for itself
The targeted group answered, and the targeted group of C6 is also G5, if the message amount in G5 is not less than two, be can use at this time
C5 and C6 handles the different messages in G5 respectively simultaneously;(3) when C5 selects G5 for itself corresponding targeted group, and the mesh of C6
Marking user group is also G5, if the message amount in G5, less than two, and C5 compete successfully, can use C5 at this time and handles in G5
Message;(4) when C5 selects G5 for itself corresponding targeted group, and the targeted group of C6 is also G5, if the message in G5
Quantity is less than two, and C6 is competed successfully, can use the message in C6 processing G5 at this time.
Processing mode four includes: (1) when C5 selects G5 for itself corresponding targeted group, and the targeted group of C6 is
G6 can use the message in C6 processing G6 at this time, and utilize the message in C5 processing G5;(2) when C5 selects G6 right for itself
The targeted group answered, and the targeted group of C6 is also G6, if the message amount in G6 is not less than two, be can use at this time
C5 and C6 handles the different messages in G6 respectively simultaneously;(3) when C5 selects G6 for itself corresponding targeted group, and the mesh of C6
Marking user group is also G6, if the message amount in G6, less than two, and C5 compete successfully, can use C5 at this time and handles in G6
Message;(4) when C5 selects G6 for itself corresponding targeted group, and the targeted group of C6 is also G6, if the message in G6
Quantity is less than two, and C6 is competed successfully, can use the message in C6 processing G6 at this time.
Processing mode five includes: (1) when C5 selects G5 for itself corresponding targeted group, and C6 selects G6 right for itself
The targeted group answered can use the message in C5 processing G5 at this time, and utilize the message in C6 processing G6;(2) when C5 is selected
Selecting G6 is itself corresponding targeted group, and C6 selects G5 for itself corresponding targeted group, can use at C5 at this time
The message in G6 is managed, and utilizes the message in C6 processing G5;(3) when C5 selects G5 for itself corresponding targeted group, and C6
Also it selects G5 for itself corresponding targeted group, if the message amount in G5 is not less than two, can use C5 and C6 at this time
Handle the different messages in G5 respectively simultaneously;If the message amount in G5 is less than two, and C5 is competed successfully, can use at this time
C5 handles the message in G5;If the message amount in G5 is less than two, and C6 is competed successfully, is can use in C6 processing G5 at this time
Message.(4) when C5 selects G6 for itself corresponding targeted group, and C6 also selects G6 for itself corresponding target user
Group can use at this time if message amount in G6 is not less than two while C5 and C6 handle different messages in G6 respectively;If
Message amount in G6 is less than two, and C5 is competed successfully, can use the message in C5 processing G6 at this time;If the message in G6
Quantity is less than two, and C6 is competed successfully, can use the message in C6 processing G6 at this time.
Step 440, the first core of record handles the processing time of the message in user group to be processed.
Step 450, the processing time is subtracted from the timeslice of user group to be processed distributed by the first core using the first core,
Obtain the remaining value of timeslice.
Specifically, the corresponding each user group of the first core all has the timeslice distributed by the first core, and timeslice is maximum
User group be user group to be processed, can be from user group to be processed after the message in the user group to be processed is processed
Timeslice in subtract processing the time, when the user group for reducing timeslice may be still in the corresponding each user group of the first core
Between the maximum user group of piece, it is also possible to be not the maximum user group of timeslice in the corresponding each user group of the first core.
Step 460, when the remaining value for the timeslice of the corresponding each user group of the first core distributed by the first core is all zero
When, it is that the corresponding each user group of the first core distributes preset timeslice respectively using the first core.
Specifically, the preset time of itself corresponding each user group can be arranged in the first core in advance according to the actual situation
Piece can also according to the actual situation be adjusted each preset timeslice.Wherein, each preset timeslice can phase
It together, can not also be identical.
As seen from the above-described embodiment, after handling the message in user group to be processed using the first core, it can recorde
One core handles the processing time of the message in user group to be processed, utilizes the first core being distributed by the first core from user group to be processed
Timeslice in subtract processing the time, the remaining value of timeslice is obtained, when the corresponding each user group of the first core is by the first core
When the remaining value of the timeslice of distribution is all zero, using the first core be the corresponding each user group of the first core distribute respectively it is preset
Timeslice so that the network equipment is after handling message, can also each user group corresponding to the first core timeslice carry out it is real
When adjust, to improve the practicability of Message processing.
Corresponding with aforementioned message processing method embodiment, the present invention also provides the embodiments of message process device.
The embodiment of the application message process device can be using on network devices.Installation practice can pass through software
It realizes, can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, as on a logical meaning
Device, be in being read computer program instructions corresponding in nonvolatile memory by the processor of equipment where it
Deposit what middle operation was formed.For hardware view, as shown in figure 9, one kind of equipment where the application message process device is hard
Part structural schematic diagram, other than processor shown in Fig. 9, network interface, memory and nonvolatile memory, in embodiment
Equipment where device can also include usually other hardware, such as be responsible for the forwarding chip of processing message;From hardware configuration
From the equipment be also possible to be distributed equipment, may include multiple interface cards, so as to hardware view carry out message at
The extension of reason.
It is one embodiment block diagram of the application message process device referring to Figure 10, which can be applied to include more
On the network equipment of core processor, at least one user group is answered in each verification of the multi-core processor, each user group by with
The corresponding each core of the user group is assigned corresponding weight, and can be used for executing message processing method shown in Fig. 2, can be with
It include: receiving unit 101, user group determination unit 102 and message process unit 103.
Wherein, receiving unit 101, for receiving at least one message;
User group determination unit 102 is divided for determining the corresponding user group of each message, and by each message
It is assigned to corresponding user group;
Message process unit 103, it is maximum for weight in the corresponding user group of the first core by the multi-core processor
User group is determined as user group to be processed, and handles the message in the user group to be processed using first core.
As seen from the above-described embodiment, by receiving at least one message;Determine the corresponding user group of each message, and will be each
A message is distributed to corresponding user group;The maximum user group of weight in the corresponding user group of the first core of multi-core processor is true
It is set to user group to be processed, and handles the message in user group to be processed using the first core, so that the network equipment is total in multi-user
When enjoying multi-core processor, each core of multi-core processor can handle identical or not respectively according to the weight of corresponding user group
With the message of user group, the accounting of each nuclear resource of user occupancy multi-core processor is more reasonably controlled, to improve report
The efficiency and reliability of text processing.
In an optional implementation, the user group determination unit 102 includes: that parsing subunit and matching are single
First (being not shown in Figure 10).
Parsing subunit obtains parsing result for parsing to the message, and the parsing result includes source IP
One of location, source port, purpose IP address, destination port and transport layer protocol are a variety of;
Coupling subelement, if for being matched to the corresponding user of the parsing result in preset user group matching list item
The user group being matched to then is determined as the corresponding user group of the message by group.
In another optional implementation, the message process unit 103 may include: first determine subelement and
Second determines subelement (being not shown in Figure 10).
Select subelement, for from the corresponding user group of first core in the maximum user group of weight select a use
Family group is determined as targeted group;
First determines subelement, for when the corresponding target of other cores that the targeted group is the multi-core processor
User group, and the message amount for including in the targeted group is not less than the sum of the quantity of first core and other cores
When, then the targeted group is determined as user group to be processed;
Second determines subelement, for when the corresponding target of other cores that the targeted group is the multi-core processor
User group, and the message amount for including in the targeted group is less than the sum of the quantity of first core and other cores
When, if first core and other cores compete successfully, the targeted group is determined as user group to be processed.
In another optional implementation, described device can also include: that the first computing unit and the first distribution are single
First (being not shown in Figure 10).
First computing unit, after the message handled using first core in the user group to be processed,
Using described first examine and make cuts less the user group to be processed by the first core distribute weight;
First allocation unit, the weight distributed by the first core for working as the corresponding each user group of first core are all
It is that the corresponding each user group of first core distributes preset weight respectively using first core when zero.
As seen from the above-described embodiment, after handling the message in user group to be processed using the first core, it can use
One, which examines and makes cuts, waits a little while,please and handles the weight of user group distributed by the first core, and when the first core corresponding each user group is by the first core
When the weight of distribution is all zero, preset weight is distributed respectively for the corresponding each user group of the first core using the first core, so that
The network equipment after handling message, can also the weight of each user group corresponding to the first core adjusted in real time, to mention
The high practicability of Message processing.
In another optional implementation, the weight is timeslice;Described device can also include: record
Member, the second computing unit and the second allocation unit (being not shown in Figure 10).
Recording unit, after the message handled using first core in the user group to be processed, record
First core handles the processing time of the message in the user group to be processed;
Second computing unit, for the time distributed by the first core using first core from the user group to be processed
The processing time is subtracted in piece, obtains the remaining value of the timeslice;
Second allocation unit, for the timeslice distributed by the first core when the corresponding each user group of first core
It is that the corresponding each user group of first core distributes the preset time respectively using first core when remaining value is all zero
Piece.
As seen from the above-described embodiment, after handling the message in user group to be processed using the first core, it can recorde
One core handles the processing time of the message in user group to be processed, utilizes the first core being distributed by the first core from user group to be processed
Timeslice in subtract processing the time, the remaining value of timeslice is obtained, when the corresponding each user group of the first core is by the first core
When the remaining value of the timeslice of distribution is all zero, using the first core be the corresponding each user group of the first core distribute respectively it is preset
Timeslice so that the network equipment is after handling message, can also each user group corresponding to the first core timeslice carry out it is real
When adjust, to improve the practicability of Message processing.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize application scheme.Those of ordinary skill in the art are not paying
Out in the case where creative work, it can understand and implement.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.
Claims (10)
1. a kind of message processing method, which is characterized in that the method is applied on the network equipment including multi-core processor, institute
At least one user group is answered in each verification for stating multi-core processor, and each user group is distributed by each core corresponding with the user group
There is corresponding weight, comprising:
Receive at least one message;
It determines the corresponding user group of each message, and each message is distributed to corresponding user group;
For the first core for distributing the multi-core processor after the corresponding user group of each message, by the multi-core processor
The corresponding user group of the first core in the maximum user group of weight be determined as user group to be processed, and handled using first core
Message in the user group to be processed, first core are used to characterize any one core in the multi-core processor.
2. the method according to claim 1, wherein the corresponding user group of each message of the determination, packet
It includes:
It the message is parsed, obtains parsing result, the parsing result includes source IP address, source port, destination IP
One of location, destination port and transport layer protocol are a variety of;
If being matched to the corresponding user group of the parsing result, the use that will be matched in preset user group matching list item
Family group is determined as the corresponding user group of the message.
3. the method according to claim 1, wherein the corresponding use of the first core by the multi-core processor
The maximum user group of weight is determined as user group to be processed in the group of family, comprising:
From one user group of selection is determined as target user in the maximum user group of weight in the corresponding user group of first core
Group;
When the corresponding targeted group of other cores that the targeted group is the multi-core processor, and the targeted group
In include message amount not less than first core and other cores the sum of quantity when, then it is the targeted group is true
It is set to user group to be processed;
When the corresponding targeted group of other cores that the targeted group is the multi-core processor, and the targeted group
In include message amount when being less than the sum of the quantity of first core and other cores, if first core and other cores are competing
Success is striven, then the targeted group is determined as user group to be processed.
4. method according to claim 1-3, which is characterized in that it is described using first core handle it is described to
After handling the message in user group, the method also includes:
Using described first examine and make cuts less the user group to be processed by the first core distribute weight;
When the weight of the corresponding each user group of first core distributed by the first core is all zero, it is using first core
The corresponding each user group of first core distributes preset weight respectively.
5. method according to claim 1-3, which is characterized in that the weight is timeslice;It is described to utilize institute
After stating the message that the first core is handled in the user group to be processed, the method also includes:
Record the processing time for the message that first core is handled in the user group to be processed;
The processing time is subtracted from the timeslice of the user group to be processed distributed by the first core using first core,
Obtain the remaining value of the timeslice;
When the remaining value for the timeslice of the corresponding each user group of first core distributed by the first core is all zero, institute is utilized
Stating the first core is that the corresponding each user group of first core distributes preset timeslice respectively.
6. a kind of message process device, which is characterized in that described device is applied on the network equipment including multi-core processor, institute
At least one user group is answered in each verification for stating multi-core processor, and each user group is distributed by each core corresponding with the user group
There is corresponding weight, comprising:
Receiving unit, for receiving at least one message;
User group determination unit is distributed for determining the corresponding user group of each message, and by each message to right
The user group answered;
Message process unit, for being directed to first of the multi-core processor after distributing the corresponding user group of each message
The maximum user group of weight in the corresponding user group of the first core of the multi-core processor is determined as user group to be processed by core,
And the message in the user group to be processed is handled using first core, first core is for characterizing the multi-core processor
In any one core.
7. device according to claim 6, which is characterized in that the user group determination unit includes:
Parsing subunit obtains parsing result for parsing to the message, the parsing result include source IP address,
One of source port, purpose IP address, destination port and transport layer protocol are a variety of;
Coupling subelement, if for being matched to the corresponding user group of the parsing result in preset user group matching list item,
The user group being matched to then is determined as the corresponding user group of the message.
8. device according to claim 6, which is characterized in that the message process unit includes:
Select subelement, for from the corresponding user group of first core in the maximum user group of weight select a user group
It is determined as targeted group;
First determines subelement, for as the corresponding target user of other cores that the targeted group is the multi-core processor
Group, and the message amount for including in the targeted group not less than first core and other cores the sum of quantity when,
The targeted group is then determined as user group to be processed;
Second determines subelement, for as the corresponding target user of other cores that the targeted group is the multi-core processor
Group, and when the message amount for including in the targeted group is less than the sum of the quantity of first core and other cores, if
First core and other cores compete successfully, then the targeted group are determined as user group to be processed.
9. according to the described in any item devices of claim 6-8, which is characterized in that described device further include:
First computing unit is utilized after the message handled using first core in the user group to be processed
Described first examine and make cuts less the user group to be processed by the first core distribute weight;
First allocation unit is all zero for the weight distributed by the first core when the corresponding each user group of first core
When, it is that the corresponding each user group of first core distributes preset weight respectively using first core.
10. according to the described in any item devices of claim 6-8, which is characterized in that the weight is timeslice;
Described device further include:
Recording unit, after the message handled using first core in the user group to be processed, described in record
First core handles the processing time of the message in the user group to be processed;
Second computing unit, for utilizing first core from the timeslice of the user group to be processed distributed by the first core
The processing time is subtracted, the remaining value of the timeslice is obtained;
Second allocation unit, the residue for the timeslice distributed by the first core when the corresponding each user group of first core
It is that the corresponding each user group of first core distributes preset timeslice respectively using first core when value is all zero.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610168441.1A CN105760235B (en) | 2016-03-22 | 2016-03-22 | Message processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610168441.1A CN105760235B (en) | 2016-03-22 | 2016-03-22 | Message processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105760235A CN105760235A (en) | 2016-07-13 |
CN105760235B true CN105760235B (en) | 2019-05-07 |
Family
ID=56346290
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610168441.1A Active CN105760235B (en) | 2016-03-22 | 2016-03-22 | Message processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105760235B (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7843926B1 (en) * | 2005-04-05 | 2010-11-30 | Oracle America, Inc. | System for providing virtualization of network interfaces at various layers |
CN101217467B (en) * | 2007-12-28 | 2010-10-27 | 杭州华三通信技术有限公司 | An inter-core load dispensing device and method |
CN102253857B (en) * | 2011-06-24 | 2013-03-27 | 华中科技大学 | Xen virtual machine scheduling control method in multi-core environment |
CN103514043B (en) * | 2012-06-29 | 2017-09-29 | 华为技术有限公司 | The data processing method of multicomputer system and the system |
CN103595654B (en) * | 2013-11-01 | 2016-06-29 | 福建星网锐捷网络有限公司 | HQoS based on multi-core CPU realizes method, device and the network equipment |
CN103916906B (en) * | 2014-03-07 | 2017-10-13 | 大唐移动通信设备有限公司 | To the method, equipment and system of user data message distribution processor |
CN105450792B (en) * | 2015-12-23 | 2018-09-14 | 东软集团股份有限公司 | Port assignment method and apparatus for multinuclear forwarding network address port conversion |
-
2016
- 2016-03-22 CN CN201610168441.1A patent/CN105760235B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN105760235A (en) | 2016-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105553977B (en) | Processing, sending method and the device of request message | |
Buyya | CloudAnalyst: A CloudSim-based tool for modelling and analysis of large scale cloud computing environments | |
US11363092B2 (en) | Resource sharing method, device and system | |
CN108377671B (en) | Method and computer equipment for processing message | |
US20050165932A1 (en) | Redirecting client connection requests among sockets providing a same service | |
CN104123265B (en) | A kind of many communication method between cores and system | |
CN108268372A (en) | Mock test processing methods, device, storage medium and computer equipment | |
CN105988688A (en) | Screen capture method and apparatus | |
CN108933829A (en) | A kind of load-balancing method and device | |
CN108228349A (en) | For handling the method for task, system and storage medium | |
CN105939279B (en) | Flow processing method and device | |
CN106681840A (en) | Tasking scheduling method and device for cloud operating system | |
EP3051415A1 (en) | Method, apparatus, and device for selecting protocol stack | |
CN105939240B (en) | Load-balancing method and device | |
CN105573850B (en) | Multi-process exchange method, system and server | |
CN107733995A (en) | A kind of session keeping method, device and electronic equipment | |
CN103238301A (en) | Technique for managing traffic at router | |
CN112311851B (en) | Network policy configuration method and device | |
CN107247629A (en) | Cloud computing system and cloud computing method and device for controlling server | |
CN109634720A (en) | A kind of multi-dummy machine shares the method, system and device of FPGA board | |
CN107527222A (en) | Information processing method and apparatus and system | |
CN108847981A (en) | Distributed computer cloud computing processing method | |
CN105978938A (en) | Service processing equipment service status determining method and scheduling equipment | |
CN110417632A (en) | A kind of network communication method, system and server | |
CN107888700A (en) | A kind of shared cloud rendering system and its handling process |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Applicant after: Xinhua three Technology Co., Ltd. Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Applicant before: Huasan Communication Technology Co., Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |