CN114138496A - Hardware resource management method and device, electronic equipment and storage medium - Google Patents

Hardware resource management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114138496A
CN114138496A CN202111488681.7A CN202111488681A CN114138496A CN 114138496 A CN114138496 A CN 114138496A CN 202111488681 A CN202111488681 A CN 202111488681A CN 114138496 A CN114138496 A CN 114138496A
Authority
CN
China
Prior art keywords
hardware resource
service
resource attribute
attribute
service functions
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
CN202111488681.7A
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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN202111488681.7A priority Critical patent/CN114138496A/en
Publication of CN114138496A publication Critical patent/CN114138496A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a hardware resource management method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource. The embodiment of the invention solves the problem that the prior art can only take effect of the service function configured firstly, can fully utilize hardware resources and improve the utilization rate of the hardware resources of the switching equipment.

Description

Hardware resource management method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a hardware resource management method and device, electronic equipment and a storage medium.
Background
Inside a Media Access Control (MAC) chip in the switching device, hardware resource attributes of each port of the switching device are usually stored, and a user can configure the hardware resource attributes on the port, so that after a message is received through the port, the message content is matched with the hardware resource attributes, corresponding editing actions (actions) are executed, such as basic qinqinq and flexible qinqinq, and Virtual Local Area Network (VLAN) ID replacement or addition is performed on different messages, thereby realizing different service functions of the switching device. The hardware resources refer to a register and a hardware table entry inside an MAC chip of the switching device, for example, a Service Classification List (SCL) module of the MAC chip, and two SCL hardware resources are shared and are respectively denoted as SCL _0 and SCL _1, and are used for storing message editing information of a port.
Fig. 1 is a schematic diagram illustrating a correspondence relationship between port attributes and SCL resources, and as shown in fig. 1, an SCL module includes two hardware resources, SCL _0 and SCL _1, which respectively correspond to SCL _ key _ type _0 attributes and SCL _ key _ type _1 attributes of ports, so that each port of the switch device has two attributes, SCL _ key _ type _0/1, and SCL _ key _ type _0/1 is a name of a network protocol field (e.g., src _ mac, vid, src _ ip, etc.). After receiving the message, the switching equipment acquires the value of a corresponding field in the message according to the SCL _ key _ type0/1 field set on the message inlet, obtains a combined index by combining with the inlet port _ id of the message, searches the editing action in the corresponding SCL hardware resource through the combined index, edits the message according to the SCL _ action if the message is hit, and otherwise, does not process the message. Wherein, the index composed of the port number and SCL _ key _ type0 will only be searched in SCL _0, and similarly, the index composed of the port number and SCL _ key _ type1 will only be searched in SCL _ 1; if the SCL _ key _ type0/1 of the port has corresponding fields set, and the message hits SCL _ action editing action in SCL0/1, only SCL _0 editing action will take effect. The difference between the service functions configured in the SCL hardware resources is only that SCL _ action is different, and SCL _ key _ type may be the same, for example, service function fun _1, SCL _ key _ type is vlan _ id, and SCL _ action is added with one layer of vid; the key _ type of the service function fun _2 is also vlan _ id, but the scl _ action is replacement vid, etc. The ports can be configured with a plurality of service functions, the maximum configurable number depends on the number of hardware resources corresponding to the ports, and the same service function is configured on different ports, independent from each other and not influenced by each other.
In the prior art, when a plurality of different service functions are configured on the same port, the configured service function takes effect first, and no new service function is supported to be configured any longer after the hardware resources are used up. The existing scheme ensures that when two or more service functions are configured on a port, the configuration is effective only first, so that the utilization rate of hardware resources is low.
Disclosure of Invention
In order to overcome the defects in the prior art, embodiments of the present invention provide a hardware resource management method and apparatus, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present invention provides a hardware resource management method, which is applied to a switching device, where the switching device includes an active hardware resource and a standby hardware resource, and the method includes:
acquiring the service priority of a service function to be configured;
if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions;
if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource;
and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
The method as described above, optionally, further includes:
if the service priority of the service function to be configured is judged and obtained to be lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
The method as described above, optionally, further includes:
if the judgment result shows that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment configures other service functions, and the second hardware resource attribute corresponding to the standby hardware resource does not configure other service functions;
judging whether the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute;
if yes, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource, and deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if not, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
The method as described above, optionally, further includes:
and if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are not configured with other service functions, configuring the service functions to be configured in the first hardware resource attribute and the main hardware resource.
As above, optionally, before deleting the first hardware resource attribute and the other service functions configured in the active hardware resource, the method further includes:
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource.
As above, optionally, before deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource, the method further includes:
and storing the second hardware resource attribute and the other service functions configured in the standby hardware resource.
The method as described above, optionally, further includes:
and if the service priority of the service function to be configured is lower than the service priorities of all other configured service functions, storing the service function to be configured and the corresponding service priority.
The method as described above, optionally, further includes:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are eliminated, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
The method as described above, optionally, further includes:
and if the second hardware resource attribute and the other service functions configured in the standby hardware resource are eliminated, configuring other service functions with the highest priority in the stored service functions in the second hardware resource attribute and the standby hardware resource.
As in the foregoing method, optionally, the configuring the service to be configured in the first hardware resource attribute and the active hardware resource includes:
determining message fields corresponding to the service functions to be configured and message editing actions corresponding to the indexes;
configuring the message field into the first hardware resource attribute;
combining each value of the message field and the port number of the port to be configured to serve as the index, and storing the index and each message editing action corresponding to the index in the main hardware resource.
In a second aspect, an embodiment of the present invention provides a hardware resource management apparatus, which is applied to a switch device, where the switch device includes an active hardware resource and a standby hardware resource, and the apparatus includes:
the acquisition module is used for acquiring the service priority of the service function to be configured;
the judging module is used for judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment and a second hardware resource attribute corresponding to a standby hardware resource are configured with other service functions;
the acquiring module is further configured to acquire a service priority of another service function if both a first hardware resource attribute corresponding to a primary hardware resource and a second hardware resource attribute corresponding to a standby hardware resource on a port to be configured of the switching device are configured with the other service function;
the judging module is further configured to judge whether the service priority of the service function to be configured is higher than the service priorities of all other configured services;
a deleting module, configured to delete the first hardware resource attribute and the other service functions configured in the main hardware resource if the service priority of the service function to be configured is higher than the service priorities of all other configured services;
and the configuration module is used for configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
As in the above apparatus, optionally, the determining module is further configured to:
judging whether the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute;
accordingly, the deletion module is further configured to: if the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
As in the above apparatus, optionally, the determining module is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment is configured with other service functions or not, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions;
after a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching device is configured with other service functions, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions, judging whether the service priority of the service function to be configured is higher than the service priority of the other service functions configured by the first hardware resource attribute;
accordingly, the configuration module is further configured to:
if the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource;
accordingly, the deletion module is further configured to:
deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
accordingly, the configuration module is further configured to:
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if the service priority of the service function to be configured is lower than the service priority of other service functions configured by the first hardware resource attribute, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
As in the above apparatus, optionally, the determining module is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment and a second hardware resource attribute corresponding to a standby hardware resource are not configured with other service functions;
accordingly, the configuration module is further configured to: if no other service function is configured in both a first hardware resource attribute corresponding to a main hardware resource and a second hardware resource attribute corresponding to a standby hardware resource on a port to be configured of the switching device, configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
As in the foregoing apparatus, optionally, the deleting module is further configured to:
before deleting the first hardware resource attribute and the other service functions configured in the active hardware resource, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource.
The apparatus as described above, optionally, further includes a storage module, where the storage module is configured to:
before deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource, storing the second hardware resource attribute and the other service functions configured in the standby hardware resource.
As in the above apparatus, optionally, the determining module is further configured to:
judging whether the service priority of the service function to be configured is lower than the service priorities of all other configured service functions;
accordingly, the storage module is further configured to:
and if the service priority of the service function to be configured is lower than the service priorities of all other configured service functions, storing the service function to be configured and the corresponding service priority.
As in the above apparatus, optionally, the configuration module is further configured to:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are deleted, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
accordingly, the deletion module is further configured to:
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
As in the above apparatus, optionally, the configuration module is further configured to:
and if the second hardware resource attribute and the other service functions configured in the standby hardware resource are deleted, configuring the other service functions with the highest priority in the stored service functions in the second hardware resource attribute and the standby hardware resource.
As with the apparatus described above, optionally, the configuration module is specifically configured to:
determining message fields corresponding to the service functions to be configured and message editing actions corresponding to the indexes;
configuring the message field into the first hardware resource attribute;
combining each value of the message field and the port number of the port to be configured to serve as the index, and storing the index and each message editing action corresponding to the index in the main hardware resource.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following method: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
The hardware resource management method provided by the embodiment of the invention comprises the steps of firstly obtaining the service priority of the service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; the service function to be configured is configured in the first hardware resource attribute and the main hardware resource, so that the problem that only the service function configured firstly can be taken into effect in the prior art is solved, the service function is configured based on the service priority, the service configuration is more reasonable, the hardware resource can be managed based on the priority of the service function, the hardware resource is fully utilized, and the hardware resource utilization rate of the switching equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a diagram illustrating a port attribute and SCL resource mapping relationship;
FIG. 2 is a flowchart illustrating a hardware resource management method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a hardware resource management method according to another embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a hardware resource attribute configuration flow in a hardware resource management method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a hardware resource management device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 2 is a schematic flow diagram of a hardware resource management method provided in an embodiment of the present invention, and as shown in fig. 2, the method is applied to a switching device, where the switching device includes an active hardware resource and a standby hardware resource, and the method includes:
step S21, acquiring the service priority of the service function to be configured;
specifically, the switching device includes a primary hardware resource and a standby hardware resource, so that each port of the switching device can set a first hardware resource attribute corresponding to the primary hardware resource and a second hardware resource attribute corresponding to the standby hardware resource, and implement an editing behavior on a packet received by the port by configuring a service function on the hardware resource attributes and the hardware resources, where the service function refers to a switching device function for editing a received packet based on the port, such as basic qinqinq (configuration) and flexible qinqinq, and performs VLAN ID replacement or addition on different packets, and different service functions have effective priorities. Meanwhile, in the switching device, only the service function configured on the attribute of the active hardware resource and the first hardware resource is effective, that is, when the attribute of the active hardware resource and the first hardware resource configures the service function 1, the attribute of the standby hardware resource and the second hardware resource configures the service function 2, only the service function 1 is effective. Therefore, in the prior art, generally, the standby hardware resource and the second hardware resource attribute are not configured with the service function, and after the active hardware resource and the first hardware resource attribute are configured with the service function, other service functions cannot be configured subsequently, which results in unreasonable configuration of the service function and low efficiency.
Step S22, if it is determined that both the first hardware resource attribute corresponding to the primary hardware resource and the second hardware resource attribute corresponding to the standby hardware resource on the port to be configured of the switch device are configured with other service functions, acquiring service priorities of the other service functions;
specifically, it is determined whether a first hardware resource attribute corresponding to a primary hardware resource on a port to be configured of the switch device and a second hardware resource attribute corresponding to a standby hardware resource configure other service functions, for example, an attribute of the port to be configured may be read through a Software Development Kit (SDK) interface, if the port attribute is not configured, the port attribute is null (none), if the first hardware resource attribute and the second hardware resource attribute both configure other service functions, priorities of the other service functions are respectively obtained, a service priority of the service function F1 configured by the first hardware resource attribute is recorded as P1, and a service priority of the service function F2 configured by the second hardware resource attribute is recorded as P2. The service priority can be obtained through a user manual, or when the service function is configured in the hardware resource attribute, the priority of the configured service function is stored in the memory of the switching device, and the service priority stored in the memory is read to determine P1 and P2, and P1 is greater than P2, that is, the service priority of the service function F1 configured in the active hardware resource attribute is the highest, so that the service function configured in the active hardware resource attribute can be ensured to be effective.
Step S23, if it is determined that the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource;
specifically, if P0> P1, that is, P0> P1> P2, at this time, the priority of the service function configured later is the highest, the first hardware resource attribute and the other service functions configured in the active hardware resource are deleted.
In addition, in practical applications, there is also a possibility that some service functions are cleared by the user after being validated, where clearing means that the user deletes a service function configured on a port after determining that the certain service function is not used, that is, deletes the hardware resource attribute on the port and the service function configured on the hardware resource. If the service function F1 configured in the active hardware resource and the first hardware resource attribute is eliminated, then other service functions need to be configured in the active hardware resource and the first hardware resource attribute, in order to make the service function configuration more reasonable, before deleting the first hardware resource attribute and the service function F1 configured in the active hardware resource, the service function F2 configured in the second hardware resource attribute and the standby hardware resource may also be deleted first, so that no service function configured in the second hardware resource attribute and the standby hardware resource exists, the service function F1 may be configured in the second hardware resource attribute and the standby hardware resource, that is, when the service priority of the service function to be configured is higher than the service priority of the service function configured in the first hardware resource attribute, the service function configured in the first hardware resource attribute and the hardware resource before is configured in the second hardware resource attribute and the standby hardware resource, and configuring the service function to be configured into the first hardware resource attribute and the main hardware resource, and adjusting the set service function to realize the management of the hardware resource based on the priority of the service function and reasonably utilize the hardware resource.
Step S24, configuring the service function to be configured in the first hardware resource attribute and the active hardware resource.
Specifically, the first hardware resource attribute is currently a none, and the service function to be configured may be directly configured in the first hardware resource attribute and the active hardware resource.
Specifically, a message field key _ type corresponding to a service function to be configured and a message editing action corresponding to each index corresponding to the service function are determined, where the index is a combination of each value corresponding to the key _ type and a Port number portID of a Port receiving a message, for example, the value of the key _ type is key _ type _1, the Port number is Port1, the index is key _ type _1_ Port1, and there may be various combinations of the field value and the Port number, as long as the combination is unique.
Then, the message field is configured in a first hardware resource attribute of the port to be configured, for example, key _ type ═ VLAN ID is configured in the first hardware resource attribute, and each index formed by combining each message field and the port and the message editing action corresponding to each index are stored in the active hardware resource, that is, the editing action entry of the service function is installed in the active hardware resource. Thus, after the port receives the message, firstly, the message field is determined through the first hardware resource attribute in the port, then the value of the message field in the message is read, the value and the port number are combined to obtain the index, after the corresponding entry is hit in the main hardware resource through the index, the message is edited according to the hit action, for example, the VLAN ID is replaced, and the like, so that the function to be configured with higher priority is configured on the port on the premise that the port is configured with other service functions.
The hardware resource management method provided by the embodiment of the invention comprises the steps of firstly obtaining the service priority of the service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured services, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; the service function to be configured is configured in the first hardware resource attribute and the main hardware resource, so that the problem that the service function configured firstly can only be valid in the prior art is solved, the service function is configured based on the service priority, the service configuration is more reasonable, the hardware resource can be managed based on the priority of the service function, the hardware resource is fully utilized, and the utilization rate of the hardware resource of the switching equipment is improved.
On the basis of the above embodiment, further, the method further includes:
if the service priority of the service function to be configured is judged and obtained to be lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
Specifically, if the relationship between the service priority P0 of the service function F0 to be configured, the service priority P1 of the service function F1 configured by the first hardware resource attribute, and the service priority P2 of the service function F2 configured by the second hardware resource attribute is P1> P0> P2, the service function F2 configured in the second hardware resource attribute and the standby hardware resource is deleted, and the service function F0 to be configured is configured in the second hardware resource attribute and the standby resource, that is, the configuration with the highest service priority is in the first hardware resource attribute and the active hardware resource, and the configuration with the second highest service priority is in the second hardware resource attribute and the standby hardware resource, so that the active and standby hardware resources can be fully utilized, and the configuration method is the same as the method configured in the first hardware resource attribute and the active hardware resource, and is not described herein again.
In practical applications, before deleting the service function F2 configured in the second hardware resource attribute and the standby hardware resource, the service function F2 may be stored in the memory of the switching device, so that when the later condition is met, the service function F2 may be configured in the port again.
If P1> P2> P0, the service function F0 and the priority P0 to be configured are directly stored in the memory of the switching equipment.
On the basis of the foregoing embodiments, further, if it is determined that the first hardware resource attribute corresponding to the active hardware resource on the port to be configured of the switch device is configured with other service functions, and the second hardware resource attribute corresponding to the standby hardware resource is not configured with other service functions;
judging whether the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute;
if yes, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource, and deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if not, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
Specifically, if only the first hardware resource attribute on the current port to be configured is configured with the service function F1, and the second hardware resource attribute is configured with the none, it is determined whether the service priority P0 of the service function F0 to be configured is higher than the service priority P1 of the service function F1, if P0> P1, at this time, the second hardware resource attribute is configured with the none, the service function F1 is configured into the second hardware resource attribute and the standby hardware resource, then the service function F1 configured in the first hardware resource attribute and the main hardware resource is deleted, and then the service function F0 is configured in the first hardware resource attribute and the main hardware resource; if P0< P1, the service function F0 is configured directly in the second hardware resource attribute and the standby hardware resource.
On the basis of the foregoing embodiments, further, if it is determined that neither the first hardware resource attribute corresponding to the active hardware resource on the port to be configured of the switch device nor the second hardware resource attribute corresponding to the standby hardware resource is configured with other service functions, the service function to be configured is configured in the first hardware resource attribute and the active hardware resource.
Specifically, if the first hardware resource attribute on the port to be configured is configured as a none, and the second hardware resource attribute is also configured as a none, the service function F0 to be configured is directly configured in the first hardware resource attribute and the active hardware resource.
The hardware resource management method provided by the embodiment of the invention can effectively allocate hardware resources according to the priority of the service function and improve the utilization rate of the hardware resources of the switching equipment.
On the basis of the above embodiments, the method further includes:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are deleted, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
Specifically, if the user actively clears the first hardware resource attribute and the service function F1 configured in the active hardware resource, if a service function F2 is configured in the second hardware resource attribute at this time, the service function F2 is configured in the first hardware resource attribute and the active hardware resource, and the second hardware resource attribute and the service function F2 configured in the standby hardware resource are deleted, if other service functions F5, F6, and F7 are also stored in the memory, the service function F5 with the highest service priority is found out from the other service functions, the service function F5 is configured in the second hardware resource attribute and the standby hardware resource, the service function F5 stored in the memory is deleted, and if no other service functions are stored in the memory, the second hardware resource attribute is configured as none.
If the user actively clears the service function F2 configured in the second hardware resource attribute and the standby hardware resource, and the memory also stores other service functions F5, F6, and F7, the service function F5 with the highest service priority is found from the other service functions, the service function F5 is configured in the second hardware resource attribute and the standby hardware resource, the service function F5 stored in the memory is deleted, and if the memory does not store other service functions, the second hardware resource attribute is configured as none.
Fig. 3 is a schematic flow chart of a hardware resource management method according to another embodiment of the present invention, as shown in fig. 3, the switch device includes two hardware resources, SCL _0 and SCL _1, SCL _0 is an active hardware resource, the corresponding port has an attribute SCL _ key _ type0 corresponding to SCL _0 and an attribute SCL _ key _ type1 corresponding to SCL _1, and the service function Func _ x to be configured needs to be configured in the port, the method includes:
step S301, setting a service function Func _ x on a port, that is, receiving an instruction to set Func _ x on the port;
step S302, judging whether SCL _ key _ type0 and SCL _ key _ type1 are both configured service functions, if yes, jumping to step S312, otherwise executing step S303;
step S303, judging whether SCL _ key _ type0 is configured with service functions and SCL _ key _ type1 is not configured with service functions, if yes, executing step S314, otherwise, executing step S304;
step S304, judging whether SCL _ key _ type0 is not configured with service function and SCL _ key _ type1 is configured with service function, if yes, executing step S308, otherwise executing step S305;
step S305, judging whether the Func _ x priority is higher than the SCL _ key _ type0 configured service function service priority, if so, executing step S313, otherwise, executing step S306;
step S306, judging whether the Func _ x priority is higher than the SCL _ key _ type1 configured service function service priority, if so, executing step S310, otherwise, executing step S307;
step S307, the hardware resources are insufficient, and the configuration is failed;
step S308, judging whether the Func _ x priority is higher than the SCL _ key _ type1 configured service function service priority, if so, executing step S312, otherwise, executing step S309;
step S309, transferring the service function configured on SCL _1 to SCL _ 0;
step S310, deleting the service function configured on SCL _ 1;
step 311, configuring a service function Func _ x on SCL _ 1;
step S312, configuring a service function Func _ x on SCL _ 0;
step S313, deleting the service function configured on SCL _ 1;
step S314, judging whether the Func _ x priority is higher than the SCL _ key _ type0 configured service function service priority, if so, executing step S315, otherwise, executing step S318;
step S315, transferring the service function configured on SCL _0 to SCL _ 1;
step S316, deleting the service function configured on SCL _ 0;
step S317, configuring a service function Func _ x on SCL _ 0;
step S318, configuring the service function Func _ x on SCL _ 1.
The above steps can be summarized as follows: when a service function Func _ x is configured on a port, firstly, whether the port SCL _ key _ type0/SCL _ key _ type1 is configured with other service functions or not is judged, and the key _ type is none under the condition of no configuration; if neither SCL _ key _ type0 nor SCL _ key _ type1 is configured with service functions, directly configuring Func _ x on SCL _0, otherwise, comparing the priority levels of Func _ x and the already configured service functions; if only one service function is configured on the port, comparing the priority of the Func _ x and the priority of the configured service function of the port, ensuring that the service function with high priority is configured on SCL _0, the service function with low priority is configured on SCL _1, if the port has configured the service function with high priority on SCL _1 before the Func _ x is configured, and SCL _0 has not configured the service function, moving the configuration of SCL _1 to SCL _0, and configuring Func _ x on SCL _ 1; if the port is already configured with two service functions before Func _ x is configured, SCL _0 and SCL _1 are respectively occupied, the priority of the service functions in Func _ x, SCL _0 and SCL _1 needs to be compared in sequence; if the number of the hardware resources is lower than the number of the hardware resources, the hardware resources cannot be configured, and the hardware resources are prompted to be used up; if the priority is higher than SCL _1 but lower than SCL _0, removing the service function originally configured in SCL _1 and configuring the service function as Func _ x; if Func _ x is higher than SCL _0 and SCL _1 at the same time, deleting the service function of SCL _1, moving the service function on SCL _0 to SCL _1, and configuring Func _ x to SCL _ 0.
Fig. 4 is a schematic diagram of a hardware resource attribute configuration flow in the hardware resource management method provided in the embodiment of the present invention, and as shown in fig. 4, the priority order of service functions is: func _1> Func _2> Func _3> Func _4, then: after the port is initialized, SCL _ key _ type0 and SCL _ key _ type1 are defaulted to none; when the service function Func _2 is configured, because the port is not configured with the service function yet, the Func _2 is directly configured on SCL _ 0; when the service function Func _3 is configured, the priority is lower than Func _2, and SCL _1 is none, and the configuration is only on SCL _ 1; configuring a service function Func _1, which has a higher priority than Func _2 and Func _3, so that the configuration of Func _3 is deleted, the configuration of Func _2 is moved to SCL _1, and the service function Func _1 is configured at SCL _ 0; when the service function Func _4 is configured, the service function Func _4 cannot be configured because the priority of the service function Func _4 is lower than that of the service function Func _1 and Func _2 currently configured by the port; when the service function Func _1 is deleted, releasing the configuration of the SCL _0 and recovering to a none state; on the basis of the above steps, configuring a service function Func _3, and moving the configuration of Func _2 to SCL _0 and the configuration of Func _3 to SCL _1 because the priority is lower than Func _ 2; and finally, when the service functions Func _2 and Func _3 are deleted, restoring the corresponding SCL to be in the none state. By the method, the SCL resources can be managed based on the priority of the service function, and two SCL resources, namely SCL _0 and SCL _1, are fully utilized, so that the utilization rate of the hardware resources is improved. It should be noted that the hardware resource management method based on service function priority provided in the embodiment of the present invention is also applicable to other software/hardware resource management problems, for example, occupation of global resources by multiple modules in a process may manage limited global resources based on priority, and ensure that a module with high priority or a service preferentially uses resources.
Based on the same inventive concept, an embodiment of the present invention further provides a hardware resource management apparatus, which is applied to a switching device, where the switching device includes an active hardware resource and a standby hardware resource, and the apparatus includes: an obtaining module 51, a judging module 52, a deleting module 53 and a configuring module 54, wherein:
the obtaining module 51 is configured to obtain a service priority of a service function to be configured; the judging module 52 is configured to judge whether a first hardware resource attribute corresponding to a primary hardware resource on a port to be configured of the switching device and a second hardware resource attribute corresponding to a standby hardware resource have configured other service functions; the obtaining module 51 is further configured to, if both a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switch device and a second hardware resource attribute corresponding to a standby hardware resource have been configured with other service functions, obtain service priorities of the other service functions; the judging module is further configured to judge whether the service priority of the service function to be configured is higher than the service priorities of all other configured service functions; the deleting module 53 is configured to delete the first hardware resource attribute and the other service functions configured in the main hardware resource if the service priority of the service function to be configured is higher than the service priorities of all other configured services; the configuration module 54 is configured to configure the service function to be configured in the first hardware resource attribute and the active hardware resource.
As the above apparatus, optionally, the determining module 52 is further configured to:
judging whether the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute;
accordingly, the deleting module 53 is further configured to: if the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module 54 is further configured to:
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
As the above apparatus, optionally, the determining module 52 is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment is configured with other service functions or not, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions;
after a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching device is configured with other service functions, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions, judging whether the service priority of the service function to be configured is higher than the service priority of the other service functions configured by the first hardware resource attribute;
accordingly, the configuration module 54 is further configured to:
if the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource;
accordingly, the deleting module 53 is further configured to:
deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
accordingly, the configuration module 54 is further configured to:
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if the service priority of the service function to be configured is lower than the service priority of other service functions configured by the first hardware resource attribute, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
As the above apparatus, optionally, the determining module 52 is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment and a second hardware resource attribute corresponding to a standby hardware resource are not configured with other service functions;
accordingly, the configuration module 54 is further configured to: if no other service function is configured in both a first hardware resource attribute corresponding to a main hardware resource and a second hardware resource attribute corresponding to a standby hardware resource on a port to be configured of the switching device, configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
As with the above apparatus, optionally, the deleting module 52 is further configured to:
before deleting the first hardware resource attribute and the other service functions configured in the active hardware resource, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module 54 is further configured to:
and configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource.
The apparatus as described above, optionally, further includes a storage module, where the storage module is configured to:
before deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource, storing the second hardware resource attribute and the other service functions configured in the standby hardware resource.
As the above apparatus, optionally, the determining module 52 is further configured to:
judging whether the service priority of the service function to be configured is lower than the service priorities of all other configured service functions;
accordingly, the storage module is further configured to:
and if the service priority of the service function to be configured is lower than the service priorities of all other configured service functions, storing the service function to be configured and the corresponding service priority.
As with the apparatus described above, optionally, the configuration module 54 is further configured to:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are deleted, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
accordingly, the deleting module 53 is further configured to:
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module 54 is further configured to:
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
As with the apparatus described above, optionally, the configuration module 54 is further configured to:
and if the second hardware resource attribute and the other service functions configured in the standby hardware resource are deleted, configuring the other service functions with the highest priority in the stored service functions in the second hardware resource attribute and the standby hardware resource.
As with the above apparatus, optionally, the configuration module 54 is specifically configured to:
determining message fields corresponding to the service functions to be configured and message editing actions corresponding to the indexes;
configuring the message field into the first hardware resource attribute;
combining each value of the message field and the port number of the port to be configured to serve as the index, and storing the index and each message editing action corresponding to the index in the main hardware resource.
The apparatus provided in the embodiment of the present invention is configured to implement the method, and its functions specifically refer to the method embodiment, which is not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device includes: a processor (processor)61, a memory (memory)62, and a bus 63;
wherein, the processor 61 and the memory 62 complete the communication with each other through the bus 63;
the processor 61 is configured to call program instructions in the memory 62 to perform the methods provided by the above-described method embodiments, including, for example: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include: acquiring the service priority of a service function to be configured; if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions; if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource; and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatuses and the like are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (22)

