CN102571593A - Method and device for distributing messages - Google Patents

Method and device for distributing messages Download PDF

Info

Publication number
CN102571593A
CN102571593A CN2012100189279A CN201210018927A CN102571593A CN 102571593 A CN102571593 A CN 102571593A CN 2012100189279 A CN2012100189279 A CN 2012100189279A CN 201210018927 A CN201210018927 A CN 201210018927A CN 102571593 A CN102571593 A CN 102571593A
Authority
CN
China
Prior art keywords
core
service
sub
app
correspondence
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.)
Pending
Application number
CN2012100189279A
Other languages
Chinese (zh)
Inventor
武旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN2012100189279A priority Critical patent/CN102571593A/en
Publication of CN102571593A publication Critical patent/CN102571593A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a method for distributing messages. The method comprises the following steps of: establishing a first corresponding relationship between application programs (APPs) and service cores for distributing the messages according to the first corresponding relationship by a distribution unit in a multi-core processor, wherein the first corresponding relationship comprises a first sub-corresponding-relationship which is a corresponding relationship between a first APP and a first service core, and the first service core is a service core in the multi-core processor; and in the operation process of the multi-core processor, modifying the first corresponding relationship into a second corresponding relationship between a second APP and a second service core for conveniently distributing the messages according to the second corresponding relationship by the distribution unit, wherein the service core in the second corresponding relationship is a service core in the multi-core processor. In addition, the embodiment of the invention also provides a corresponding device for distributing the messages. By the technical scheme provided by the embodiment of the invention, the corresponding relationships between the APPs and the service cores can be regulated in the operation process of the multi-core processor, and the flexibility of the resource distribution way of the service cores in the multi-core processor is improved.

Description

