CN116483767A - Command response method and device, electronic equipment and storage medium - Google Patents

Command response method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116483767A
CN116483767A CN202310617717.XA CN202310617717A CN116483767A CN 116483767 A CN116483767 A CN 116483767A CN 202310617717 A CN202310617717 A CN 202310617717A CN 116483767 A CN116483767 A CN 116483767A
Authority
CN
China
Prior art keywords
target
command
interface
interfaces
matching
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
CN202310617717.XA
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.)
Inspur Shandong Computer Technology Co Ltd
Original Assignee
Inspur Shandong Computer Technology 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 Inspur Shandong Computer Technology Co Ltd filed Critical Inspur Shandong Computer Technology Co Ltd
Priority to CN202310617717.XA priority Critical patent/CN116483767A/en
Publication of CN116483767A publication Critical patent/CN116483767A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Abstract

The application discloses a command response method, a device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: dividing a plurality of interfaces supported by a substrate controller into a plurality of categories; receiving a target command, matching the target command with a category, and determining the target category matched with the target command; matching the target command with an interface under the target category, and determining a target interface matched with the target command; responding to the target command based on the target interface. According to the command response method, interfaces supported by the BMC are divided into a plurality of categories, when a target command is received, the target command is subjected to target category matching, then the target command is subjected to target interface matching under the target category, all the interfaces supported by the substrate controller are not required to be matched one by one, the efficiency of determining the matched target interfaces is improved in a step-by-step matching mode, and further the command response efficiency is improved.

Description