1. A hardware resource management method is applied to a switching device, wherein the switching device includes a primary hardware resource and a standby hardware resource, and the method includes:
acquiring the service priority of a service function to be configured;
if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are both configured with other service functions, acquiring the service priority of the other service functions;
if the service priority of the service function to be configured is higher than the service priorities of all other configured service functions, deleting the first hardware resource attribute and the other configured service functions in the main hardware resource;
and configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
2. The method of claim 1, further comprising:
if the service priority of the service function to be configured is judged and obtained to be lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
3. The method of claim 1, further comprising:
if the judgment result shows that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment configures other service functions, and the second hardware resource attribute corresponding to the standby hardware resource does not configure other service functions;
judging whether the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute;
if yes, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource, and deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if not, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
4. The method of claim 1, further comprising:
and if judging that the first hardware resource attribute corresponding to the main hardware resource on the port to be configured of the switching equipment and the second hardware resource attribute corresponding to the standby hardware resource are not configured with other service functions, configuring the service functions to be configured in the first hardware resource attribute and the main hardware resource.
5. The method according to claim 1, wherein before deleting the first hardware resource attribute and the other service functions configured in the active hardware resource, further comprising:
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource.
6. The method according to claim 2 or 5, further comprising, before deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource:
and storing the second hardware resource attribute and the other service functions configured in the standby hardware resource.
7. The method of claim 6, further comprising:
and if the service priority of the service function to be configured is lower than the service priorities of all other configured service functions, storing the service function to be configured and the corresponding service priority.
8. The method of claim 7, further comprising:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are eliminated, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
9. The method of claim 8, further comprising:
and if the second hardware resource attribute and the other service functions configured in the standby hardware resource are eliminated, configuring other service functions with the highest priority in the stored service functions in the second hardware resource attribute and the standby hardware resource.
10. The method of claim 1, wherein the configuring the service to be configured in the first hardware resource attribute and the active hardware resource comprises:
determining message fields corresponding to the service functions to be configured and message editing actions corresponding to the indexes;
configuring the message field into the first hardware resource attribute;
combining each value of the message field and the port number of the port to be configured to serve as the index, and storing the index and each message editing action corresponding to the index in the main hardware resource.
11. A hardware resource management device is applied to a switching device, wherein the switching device includes a main hardware resource and a standby hardware resource, and the device includes:
the acquisition module is used for acquiring the service priority of the service function to be configured;
the judging module is used for judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment and a second hardware resource attribute corresponding to a standby hardware resource are configured with other service functions;
the acquiring module is further configured to acquire a service priority of another service function if both a first hardware resource attribute corresponding to a primary hardware resource and a second hardware resource attribute corresponding to a standby hardware resource on a port to be configured of the switching device are configured with the other service function;
the judging module is further configured to judge whether the service priority of the service function to be configured is higher than the service priorities of all other configured service functions;
a deleting module, configured to delete the first hardware resource attribute and the other service functions configured in the main hardware resource if the service priority of the service function to be configured is higher than the service priorities of all other configured services;
and the configuration module is used for configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
12. The apparatus of claim 11, wherein the determining module is further configured to:
judging whether the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute;
accordingly, the deletion module is further configured to: if the service priority of the service function to be configured is lower than other service functions configured by the first hardware resource attribute and higher than other service functions configured by the second hardware resource attribute, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
13. The apparatus of claim 11, wherein the determining module is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment is configured with other service functions or not, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions;
after a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching device is configured with other service functions, and a second hardware resource attribute corresponding to a standby hardware resource is not configured with other service functions, judging whether the service priority of the service function to be configured is higher than the service priority of the other service functions configured by the first hardware resource attribute;
accordingly, the configuration module is further configured to:
if the service priority of the service function to be configured is higher than the service priorities of other service functions configured by the first hardware resource attribute, configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource;
accordingly, the deletion module is further configured to:
deleting the first hardware resource attribute and the other service functions configured in the main hardware resource;
accordingly, the configuration module is further configured to:
configuring the service function to be configured in the first hardware resource attribute and the main hardware resource;
and if the service priority of the service function to be configured is lower than the service priority of other service functions configured by the first hardware resource attribute, configuring the service function to be configured in the second hardware resource attribute and the standby hardware resource.
14. The apparatus of claim 11, wherein the determining module is further configured to:
judging whether a first hardware resource attribute corresponding to a main hardware resource on a port to be configured of the switching equipment and a second hardware resource attribute corresponding to a standby hardware resource are not configured with other service functions;
accordingly, the configuration module is further configured to: if no other service function is configured in both a first hardware resource attribute corresponding to a main hardware resource and a second hardware resource attribute corresponding to a standby hardware resource on a port to be configured of the switching device, configuring the service function to be configured in the first hardware resource attribute and the main hardware resource.
15. The apparatus of claim 11, wherein the deletion module is further configured to:
before deleting the first hardware resource attribute and the other service functions configured in the active hardware resource, deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring other service functions configured by the first hardware resource attribute in the second hardware resource attribute and the standby hardware resource.
16. The apparatus of claim 12 or 15, further comprising a storage module configured to:
before deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource, storing the second hardware resource attribute and the other service functions configured in the standby hardware resource.
17. The apparatus of claim 16, wherein the determining module is further configured to:
judging whether the service priority of the service function to be configured is lower than the service priorities of all other configured service functions;
accordingly, the storage module is further configured to:
and if the service priority of the service function to be configured is lower than the service priorities of all other configured service functions, storing the service function to be configured and the corresponding service priority.
18. The apparatus of claim 17, wherein the configuration module is further configured to:
if the first hardware resource attribute and the other service functions configured in the main hardware resource are eliminated, configuring other service functions corresponding to the second hardware resource attribute in the first hardware resource attribute and the main hardware resource;
accordingly, the deletion module is further configured to:
deleting the second hardware resource attribute and the other service functions configured in the standby hardware resource;
accordingly, the configuration module is further configured to:
and configuring other business functions with the highest priority in the second hardware resource attribute and the stored business functions in the standby hardware resource.
19. The apparatus of claim 18, wherein the configuration module is further configured to:
and if the second hardware resource attribute and the other service functions configured in the standby hardware resource are eliminated, configuring other service functions with the highest priority in the stored service functions in the second hardware resource attribute and the standby hardware resource.
20. The apparatus of claim 11, wherein the configuration module is specifically configured to:
determining message fields corresponding to the service functions to be configured and message editing actions corresponding to the indexes;
configuring the message field into the first hardware resource attribute;
combining each value of the message field and the port number of the port to be configured to serve as the index, and storing the index and each message editing action corresponding to the index in the main hardware resource.
21. An electronic device, comprising:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 10.
22. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 10.
CN202111488681.7A 2021-12-08 2021-12-08 Hardware resource management method and device, electronic equipment and storage medium Pending CN114138496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111488681.7A CN114138496A (en) 2021-12-08 2021-12-08 Hardware resource management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111488681.7A CN114138496A (en) 2021-12-08 2021-12-08 Hardware resource management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114138496A true CN114138496A (en) 2022-03-04