Message distribution method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for distributing a packet.
Background
Multi-core technology has been the direction of development of processor technology. In a multi-core system, one core in a multi-core processor is usually used as a control core, and the other cores are used as service cores. The control core is responsible for system management, user access control and core resource allocation, and the service core is responsible for processing messages corresponding to Application programs (APPs).
In a multi-core system, the APP may be deployed on a multi-core processor in the following manner: and setting the corresponding relation between the APP and the service cores in the process of initializing the multi-core system so as to determine the type of the APP processed by each service core. In the operation process of the multi-core system, after receiving the message, the distribution unit distributes the message to the service core corresponding to the APP to which the message belongs according to the preset corresponding relation between the APP and the service core.
The inventor finds that the prior art has the following technical problems:
and message distribution is carried out according to the preset corresponding relation between the APP and the service cores, so that the distribution mode of core resources in the multi-core processor is not flexible enough.
Disclosure of Invention
The embodiment of the invention provides a message distribution method and a message distribution device, which can adjust the corresponding relation between an APP and a service core in the running process of a multi-core processor and improve the flexibility of the distribution mode of core resources in the multi-core processor.
According to the message distribution method and the message distribution device provided by the embodiment of the invention, the flexibility of the resource distribution mode of the service core can be improved by adjusting the corresponding relation of the APP service core in the running process of the multi-core processor.
In one aspect, a message distribution method provided in the embodiments of the present invention includes:
in the process of initializing a multi-core processor or in the process of operating the multi-core processor, establishing a first corresponding relationship between an application program APP and a service core so that a distribution unit in the multi-core processor distributes a message according to the first corresponding relationship, wherein the first corresponding relationship comprises a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between a first APP and a first service core, and the first service core is the service core in the multi-core processor;
and in the running process of the multi-core processor, modifying the first corresponding relation into a second corresponding relation between the APP and the service core so that the distribution unit can distribute the message according to the second corresponding relation, wherein the service core in the second corresponding relation is the service core in the multi-core processor.
On the other hand, the message distribution apparatus provided in the embodiment of the present invention includes:
the message distribution method comprises the steps that an establishing unit is used for establishing a first corresponding relation between an application program APP and a service core in the process of initializing a multi-core processor or in the process of operating the multi-core processor so as to facilitate a distribution unit in the multi-core processor to distribute a message according to the first corresponding relation, wherein the first corresponding relation comprises a first sub-corresponding relation, the first sub-corresponding relation is the corresponding relation between a first APP and a first service core, and the first service core is the service core in the multi-core processor;
and the modifying unit is used for modifying the first corresponding relation into a second corresponding relation between the APP and the service cores in the running process of the multi-core processor and after the establishing unit establishes the first corresponding relation, so that the distributing unit can distribute the message according to the second corresponding relation, and the service cores in the second corresponding relation are the service cores in the multi-core processor.
The technical scheme provided by the embodiment of the invention has the following advantages:
in the process of initializing the multi-core processor or in the process of operating the multi-core processor, establishing a first corresponding relation between the APP and the service core. And in the running process of the multi-core processor, modifying the first corresponding relation into a second corresponding relation. By adjusting the corresponding relation between the APP and the service cores in the running process of the multi-core processor, the flexibility of the core resource allocation mode in the multi-core processor is improved.
Drawings
Fig. 1 is a flowchart of a message distribution method according to an embodiment of the present invention;
fig. 2 is a flowchart of another message distribution method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for resource allocation of a multi-core system according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another apparatus for resource allocation in a multi-core system according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an add subunit according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a modification subunit according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another modification subunit provided in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a message distribution method and a message distribution device, which can adjust the corresponding relation between an APP and a service core in the running process of a multi-core processor, and improve the flexibility of a service core resource distribution mode.
Example one
The embodiment of the invention provides a message distribution method. Referring to fig. 1, fig. 1 is a flowchart of a message distribution method according to an embodiment of the present invention, where the method includes:
101. in the process of initializing the multi-core processor or in the process of operating the multi-core processor, establishing a first corresponding relationship between an application program APP and a service core so that a distribution unit in the multi-core processor distributes a message according to the first corresponding relationship, wherein the first corresponding relationship comprises a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between a first APP and a first service core, and the first service core is the service core in the multi-core processor.
In the embodiment of the present invention, in an initialization process of a multi-core processor or in an operation process of the multi-core processor, a first corresponding relationship between an APP and a service core is established, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor.
In particular implementations, the multi-core processor may be a multi-core processor in a network device. The network device may be a router, a switch, a Broadband Access Server (BRAS) or a Digital Subscriber Line Access Multiplexer (DSLAM).
In particular implementation, the execution subject of 101 may be a control core.
It should be noted that, in the embodiment of the present invention, when the distribution unit is implemented specifically, the distribution unit may be a hardware module in a multi-core processor. In addition, the distribution unit may also be implemented by software.
In the embodiment of the present invention, the first sub-mapping relationship is a mapping relationship between the first APP and the first service core. In particular, the first APP refers to a certain APP. Hereinafter, the APP will be described, and will not be described in detail here. The first service core may be one service core or a plurality of service cores.
The first sub-correspondence is used for message distribution. In specific implementation, after receiving a message, a distribution unit determines the type of the APP corresponding to the message. If the APP corresponding to the message is the first APP, the distribution unit distributes the message to the first service core according to the first sub-correspondence. In a scenario where the first service core is a plurality of service cores, the distribution unit may distribute the packet to one of the plurality of service cores according to a predetermined rule.
In a specific implementation, the first corresponding relationship may include other sub-corresponding relationships in addition to the first sub-corresponding relationship. For example, the first corresponding relationship may further include an eighth sub-corresponding relationship, where the eighth sub-corresponding relationship is a corresponding relationship between an eighth APP and an eighth service core, and the eighth service core is a service core in the multi-core processor. The eighth sub-correspondence is similar to the first sub-correspondence, and is not described herein again. It is noted that the eighth APP is different from the first APP and the second APP.
In the embodiment of the present invention, APP refers to an Application Program (APP). For example, APP may be a network stream (netstream). The network flow is a statistical technique based on network traffic information. The APP may also be Bidirectional Forwarding Detection (BFD).
102. And in the operation process of the multi-core processor, modifying the first corresponding relation into a second corresponding relation between the APP and the service core so as to facilitate the distribution unit to distribute the message according to the second corresponding relation, wherein the service core in the second corresponding relation is the service core in the multi-core processor.
In the embodiment of the present invention, in the operating process of the multi-core processor, after the first corresponding relationship is established, the first corresponding relationship may be modified into a second corresponding relationship between the APP and the service core, so that the distribution unit distributes the packet according to the second corresponding relationship, and the service core in the second corresponding relationship is the service core in the multi-core processor.
In particular implementations, the execution subject of 102 may be a control core.
In the process of initializing the multi-core system or in the process of operating the multi-core processor, the control core establishes a first corresponding relationship between the APP and the service core so that the distribution unit can distribute the message according to the first corresponding relationship, the first corresponding relationship comprises a first sub-corresponding relationship, the first sub-corresponding relationship is the corresponding relationship between the first APP and the first service core, in the process of operating the multi-core processor, the first corresponding relationship is modified into a second corresponding relationship so that the distribution unit can distribute the message according to the second corresponding relationship, and in the process of operating the multi-core processor, the first corresponding relationship is modified into the second corresponding relationship, so that the flexibility of core resource distribution can be improved.
Example two
In the embodiment of the present invention, modifying the first corresponding relationship into the second corresponding relationship may be adding a second sub-corresponding relationship to the first corresponding relationship, or deleting a first sub-corresponding relationship in the first corresponding relationship, or modifying the first sub-corresponding relationship. The above will be discussed in detail below. Please refer to fig. 2. Fig. 2 is a flowchart of another message distribution method according to an embodiment of the present invention. The message distribution method comprises the following steps:
201. in the process of initializing the multi-core processor or in the process of operating the multi-core processor, establishing a first corresponding relationship between an application program APP and a service core so that a distribution unit in the multi-core processor distributes a message according to the first corresponding relationship, wherein the first corresponding relationship comprises a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between a first APP and a first service core, and the first service core is the service core in the multi-core processor.
In an embodiment of the invention, after execution 201, 202, or 203, or 204 may be executed.
In the embodiment of the present invention, in an initialization process of a multi-core processor or in an operation process of the multi-core processor, a first corresponding relationship between an APP and a service core is established, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor.
In particular implementations, the multi-core processor may be a multi-core processor in a network device. The network device may be a router, a switch, a Broadband Access Server (BRAS) or a Digital Subscriber Line Access Multiplexer (DSLAM).
In particular implementation, the execution subject of 201 may be a control core.
It should be noted that, in the embodiment of the present invention, when the distribution unit is implemented specifically, the distribution unit may be a hardware module in a multi-core processor. In addition, the distribution unit may also be implemented by software.
In the embodiment of the present invention, the first sub-mapping relationship is a mapping relationship between the first APP and the first service core. In particular, the first APP refers to a certain APP. Hereinafter, the APP will be described, and will not be described in detail here. The first service core may be one service core or a plurality of service cores.
The first sub-correspondence is used for message distribution. In specific implementation, after receiving a message, a distribution unit determines the type of the APP corresponding to the message. If the APP corresponding to the message is the first APP, the distribution unit distributes the message to the first service core according to the first sub-correspondence. In a scenario where the first service core is a plurality of service cores, the distribution unit may distribute the packet to one of the plurality of service cores according to a predetermined rule.
In a specific implementation, the first corresponding relationship may include other sub-corresponding relationships in addition to the first sub-corresponding relationship. For example, the first corresponding relationship may further include an eighth sub-corresponding relationship, where the eighth sub-corresponding relationship is a corresponding relationship between an eighth APP and an eighth service core, and the eighth service core is a service core in the multi-core processor. The eighth sub-correspondence is similar to the first sub-correspondence, and is not described herein again. It is noted that the eighth APP is different from the first APP and the second APP.
In the embodiment of the present invention, APP refers to an Application Program (APP). For example, APP may be a network stream (netstream). The network flow is a statistical technique based on network traffic information. The APP may also be Bidirectional Forwarding Detection (BFD).
202. And in the operation process of the multi-core processor, adding a second sub-corresponding relationship in the first corresponding relationship, wherein the second sub-corresponding relationship is a corresponding relationship between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
When the second sub-correspondence is added to the first correspondence, the specific implementation may be:
the user enables the second APP by means of a command line. The control core senses that the second APP is enabled, and the second sub-corresponding relation is added to the first corresponding relation.
And in the operation process of the multi-core processor, the control core adds a second sub-corresponding relation in the first corresponding relation, the second sub-corresponding relation is the corresponding relation between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
In this embodiment of the present invention, when the control core adds the second sub-correspondence to the first correspondence, the specific implementation may be:
the control core determines available ones of the service cores of the multi-core processor. The available service cores have a specific meaning. The "available" of the available service cores emphasizes that the service core has additional processing power. The available service cores include service cores which have not established a corresponding relationship with the APP, and also include service cores which have established a corresponding relationship with the APP, but have additional processing capacity. The processing capability of the service core is influenced by the operating frequency of the service core, the manufacturing process and other factors. The processing power of the business core can be obtained by prototype testing.
The control core determines a second service core allocated to a second APP from the available service cores. And the control core adds a second sub-corresponding relation formed by a second APP and a second service core in the first corresponding relation. For example, the multi-core processor includes 5 service cores having the same processing capability, i.e., service cores 1 to 5. Wherein the service core 4 and the service core 5 have no additional processing capacity. The business core 1 and the business core 3 do not establish a corresponding relationship with the APP. The service core 2 has an additional processing capacity, which is equal to the processing capacity of 0.5 service cores for the service core 2. Thus, available service cores include: a service core 1, a service core 2 and a service core 3. If the second APP requires 2.5 service cores, the service core 1, the service core 2, and the service core 3 may be allocated to the second APP. That is, the second service core includes service cores 1 to 3.
It should be noted that, the control core may determine the number of service cores that need to be allocated to the second APP according to the stored service specification parameter of the second APP. The specific implementation can be as follows:
the license document describes the service specification of the second APP. The service specification may be the number of sessions of the second APP, for example, 1000 sessions, or the service specification may be a detection period, for example, the detection period of the second APP is 10 ms. In addition, the control core can access the corresponding relation between the pre-stored service specification of the APP to be processed and the number of the required service cores. The corresponding relation between the business specification of the APP to be processed and the number of the needed business cores can be obtained through prototype testing. The control core may determine the service specification of the second APP through the license file of the second APP. The control core may determine the number of service cores to be allocated by the second APP according to the correspondence between the service specification of the APP to be processed and the number of service cores required.
It should be noted that the number of the service cores to be allocated by the second APP may be an integer or a decimal number.
In the embodiment of the present invention, the control core may add the second sub-correspondence to the first correspondence, so that the distribution unit can distribute the packet according to the second correspondence, thereby improving the flexibility of the core resource allocation manner.
203. And deleting the first sub-corresponding relation in the first corresponding relation in the running process of the multi-core processor.
In the operating process of the multi-core processor, the control core may delete the first sub-correspondence in the first correspondence, that is, delete the first sub-correspondence of the first APP and the first service core in the first correspondence.
The specific implementation of deleting the first sub-correspondence relationship may be:
the user disables the second APP by means of a command line. And the control core senses that the second APP is forbidden and deletes the first sub-corresponding relation.
204. And in the operation process of the multi-core processor, modifying the first sub-corresponding relationship into a third sub-corresponding relationship, wherein the third sub-corresponding relationship is the corresponding relationship between the first APP and a third service core, and the third service core is a service core in the multi-core processor.
And in the operation process of the multi-core processor, the control core modifies the first sub-corresponding relation into a third sub-corresponding relation, the third sub-corresponding relation is the corresponding relation between the first APP and the third service core, and the third service core is a service core in the multi-core processor.
In the embodiment of the present invention, the modification of the first sub-correspondence to the third sub-correspondence may specifically be:
and the control core determines the available service cores in the service cores of the multi-core processor and modifies the first sub-corresponding relation into a third sub-corresponding relation. And the third sub-corresponding relationship is a corresponding relationship between the first APP and the third service core. The third service core comprises a first service core and a fourth service core. The fourth service core is an available service core. The above means that the number of the service cores corresponding to the first APP is increased by modifying the first sub-correspondence relationship into the third sub-correspondence relationship.
For example, the first service core corresponding to the first APP in the first sub-correspondence relationship includes a service core 1 and a service core 2. And the service specification in the license file corresponding to the first APP is modified into a new service specification. The number of the service cores corresponding to the new service specification is 3. The control core senses that the service specification in the license file corresponding to the first APP changes, and determines an available service core, namely a service core 3, from the service cores of the multi-core processor. The service core 3 is a fourth service core. And the control core modifies the first sub-corresponding relation into a third sub-corresponding relation. In the third sub-correspondence relationship, the third service core includes a service core 1, a service core 2, and a service core 3.
In this embodiment of the present invention, modifying the first sub-correspondence to the third sub-correspondence may further be:
the control core determines available ones of the service cores of the multi-core processor. And modifying the first sub-corresponding relationship into a third sub-corresponding relationship, wherein the third sub-corresponding relationship is the corresponding relationship between the first APP and the third service core. The first service core comprises a third service core and a fifth service core, and the fifth service core is a service core in the multi-core processor. The above means that the number of the service cores corresponding to the first APP is reduced by modifying the first sub-correspondence relationship into the third sub-correspondence relationship.
For example: in the first sub-correspondence relationship, the first service core includes a service core 1, a service core 2, and a service core 3. And the service specification in the license file corresponding to the first APP is modified into a new service specification. The number of the service cores corresponding to the new service specification is 2. The control core senses that the service specification in the license file corresponding to the first APP changes, and determines the service core 3 as a fifth service core. In the third sub-correspondence relationship, the third service core includes a service core 1 and a service core 2. The third sub-correspondence does not include the service core 3. Meaning that the service core 3 becomes an available service core, and the service core 3 can be used when a sub-correspondence is subsequently established or a correspondence is modified.
It should be noted that, in the embodiment of the present invention, the first corresponding relationship, the first sub corresponding relationship, the second sub corresponding relationship, and the third sub corresponding relationship may be embodied in a corresponding table, or may be embodied in a computer program code. The present invention is not limited to a specific load bearing manner.
It can be determined from the above description of 204 that 204 can be applied in a scenario where the service specification of the first APP changes. That is to say, when the number of the service cores to be allocated by the first APP changes, the number of the service cores corresponding to the first APP is increased or decreased by modifying the correspondence between the first APP and the first service core.
In an embodiment, the distributing unit determines, for the received packet, a service core to process according to a corresponding relationship between the APP in the control core and the service core, and specifically may be:
the multi-core processor receives the message. And the message unit analyzes the message and determines the APP corresponding to the message. And the distribution unit searches the business core corresponding to the APP corresponding to the message in the corresponding relation between the APP and the business core according to the APP corresponding to the message. And the distribution unit distributes the received message to the searched service core.
It should be noted that "first" and "second" in the first corresponding relationship and the second corresponding relationship related to the embodiment of the present invention are used to distinguish different corresponding relationships, and are not used to define a sequence. Similarly, "first", "second", "third", and "eighth" in the first sub-correspondence, the second sub-correspondence, the third sub-correspondence, and the eighth sub-correspondence are used to distinguish different correspondences, and are not used to limit the order of precedence. The first, second, third, fourth, fifth and eighth service cores in the first, second, third, fourth, fifth and eighth service cores are used for distinguishing different service cores, and are not used for limiting the order.
In addition, the first service core, the second service core, the third service core, the fourth service core, the fifth service core and the eighth service core all refer to a set of service cores, and the set may include one service core or a plurality of service cores.
It should be noted that, in the embodiment of the present invention, the second embodiment is a refinement and supplement of the first embodiment. The contents of the first and second embodiments may be combined.
In the embodiment of the present invention, after the first corresponding relationship is established, the flexibility of the service core resource allocation manner can be improved by modifying the first corresponding relationship, specifically including adding the second sub-corresponding relationship to the first corresponding relationship, or deleting the first sub-corresponding relationship in the first corresponding relationship, or modifying the first sub-corresponding relationship.
EXAMPLE III
The embodiment of the invention provides a message distribution device. Referring to fig. 3, fig. 3 is a schematic structural diagram of a message distribution apparatus according to an embodiment of the present invention, including:
the establishing unit 301 is configured to establish a first corresponding relationship between an application APP and a service core in an initialization process of a multi-core processor or in an operation process of the multi-core processor, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor.
When the establishing unit 301 is implemented specifically, it may be a control core.
In the embodiment of the present invention, in an initialization process of a multi-core processor or in an operation process of the multi-core processor, a first corresponding relationship between an APP and a service core is established, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor.
In particular implementations, the multi-core processor may be a multi-core processor in a network device. The network device may be a router, switch, BRAS, or DSLAM.
When the distribution unit is implemented, the distribution unit may be a hardware module in a multi-core processor. In addition, the distribution unit may also be implemented by software.
The first sub-corresponding relationship is a corresponding relationship between the first APP and the first service core. In particular, the first APP refers to a certain APP. Hereinafter, the APP will be described, and will not be described in detail here. The first service core may be one service core or a plurality of service cores.
The first sub-correspondence is used for message distribution. In specific implementation, after receiving a message, a distribution unit determines the type of the APP corresponding to the message. If the APP corresponding to the message is the first APP, the distribution unit distributes the message to the first service core according to the first sub-correspondence. In a scenario where the first service core is a plurality of service cores, the distribution unit may distribute the packet to one of the plurality of service cores according to a predetermined rule.
In a specific implementation, the first corresponding relationship may include other sub-corresponding relationships in addition to the first sub-corresponding relationship. For example, the first corresponding relationship may further include an eighth sub-corresponding relationship, where the eighth sub-corresponding relationship is a corresponding relationship between an eighth APP and an eighth service core, and the eighth service core is a service core in the multi-core processor. The eighth sub-correspondence is similar to the first sub-correspondence, and is not described herein again. It is noted that the eighth APP is different from the first APP and the second APP.
In the embodiment of the present invention, APP refers to an application program. For example, APP may be netstream. APP may also be BFD.
A modifying unit 302, configured to modify the first corresponding relationship into a second corresponding relationship between the APP and the service core in the operating process of the multi-core processor, so that the distributing unit distributes the packet according to the second corresponding relationship, where the service core in the second corresponding relationship is the service core in the multi-core processor.
When the modification unit 302 is implemented in detail, it may be a control core.
In the embodiment of the present invention, in an initialization process of a multi-core processor or in an operation process of the multi-core processor, an establishing unit 301 establishes a first corresponding relationship between an APP and a service core, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor; after the establishing unit 301 establishes the first corresponding relationship, in the operating process of the multi-core processor, the modifying unit 302 modifies the first corresponding relationship into a second corresponding relationship between the APP and the service core, so that the distributing unit distributes the packet according to the second corresponding relationship, and the service core in the second corresponding relationship is the service core in the multi-core processor.
In the embodiment of the present invention, in the operating process of the multi-core processor, after the first corresponding relationship is established, the first corresponding relationship may be modified into a second corresponding relationship between the APP and the service core, so that the distribution unit distributes the packet according to the second corresponding relationship, and the service core in the second corresponding relationship is the service core in the multi-core processor.
In the process of initializing a multi-core system or in the process of operating a multi-core processor, the establishing unit 301 in the control core establishes a first corresponding relationship between the APP and the service core, so that the distributing unit distributes the packet according to the first corresponding relationship, the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and the first service core, and in the process of operating the multi-core processor, the first corresponding relationship is modified into a second corresponding relationship, so that the distributing unit distributes the packet according to the second corresponding relationship, and in the process of operating the multi-core processor, the modifying unit 302 modifies the first corresponding relationship into the second corresponding relationship, so that the flexibility of the resource distribution mode of the service core can be improved.
Example four
The modifying unit 302 in the third embodiment may be configured to modify the first corresponding relationship into the second corresponding relationship, where the modifying is to add a second sub-corresponding relationship in the first corresponding relationship, or to delete a first sub-corresponding relationship in the first corresponding relationship, or to modify the first sub-corresponding relationship. The above will be discussed in detail below. Please refer to fig. 4. Fig. 4 is a schematic structural diagram of another message distribution apparatus according to an embodiment of the present invention.
Referring to fig. 4, when the modification unit 302 is implemented specifically, it may be an add subunit 401, a delete subunit 402, or a modify subunit 403. The detailed discussion is as follows:
the adding subunit 401 is configured to add a second sub-correspondence relationship in the first correspondence relationship, where the second sub-correspondence relationship is a correspondence relationship between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
When the second sub-correspondence is added to the first correspondence, the specific implementation may be:
the user enables the second APP by means of a command line. The control core senses that the second APP is enabled, and the second sub-corresponding relation is added to the first corresponding relation.
And in the operation process of the multi-core processor, the control core adds a second sub-corresponding relation in the first corresponding relation, the second sub-corresponding relation is the corresponding relation between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
Optionally, the adding subunit 401 may include a first determining unit 501, a second determining unit 502, and a first adding unit 503. Please refer to fig. 5. Fig. 5 is a schematic structural diagram of an add-on subunit 401 in the embodiment of the present invention. The adding subunit 401 includes:
a first determining unit 501, configured to determine available service cores in the service cores of the multi-core processor.
The available service cores have a specific meaning. The "available" of the available service cores emphasizes that the service core has additional processing power. The available service cores include service cores which have not established a corresponding relationship with the APP, and also include service cores which have established a corresponding relationship with the APP, but have additional processing capacity. The processing capability of the service core is influenced by the operating frequency of the service core, the manufacturing process and other factors. The processing power of the business core can be obtained by prototype testing.
A second determining unit 502, configured to determine, after the first determining unit 501 determines the available service cores, the second service core allocated to the second APP from the available service cores.
A first adding unit 503, configured to add, in the first correspondence, a second sub-correspondence formed by the second APP and the second service core after the second determining unit determines the second service core.
For example, the multi-core processor includes 5 service cores having the same processing capability, i.e., service cores 1 to 5. Wherein the service core 4 and the service core 5 have no additional processing capacity. The business core 1 and the business core 3 do not establish a corresponding relationship with the APP. The service core 2 has an additional processing capacity, which is equal to the processing capacity of 0.5 service cores for the service core 2. Thus, available service cores include: a service core 1, a service core 2 and a service core 3. If the second APP requires 2.5 service cores, the service core 1, the service core 2, and the service core 3 may be allocated to the second APP. That is, the second service core includes service cores 1 to 3.
It should be noted that, the control core may determine the number of service cores that need to be allocated to the second APP according to the stored service specification parameter of the second APP. The specific implementation can be as follows:
the license document describes the service specification of the second APP. The service specification may be the number of sessions of the second APP, for example, 1000 sessions, or the service specification may be a detection period, for example, the detection period of the second APP is 10 ms. In addition, the control plane pre-stores the corresponding relation between the service specification of the APP to be processed and the number of the required service cores. The corresponding relation between the business specification of the APP to be processed and the number of the needed business cores can be obtained through prototype testing. The control core may determine the service specification of the second APP through the license file of the second APP. The control core may determine the number of service cores to be allocated by the second APP according to the correspondence between the service specification of the APP to be processed and the number of service cores required.
It should be noted that the number of the service cores to be allocated by the second APP may be an integer or a decimal number.
In the embodiment of the present invention, the control core may add the second sub-correspondence to the first correspondence, so that the distribution unit can distribute the packet according to the second correspondence, thereby improving the flexibility of the core resource allocation manner.
A deleting subunit 402, configured to delete the first sub-correspondence in the first correspondence.
In the operating process of the multi-core processor, the control core may delete the first sub-correspondence in the first correspondence, that is, delete the first sub-correspondence of the first APP and the first service core in the first correspondence.
The specific implementation of deleting the first sub-correspondence relationship may be:
the user disables the second APP by means of a command line. And the control core senses that the second APP is forbidden and deletes the first sub-corresponding relation.
The modifying subunit 403 is configured to modify the first sub-correspondence relationship into a third sub-correspondence relationship, where the third sub-correspondence relationship is a correspondence relationship between the first APP and a third service core, and the third service core is a service core in the multi-core processor.
And in the operation process of the multi-core processor, the control core modifies the first sub-corresponding relation into a third sub-corresponding relation, the third sub-corresponding relation is the corresponding relation between the first APP and the third service core, and the third service core is a service core in the multi-core processor.
Alternatively to this, the first and second parts may,
the modification subunit 403 may specifically include a third determining unit 601 and a first modifying unit 602. Please refer to fig. 6. Fig. 6 is a schematic structural diagram of the modifying subunit 403 in the embodiment of the present invention. The modification subunit 403 specifically includes:
a third determining unit 601, configured to determine available service cores in the service cores of the multi-core processor.
A first modifying unit 602, configured to modify the first sub-correspondence to the third sub-correspondence after the third determining unit determines the available service core, where the third sub-correspondence is a correspondence between the first APP and the third service core, the third service core includes the first service core and a fourth service core, and the fourth service core is the available service core.
The above means that the number of the service cores corresponding to the first APP is increased by modifying the first sub-correspondence relationship into the third sub-correspondence relationship.
For example, the first service core corresponding to the first APP in the first sub-correspondence relationship includes a service core 1 and a service core 2. And the service specification in the license file corresponding to the first APP is modified into a new service specification. The number of the service cores corresponding to the new service specification is 3. The control core senses that the service specification in the license file corresponding to the first APP changes, and determines an available service core, namely a service core 3, from the service cores of the multi-core processor. The service core 3 is a fourth service core. And the control core modifies the first sub-corresponding relation into a third sub-corresponding relation. In the third sub-correspondence relationship, the third service core includes a service core 1, a service core 2, and a service core 3.
Optionally, the modification subunit 403 may specifically include a third determining unit 601 and a second modifying unit 603. Referring to fig. 7, fig. 7 is a schematic diagram illustrating another structure of the modifying subunit 403 according to an embodiment of the present invention. The modification subunit 403 includes:
a third determining unit 601, configured to determine available service cores in the service cores of the multi-core processor.
A second modifying unit 603, configured to modify the first sub-correspondence to a third sub-correspondence after the third determining unit determines an available service core, where the third sub-correspondence is a correspondence between the first APP and the third service core, the first service core includes the third service core and a fifth service core, and the fifth service core is a service core in the multi-core processor.
The above means that the number of the service cores corresponding to the first APP is reduced by modifying the first sub-correspondence relationship into the third sub-correspondence relationship.
For example: in the first sub-correspondence relationship, the first service core includes a service core 1, a service core 2, and a service core 3. And the service specification in the license file corresponding to the first APP is modified into a new service specification. The number of the service cores corresponding to the new service specification is 2. The control core senses that the service specification in the license file corresponding to the first APP changes, and determines the service core 3 as a fifth service core. In the third sub-correspondence relationship, the third service core includes a service core 1 and a service core 2. The third sub-correspondence does not include the service core 3. Meaning that the service core 3 becomes an available service core, and the service core 3 can be used when a sub-correspondence is subsequently established or a correspondence is modified.
It should be noted that, in the embodiment of the present invention, the first corresponding relationship, the first sub corresponding relationship, the second sub corresponding relationship, and the third sub corresponding relationship may be embodied in a corresponding table, or may be embodied in a computer program code. The present invention is not limited to a specific load bearing manner.
In an embodiment, the distributing unit determines, for the received packet, a service core to process according to a corresponding relationship between the APP in the control core and the service core, and specifically may be:
the multi-core processor receives the message. And the message unit analyzes the message and determines the APP corresponding to the message. And the distribution unit searches the business core corresponding to the APP corresponding to the message in the corresponding relation between the APP and the business core according to the APP corresponding to the message. And the distribution unit distributes the received message to the searched service core.
It should be noted that "first", "second", and "third" in the first determining unit, the second determining unit, and the third determining unit according to the embodiments of the present invention are used to distinguish different units, and are not used to identify a sequence. Also, "first" and "second" in the first modification unit and the second modification unit are used to distinguish different units, and are not used to define the order of precedence.
In addition, the "first" and the "second" in the first corresponding relationship and the second corresponding relationship related to the embodiment are used for distinguishing different corresponding relationships, and are not used for defining the sequence. Similarly, "first", "second", "third", and "eighth" in the first sub-correspondence, the second sub-correspondence, the third sub-correspondence, and the eighth sub-correspondence are used to distinguish different correspondences, and are not used to limit the order of precedence. The first, second, third, fourth, fifth and eighth service cores in the first, second, third, fourth, fifth and eighth service cores are used for distinguishing different service cores, and are not used for limiting the order.
In addition, the first service core, the second service core, the third service core, the fourth service core, the fifth service core and the eighth service core all refer to a set of service cores, and the set may include one service core or a plurality of service cores.
In the embodiment of the present invention, in an initialization process of a multi-core processor or in an operation process of the multi-core processor, an establishing unit 301 establishes a first corresponding relationship between an APP and a service core, so that a distribution unit in the multi-core processor distributes a packet according to the first corresponding relationship, where the first corresponding relationship includes a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between the first APP and a first service core, and the first service core is a service core in the multi-core processor; after the establishing unit 301 establishes the first corresponding relationship, in the running process of the multi-core processor, the modifying unit 302 modifies the first corresponding relationship into a second corresponding relationship between the APP and the service core, so that the distributing unit distributes the packet according to the second corresponding relationship, the service core in the second corresponding relationship is the service core in the multi-core processor, specifically, the modifying unit 302 modifies the first corresponding relationship into the second corresponding relationship between the APP and the service core, which may be: a second sub-correspondence relationship is added to a first correspondence relationship of an adding subunit 401 in the modifying unit, where the second sub-correspondence relationship is a correspondence relationship between a second APP and a second service core, and the second service core is a service core in the multi-core processor, or a deleting subunit 402 in the modifying unit 302 deletes the first sub-correspondence relationship in the first correspondence relationship, or a modifying subunit 403 in the modifying unit 302 modifies the first sub-correspondence relationship into a third sub-correspondence relationship, and the third sub-correspondence relationship is a correspondence relationship between the first APP and a third service core, and the third service core is a service core in the multi-core processor.
The adding the second sub-correspondence relationship in the first correspondence relationship by the adding sub-unit 401 in the modifying unit 301 specifically includes: a first determining unit 501 in the adding subunit 401 first determines available service cores in the service cores of the multi-core processor; a second determining unit 502 in the adding subunit 401 determines, from the available service cores, a second service core allocated to a second APP; finally, the first adding unit 503 in the adding subunit 401 is configured to add a second sub-correspondence formed by the second APP and the second service core in the first correspondence.
Wherein, the modifying the first sub-correspondence to the third sub-correspondence by the modifying subunit 403 specifically includes: determining, by a third determining unit 601 in the modifying subunit 403, available ones of the service cores of the multi-core processor; then, a first modification unit 602 in the modification subunit modifies the first sub-correspondence to a third sub-correspondence, where the third sub-correspondence is a correspondence between the first APP and a third service core, and the third service core includes a first service core and a fourth service core. The fourth service core is an available service core; or, after determining an available service core in the service cores of the multi-core processor by the third determining unit 601 in the modifying subunit 403, the second modifying unit 603 modifies the first sub-correspondence to a third sub-correspondence, where the third sub-correspondence is a correspondence between the first APP and the third service core. The first service core comprises a third service core and a fifth service core, and the fifth service core is a service core in the multi-core processor.
In the embodiment of the present invention, the fourth embodiment is a refinement and a supplement of the third embodiment. The contents of the third embodiment and the fourth embodiment can be combined.
In this embodiment of the present invention, after the establishing unit 301 establishes the first corresponding relationship, the first corresponding relationship is modified, specifically including adding the second sub-corresponding relationship in the first corresponding relationship of the sub-unit 401, or deleting the first sub-corresponding relationship in the first corresponding relationship by the sub-unit 402, or modifying the first sub-corresponding relationship by the sub-unit 403, so as to improve the flexibility of the service core resource allocation manner.
In the above, the message distribution method and apparatus provided by the present invention are described in detail, and a person having ordinary skill in the art may change the concepts of the embodiments of the present invention in the specific implementation and application scope.

Claims (12)

1. A method for distributing messages, comprising:
in the process of initializing a multi-core processor or in the process of operating the multi-core processor, establishing a first corresponding relationship between an application program APP and a service core so that a distribution unit in the multi-core processor distributes a message according to the first corresponding relationship, wherein the first corresponding relationship comprises a first sub-corresponding relationship, the first sub-corresponding relationship is a corresponding relationship between a first APP and a first service core, and the first service core is the service core in the multi-core processor;
and in the running process of the multi-core processor, modifying the first corresponding relation into a second corresponding relation between the APP and the service core so that the distribution unit can distribute the message according to the second corresponding relation, wherein the service core in the second corresponding relation is the service core in the multi-core processor.
2. The method according to claim 1, wherein the modifying the first correspondence to the second correspondence between the APP and the service core specifically comprises:
and adding a second sub-corresponding relation in the first corresponding relation, wherein the second sub-corresponding relation is a corresponding relation between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
3. The method of claim 1, wherein the modifying the first correspondence to a second correspondence of the APP with the service core comprises:
deleting the first sub-correspondence in the first correspondence.
4. The method according to claim 1, wherein the modifying the first correspondence to the second correspondence between the APP and the service core specifically comprises:
and modifying the first sub-corresponding relation into a third sub-corresponding relation, wherein the third sub-corresponding relation is the corresponding relation between the first APP and a third service core, and the third service core is a service core in the multi-core processor.
5. The method according to claim 2, wherein the adding a second sub-correspondence in the first correspondence specifically comprises:
determining available service cores in the service cores of the multi-core processor;
determining the second service core allocated to the second APP from the available service cores;
and adding a second sub-corresponding relation formed by the second APP and the second service core in the first corresponding relation.
6. The method of claim 4,
the modifying the first sub-correspondence to a third sub-correspondence, where the third sub-correspondence is a correspondence between the first APP and a third service core specifically includes:
determining available service cores in the service cores of the multi-core processor;
modifying the first sub-correspondence into a third sub-correspondence, where the third sub-correspondence is a correspondence between the first APP and the third service core, the third service core includes the first service core and a fourth service core, and the fourth service core is the available service core;
or,
determining available service cores in the service cores of the multi-core processor;
and modifying the first sub-correspondence into a third sub-correspondence, wherein the third sub-correspondence is the correspondence between the first APP and the third service core, the first service core comprises a third service core and a fifth service core, and the fifth service core is a service core in the multi-core processor.
7. A message distribution apparatus, comprising:
the message distribution method comprises the steps that an establishing unit is used for establishing a first corresponding relation between an application program APP and a service core in the process of initializing a multi-core processor or in the process of operating the multi-core processor so as to facilitate a distribution unit in the multi-core processor to distribute a message according to the first corresponding relation, wherein the first corresponding relation comprises a first sub-corresponding relation, the first sub-corresponding relation is the corresponding relation between a first APP and a first service core, and the first service core is the service core in the multi-core processor;
and the modifying unit is used for modifying the first corresponding relation into a second corresponding relation between the APP and the service cores in the running process of the multi-core processor and after the establishing unit establishes the first corresponding relation, so that the distributing unit can distribute the message according to the second corresponding relation, and the service cores in the second corresponding relation are the service cores in the multi-core processor.
8. The apparatus according to claim 7, wherein the modifying unit specifically comprises:
and the adding subunit is used for adding a second sub-corresponding relationship in the first corresponding relationship, the second sub-corresponding relationship is a corresponding relationship between a second APP and a second service core, and the second service core is a service core in the multi-core processor.
9. The apparatus according to claim 7, wherein the modifying unit specifically comprises:
a deleting subunit, configured to delete the first sub-correspondence in the first correspondence.
10. The apparatus according to claim 7, wherein the modifying unit specifically comprises:
and the modifying subunit is configured to modify the first sub-correspondence into a third sub-correspondence, where the third sub-correspondence is a correspondence between the first APP and a third service core, and the third service core is a service core in the multi-core processor.
11. The apparatus according to claim 8, wherein the adding subunit specifically comprises:
the first determining unit is used for determining available service cores in the service cores of the multi-core processor;
a second determining unit, configured to determine, after the first determining unit determines the available service cores, the second service core allocated to the second APP from the available service cores;
a first adding unit, configured to add, after the second determining unit determines the second service core, a second sub-correspondence relationship formed by the second APP and the second service core in the first correspondence relationship.
12. The apparatus according to claim 10, wherein the modifying subunit specifically comprises:
a third determining unit, configured to determine available service cores in the service cores of the multi-core processor;
a first modifying unit, configured to modify the first sub-correspondence to a third sub-correspondence after the third determining unit determines the available service core, where the third sub-correspondence is a correspondence between the first APP and the third service core, the third service core includes the first service core and a fourth service core, and the fourth service core is the available service core;
or,
a third determining unit, configured to determine available service cores in the service cores of the multi-core processor;
and the second modification unit is used for modifying the first sub-corresponding relationship into a third sub-corresponding relationship after the third determination unit determines an available service core, wherein the third sub-corresponding relationship is the corresponding relationship between the first APP and the third service core, the first service core comprises the third service core and a fifth service core, and the fifth service core is a service core in the multi-core processor.
CN2012100189279A 2012-01-20 2012-01-20 Method and device for distributing messages Pending CN102571593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100189279A CN102571593A (en) 2012-01-20 2012-01-20 Method and device for distributing messages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100189279A CN102571593A (en) 2012-01-20 2012-01-20 Method and device for distributing messages

Publications (1)

Publication Number Publication Date
CN102571593A true CN102571593A (en) 2012-07-11

Family

ID=46416094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100189279A Pending CN102571593A (en) 2012-01-20 2012-01-20 Method and device for distributing messages

Country Status (1)

Country Link
CN (1) CN102571593A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110043A (en) * 2007-09-04 2008-01-23 杭州华三通信技术有限公司 Resource management method of multiple nucleus system and its controlling nucleus
CN101146089A (en) * 2007-08-22 2008-03-19 杭州华三通信技术有限公司 Method for configuring core resources in multi-core system, multi-core system and management core
CN101217467A (en) * 2007-12-28 2008-07-09 杭州华三通信技术有限公司 An inter-core load dispensing device and method
CN101610209A (en) * 2008-11-28 2009-12-23 北京网康科技有限公司 A kind of Network method for stream processing and equipment of multi-core parallel concurrent

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146089A (en) * 2007-08-22 2008-03-19 杭州华三通信技术有限公司 Method for configuring core resources in multi-core system, multi-core system and management core
CN101110043A (en) * 2007-09-04 2008-01-23 杭州华三通信技术有限公司 Resource management method of multiple nucleus system and its controlling nucleus
CN101217467A (en) * 2007-12-28 2008-07-09 杭州华三通信技术有限公司 An inter-core load dispensing device and method
CN101610209A (en) * 2008-11-28 2009-12-23 北京网康科技有限公司 A kind of Network method for stream processing and equipment of multi-core parallel concurrent

Similar Documents

Publication Publication Date Title
CN108781229B (en) Method and server for controlling relocation of session of application
CN113315700B (en) Computing resource scheduling method, device and storage medium
US20200351204A1 (en) Method, apparatus, and system for load balancing of service chain
WO2019200716A1 (en) Fog computing-oriented node computing task scheduling method and device thereof
WO2019007345A1 (en) Method, apparatus, and system for selecting network slice, and storage medium
US10924966B2 (en) Management method, management unit, and system
CN107222324B (en) Service configuration method and device of network service
CN105791254B (en) Network request processing method and device and terminal
US11044729B2 (en) Function scheduling method, device, and system
CN108011899B (en) Session establishment optimization method, device and system
CN102316043B (en) Port virtualization method, switch and communication system
CN110267276B (en) Network slice deployment method and device
CN103516625A (en) Bandwidth virtualization
CN112703774A (en) Network slice management
KR20210023194A (en) Mec(mobile edge computing) system and control method thereof
CN103002517A (en) Data transmission method and data terminal
CN110650503B (en) Network access method, device, system and computer readable storage medium
CN105100150A (en) Cloud desktop migration method and apparatus, and distributed cloud desktop system
CN110290228B (en) Internet protocol IP address allocation method and device
CN109104309B (en) Edge server management system and method of CDN (content delivery network)
CN106792923A (en) A kind of method and device for configuring qos policy
US10498637B2 (en) Switch processing method, controller, switch, and switch processing system
CN107426109B (en) Traffic scheduling method, VNF module and traffic scheduling server
CN112905338A (en) Automatic allocation method and device for computing resources
CN109842892B (en) NSI PNF updating method, device and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120711