Command response method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technology, and more particularly, to a command response method and apparatus, an electronic device, and a computer readable storage medium.
Background
The BMC (Baseboard Management Controller, substrate controller) can realize the functions of relevant control, information supervision and the like of the server, and is a platform for visually presenting the information of the server. The Redfish specification is an open industry standard specification that provides simple, modern, and secure management functions for extensible platform hardware. The BMC is used for supporting to acquire various information of the server through a Redfish protocol and realizing device management by utilizing a Restful interface.
In the related art, the BMC supports a total of 206 Restful interfaces, after receiving a command, the BMC matches and determines matched interfaces one by one from the 206 Restful interfaces, and then returns data through the matched interfaces responding to the command. The process of matching one by one takes a long time, and the command response efficiency of the BMC in the related art is low.
Therefore, how to improve the command response efficiency of the BMC is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a command response method and device, electronic equipment and a computer readable storage medium, and the command response efficiency of a BMC is improved.
To achieve the above object, the present application provides a command response method, including:
dividing a plurality of interfaces supported by a substrate controller into a plurality of categories;
receiving a target command, matching the target command with the category, and determining a target category matched with the target command;
matching the target command with an interface under the target category, and determining a target interface matched with the target command;
responding to the target command based on the target interface.
Wherein the method for classifying the plurality of interfaces supported by the substrate controller into a plurality of categories comprises the following steps:
the plurality of interfaces supported by the substrate controller are divided into a plurality of categories according to the interface function.
Wherein the category includes any one or a combination of any of a session service interface, an account service interface, a hardware interface, a management interface, a system interface, an update service interface, a task service interface, and an event service interface.
Wherein the target command is a command of a uniform resource location system, and matching the target command with the category comprises:
and matching a third segment of characters in the target command with the category.
Wherein before receiving the target command, the method further comprises:
receiving enabling commands for a plurality of interfaces, and setting enabling definitions of the interfaces based on the enabling commands; wherein the enabling definition includes valid and invalid;
correspondingly, matching the target command with the interface under the target category comprises the following steps:
and matching the target command with the interfaces which are effective under the target category.
Wherein said receiving an enable command for a plurality of said interfaces comprises:
receiving an enabling command conforming to an intelligent platform management interface protocol; wherein the enable command includes a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface.
Wherein after the plurality of interfaces supported by the substrate controller are divided into a plurality of categories, the method further comprises:
counting the matching quantity of a plurality of interfaces within a preset time period, and determining the sum of the matching quantity of all interfaces in each category;
sorting all the classes from big to small according to the sum of the matching numbers of all the interfaces in the classes to obtain a first sorting result;
sequencing all the interfaces in each category from large to small according to the matching quantity of the interfaces in each category to obtain a second sequencing result;
correspondingly, matching the target command with the category, and determining the target category matched with the target command comprises the following steps:
sequentially matching the target command with the categories according to the first sequencing result, and determining a target category matched with the target command;
correspondingly, matching the target command with the interface under the target category, and determining the target interface matched with the target command comprises the following steps:
and matching the target command with the interface under the target category according to the second sequencing result corresponding to the target category, and determining the target interface matched with the target command.
To achieve the above object, the present application provides a command response device including:
the dividing module is used for dividing a plurality of interfaces supported by the substrate controller into a plurality of categories;
the first matching module is used for receiving a target command, matching the target command with the category and determining a target category matched with the target command;
the second matching module is used for matching the target command with the interface under the target category and determining a target interface matched with the target command;
and the response module is used for responding to the target command based on the target interface.
To achieve the above object, the present application provides an electronic device, including:
a memory for storing a computer program;
and a processor for implementing the steps of the command response method as described above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the command response method as described above.
According to the scheme, the command response method provided by the application comprises the following steps: dividing a plurality of interfaces supported by a substrate controller into a plurality of categories; receiving a target command, matching the target command with the category, and determining a target category matched with the target command; matching the target command with an interface under the target category, and determining a target interface matched with the target command; responding to the target command based on the target interface.
According to the command response method, interfaces supported by the BMC are divided into a plurality of categories, when a target command is received, the target command is subjected to target category matching, then the target command is subjected to target interface matching under the target category, all the interfaces supported by the substrate controller are not required to be matched one by one, the efficiency of determining the matched target interfaces is improved in a step-by-step matching mode, and further the command response efficiency is improved.
Furthermore, the enabling command is used for enabling the interfaces supported by the BMC to be defined, when the subsequent interfaces are matched, only the effective interfaces are matched, and the matching of the ineffective interfaces is skipped, so that the matching efficiency of the interfaces is further improved, and the command response efficiency is further improved.
Further, according to the method and the device, each class is ranked from large to small according to the sum of the matching numbers of all interfaces in each class, when the subsequent classes are matched, the matching is carried out in sequence according to the ranking results, the class ranking is higher than the previous description that the client uses the interfaces of the class, and the matching efficiency of the target class can be improved by preferentially matching the classes ranked at the previous time. According to the method, all interfaces in each category are ordered from large to small according to the matching quantity of the interfaces in each category, when the subsequent interfaces are matched, the interfaces are matched in sequence according to the ordering result, the interface ordering is higher, the frequency of using the interfaces by a client is higher, the interfaces with the front priority matching ordering can improve the matching efficiency of the target interfaces, and further the command response efficiency is improved.
The application also discloses a command response device, electronic equipment and a computer readable storage medium, and the technical effects can be achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a command response method according to an exemplary embodiment;
FIG. 2 is a flowchart illustrating another command response method according to an example embodiment;
FIG. 3 is a block diagram of a command response device according to an exemplary embodiment;
fig. 4 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application. In addition, in the embodiments of the present application, "first," "second," and the like are used to distinguish similar objects, and are not necessarily used to describe a particular order or sequence.
The embodiment of the application discloses a command response method, which improves the command response efficiency of BMC.
Referring to fig. 1, a flowchart of a command response method is shown according to an exemplary embodiment, as shown in fig. 1, including:
s101: dividing a plurality of interfaces supported by a substrate controller into a plurality of categories;
in this step, the interfaces supported by the BMC are divided into a plurality of classes, and in this embodiment, the interfaces may be Restful interfaces, and there are 206 Restful interfaces supported by the BMC.
As one possible implementation, the plurality of interfaces supported by the substrate controller are divided into a plurality of categories, including: the plurality of interfaces supported by the substrate controller are divided into a plurality of categories according to the interface function.
In a specific implementation, the interfaces may be classified according to interface functions, and for the total of 206 Restful interfaces, the interfaces may be classified into 8 classes, which are session service (SessionService) interface, account service (accountvervice) interface, hardware (Chassis) interface, management (manager) interface, systems) interface, update service (UpdateService) interface, task service (TaskService) interface, and event service (EventService) interface, respectively. The session service (SessionService) interface may be expressed as https: the interface of account service (AccountService) can be expressed as https:// BMC_IP/repash/v 1/AccountService, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/Chassis, the interface of hardware (Chassis) can be expressed as https:// BMC_IP/repash/v 1/Chassis, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/manager, the interface of system (Systems) can be expressed as https:// BMC_IP/repash/v 1/Systems, the interface of update service (UpdService) can be expressed as htps/IP/v 1/datavice, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/Systems, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/interface of sub-26.
S102: receiving a target command, matching the target command with the category, and determining a target category matched with the target command;
in this step, when a target command is received, the target command is matched with a plurality of categories, and a target category matched with the target command is determined. Wherein the target command may be a URL (uniform resource location system, uniform Resource Locator) command, the URL command is typically segmented by "/", for example, the target command of one URL may be expressed as: https://192.168.16.8/redfish/v1/Chassis/1/PCIEDevices/0.
In this embodiment, the third character in the target command may be matched to multiple categories. For the above example, "Chassis" is matched to the representation of the multiple classes shown in the previous step, and "https:// BMC_IP/redfish/v1/Chassis" is matched to the target class for which the target command matches is a hardware interface.
S103: matching the target command with an interface under the target category, and determining a target interface matched with the target command;
in the step, the target command is matched with the interface under the target category, and the target interface matched with the target command is determined.
It can be seen that, for the above-mentioned example, the target interface can be determined up to (26+8) times, and compared with the target interface can be determined up to 206 times in the related art, the interface matching efficiency is significantly improved.
S104: responding to the target command based on the target interface.
In this step, the target command is responded to based on the target interface.
According to the command response method provided by the embodiment of the application, interfaces supported by the BMC are divided into a plurality of categories, when a target command is received, the target command is subjected to target category matching firstly, then the target command is subjected to target interface matching under the target category, all the interfaces supported by the substrate controller are not required to be matched one by one, the efficiency of determining the matched target interfaces is improved in a step-by-step matching mode, and further the command response efficiency is improved.
On the basis of the foregoing embodiment, as a preferred implementation manner, before the receiving the target command, the method further includes: receiving enabling commands for a plurality of interfaces, and setting enabling definitions of the interfaces based on the enabling commands; wherein the enabling definition includes valid and invalid; correspondingly, matching the target command with the interface under the target category comprises the following steps: and matching the target command with the interfaces which are effective under the target category.
It will be appreciated that in practical applications, the client may not need to use the full number of interfaces, and the client may send an enable command to the BMC to set the enable definition of the interfaces of the BMC before responding to the command. When the target command is responded subsequently, only the target command is matched with an effective (enabled) interface, and an ineffective (disabled) interface is not matched any more, so that the matching efficiency of the interfaces is further improved, and the command response efficiency is further improved.
As a possible implementation manner, the receiving the enabling command for a plurality of interfaces includes: receiving an enabling command conforming to an intelligent platform management interface protocol; wherein the enable command includes a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface.
In particular implementations, a client may send an enable command to a BMC conforming to an intelligent platform management interface (Intelligent Platform Management Interface, IPMI) protocol, the enable command including a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface.
For example, 26 data may be employed for a full amount of 206 Restful interfaces, each data containing 8 data bits, each data bit representing an enable definition of the corresponding interface, 1 representing active (enabled) and 0 representing inactive (disabled). The data in the IPMI command may be 16-system data, for example, binary data corresponding to 0xff is 1111 1111, which represents that 8 corresponding interfaces are all enabled, and binary data corresponding to 0xf0 is 1111 0000, which represents that the first 4 interfaces are enabled and the last 4 interfaces are disabled. Of course, if there is a reserved bit in the IPMI command, more data may be included, which is not specifically limited in this embodiment.
Of course, the client may also enable the entire class through IPMI commands, i.e., set all interfaces in one class to active or inactive at a time.
Therefore, in this embodiment, the enabling command defines the enabling of the interfaces supported by the BMC, and when the subsequent interfaces are matched, only the effective (enabled) interface is matched, and the matching of the ineffective (disabled) interface is skipped, so that the matching efficiency of the interfaces is further improved, and the command response efficiency is further improved.
The embodiment of the application discloses a command response method, and compared with the previous embodiment, the technical scheme is further described and optimized. Specific:
referring to FIG. 2, a flowchart of another command response method is shown according to an exemplary embodiment, as shown in FIG. 2, comprising:
s201: dividing a plurality of interfaces supported by a substrate controller into a plurality of categories;
s202: counting the matching quantity of a plurality of interfaces within a preset time period, and determining the sum of the matching quantity of all interfaces in each category;
s203: sorting all the classes from big to small according to the sum of the matching numbers of all the interfaces in the classes to obtain a first sorting result;
s204: sequencing all the interfaces in each category from large to small according to the matching quantity of the interfaces in each category to obtain a second sequencing result;
in this embodiment, the number of matches of all interfaces in the BMC within the preset time period is counted, for example, the number of matches of all interfaces in the BMC within the latest preset time period is counted, and the sum of the number of matches of all interfaces in each category is determined.
Further, sorting the classes according to the sum of the matching numbers of all the interfaces in the classes from large to small, wherein the class sorting is more advanced to indicate that the client uses the interfaces of the class more frequently. For example, the ranking results are shown in table 1:
TABLE 1
1 https://BMC_IP/redfish/v1/SessionService
2 https://BMC_IP/redfish/v1/AccountService
3 https://BMC_IP/redfish/v1/Chassis
4 https://BMC_IP/redfish/v1/Managers
5 https://BMC_IP/redfish/v1/Systems
6 https://BMC_IP/redfish/v1/UpdateService
7 https://BMC_IP/redfish/v1/TaskService
8 https://BMC_IP/redfish/v1/EventService
For the interfaces in each category, the interfaces are ranked according to the matching quantity of the interfaces from large to small, and the interface ranking is higher than the previous description that the client uses the interfaces. It should be noted that, when sorting interfaces, only valid interfaces may be sorted, and invalid interfaces may be skipped.
S205: receiving a target command, sequentially matching the target command with the categories according to the first sequencing result, and determining a target category matched with the target command;
in the implementation, when the category matching is performed on the target command, the category with the first priority matching order is matched in sequence according to the first ordering result, so that the matching efficiency of the target category can be improved.
S206: matching the target command with the interface under the target category according to a second sequencing result corresponding to the target category, and determining a target interface matched with the target command;
in the implementation, when the interfaces of the target commands are matched, the interfaces which are ranked in front of the priority matching are sequentially matched according to the second ranking results corresponding to the target categories, so that the matching efficiency of the target interfaces can be improved, and further the response efficiency of the commands is improved. It should be noted that, when performing interface matching, only valid interfaces may be matched, and invalid interfaces may be skipped.
S207: responding to the target command based on the target interface.
Therefore, in this embodiment, the classes are ranked according to the sum of the matching numbers of all the interfaces in the classes from large to small, when the subsequent classes are matched, the matching is performed in sequence according to the ranking result, the class ranking is more advanced, which indicates that the frequency of the client using the interfaces of the class is higher, and the class with the advanced priority matching ranking can improve the matching efficiency of the target class. According to the method, all interfaces in each category are ordered from large to small according to the matching quantity of the interfaces in each category, when the subsequent interfaces are matched, the interfaces are matched in sequence according to the ordering result, the interface ordering is higher, the frequency of using the interfaces by a client is higher, the interfaces with the front priority matching ordering can improve the matching efficiency of the target interfaces, and further the command response efficiency is improved.
A command response device provided in the embodiments of the present application is described below, and a command response device described below and a command response method described above may be referred to with each other.
Referring to fig. 3, a structure diagram of a command response device according to an exemplary embodiment is shown, as shown in fig. 3, including:
a dividing module 301, configured to divide a plurality of interfaces supported by the substrate controller into a plurality of classes;
in a specific implementation, the interfaces supported by the BMC are divided into a plurality of classes, and in this embodiment, the interfaces may be Restful interfaces, and there are 206 Restful interfaces supported by the BMC.
As a possible implementation, the dividing module 301 is specifically configured to: the plurality of interfaces supported by the substrate controller are divided into a plurality of categories according to the interface function.
As a possible implementation, the category includes any one or a combination of any of a session service interface, an account service interface, a hardware interface, a management interface, a system interface, an update service interface, a task service interface, and an event service interface.
The session service (SessionService) interface may be expressed as https: the interface of account service (AccountService) can be expressed as https:// BMC_IP/repash/v 1/AccountService, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/Chassis, the interface of hardware (Chassis) can be expressed as https:// BMC_IP/repash/v 1/Chassis, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/manager, the interface of system (Systems) can be expressed as https:// BMC_IP/repash/v 1/Systems, the interface of update service (UpdService) can be expressed as htps/IP/v 1/datavice, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/Systems, the interface of sub-26 can be expressed as https:// BMC_IP/repash/v 1/interface of sub-26.
The first matching module 302 is configured to receive a target command, match the target command with the category, and determine a target category matched with the target command;
in particular implementations, when a target command is received, the target command is matched with a plurality of categories, and a target category that matches the target command is determined. Wherein the target command may be a URL (uniform resource location system, uniform Resource Locator) command, the URL command is typically segmented by "/", for example, the target command of one URL may be expressed as: https://192.168.16.8/redfish/v1/Chassis/1/PCIEDevices/0.
In this embodiment, the first matching module 302 is specifically configured to: and receiving a target command, and matching a third segment of characters in the target command with the category. For the above example, "Chassis" is matched to the representation of the multiple classes shown in the previous step, and "https:// BMC_IP/redfish/v1/Chassis" is matched to the target class for which the target command matches is a hardware interface.
A second matching module 303, configured to match the target command with an interface under the target class, and determine a target interface matched with the target command;
in a specific implementation, the target command is matched with an interface under the target category, and a target interface matched with the target command is determined.
It can be seen that, for the above-mentioned example, the target interface can be determined up to (26+8) times, and compared with the target interface can be determined up to 206 times in the related art, the interface matching efficiency is significantly improved.
And a response module 304, configured to respond to the target command based on the target interface.
In implementations, the target command is responded to based on the target interface.
According to the command response device provided by the embodiment of the application, interfaces supported by the BMC are divided into a plurality of categories, when a target command is received, the target command is subjected to target category matching firstly, then the target command is subjected to target interface matching under the target category, all the interfaces supported by the substrate controller are not required to be matched one by one, the efficiency of determining the matched target interfaces is improved in a step-by-step matching mode, and further the command response efficiency is improved.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
a setting module, configured to receive enabling commands for a plurality of interfaces, and set enabling definitions of the plurality of interfaces based on the enabling commands; wherein the enabling definition includes valid and invalid;
correspondingly, the second matching module 303 is specifically configured to: and matching the target command with an effective interface under the target category, and determining a target interface matched with the target command.
It will be appreciated that in practical applications, the client may not need to use the full number of interfaces, and the client may send an enable command to the BMC to set the enable definition of the interfaces of the BMC before responding to the command. When the target command is responded subsequently, only the target command is matched with an effective (enabled) interface, and an ineffective (disabled) interface is not matched any more, so that the matching efficiency of the interfaces is further improved, and the command response efficiency is further improved.
As a possible implementation manner, the setting module is specifically configured to: receiving an enabling command conforming to an intelligent platform management interface protocol; wherein the enable command includes a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface; setting an enable definition of a plurality of the interfaces based on the enable command.
In particular implementations, a client may send an enable command to a BMC conforming to an intelligent platform management interface (Intelligent Platform Management Interface, IPMI) protocol, the enable command including a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface.
For example, 26 data may be employed for a full amount of 206 Restful interfaces, each data containing 8 data bits, each data bit representing an enable definition of the corresponding interface, 1 representing active (enabled) and 0 representing inactive (disabled). The data in the IPMI command may be 16-system data, for example, binary data corresponding to 0xff is 1111 1111, which represents that 8 corresponding interfaces are all enabled, and binary data corresponding to 0xf0 is 1111 0000, which represents that the first 4 interfaces are enabled and the last 4 interfaces are disabled. Of course, if there is a reserved bit in the IPMI command, more data may be included, which is not specifically limited in this embodiment.
Of course, the client may also enable the entire class through IPMI commands, i.e., set all interfaces in one class to active or inactive at a time.
Therefore, in this embodiment, the enabling command defines the enabling of the interfaces supported by the BMC, and when the subsequent interfaces are matched, only the effective (enabled) interface is matched, and the matching of the ineffective (disabled) interface is skipped, so that the matching efficiency of the interfaces is further improved, and the command response efficiency is further improved.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
the statistics module is used for counting the matching quantity of the interfaces in a preset time period and determining the sum of the matching quantity of all the interfaces in each category;
the first sorting module is used for sorting all the classes from large to small according to the sum of the matching numbers of all the interfaces in the classes to obtain a first sorting result;
the first sorting module is used for sorting all the interfaces in each category from large to small according to the matching quantity of the interfaces in each category to obtain a second sorting result;
in this embodiment, the number of matches of all interfaces in the BMC within the preset time period is counted, for example, the number of matches of all interfaces in the BMC within the latest preset time period is counted, and the sum of the number of matches of all interfaces in each category is determined.
Further, sorting the classes according to the sum of the matching numbers of all the interfaces in the classes from large to small, wherein the class sorting is more advanced to indicate that the client uses the interfaces of the class more frequently. For the interfaces in each category, the interfaces are ranked according to the matching quantity of the interfaces from large to small, and the interface ranking is higher than the previous description that the client uses the interfaces. It should be noted that, when sorting interfaces, only valid interfaces may be sorted, and invalid interfaces may be skipped.
Accordingly, the first matching module 302 is specifically configured to: receiving a target command, sequentially matching the target command with the categories according to the first sequencing result, and determining a target category matched with the target command;
in the implementation, when the category matching is performed on the target command, the category with the first priority matching order is matched in sequence according to the first ordering result, so that the matching efficiency of the target category can be improved.
Correspondingly, the second matching module 303 is specifically configured to: and matching the target command with the interface under the target category according to the second sequencing result corresponding to the target category, and determining the target interface matched with the target command.
In the implementation, when the interfaces of the target commands are matched, the interfaces which are ranked in front of the priority matching are sequentially matched according to the second ranking results corresponding to the target categories, so that the matching efficiency of the target interfaces can be improved, and further the response efficiency of the commands is improved. It should be noted that, when performing interface matching, only valid interfaces may be matched, and invalid interfaces may be skipped.
Therefore, in this embodiment, the classes are ranked according to the sum of the matching numbers of all the interfaces in the classes from large to small, when the subsequent classes are matched, the matching is performed in sequence according to the ranking result, the class ranking is more advanced, which indicates that the frequency of the client using the interfaces of the class is higher, and the class with the advanced priority matching ranking can improve the matching efficiency of the target class. According to the method, all interfaces in each category are ordered from large to small according to the matching quantity of the interfaces in each category, when the subsequent interfaces are matched, the interfaces are matched in sequence according to the ordering result, the interface ordering is higher, the frequency of using the interfaces by a client is higher, the interfaces with the front priority matching ordering can improve the matching efficiency of the target interfaces, and further the command response efficiency is improved.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the hardware implementation of the program modules, and in order to implement the method of the embodiments of the present application, the embodiments of the present application further provide an electronic device, fig. 4 is a block diagram of an electronic device according to an exemplary embodiment, and as shown in fig. 4, the electronic device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
and the processor 2 is connected with the communication interface 1 to realize information interaction with other devices and is used for executing the command response method provided by one or more technical schemes when running the computer program. And the computer program is stored on the memory 3.
Of course, in practice, the various components in the electronic device are coupled together by a bus system 4. It will be appreciated that the bus system 4 is used to enable connected communications between these components. The bus system 4 comprises, in addition to a data bus, a power bus, a control bus and a status signal bus. But for clarity of illustration the various buses are labeled as bus system 4 in fig. 4.
The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Wherein the nonvolatile Memory may be Read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read Only Memory (EEPROM, electrically Erasable Programmable Read-Only Memory), magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk Read Only Memory (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (ddr SDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). The memory 3 described in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the embodiments of the present application may be applied to the processor 2 or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 2 or by instructions in the form of software. The processor 2 described above may be a general purpose processor, DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied in a hardware decoding processor or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium in the memory 3 and the processor 2 reads the program in the memory 3 to perform the steps of the method described above in connection with its hardware.
The processor 2 implements corresponding flows in the methods of the embodiments of the present application when executing the program, and for brevity, will not be described in detail herein.
In an exemplary embodiment, the present application also provides a storage medium, i.e. a computer storage medium, in particular a computer readable storage medium, for example comprising a memory 3 storing a computer program executable by the processor 2 for performing the steps of the method described above. The computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, CD-ROM, etc.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
Alternatively, the integrated units described above may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing an electronic device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A command response method, comprising:
dividing a plurality of interfaces supported by a substrate controller into a plurality of categories;
receiving a target command, matching the target command with the category, and determining a target category matched with the target command;
matching the target command with an interface under the target category, and determining a target interface matched with the target command;
responding to the target command based on the target interface.
2. The command response method of claim 1, wherein classifying the plurality of interfaces supported by the substrate controller into a plurality of classes comprises:
the plurality of interfaces supported by the substrate controller are divided into a plurality of categories according to the interface function.
3. The command response method of claim 2, wherein the categories include any one or a combination of a session service interface, an account service interface, a hardware interface, a management interface, a system interface, an update service interface, a task service interface, an event service interface.
4. The command response method of claim 1, wherein the target command is a command of a uniform resource location system, and matching the target command with the category comprises:
and matching a third segment of characters in the target command with the category.
5. The command response method of claim 1, wherein prior to receiving the target command, further comprising:
receiving enabling commands for a plurality of interfaces, and setting enabling definitions of the interfaces based on the enabling commands; wherein the enabling definition includes valid and invalid;
correspondingly, matching the target command with the interface under the target category comprises the following steps:
and matching the target command with the interfaces which are effective under the target category.
6. The command response method of claim 5, wherein the receiving the enable command for a plurality of the interfaces comprises:
receiving an enabling command conforming to an intelligent platform management interface protocol; wherein the enable command includes a plurality of data, each data including a plurality of data bits, each data bit representing an enable definition of a corresponding interface.
7. The command response method of claim 1, wherein after the dividing the plurality of interfaces supported by the substrate controller into the plurality of classes, further comprising:
counting the matching quantity of a plurality of interfaces within a preset time period, and determining the sum of the matching quantity of all interfaces in each category;
sorting all the classes from big to small according to the sum of the matching numbers of all the interfaces in the classes to obtain a first sorting result;
sequencing all the interfaces in each category from large to small according to the matching quantity of the interfaces in each category to obtain a second sequencing result;
correspondingly, matching the target command with the category, and determining the target category matched with the target command comprises the following steps:
sequentially matching the target command with the categories according to the first sequencing result, and determining a target category matched with the target command;
correspondingly, matching the target command with the interface under the target category, and determining the target interface matched with the target command comprises the following steps:
and matching the target command with the interface under the target category according to the second sequencing result corresponding to the target category, and determining the target interface matched with the target command.
8. A command response device, comprising:
the dividing module is used for dividing a plurality of interfaces supported by the substrate controller into a plurality of categories;
the first matching module is used for receiving a target command, matching the target command with the category and determining a target category matched with the target command;
the second matching module is used for matching the target command with the interface under the target category and determining a target interface matched with the target command;
and the response module is used for responding to the target command based on the target interface.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the command response method according to any one of claims 1 to 7 when executing said computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the command response method according to any of claims 1 to 7.
CN202310617717.XA 2023-05-26 2023-05-26 Command response method and device, electronic equipment and storage medium Pending CN116483767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310617717.XA CN116483767A (en) 2023-05-26 2023-05-26 Command response method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310617717.XA CN116483767A (en) 2023-05-26 2023-05-26 Command response method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116483767A true CN116483767A (en) 2023-07-25

Family

ID=87214047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310617717.XA Pending CN116483767A (en) 2023-05-26 2023-05-26 Command response method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116483767A (en)

Similar Documents

Publication Publication Date Title
CN107360224B (en) Method, system, device and storage medium for generating serial number in distributed system
CN113886182A (en) Alarm convergence method and device, electronic equipment and storage medium
CN109213604B (en) Data source management method and device
CN108572823A (en) Front and back end development management method and system based on interface engine
CN113190405A (en) Node health detection method and device, electronic equipment and storage medium
CN111125240B (en) Distributed transaction realization method and device, electronic equipment and storage medium
CN115114219A (en) PCI-E topological method, device, equipment and storage medium
CN112506539B (en) Firmware updating method and device, electronic equipment and storage medium
WO2019080424A1 (en) Customer migration method and system, computer device and storage medium
CN116483767A (en) Command response method and device, electronic equipment and storage medium
CN116450165A (en) Method, system, terminal and storage medium for quickly building environment and deploying program
CN113872951B (en) Hybrid cloud security policy issuing method and device, electronic equipment and storage medium
EP3346671A1 (en) Service processing method and equipment
CN114422576A (en) Session cleaning method and device, computer equipment and readable storage medium
CN105991450B (en) Mac address table update method and device
CN110769462B (en) Network access control method and device
CN110347683B (en) Data table merging processing method and device
CN114500261B (en) Network asset identification method and device, electronic equipment and storage medium
CN109976896B (en) Service re-ranking processing method and device
CN113886199A (en) Data processing method and device
CN108763498B (en) User identity identification method and device, electronic equipment and readable storage medium
CN113810486B (en) Internet of things platform docking method and device, electronic equipment and storage medium
CN111414162B (en) Data processing method, device and equipment thereof
CN111078714B (en) Data processing method and device
US20240078222A1 (en) Selective Addition of Datum to a Tree Data Structure

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