Family

ID=80384625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111488681.7A Pending CN114138496A (en) 2021-12-08 2021-12-08 Hardware resource management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114138496A (en)

Similar Documents

Publication Publication Date Title
CN107104824A (en) A kind of network topology determines method and apparatus
CN106936683B (en) A kind of method and device for realizing tunnel configuration
CN107547364A (en) Route sending-down method, device and the network equipment
US9135833B2 (en) Process for selecting compressed key bits for collision resolution in hash lookup table
CN110798412A (en) Multicast service processing method, device, cloud platform, equipment and readable storage medium
CN105282057B (en) Flow table updating method, controller and flow table analysis device
EP2928129B1 (en) Method and network devices for determining an administrative domain in a virtual cluster
RU2602333C2 (en) Network system, packet processing method and storage medium
Ma et al. Cost-aware multi-domain virtual data center embedding
Qing et al. Hybrid virtual network embedding with K-core decomposition and time-oriented priority
CN103188120A (en) Detection method for packet loss of multicast business and device thereof
CN106921576B (en) Virtualization system-based data network and management network flow separation method and device
EP3461083B1 (en) Data processing method and device
CN102984739A (en) Breakdown information processing method and processing device
CN106330783A (en) Method and device for reporting OpenFlow switch capabilities
CN110581800B (en) Method and device for creating virtual router interface, storage medium and equipment
CN112187635B (en) Message forwarding method and device
CN105744010A (en) Method and device for realizing network address translation and access control list rule polymerization
CN106209634B (en) Learning method and device of address mapping relation
CN111885044A (en) Method, device, equipment and storage medium for configuring multiple network cards of cloud host
CN111327543A (en) Message forwarding method and device, storage medium and electronic device
CN114138496A (en) Hardware resource management method and device, electronic equipment and storage medium
CN108199975B (en) Flow control method and device
CN113395183B (en) Virtual node scheduling method and system for network simulation platform VLAN interconnection
CN116015796A (en) Flow table updating method and device, firewall equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination