An event subscription method and computing device
By obtaining subscription support information from communication devices, determining the target filtering mode, and subscribing to events, the server management challenges of different event subscription mechanisms are solved, achieving efficient and unified management and precise subscription.
Patent Information
- Application Number
- CN202311421511.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-10-30
AI Technical Summary
Existing technologies make it difficult to manage servers that support different event subscription mechanisms in a unified manner, resulting in low management efficiency.
By obtaining subscription support information from communication devices, the target filtering mode is determined, and event subscription is performed based on this mode. It supports flexible switching between precise filtering mode and event type filtering mode, and selects appropriate parameters and request messages for unified event subscription.
It enables unified management of Redfish devices with different event filtering modes, improving management efficiency and subscription accuracy, and reducing the resource overhead of handling useless events.
Smart Images

Figure CN117615449B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an event subscription method and a computing device. BACKGROUND
[0002] In order to meet the growing demand for data processing, the number of data centers deployed is increasing, and the number of servers deployed in a single data center is also increasing. Therefore, in order to reduce the complexity of server management and improve the efficiency of server operation and management, server manufacturers generally provide centralized management software for users. The centralized management software generally has monitoring and alarm functions, can obtain the state data of each server in the data center through the Redfish protocol, and save the obtained state data in the local database for users to use.
[0003] The centralized management software can efficiently and in real time obtain the state data of the server through the event subscription mechanism of the Redfish protocol. Specifically, the centralized management software can subscribe to the relevant events of the state data that it is interested in from the server; when the state data of the server changes, the server can report the relevant event to the centralized management software, thereby achieving the effect of fast data synchronization.
[0004] With the continuous updating and iteration of the Redfish protocol, the event subscription mechanism of the Redfish protocol is gradually refined. Some earlier versions of the Redfish protocol divide the events of the server into different event types, and the centralized management software can subscribe to one or more event types; some recent versions of the Redfish protocol cancel the division of event types, and instead set multiple event attributes to describe the event, and the centralized management software can indicate a specific event directory through different event attribute arrays to perform more refined event subscription.
[0005] However, the promotion and application of the new version of the Redfish protocol in the user group need some time. At present, a part of the servers in the same data center may support the above-mentioned event subscription through event types, another part may support the above-mentioned event subscription through event directories, and the other part may support both of the above-mentioned two event subscription methods.
[0006] How to uniformly subscribe to events of servers with different event subscription mechanisms is a technical problem that needs to be solved at present. SUMMARY
[0007] The embodiments of the present application provide an event subscription method and a computing device, which can uniformly subscribe to events of communication devices supporting different event subscription mechanisms and improve management efficiency.
[0008] The first aspect of the embodiment of the application provides an event subscription method, which is applied to a computing device; the method comprises the following steps: obtaining subscription support information of a communication device; determining a target filtering mode based on the subscription support information; and performing event subscription on the communication device based on the target filtering mode.
[0009] The target filtering mode is an event filtering mode that can be supported by the communication device. It can be understood that when the communication device supports event subscription through an event subscription mechanism, the communication device can also be said to support an event filtering mode corresponding to the event subscription mechanism. The communication device is a device supporting the Redfish protocol, such as a Redfish device.
[0010] The embodiment of the application obtains the subscription support information of the communication device, determines the target filtering mode based on the subscription support information, and then performs corresponding event subscription based on the target filtering mode. In this way, for communication devices supporting different event filtering modes, unified event subscription can be performed, and management efficiency is improved.
[0011] In a possible implementation, the determining of the target filtering mode based on the subscription support information comprises the following steps: if the subscription support information contains a field supporting event directory for event filtering, it is determined that the target filtering mode is a precise filtering mode; if the subscription support information does not contain the field supporting event directory for event filtering, and the subscription support information contains a field supporting event type for event filtering, it is determined that the target filtering mode is an event type filtering mode.
[0012] In the embodiment of the application, when the subscription support information contains the field supporting event directory for event filtering, the target filtering mode is determined to be the precise filtering mode. When the communication device supports the precise filtering mode and the event type filtering mode at the same time, the precise filtering mode is preferentially used for event subscription, and the subscription accuracy can be improved.
[0013] In a possible implementation, the event directory comprises a white list and / or a black list, and the subscription support information comprises a subscription support field; the method further comprises the following steps: if there is a field supporting the white list for event filtering in the subscription support field, and / or there is a field supporting the black list for event filtering in the subscription support field, it is determined that the communication device supports the precise filtering mode; and / or if there is a field supporting the event type for event filtering in the subscription support field, it is determined that the communication device supports the event type filtering mode.
[0014] In the embodiments of the present application, the computing device can determine the support capability of the Redfish device for different event filtering modes by subscribing to the fields in the support information, so that the computing device can flexibly select appropriate parameters and request messages to uniformly subscribe to events of the Redfish device supporting different event filtering modes, thereby improving the management efficiency.
[0015] In a possible implementation, the event subscription to the communication device based on the target filtering mode includes: obtaining a subscription parameter; if the target filtering mode is the accurate filtering mode, determining a first target subscription parameter based on the subscription parameter and the subscription support information, and performing event subscription to the communication device according to the first target subscription parameter; and / or, if the target filtering mode is the event type filtering mode, determining a second target subscription parameter based on the subscription parameter, and performing event subscription to the communication device according to the second target subscription parameter.
[0016] In the embodiments of the present application, by obtaining the first target subscription parameter or the second target subscription parameter matched with the target filtering mode based on the subscription parameter, and then performing event subscription, the consistency of the filtering conditions under different target filtering modes can be ensured as much as possible, and the computing device can more conveniently uniformly manage the communication device.
[0017] In a possible implementation, the determination of the first target subscription parameter based on the subscription parameter and the subscription support information includes: if the accurate filtering parameter is included in the subscription parameter, and the event type filtering parameter is not included in the subscription parameter, determining that the first target subscription parameter is the accurate filtering parameter; and / or, if the event type filtering parameter is included in the subscription parameter, and the communication device supports the event type filtering mode, determining that the first target subscription parameter is the event type filtering parameter; and / or, if the accurate filtering parameter and the event type filtering parameter are included in the subscription parameter, and the communication device does not support the event type filtering mode, determining the first target subscription parameter based on the accurate filtering parameter and the event type filtering parameter.
[0018] In the embodiments of the present application, in the case that the subscription parameter can directly complete event subscription under the event filtering mode supported by the communication device, the computing device can directly use the subscription parameter as the first target subscription parameter; otherwise, the first target subscription parameter is further determined based on the subscription parameter, so that the event indicated by the subscription parameter can be subscribed as accurately as possible.
[0019] In a possible implementation, the determining the first target subscription parameter based on the accurate filtering parameter and the event type filtering parameter comprises: if the event type filtering parameter comprises an alarm event field and a resource change event field, determining the first target subscription parameter as the accurate filtering parameter; and / or, if the event type filtering parameter comprises the alarm event field or the resource change event field, and the accurate filtering parameter does not comprise a first accurate filtering parameter, determining the first target subscription parameter as the accurate filtering parameter; wherein the first accurate filtering parameter is capable of indicating a message ID of an event of the communication device; and / or, if the event type filtering parameter comprises the alarm event field or the resource change event field, and the accurate filtering parameter comprises the first accurate filtering parameter, determining the first target subscription parameter based on an event level corresponding to the event type filtering parameter and the first accurate filtering parameter.
[0020] In the embodiments of the present application, by determining the first target subscription parameter after judging whether the event type filtering parameter loses filtering effect due to the accurate filtering parameter or the event type filtering parameter, the subscription efficiency can be improved.
[0021] In a possible implementation, the first accurate filtering parameter comprises one or more event attribute arrays; and the determining the first target subscription parameter based on the event level corresponding to the event type filtering parameter and the first accurate filtering parameter comprises: obtaining message registration table information of the communication device, the message registration table information comprising message IDs of all events of the communication device; obtaining, from the message registration table information, a message ID set of an event indicated by each event attribute array of the communication device, and obtaining an intersection of the message ID set as a message ID accurate list; obtaining, from the message ID accurate list, a message ID of an event of the event level as a target message ID; and determining the first target subscription parameter based on the target message ID.
[0022] In the embodiments of the present application, by taking the intersection of the event indicated by the event attribute array and the event indicated by the event level corresponding to the event type filtering parameter as the first target subscription parameter, the event of the communication device is finely subscribed, the subscription precision can be improved, and the resource loss caused by processing useless events can be reduced.
[0023] In a possible implementation, the determining the first target subscription parameter based on the target message ID comprises: if the event attribute array comprises a whitelist attribute array, generating a message ID array based on the target message ID as the first target subscription parameter, wherein the whitelist attribute array is used to indicate a whitelist of event categories; and / or, if the event attribute array comprises a blacklist attribute array and does not comprise the whitelist attribute array, generating an excluded message ID array based on the target message ID as the first target subscription parameter, wherein the blacklist attribute array is used to indicate a blacklist of event categories.
[0024] In the embodiments of the present application, by taking the message ID array or the excluded message ID array as the first target subscription parameter, the subscription accuracy can be improved, and different event subscription requirements of users can be met.
[0025] In a possible implementation, the obtaining the message ID of the event of the event level from the message ID accurate list as the target message ID comprises: if the event type filter parameter comprises an alarm event field, obtaining the message ID of the event of the alarm level and the severe level from the message ID accurate list as the target message ID; and / or, if the event type filter parameter comprises a resource change event field, obtaining the message ID of the event of the normal level from the message ID accurate list as the target message ID.
[0026] In the embodiments of the present application, by taking the event level of the event as an intermediary, the event type filter parameter can play a filtering effect in the case that the target filtering mode is the accurate filtering mode, so that the subscription accuracy can be improved, and the consistency of the filtering conditions can be maintained as much as possible.
[0027] In a possible implementation, the event subscription of the communication device according to the first target subscription parameter comprises: verifying the legality of the first target subscription parameter; if the legality verification of the first target subscription parameter passes, the event subscription of the communication device according to the first target subscription parameter is performed based on the accurate filtering mode.
[0028] In the embodiments of the present application, by verifying the legality of the first target subscription parameter first and then performing the event subscription after the verification passes, the subscription efficiency can be improved, and resource waste caused by invalid subscription requests can be avoided.
[0029] In a possible implementation, the method further comprises: if the communication device supports the event type filtering mode and the event subscription of the communication device according to the first target subscription parameter fails, determining the second target subscription parameter based on the first target subscription parameter, and performing the event subscription of the communication device according to the second target subscription parameter.
[0030] In the embodiments of the present application, in the case that the event subscription according to the first target subscription parameter fails, the second target subscription parameter can be acquired for secondary subscription, so as to improve the success probability of event subscription.
[0031] In a possible implementation, the second target subscription parameter is determined based on the subscription parameter, including: if the subscription parameter includes the accurate filtering parameter and the event type filtering parameter, the second target subscription parameter is determined based on the accurate filtering parameter and the event type filtering parameter.
[0032] In the embodiments of the present application, the second target subscription parameter is determined based on the accurate filtering parameter and the event type filtering parameter, so that the accurate filtering parameter can play a filtering role in the case that the target filtering mode is the event type filtering mode, and the subscription accuracy is improved.
[0033] In a possible implementation, the second target subscription parameter is determined based on the accurate filtering parameter and the event type filtering parameter, including: if the accurate filtering parameter does not include the first accurate filtering parameter, the second target subscription parameter is determined as the event type filtering parameter; and / or, if the accurate filtering parameter includes the first accurate filtering parameter, and the first accurate filtering parameter includes the black list attribute array and does not include the white list attribute array, the second target subscription parameter is determined as the event type filtering parameter; and / or, if the accurate filtering parameter includes the first accurate filtering parameter, and the first accurate filtering parameter includes the white list attribute array, parameters are added in the event type filtering parameter based on the white list attribute array, and the second target subscription parameter is determined as the event type filtering parameter after the parameters are added.
[0034] In the embodiments of the present application, in the case that the subscription parameter includes the first accurate filtering parameter, and the first accurate filtering parameter includes the white list attribute array, the event type filtering parameter is aggregated with the original event type subscription parameter based on the white list attribute array, and the event subscription is performed together, so that the case that the accurate filtering parameter loses the filtering effect can be avoided, and the subscription efficiency is improved.
[0035] In a possible implementation, the parameters are added in the event type filtering parameter based on the white list attribute array, including: message registry information of the communication device is acquired; a message ID set of each event indicated by the white list attribute array is acquired from the message registry information, and an intersection of the message ID set is acquired as a message ID accurate list; and parameters are added in the event type filtering parameter based on an event level corresponding to a message ID in the message ID accurate list.
[0036] In a possible implementation, the event type filter parameter is added with a parameter based on the event level corresponding to the message ID in the message ID accurate list, including: if the event level includes an alarm level or a serious level, an alarm event field is added in the event type filter parameter; and / or, if the event level includes a normal level, a resource change event field is added in the event type filter parameter.
[0037] In the embodiments of the present application, by taking the event level of an event as an intermediary, the accurate filter parameter can play a filtering effect in the case that the target filtering mode is the event type filtering mode, thereby improving the compatibility of the accurate filter parameter and the event type filtering mode.
[0038] The second aspect of the embodiments of the present application provides a computing device, including: a processor, a memory; the memory has stored therein instruction operations or codes; the processor is configured to communicate with the memory and execute the instruction operations or codes in the memory to perform the event subscription method described in any possible implementation of the first aspect.
[0039] The third aspect of the embodiments of the present application provides a computer readable storage medium, the computer readable storage medium has stored therein computer execution instructions; when at least one processor of a device executes the computer execution instructions, the device performs the event subscription method described in any possible implementation of the first aspect.
[0040] The fourth aspect of the embodiments of the present application provides a computer program product, the computer program product includes computer execution instructions, the computer execution instructions are stored in a computer readable storage medium; at least one processor of a device can read the computer execution instructions from the computer readable storage medium, and the at least one processor executes the computer execution instructions to make the device perform the event subscription method described in any possible implementation of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 A schematic diagram of a system architecture provided by the embodiments of the present application;
[0042] Figure 2 A schematic diagram of a software structure inside a computing device provided by the embodiments of the present application;
[0043] Figure 3 A flowchart of an event subscription method provided by the embodiments of the present application;
[0044] Figure 4 A flowchart of one specific embodiment of an event subscription method provided by the embodiments of the present application;
[0045] Figure 5A flowchart of a process provided by an embodiment of the present application for adding a parameter in an event type filtering parameter based on a whitelist attribute array is shown in FIG. 1.
[0046] Figure 6 A flowchart of another event subscription method provided by an embodiment of the present application is shown in FIG. 2.
[0047] Figure 7 A structural diagram of a computing device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0048] The embodiments of the present application are described below with reference to the accompanying drawings. It is obvious that the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. It is obvious for those skilled in the art that the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems as the technology develops and new scenarios appear.
[0049] The terms "first", "second", and the like in the description and claims of the present application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product, or device.
[0050] Redfish is a management standard aiming to provide simple and secure management functions for converged, hybrid information technology (IT) and software defined data center (SDDC). It uses representational state transfer (RESTful) interface semantics to access data defined in a model format, which is used to perform out of band systems management. The Redfish standard (i.e., protocol) is applicable to large-scale servers, from standalone servers to rack and blade server environments, and is also applicable to large-scale cloud environments, data centers, and the like.
[0051] A uniform resource identifier (URI) can be used in Redfish protocol to identify a resource, a service, or a collection of resources. Generally, a URI can include three parts, the first part includes a service scheme and a host internet protocol (IP) address or domain name, the second part includes a root service and a Redfish protocol version, and the third part is a unique resource identifier. For example, the following uniform resource locator (URL):
[0052] https: / / mgmt.vendor.com / Redfish / v1 / Systems / 1 / EthernetInterfaces / 1,
[0053] wherein the service scheme of the first part is https (i.e., communication is performed by using https protocol), and the host domain name is mgmt.vendor.com. The root service and the Redfish protocol version of the second part are Redfish and v1 respectively, and / Redfish / v1 is also generally referred to as a root URL. The unique resource identifier of the third part is / Systems / 1 / EthernetInterfaces / 1, which is also generally referred to as a resource path.
[0054] Redfish protocol uses hypertext transfer protocol (HTTP) or hyper text transfer protocol secure (HTTPS) technology. Therefore, in Redfish protocol, a client can send a request (i.e., a request message) to a server, and the server can return a response (i.e., a response message) to the client. The request generally can include a request header and a request body (i.e., a request message body), and the response generally can include a response header, a response body (i.e., a response message body) and a response code (i.e., an http status code). The request types specified in Redfish protocol can include GET, POST, PATCH, DELETE, etc. The GET request can obtain the representation of a resource (i.e., the description or data of the resource), the POST request can create a new resource, the PATCH request can modify a resource (e.g., modify the attributes of the resource), and the DELETE request can delete a specified resource.
[0055] With the progress of computer technology, the functions and performances of servers are constantly improved and perfected, and servers play an increasingly important role in the fields of cloud computing, data center, big data, etc. In order to meet the growing demand for data processing, the number of data centers deployed by various enterprises is also increasing, and the number of servers deployed in a single data center is also increasing. Therefore, in order to reduce the complexity of server management and improve the efficiency of server operation and management, server manufacturers generally provide centralized management software for users. The centralized management software generally has monitoring and alarm functions, can obtain the state data of each server in the data center through the Redfish protocol, simple network management protocol (SNMP), intelligent platform management interface (IPMI), etc., and save the obtained state data in the local database of the centralized management software for users to use.
[0056] At present, the centralized management software subscribes to the relevant state data of the Redfish device through the event subscription mechanism of the Redfish protocol. In this way, when the state of the communication device such as the Redfish device changes, the communication device can send a corresponding Redfish event message to the centralized management software, thereby achieving the effect of quickly synchronizing data.
[0057] In some earlier versions of the Redfish protocol, the Redfish protocol specifies five event types, which specifically include a resource state change event (StatusChanged), a resource update event (ResourceUpdated), a resource addition event (ResourceAdded), a resource removal event (ResourceRemoved), and an alarm event (Alert). The centralized management software can create a subscription by calling the event service subscription interface of the Redfish device through a POST request, and subscribe to one or more of the five event types.
[0058] With the updated iterations of the Redfish protocol, the event subscription mechanism of the Redfish protocol also changes. In some newer versions of the Redfish protocol, the Redfish protocol cancels the subscription mode of the event type, and no longer uses the corresponding fields of the above-mentioned five event types for subscription, but uses some more refined event attribute arrays for event subscription. The elements in the event attribute array are used to indicate one or more events. Specifically, these more refined event attribute arrays include RegistryPrefixes, MessageIds, OriginResources, ResourceTypes, ExcludeMessageIds, and ExcludeRegistryPrefixes.
[0059] Among them, the Redfish protocol of the newer version defines a plurality of standard message IDs as the identification of the event. A message ID can include a registry prefix (RegistryPrefixe), a message version (Version), and a message key (MessageKey). It can be understood that different events of the Redfish device are defined as different message IDs. Specifically, the Redfish protocol defines the format of the message ID through the message registry (MessageRegistry), and the message IDs of all events of a server can be defined in one or more message registries.
[0060] For example, the message ID of an event is Power1.0.0.BreakerFault, in which the registry prefix is Power, the message version is 1.0.0, and the message key is BreakerFault. Specifically, when subscribing to the corresponding event using the message ID, the format of the element in the message ID array is the field obtained by removing the message version from the standard message ID. In this example, the message ID used to subscribe to the event is Power.BreakerFault, and the registry prefix is Power.
[0061] It can be understood that with further updated iterations of the Redfish protocol, these subscription fields will be increased or decreased.
[0062] It can be understood that in the process of updating iterations of the Redfish protocol, some versions of the Redfish protocol support the above-mentioned two event subscription mechanisms at the same time.
[0063] It can be understood that the process of centralized management software managing software subscription events is also the process of filtering events. Among them, the centralized management software instructs the communication device (such as a server) supporting the Redfish protocol to push the events indicated by the subscription parameters by sending a subscription request containing the above-mentioned subscription parameters to the communication device, thereby filtering events. Specifically, the communication device generates an event filter based on the subscription parameters, and when an event occurs, the communication device determines whether the event meets the filtering condition based on the event filter, and if so, pushes the event to the centralized management software. Therefore, when the communication device supports the centralized management software to subscribe to events of itself through an event subscription mechanism, the communication device can also be said to support the event filtering mode corresponding to the event subscription mechanism.
[0064] It can be understood that, for ease of description, the communication devices supporting the Redfish protocol in this paper are all taken as Redfish devices for example.
[0065] Among them, when the Redfish device supports event subscription through the above-mentioned non-event type, more refined event attribute array, since the elements in the event attribute array are event attributes of events in the Redfish device, the elements of the event attribute array can obtain personalized and accurate event directory, therefore it can be considered that the Redfish device supports the event filtering mode of filtering according to the event directory. This event filtering mode can also be called precise filtering mode.
[0066] Among them, when the Redfish device supports event subscription through the above-mentioned event type, it can be considered that the Redfish device supports the event filtering mode of filtering according to the event type, and this event filtering mode can also be called event type filtering mode.
[0067] It should be understood that when the centralized management software manages the Redfish device, the computing device starts to subscribe to the events of the Redfish device.
[0068] It can be seen that the event filtering modes corresponding to the above-mentioned two versions of Redfish protocol are quite different and difficult to be compatible. The new version of Redfish protocol needs a certain period of time for popularization and application before it completely replaces the earlier version of Redfish protocol. At present, in the servers of the same data center, some may support the precise filtering mode, some may support the event type filtering mode, and some may support both the precise filtering mode and the event type filtering mode. Therefore, how to uniformly subscribe to the events of the Redfish devices supporting different event filtering modes is a technical problem that needs to be solved at present.
[0069] Based on this, the embodiment of the present application provides an event subscription method, which can uniformly subscribe to events of a Redfish device supporting different event filtering modes and improve the subscription accuracy. In this way, the universality of the centralized management software in managing the Redfish device can be improved, and the overhead generated by the centralized management software in processing useless events can be reduced.
[0070] In order to better understand the embodiments of the present application, the system architecture used by the embodiments of the present application will be described first.
[0071] Please refer to Figure 1 , Figure 1 is a schematic diagram of a system architecture provided by the embodiments of the present application. As Figure 1 indicated, the system architecture can include a computing device 101, communication devices such as Redfish devices 102a to 102c (hereinafter collectively referred to as Redfish devices 102), and a network 103. The computing device 101 and the Redfish devices 102 can be connected to the network 102 respectively, and communicate with each other through the network 102. In some possible implementations, the Redfish devices 102 can communicate with each other through the network.
[0072] Among them, the computing device 101 is configured to manage the Redfish devices 102, specifically configured to acquire state data of the Redfish devices 102, and monitor the Redfish devices 102; and further configured to perform power-on and power-off control operations on the Redfish devices 102 according to the state data. For example, the computing device 101 can be a total control device of a machine room where the Redfish devices 102 are located, or an intelligent terminal carried by a management personnel. Specifically, the computing device 101 can be a server, or an intelligent terminal such as a personal computer (PC), a notebook computer, or a tablet computer, and the embodiments of the present application do not limit the specific form of the computing device 101.
[0073] The Redfish device 102 refers to a device supporting the Redfish protocol. In the embodiments of the present application, the Redfish device 102 can be a terminal device, a storage device, a switch or a server supporting the Redfish protocol, such as a blade server, a high-density server, a rack server, a cabinet server, a general-purpose server, a graphics processing unit (GPU) server, a data processing unit (DPU) server or an artificial intelligence (AI) server. Specifically, the number of Redfish devices 102 can be set according to actual needs, and the number of Redfish devices 102 is not specifically limited in the embodiments of the present application.
[0074] Optionally, when the number of Redfish devices 102 is multiple, the multiple Redfish devices 102 are produced by different manufacturers.
[0075] The network 103 can be an intranet inside a computer room or the Internet.
[0076] It should be understood that for any server, a baseboard management controller is generally provided. The baseboard management controller can be a baseboard management processor independent of the central processing unit (CPU). The baseboard management controller can include a monitoring management unit outside the computing device 101, a management system in a management chip outside the processor, a baseboard management controller (BMC) of the computer device, a system management module (SMM) and the like.
[0077] The baseboard management controller is mainly used for monitoring and managing the server, and supports remote control through a network port (such as server reset, power on / off, etc.). For example, the baseboard management controller can monitor the state of each hardware device in the server (such as humidity, temperature, voltage, current, etc.). For another example, system configuration, firmware upgrade, fault diagnosis and the like can be performed through the baseboard management controller. In the embodiments of the present application, the computing device 101 can realize management of each Redfish device 102 through the network port provided by the baseboard management controller of the Redfish device 102.
[0078] In some possible implementations, the computing device 101 and the Redfish device 102 can further include a processor, a memory, and the like. The memory can include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a compact disc read-only memory (CD-ROM), and the like. The processor can be a CPU, a complex programmable logic device, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof.
[0079] It should be noted that in specific implementations, the system architecture can be any architecture including Figure 1 similar structures. The embodiments of the present application do not limit the specific components of the system architecture. In addition, Figure 1 the components of the architecture shown in the foregoing do not constitute a limitation on the system architecture, and the system architecture can include more or fewer devices than those shown in the figure. Figure 1
[0080] Please refer to Figure 2 , Figure 2 is a schematic diagram of a software structure inside a computing device provided by an embodiment of the present application. The computing device 101 can include a centralized management module 110 and a unified subscription module 120. The centralized management module 110 and the unified subscription module 120 can communicate with each other.
[0081] The centralized management module 110 and the unified subscription module 120 can be two software modules deployed in the computing device 101. The centralized management module 110 is configured to run centralized management software and centrally manage one or more Redfish devices 102 included in the management.
[0082] In some other possible implementations, the unified subscription module 120 can be a sub-module of the centralized management module 110; in some other possible implementations, the centralized management module 110 and the unified subscription module 120 can be arranged in different devices respectively.
[0083] The computing device 101 can subscribe to events of the Redfish device 102 through the unified subscription module 120 to obtain state data of the Redfish device 102, and synchronize the state data with the centralized management module 110 in real time, so that the centralized management module 110 can centrally manage the Redfish device 102 based on the state data. Therefore, the computing device 101 can also be referred to as a centralized management device 101.
[0084] The specific process in which the unified subscription module 120 subscribes to the events of the Redfish device 102 will be described in detail in the method part below, and will not be repeated here.
[0085] It should be noted that, Figure 2 The software structure shown is only an example and is not limiting. In actual applications, Figure 2 The software structure shown can include more or fewer software modules than shown.
[0086] Based on the above system architecture, please refer to Figure 3 , Figure 3 is a flowchart of an event subscription method provided by an embodiment of the present application. The method is applied to a computing device, such as a server. Figure 3 As shown, the method can include but is not limited to the following steps:
[0087] Step 301: The computing device obtains subscription support information of a communication device.
[0088] The communication device supports the Redfish protocol. For ease of description, the communication device will be taken as a Redfish device for description in the embodiments and the following embodiments. It can be understood that this description does not limit the communication device.
[0089] The subscription support information is used to indicate an event subscription capability supported by the Redfish device, and the event subscription capability is used to reflect an event filtering mode supported by the Redfish device. The computing device can determine the event filtering mode supported by the Redfish device by obtaining the subscription support information, so as to use a subscription request message in a corresponding format and applicable subscription parameters for subscription.
[0090] Optionally, the computing device can obtain the subscription support information from the Redfish device.
[0091] In a possible implementation, the subscription support information includes an event filtering mode identifier. The event filtering mode identifier is identifier information agreed upon in advance between the computing device and the Redfish device.
[0092] In a possible implementation, the subscription support information includes a subscription support field.
[0093] The event service refers to an event service resource provided by the Redfish device. The computing device can obtain the subscription support field from the Redfish device through a GET request.
[0094] Specifically, the computing device can obtain the subscription support field in the event service and a child resource of the event service.
[0095] For example, the URI of the event service can be / Redfish / version number / EventService. The computing device can access the event service through the URL "https: / / Redfish device IP address / Redfish / version number / EventService".
[0096] For example, " / Redfish / version number / EventService / Subscriptions / subscription_id" is the URI of a subscription attribute child resource of the event service. The computing device can access the subscription attribute child resource through the URI.
[0097] In a possible implementation, if the resource attribute of the event service includes an attribute of event types for subscription (the resource attribute is named EventTypesForSubscription in the event service), and the array corresponding to the attribute is not empty, the computing device can obtain EventTypesForSubscription as the subscription support field.
[0098] If the subscription attribute child resource of the event service includes at least one of registry prefixes (RegistryPrefixes) and resource types (ResourceTypes), and the array corresponding to the at least one is not empty, the computing device can obtain the at least one as the subscription support field.
[0099] If the subscription attribute child resource of the event service includes at least one of include origin of condition supported (IncludeOriginOfConditionSupported), exclude registry prefix (ExcludeRegistryPrefix), and exclude message ID (ExcludeMessageId), and the Boolean value of the at least one is true, the computing device can obtain the at least one as the subscription support field.
[0100] In step 302, the computing device determines a target filtering mode based on the subscription support information.
[0101] The target filtering mode is an event filtering mode supported by the Redfish device.
[0102] In a possible implementation, the subscription support information includes an event filtering mode identifier; if the event filtering mode identifier is an identifier of the accurate filtering mode, the computing device can determine that the target filtering mode is the accurate filtering mode; if the event filtering mode is an identifier of the event type filtering mode, the computing device can determine that the target filtering mode is the event type filtering mode.
[0103] The event filtering mode identifier is a pre-designated identifier, for example, the identifier of the accurate filtering mode is "1", and the identifier of the event type filtering mode is "2".
[0104] In a possible implementation, the subscription support information includes historical subscription data of the Redfish device. The computing device can identify the historical subscription data by using a preset algorithm, and determine that the target filtering mode is the accurate filtering mode or the event type filtering mode.
[0105] In a possible implementation, the subscription support information includes a subscription support field. If the subscription support field includes a field supporting event directory-based event filtering, it is determined that the target filtering mode is the accurate filtering mode; if the subscription support field does not include the field supporting event directory-based event filtering, and includes a field supporting event type-based event filtering, it is determined that the target filtering mode is the event type filtering mode.
[0106] The field supporting event directory-based event filtering refers to a field used to indicate that the Redfish device supports event filtering based on an event directory; and the field supporting event type-based event filtering refers to a field used to indicate that the Redfish device supports event filtering based on an event type.
[0107] Specifically, the computing device can first determine whether the subscription support field includes the field supporting event directory-based event filtering; if yes, it is determined that the target filtering mode is the accurate filtering mode; if no, it is further determined whether the subscription support field includes the field supporting event type-based event filtering; if yes, it is determined that the target filtering mode is the event type filtering mode; if no, the subscription process can be ended.
[0108] The computing device can determine the target filtering mode based on the event filtering modes supported by the Redfish device.
[0109] Specifically, in a possible implementation, the event catalog includes a white list and / or a black list; if there is a field supporting the white list for event filtering in the subscription support information, and / or there is a field supporting the black list for event filtering in the subscription support information, it is determined that the Redfish device supports the precise filtering mode; and / or if there is a field supporting the event type for event filtering in the subscription support field, it is determined that the Redfish device supports the event type filtering mode.
[0110] For example, the field supporting the white list for event filtering includes one or more of RegistryPrefixes, ResourceTypes, and IncludeOriginOfConditionSupported; and the fields supporting the black list for event filtering include ExcludeMessageId and / or ExcludeRegistryPrefix.
[0111] For example, the field supporting the event type for event filtering includes EventTypesForSubscription.
[0112] Optionally, if the Redfish device supports both the precise filtering mode and the event type filtering mode, it is determined that the target filtering mode is the precise filtering mode.
[0113] In the embodiments of the present application, when the Redfish device supports both the precise filtering mode and the event type filtering mode, the precise filtering mode is used as the target filtering mode, so that the computing device preferentially uses the event attribute array for precise subscription, and the subscription accuracy is higher.
[0114] In step 303, the computing device performs event subscription on the communication device based on the target filtering mode.
[0115] The computing device is configured to manage a plurality of Redfish devices, and needs to perform unified event subscription on the plurality of Redfish devices for unified management; and after the target filtering mode is determined, the computing device can use appropriate subscription parameters to subscribe to events in the Redfish device.
[0116] The computing device can obtain the subscription parameters, and perform event subscription on the Redfish device based on the subscription parameters and the target filtering mode.
[0117] Specifically, the subscription parameters can be preset in the centralized management module of the computing device, can be obtained from other storage devices or computing devices, or can be input in real time by a manager.
[0118] Optionally, the subscription parameter is pre-set in the computing device according to actual needs of the management scene by the administrator.
[0119] Optionally, there are multiple copies of the subscription parameter in the computing device, corresponding to different management needs; the centralized management module can determine the management needs according to the current management environment, and issue the corresponding subscription parameter to the unified subscription module according to the management needs, and the unified subscription module performs event subscription on the managed Redfish device according to the received subscription parameter.
[0120] Among them, the subscription parameter can be a precise filtering parameter or an event type filtering parameter.
[0121] The precise filtering parameter includes an event attribute array used to indicate specific events in the Redfish device, and the computing device can subscribe to events in the Redfish device through the configuration of the elements in the event attribute array; the event type filtering parameter includes an event type field, and the computing device can subscribe to events of one or more event types in the Redfish device through the event type field.
[0122] In one possible implementation, the subscription parameter includes a precise filtering parameter and an event type filtering parameter; when the target filtering mode is a precise filtering mode, the computing device can perform event subscription based on the precise filtering parameter; when the target filtering mode is an event type filtering mode, the computing device can perform event subscription based on the event type filtering parameter.
[0123] In this possible implementation, the precise filtering parameter and the event type filtering parameter in the subscription parameter are respectively used for event subscription in the corresponding event filtering mode, that is, the computing device subscribes to events in the Redfish device based on the target filtering mode and uses one of the two for event subscription.
[0124] By pre-setting the subscription parameters corresponding to the two event filtering modes, and based on different target filtering modes, the corresponding subscription parameters are used for event subscription, the events in the Redfish device supporting different event filtering modes can be accurately subscribed, and the expected subscription effect is achieved.
[0125] In another possible implementation, the computing device can obtain a subscription parameter; then obtain a target subscription parameter based on the subscription parameter; and then perform event subscription on the Redfish device according to the target subscription parameter.
[0126] Among them, when the target filtering mode is a precise filtering mode, the computing device can complete event subscription through the precise filtering parameter; when the target filtering mode is an event type filtering mode, the computing device can complete event subscription through the event type filtering parameter.
[0127] Therefore, it can be said that the precision filtering mode and the precision filtering parameter are matched; similarly, the event type filtering mode and the event type filtering parameter are matched. In contrast, the precision filtering mode and the event type filtering parameter are not matched, and the event type filtering mode and the precision filtering parameter are not matched.
[0128] More specifically, the target filtering mode and the subscription parameter are matched, which means that the computing device can complete the event subscription of the Redfish device supporting the target filtering mode through a subscription request containing the subscription parameter.
[0129] In the case where the subscription parameter and the target filtering mode are matched, the computing device can directly take the subscription parameter as a target subscription parameter, and then perform event subscription based on the target subscription parameter. Specifically, the computing device can send a subscription request in a POST manner to create a subscription resource; the subscription request includes the target subscription parameter.
[0130] In a possible implementation, the subscription parameter includes a precision filtering parameter and an event type filtering parameter, and the Redfish device supports a precision filtering mode and an event type filtering mode; the computing device can send a subscription request including the precision filtering parameter and the event type filtering parameter to the Redfish device; after receiving the subscription request, the Redfish device can determine that the intersection of the event indicated by the precision filtering parameter and the event indicated by the event type filtering parameter is the subscription target of the computing device.
[0131] The computing device sends the precision filtering parameter and the event type filtering parameter to the Redfish device through one subscription request.
[0132] For example, the event type filtering parameter in the subscription request includes an event type field Alert, and the precision filtering parameter includes an event attribute array RegistryPrefixes[power], and the Redfish device can determine that the registry prefix is power and the event of the event type being an alert event is the subscription target of the computing device.
[0133] In the case where the target filtering mode and the subscription parameter are not matched, if the computing device sends a subscription request including the subscription parameter to the Redfish device, the Redfish device will not be able to respond to the subscription request to complete the event subscription. Therefore, in the embodiments of the present application, when the target filtering mode and the subscription parameter are not matched, the computing device can obtain a target subscription parameter based on the subscription parameter.
[0134] The target subscription parameter and the target filter mode match; the event indicated by the subscription parameter of the Redfish device and the event of the Redfish device corresponding to the target subscription parameter are the same type of events in different event filter modes. In other words, the target subscription parameter is a parameter that can be used to complete event subscription in the target filter mode; and the events indicated by the target subscription parameter and the subscription parameter in the respective event filter modes are the same type of events.
[0135] The same type of events refers to at least one event with the same property in different event filter modes. It can be understood that the property may be different in the event attributes corresponding to different versions of the Redfish protocol; the relationship between different event attributes corresponding to the property can be artificially preset, so that the computing device can obtain the target subscription parameter according to the relationship and the subscription parameter.
[0136] For example, in the event type filter mode, the event type field corresponding to the alarm event is the event type Alert; and in the precision filter mode, there is no event attribute array corresponding to the alarm event. At this time, the event level attribute can be introduced, and the two event level attributes of "alert level" and "serious level" are preset to correspond to the event type Alert; in this way, the computing device can subscribe to the event with the event level of "alert level" or "serious level" in the case that the Redfish device supports the precision filter mode, which is equivalent to subscribing to the alarm event in the event type filter mode.
[0137] In a possible implementation, if the target filter mode is the precision filter mode, the first target subscription parameter is determined based on the subscription parameter and the subscription support information, and event subscription is performed on the Redfish device according to the first target subscription parameter; and / or, if the target filter mode is the event type filter mode, the second target subscription parameter is determined based on the subscription parameter, and event subscription is performed on the Redfish device according to the second target subscription parameter.
[0138] In a specific possible implementation, the target filter mode is the precision filter mode, and the subscription parameter includes an event type filter parameter; the computing device can first obtain the event level corresponding to the event type filter parameter; and then obtain the precision filter parameter as the first target subscription parameter based on the event level.
[0139] The computing device can first obtain all events corresponding to the event level; and then obtain the precision filter parameter that can accurately cover all the events as the first target subscription parameter.
[0140] Optionally, the computing device can obtain the message ID of all the events as the first target subscription parameter.
[0141] The message ID and the event correspond to each other, and the message ID is used as the first target subscription parameter, so that the event subscribed through the first target subscription parameter and the event subscribed through the event type filtering parameter can be as same as possible in the corresponding event filtering mode, so that the computing device can uniformly manage the Redfish device.
[0142] In this possible implementation, when the subscription parameter further includes the accurate filtering parameter, the computing device can first acquire the event of the Redfish device indicated by the accurate filtering parameter; and then acquire the message ID of the event of the event level from the events as the first target subscription parameter.
[0143] In the embodiments of the present application, when the target filtering mode is the accurate filtering mode, if the Redfish device supports the event type filtering mode, the intersection of the event indicated by the event attribute array and the event indicated by the event type field is directly subscribed; if the Redfish device does not support the event type filtering mode, the first target subscription parameter is acquired based on the event type filtering parameter and the accurate filtering parameter, and the event subscription is performed based on the first target subscription parameter, which improves the subscription accuracy and is beneficial to the unified subscription and management of the Redfish device by the computing device.
[0144] In a specific possible implementation, the target filtering mode is the event type filtering mode, and the subscription parameter includes the accurate filtering parameter; the computing device can first acquire the event level of the event indicated by the accurate filtering parameter; and then acquire the corresponding event type filtering parameter as the second target subscription parameter according to the event level.
[0145] The computing device can first acquire the event indicated by the accurate filtering parameter, and then acquire the event level of the event.
[0146] The corresponding relationship between the event level and the event type filtering parameter is pre-stored in the computing device.
[0147] In the embodiments of the present application, when the target filtering mode is the event type filtering mode, the event level is used as the intermediate parameter, the second target subscription parameter is acquired based on the event attribute array for subscription, which can improve the compatibility of the subscription parameter for the Redfish device supporting different event filtering modes.
[0148] It can be understood that after the first target subscription parameter or the second target subscription parameter is acquired, the computing device can send a subscription request including the first target subscription parameter or the second target subscription parameter to the Redfish device to perform event subscription.
[0149] In a possible implementation, the event catalog includes a white list and / or a black list; the computing device can determine, based on the subscription parameter, whether the computing device subscribes to events of the Redfish device according to the white list or the black list.
[0150] When the computing device subscribes to events according to the white list, the computing device subscribes to events of the Redfish device indicated by the white list; when the computing device subscribes to events according to the black list, the computing device subscribes to events of the Redfish device except for events indicated by the black list.
[0151] Optionally, the subscription parameter includes a subscription mode identifier; the computing device can determine, based on the subscription mode identifier, whether the computing device subscribes to the events according to the white list or the black list.
[0152] Optionally, if the subscription parameter includes a white list attribute array or the subscription parameter includes a white list attribute array and a black list attribute array, the computing device can subscribe to the events according to the white list; if the subscription parameter includes a black list attribute array, the computing device can subscribe to the events according to the black list.
[0153] The white list attribute array is used to indicate an event catalog of a white list, and the black list attribute array is used to indicate an event catalog of a black list.
[0154] For example, the white list attribute array includes at least one of a MessageIds array, a RegistryPrefixes array, an OriginResources array, and a ResourceTypes array; and the black list attribute array includes at least one of an ExcludeRegistryPrefixes array and an ExcludeMessageIds array.
[0155] It can be understood that the subscription logic is different between the subscription according to the white list and the subscription according to the black list, and the computing device subscribes to events by using one of the two. The event type filtering parameter can be used to indicate the white list in combination with the white list attribute array, or to indicate the black list in combination with the black list attribute array; when the subscription parameter includes the event type filtering parameter and does not include the accurate filtering parameter, the computing device subscribes to events indicated by the event type filtering parameter.
[0156] It can be understood that the number of event attribute arrays that can be used for the black list subscription is less than the number of event attribute arrays that can be used for the white list subscription according to the current Redfish protocol, and therefore it can be understood that, when the subscription parameter includes white list subscription information and black list subscription information, the white list subscription information can be used for subscription preferentially, and the upper limit of the accuracy of the subscription is higher.
[0157] The embodiment of the application obtains subscription support information of a Redfish device, determines a target filtering mode based on the subscription support information, and then performs corresponding event subscription based on the target filtering mode. In this way, for a Redfish device supporting different event filtering modes, unified event subscription can be performed, and management efficiency is improved.
[0158] The main scheme of the event subscription method provided by the embodiment of the application is described above, and one specific embodiment will be described below, so that the event subscription method provided by the embodiment of the application can be better understood.
[0159] Please refer to Figure 4 , Figure 4 The flowchart of one specific embodiment of the event subscription method provided by the embodiment of the application is shown. The method is applied to a computing device, and specifically includes steps 401 to 412. In this embodiment, the Redfish device supports at least one of the precise filtering mode and the event type filtering mode, and at most the precise filtering mode and the event type filtering mode; correspondingly, the subscription parameters at most include the event type filtering parameter and the precise filtering parameter, and the subscription parameters are not empty.
[0160] Step 401, the computing device obtains the internet protocol (IP) address, account password, and subscription parameters of the Redfish device.
[0161] Among them, when configuring the centralized management module of the computing device, the management personnel can input the IP address and account password of the Redfish device to the centralized management module, so that the centralized management module can access and manage the Redfish device.
[0162] Among them, the management personnel can also set the subscription parameters in the centralized management module. Optionally, the centralized management module can issue different subscription parameters to the unified subscription module according to the management scenario and the management of the Redfish device.
[0163] For example, during the peak period of the Redfish device, the centralized management module may pay more attention to the operation reliability of the Redfish device, and therefore focus on subscribing to the alarm events of the Redfish device, so as to know the alarm situation of the Redfish device in the first time and perform corresponding processing. At this time, the centralized management module will issue the subscription parameters related to the alarm events, and the unified subscription module will subscribe to the alarm events of the Redfish device according to the subscription parameters.
[0164] In the process of event subscription, the computing device can first obtain the IP address and account password of the Redfish device, and the subscription parameters in the current management scenario from the centralized management module.
[0165] Step 402, the computing device obtains the subscription support information of the Redfish device according to the IP address and the account password.
[0166] After obtaining the IP address and the account password of the Redfish device, the computing device can access the IP address and obtain access permission of the Redfish device through the account password, access the event service of the Redfish device, and thus obtain the subscription support field of the Redfish device.
[0167] The process and principle of obtaining the subscription support field of the Redfish device are similar to the process and principle in step 301 in the foregoing Figure 3 embodiment, and details are not repeated here.
[0168] Step 403, the computing device determines whether the target filtering mode is a precise filtering mode or an event type filtering mode.
[0169] The execution process and principle of step 403 in the embodiment are similar to the execution process and principle of step 302 in the foregoing Figure 3 embodiment, and details are not repeated here.
[0170] If the target filtering mode is the precise filtering mode, step 404 is executed; if the target filtering mode is the event type filtering mode, step 408 is executed.
[0171] Step 404, the computing device determines whether the subscription parameter includes an event type filtering parameter.
[0172] The subscription parameter includes the event type filtering parameter and the precise filtering parameter at most, and the subscription parameter is not empty. Therefore, when the subscription parameter does not include the event type filtering parameter, the subscription parameter is the precise filtering parameter; based on the precise filtering parameter, event subscription can be directly performed in the precise filtering mode, and at this time, step 407 can be executed.
[0173] When the subscription parameter includes the event type filtering parameter, based on the event type filtering parameter, event subscription cannot be directly performed in the precise filtering mode, and at this time, the first target subscription parameter needs to be obtained based on the event type filtering parameter, and specifically, step 405 can be executed.
[0174] Step 405, the computing device obtains message registry information of the Redfish device.
[0175] The message registry information is also the full message registry of the Redfish device, and the message registry information includes message IDs of all events of the Redfish device.
[0176] Specifically, the URI of the registry service is: / Redfish / v1 / Registries. The computing device can obtain the message registry information from the registry service and its sub-resources by GET.
[0177] It can be understood that the message ID of the all-event also indicates the registry prefix of the all-event.
[0178] In step 406, the computing device obtains the first target subscription parameter based on the event type filtering parameter and the message registry information.
[0179] In this case, the computing device can first obtain the event level corresponding to the event type filtering parameter, and then obtain the first target subscription parameter based on the event level.
[0180] In a possible implementation, the event type filtering parameter includes an alarm event field and a resource change event field, and the event level includes a normal level, an alarm level and a serious level. The alarm event field corresponds to at least one of the alarm level and the serious level, and the resource change event field corresponds to the normal level.
[0181] Therefore, if the event type filtering parameter includes the alarm event field and the resource change event field, the computing device can obtain all event levels. If the event type filtering parameter includes the alarm event field, the computing device can obtain the alarm level and the serious level. If the event type filtering parameter includes the resource change event field, the computing device can obtain the normal level.
[0182] In this case, based on whether the subscription parameter further includes the accurate filtering parameter, the computing device can adopt the following two different processing manners:
[0183] In a possible implementation, the subscription parameter includes the event type filtering parameter but does not include the accurate filtering parameter. If the event type filtering parameter includes the alarm event field or the resource change event field, the computing device can obtain, from the message registry information, the message ID of the event corresponding to the event type filtering parameter as the first target subscription parameter. If the event type filtering parameter includes the alarm event field and the resource change event field, the computing device can determine that the first target subscription parameter is an empty array.
[0184] It can be understood that when the target subscription parameter carried in the subscription request sent by the computing device to the Redfish device is an empty array, it indicates that the Redfish device does not need to filter the event, and the computing device needs to subscribe to all events of the Redfish device.
[0185] In a possible implementation, the subscription parameter includes an event type filter parameter and a precision filter parameter; if the event type filter parameter includes an alarm event field or a resource change event field, the computing device can obtain the message ID of the event indicated by the precision filter parameter from the message registry information; then, from the message ID of the event indicated by the precision filter parameter, the computing device obtains the message ID of the event corresponding to the event type filter parameter as the first target subscription parameter; if the event type filter parameter includes both the alarm event field and the resource change event field, the computing device can determine that the first target subscription parameter is the precision filter parameter.
[0186] In this case, the computing device can first obtain a relationship table of message IDs and event levels in the Redfish device, and then, according to the relationship table, obtain the message ID of the event corresponding to the event type filter parameter from the message ID indicated by the precision filter parameter.
[0187] After obtaining the first target subscription parameter, the computing device can perform step 412 to subscribe to the event of the Redfish device based on the first target subscription parameter.
[0188] In a possible implementation, after obtaining the first target subscription parameter, the computing device can first perform the legality verification of the first target subscription parameter in step 407, and then perform step 412 if the verification is passed; or end the subscription process if the verification is not passed.
[0189] Step 407: The computing device determines whether the legality verification of the precision filter parameter is passed.
[0190] In this case, the event type field in the event type filter parameter is a field defined in the Redfish protocol, and the Redfish device supports event subscription through the event type field when the Redfish device supports the event type filter mode; and the array name of the event attribute array in the precision filter parameter is a fixed field in the protocol, and the Redfish protocol does not hard define the element field in the array. Therefore, when the Redfish device supports the precision filter mode, the computing device needs to verify whether the precision filter parameter is legal based on the support of the Redfish device for the event attribute array in the precision filter parameter and the elements in the array before the computing device subscribes to the event through the precision filter parameter.
[0191] If the Redfish device supports the event attribute array, the legality verification of the precision filter parameter is passed, and then step 411 is performed; if the Redfish device does not support the event attribute array, it indicates that the legality verification of the precision filter parameter is not passed, and the computing device can end the subscription process and output the related information of the subscription failure through the display device.
[0192] In one possible implementation, if the precise filter parameter includes a MessageIds array and / or a RegistryPrefixes array, the computing device needs to check whether the elements of the two event attribute arrays exist in the RegistryPrefixes sub-resource of the event service of the Redfish device; if yes, the check passes, if no, the check fails. For example, the third field includes an array RegistryPrefixes [task, power], and the RegistryPrefixes sub-resource supported by the event service of the Redfish device does not contain both task and power, then the legality check of the array RegistryPrefixes [task, power] fails.
[0193] In one possible implementation, if the precise filter parameter includes a ResourceTypes array, the computing device needs to check whether the elements of the array exist in the ResourceTypes sub-resource of the event service of the Redfish device; if yes, the check passes, if no, the check fails.
[0194] In one possible implementation, if the precise filter parameter includes an OriginResources array, the computing device needs to check whether the Boolean value of the IncludeOriginOfConditionSupported attribute in the event service of the Redfish device is true; if yes, the check passes, if no, the check fails.
[0195] In one possible implementation, if the precise filter parameter includes an ExcludeMessageIds array, the computing device needs to check whether the Boolean value of the ExcludeMessageIds attribute in the event service of the Redfish device is true; if yes, the check passes, if no, the check fails.
[0196] In one possible implementation, if the precise filter parameter includes an ExcludeRegistryPrefix array, the computing device needs to check whether the Boolean value of the ExcludeRegistryPrefix attribute in the event service of the Redfish device is true; if yes, the check passes, if no, the check fails.
[0197] In a possible implementation, the computing device performs event subscription on the Redfish device according to the first target subscription parameter, including: the computing device verifying legality of the first target subscription parameter; if the legality verification of the first target subscription parameter passes, performing event subscription on the Redfish device according to the first target subscription parameter based on the accurate filtering mode.
[0198] The first target subscription parameter is a parameter matched with the accurate filtering mode, that is, an accurate filtering parameter. Therefore, the implementation process of verifying legality of the first target subscription parameter is similar to the implementation process of verifying legality of the accurate filtering parameter, which is not described herein again.
[0199] Step 408: The computing device determines whether the subscription parameter includes the accurate filtering parameter.
[0200] The subscription parameter includes at most the event type filtering parameter and the accurate filtering parameter, and the subscription parameter is not empty. Therefore, when the subscription parameter does not include the accurate filtering parameter, the subscription parameter is the event type filtering parameter. Event subscription can be performed in the event type filtering mode based on the event type filtering parameter. Because the event type field belongs to the field agreed by the Redfish protocol, no legality verification is needed, and therefore the second target subscription parameter can be determined as the event type filtering parameter, and step 411 is directly executed.
[0201] When the subscription parameter includes the accurate filtering parameter, event subscription cannot be directly performed in the event type filtering mode based on the accurate filtering parameter, and the second target subscription parameter needs to be acquired based on the accurate filtering parameter. Specifically, step 409 can be executed.
[0202] Step 409: The computing device acquires message registry information of the Redfish device.
[0203] The execution process and principle of step 409 are similar to those of step 405, which are not described herein again.
[0204] Step 410: The computing device acquires the second target subscription parameter based on the accurate filtering parameter and the message registry information.
[0205] Different Redfish devices can have different hardware inside, which can result in different events supported by the Redfish devices for subscription. An event that can be subscribed to in Redfish device A can not exist in Redfish device B. Therefore, optionally, in the case that the event subscription according to the first target subscription parameter fails in step 412, if the Redfish device supports the event type filtering mode, the second target subscription parameter can be determined based on the first target subscription parameter, and the event subscription is performed according to the second target subscription parameter.
[0206] Optionally, in the case that the event subscription according to the first target subscription parameter fails in step 412, the computing device can also give up the subscription of the first target subscription parameter.
[0207] It can be understood that the above two optional means can be used in combination. In the case that part of the first target subscription parameters can be successfully subscribed to, and another part of the first target subscription parameters fails to be subscribed to, the computing device can use different processing methods according to the proportion of the two parts.
[0208] For example, in the case that more than 75% of the first target subscription parameters can be successfully subscribed to, the subscription of 25% of the first target subscription parameters that fails to be subscribed to can be given up; otherwise, the second target subscription parameter is determined based on the first target subscription parameter, and the event subscription is performed according to the second target subscription parameter.
[0209] Specifically, the proportion value can be set according to the actual management scene.
[0210] In a possible implementation, the target filtering mode is the event type filtering mode; if the subscription parameter includes the accurate filtering parameter and the event type filtering parameter, the computing device can determine the second target subscription parameter based on the accurate filtering parameter and the event type filtering parameter, and perform the event subscription.
[0211] In a specific possible implementation, the computing device can be preconfigured with the event type filtering parameter corresponding to the accurate filtering parameter; when it is determined that the target filtering mode is the event type filtering mode, the computing device can perform the event subscription based on the event type filtering parameter.
[0212] In another specific possible implementation, if the accurate filtering parameter does not include the first accurate filtering parameter, the second target subscription parameter is determined as the event type filtering parameter; and / or, if the accurate filtering parameter includes the first accurate filtering parameter, and the first accurate filtering parameter includes a black list attribute array but does not include a white list attribute array, the second target subscription parameter is determined as the event type filtering parameter; and / or, if the accurate filtering parameter includes the first accurate filtering parameter, and the first accurate filtering parameter includes the white list attribute array, a parameter is added in the event type filtering parameter based on the white list attribute array, and the second target subscription parameter is determined as the event type filtering parameter after the parameter is added.
[0213] The first accurate filtering parameter is an accurate filtering parameter capable of indicating a message ID of an event of the Redfish device. For example, there is a message registry in the Redfish device, which can be used to indicate a message ID and a registry prefix of an event; the computing device can determine a specific message ID based on the message registry and the registry prefix array, and thus the registry prefix array can be classified as the first accurate filtering parameter; similarly, the elements in the message ID array are message IDs themselves, which can indicate specific message IDs, and thus the message ID array can be classified as the first accurate filtering parameter.
[0214] It can be understood that the accurate filtering parameter that cannot indicate the message ID of the event can be referred to as a second accurate filtering parameter.
[0215] The Redfish device has a relationship table of message IDs and event levels of events; thus, the computing device can determine the second target subscription parameter based on the accurate filtering parameter by taking the event level as an intermediate attribute through the relationship table.
[0216] The premise of implementing the determination process is that a specific message ID can be determined based on the accurate filtering parameter to be associated with the event level. Therefore, in the case where the accurate filtering parameter does not include the first accurate filtering parameter, the accurate filtering parameter will lose the filtering effect, and the second target subscription parameter is directly determined as the event type subscription parameter.
[0217] In the case where the accurate filtering parameter includes the first accurate filtering parameter, it is further necessary to determine whether the first accurate filtering parameter includes a white list attribute array; if not, it indicates that the computing device performs event subscription according to a black list. If the second target subscription parameter is determined based on the black list attribute array to perform event subscription, it may cause the black list to indicate too many events, resulting in that the computing device cannot normally manage the Redfish device; therefore, in the case where the first accurate filtering parameter does not include the white list attribute array, the second target subscription parameter is determined as the event type subscription parameter.
[0218] In a case where the accurate filtering parameter includes a first accurate filtering parameter, and the first accurate filtering parameter includes a whitelist attribute array, the computing device can acquire message registry information of the Redfish device; then acquire, from the message registry information, a message ID set of an event indicated by each whitelist attribute array, and acquire an intersection of the message ID sets as a message ID accurate list; and based on an event level corresponding to a message ID in the message ID accurate list, add a parameter in the event type filtering parameter, and determine the second target subscription parameter as the event type filtering parameter after the parameter is added.
[0219] Specifically refer to Figure 5 , Figure 5 The flow of adding a parameter in the event type filtering parameter based on the whitelist attribute array for the computing device, as shown in Figure 5 , specifically includes steps 501 to 505.
[0220] Step 501, the computing device acquires an event level of an event indicated by a whitelist attribute array.
[0221] In a case where the accurate filtering parameter includes a first accurate filtering parameter, and the first accurate filtering parameter includes a whitelist attribute array, the computing device can acquire message registry information of the Redfish device; then acquire, from the message registry information, a message ID set of an event indicated by each whitelist attribute array, and acquire an intersection of the message ID sets as a message ID accurate list; and based on an event level corresponding to a message ID in the message ID accurate list, add a parameter in the event type filtering parameter, and determine the second target subscription parameter as the event type filtering parameter after the parameter is added.
[0222] It can be understood that when there is information of other whitelist attribute arrays and message IDs in the Redfish device, the message ID set indicated by the whitelist attribute array can also be acquired based on the information, and the message ID accurate list can also be acquired based on the message ID set.
[0223] Then, the computing device can acquire a relationship table of message IDs and message levels in the Redfish device; and based on the relationship table, acquire an event level corresponding to a message ID in the message ID accurate list, that is, an event level of an event indicated by the whitelist attribute array. It can be understood that the event indicated by the whitelist attribute array is the event indicated by the message ID in the message ID accurate list.
[0224] Step 502, the computing device determines whether the event level includes an alarm level and / or a serious level.
[0225] In a case where the accurate filtering parameter includes a first accurate filtering parameter, and the first accurate filtering parameter includes a whitelist attribute array, the computing device can acquire message registry information of the Redfish device; then acquire, from the message registry information, a message ID set of an event indicated by each whitelist attribute array, and acquire an intersection of the message ID sets as a message ID accurate list; and based on an event level corresponding to a message ID in the message ID accurate list, add a parameter in the event type filtering parameter, and determine the second target subscription parameter as the event type filtering parameter after the parameter is added.
[0226] The same type of events of the alarm event includes events with event levels of warning and critical, and the same type of events of the resource change event includes events with an event level of ok. Therefore, the alarm event field corresponds to event levels of warning and critical, and the resource change event field corresponds to an event level of ok.
[0227] If the event level includes the warning level and / or the critical level, the computing device performs step 503; if not, the computing device performs step 505.
[0228] In step 503, the computing device adds the alarm event field to the event type filter parameter.
[0229] When the event level includes the warning level and / or the critical level, the computing device can add the alarm event field Alert to the event type filter parameter.
[0230] After that, the computing device also needs to perform step 504 to determine whether the resource change event needs to be subscribed.
[0231] In step 504, the computing device determines whether the event level includes the ok level.
[0232] If yes, the computing device performs step 505; if not, the process of adding the parameter ends.
[0233] In step 505, the computing device adds the resource change event field to the event type filter parameter.
[0234] When the event level includes the ok level, the computing device can add the resource change event field to the event type filter parameter.
[0235] It can be understood that when the determination result of step 502 is no, the event level does not include the warning level or the critical level, and the event level is the ok level. At this time, the computing device can add all the resource change event fields to the event type filter parameter, and end the process of obtaining the target subscription parameter.
[0236] For example, the computing device can add the event type fields ResourceAdded, ResourceRemoved, ResourceUpdated, and StatusChanged to the event type filter parameter.
[0237] When the determination results of steps 502 and 504 are both yes, the event level corresponding to the accurate filter parameter includes at least one of the warning level or the critical level, and the ok level. At this time, the computing device can add all the event type fields to the event type filter parameter, and end the adding process.
[0238] After the adding process ends, the computing device can perform step 412, subscribing to the event based on the second target subscription parameter.
[0239] It can be understood that if the event type filter parameter after adding the parameter has duplicates, the duplicate parameters are removed, and the de-duplicated event type filter parameter is determined as the second target subscription parameter.
[0240] Step 411, the computing device determines that the target subscription parameter is the subscription parameter.
[0241] When the subscription parameter and the target filter mode match, the computing device can directly determine that the target subscription parameter is the subscription parameter.
[0242] Step 412, the computing device subscribes to the event based on the target subscription parameter.
[0243] The target subscription parameter can be the first target subscription parameter or the second target subscription parameter.
[0244] The step 411 of the embodiment is similar to the step 401 of the foregoing Figure 3 The step 412 of the embodiment is similar to the step 402 of the foregoing
[0245] The embodiment of the application obtains the subscription support information of the Redfish device, and determines the target filter mode based on the subscription support information. Then, in the case where the subscription parameter and the target filter mode match, the event is directly subscribed according to the subscription parameter. In the case where the subscription parameter and the target filter mode do not match, the target subscription parameter matching the target filter mode is obtained based on the subscription parameter, and the event is subscribed according to the target subscription parameter. In this way, Redfish devices supporting different event filter modes can be compatible, unified event subscription can be performed on these Redfish devices, management efficiency is improved, and the adaptation workload of the centralized management module to these Redfish devices is reduced.
[0246] Please refer to Figure 6 , Figure 6 Another flowchart of an event subscription method provided by the embodiment of the application is shown. The method is applied to a computing device, and is used for subscribing to an event in a communication device supporting a Redfish protocol. The method specifically includes steps 601 to 613. The target filter mode is a precise filter mode, and the subscription parameter includes a precise filter parameter. As in the foregoing embodiments, the communication device is taken as a Redfish device in the embodiment.
[0247] Step 601, the computing device determines whether the subscription parameter includes an event type filter parameter.
[0248] Wherein, the computing device can determine whether the subscription parameter includes the event type filter parameter after obtaining the subscription parameter, so as to determine whether the event needs to be subscribed through the event type.
[0249] If the subscription parameter includes the event type filter parameter, step 602 is executed; if not, it means that the computing device can determine that the first target filter parameter is the accurate filter parameter, and at this time the computing device can execute step 613 to subscribe to the event of the Redfish device according to the first target filter parameter.
[0250] Step 602, the computing device determines whether the Redfish device supports the event type filter mode.
[0251] Wherein, after obtaining the subscription support information, in the case that the subscription parameter includes the event type filter parameter, the computing device can determine whether the Redfish device supports the event type filter mode.
[0252] If it is supported, the computing device can determine that the first target filter parameter includes the event type filter parameter and the accurate filter parameter, and at this time the computing device can execute step 613 to subscribe to the event of the Redfish device according to the first target filter parameter, that is, to subscribe to the intersection of the event indicated by the accurate filter parameter and the event indicated by the event type filter parameter; if it is not supported, the computing device executes step 603.
[0253] It can be understood that in some possible implementations, the target filter mode is the accurate filter mode; the subscription parameter includes the event type filter parameter and does not include the accurate filter parameter; at this time, if the Redfish device supports the event type filter mode, the computing device can determine that the first target subscription parameter is the event type filter parameter.
[0254] Step 603, the computing device determines whether the event type filter parameter includes the alarm event field and the resource change event field.
[0255] Wherein, when the event type filter parameter includes the alarm event field and the resource change event field, the event level corresponding to the event type filter parameter is all event levels, which means that the computing device needs to subscribe to the alarm event and also needs to subscribe to the resource change event. That is, the computing device needs to subscribe to all event types of events, at this time the event type filter parameter has lost the filtering effect, and the computing device can ignore the event type field.
[0256] If the event type field includes the alarm event field and the resource change event field, the computing device can determine that the first target subscription parameter is the accurate filtering parameter, and step 613 can be performed, in which the computing device subscribes to the event based on the first target subscription parameter; if the event type field includes the alarm event field or the resource change event field, step 604 is performed.
[0257] In step 604, the computing device determines whether to subscribe to the event based on a white list or a black list.
[0258] Step 411 of the embodiment is similar to the principle of determining whether to subscribe to the event based on a white list or a black list in step 303 of the embodiment shown in Figure 3 The principle of determining whether to subscribe to the event based on a white list or a black list in step 303 of the embodiment shown in
[0259] If the computing device subscribes to the event based on a white list, the computing device performs step 605; if the computing device subscribes to the event based on a black list, the computing device performs step 609.
[0260] In step 605, the computing device determines whether the accurate filtering parameter includes a first accurate filtering parameter.
[0261] In the case of white list subscription, if the accurate filtering parameter includes the first accurate filtering parameter, the computing device can perform step 606; if it does not include the first accurate filtering parameter, it means that the message ID of the event to be subscribed to cannot be obtained based on the current accurate filtering parameter, and the event is subscribed to in combination with the event type filtering parameter, at this time, the computing device can determine that the first target subscription parameter is the accurate filtering parameter, and step 613 is performed.
[0262] For example, in the current version of the Redfish protocol, the MessageIds array and the RegistryPrefixs array are the first accurate filtering parameter.
[0263] In step 606, the computing device obtains the message ID of the event indicated by the white list attribute array.
[0264] The computing device subscribes to the event based on a white list, which means that the accurate filtering parameter includes a white list attribute array; and the accurate filtering parameter includes the first accurate filtering parameter, which means that at least one white list attribute array in the accurate filtering parameter belongs to the first accurate filtering parameter. It can be understood that the second accurate filtering parameter cannot indicate the message ID, and therefore, in step 606, the computing device obtains the message ID of the event indicated by the white list attribute array belonging to the first accurate filtering parameter.
[0265] Step 606 of the embodiment is similar to the part of obtaining the message ID of the event indicated by the white list attribute array in step 501 of the embodiment shown in Figure 5 the embodiment shown in
[0266] Step 607, the computing device determines a whitelist message ID based on the message ID and the event level corresponding to the event type filter parameter.
[0267] The computing device can first obtain the message ID set indicated by each whitelist attribute array, and obtain the intersection of the message sets as a message ID accurate list. It can be understood that when the number of the whitelist attribute arrays is 1, the message ID accurate list is the message ID set indicated by the whitelist attribute array itself.
[0268] Then, the computing device can obtain the message ID of the event corresponding to the event level and the event type filter parameter from the message ID accurate list as a target message ID. Specifically, the computing device has obtained the message ID indicated by the whitelist attribute array in step 606, at this time, the computing device can obtain the relationship table of the event level and the message ID in the Redfish device, and obtain the message ID corresponding to the event level and the event type filter parameter in the message ID accurate list as the target message ID based on the relationship table.
[0269] In a possible implementation, if the event type filter parameter includes an alarm event field, the message ID of the event of the alarm level and the serious level is obtained from the message ID accurate list as the target message ID; and / or, if the event type filter parameter includes a resource change event field, the message ID of the event of the normal level is obtained from the message ID accurate list as the target message ID.
[0270] It can be understood that in the case that the computing device subscribes to the event according to the whitelist, the target message ID can also be referred to as a whitelist message ID.
[0271] Step 608, the computing device subscribes to the event based on the whitelist message ID.
[0272] Among them, the computing device can generate a message ID array as a first target subscription parameter based on the whitelist message ID, and subscribe to the event in the event directory indicated by the first target subscription parameter to the Redfish device.
[0273] Step 609, the computing device determines whether the accurate filter parameter includes a first accurate filter parameter.
[0274] Step 609 of the embodiment is similar to step 605, which will not be described here.
[0275] Step 610, the computing device obtains the message ID of the event indicated by the black list attribute array.
[0276] Step 610 of this embodiment is similar to step 606 , and the blacklist attribute array is equivalent to the whitelist attribute array in step 606 , which will not be described in detail here.
[0277] Step 611: The computing device determines a blacklist message ID based on the message ID and the event level corresponding to the event type filtering parameter.
[0278] Step 611 of this embodiment is similar to step 607 . The blacklist message ID in step 611 is equivalent to the whitelist message ID in step 607 , and will not be described in detail here.
[0279] Step 612: The computing device subscribes to events based on the blacklist message ID.
[0280] In the case where the computing device subscribes to events according to the blacklist, the computing device can generate an array of excluded message IDs based on the blacklist message ID as a first target subscription parameter, and subscribe to events other than the events indicated by the first target subscription parameter to the Redfish device.
[0281] In an embodiment of the present application, when the Redfish device supports a precise filtering mode and the subscription parameters include precise filtering parameters and event type filtering parameters, the computing device can subscribe to events according to a blacklist and according to a whitelist in two subscription methods, using the intersection of events indicated by the precise filtering parameters and events indicated by the event type filtering parameters as the first target subscription parameter, and subscribing to the events of the Redfish device in a refined manner, thereby improving subscription accuracy and reducing resource loss caused by processing useless events.
[0282] like Figure 7 As shown, Figure 7 A possible logical structure diagram of a computing device provided in an embodiment of the present application. The computing device 700 includes: a processor 701, a communication interface 702, a memory 703, and a bus 704. The processor 701, the communication interface 702, and the memory 703 are interconnected via the bus 704. In the embodiment of the present application, the processor 701 is used to control and manage the actions of the computing device 500. For example, the processor 701 is used to execute Figure 3 to Figure 6 The steps of any embodiment and / or other processes for the technology described herein. The communication interface 702 is used to support the computing device 700 to communicate. The memory 703 is used to store program codes and data of the computing device 700.
[0283] The processor 701 can be a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic device, transistor logic, hardware components, or any combination thereof. It can implement or execute various example logical blocks, modules, and circuits described in connection with the disclosure. The processor can also be a combination of computing functionality, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 704 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, and so on. The bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, Figure 7 Only one bus is shown in the figure, but there can be more than one bus, and buses can be of different types.
[0284] In another embodiment of the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores computer executable instructions. When at least one processor of the device executes the computer executable instructions, the device performs the above-mentioned Figure 3 to Figure 6 The event subscription method described in any embodiment.
[0285] In another embodiment of the present application, a computer program product is also provided, and the computer program product includes computer executable instructions stored in a computer readable storage medium. At least one processor of the device can read the computer executable instructions from the computer readable storage medium, and the at least one processor executes the computer executable instructions to make the device perform the above-mentioned Figure 3 to Figure 6 The event subscription method described in any embodiment.
[0286] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of the present application.
[0287] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-mentioned system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0288] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed system, device and method can be implemented by other manners. For example, the device embodiments described above are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0289] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0290] In addition, each functional unit in each embodiment of the embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0291] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various program code storage media.
Claims
1. An event subscription method, characterized by, The method is applied to a computing device; the method comprises: obtaining subscription support information of a communication device, the communication device supporting a Redfish protocol; if the subscription support information contains a field supporting event directory for event filtering, determining that a target filtering mode is a precise filtering mode; if the subscription support information does not contain the field supporting event directory for event filtering, and contains a field supporting event type for event filtering, determining that the target filtering mode is an event type filtering mode; the event directory comprises a white list and / or a black list, and the subscription support information comprises a subscription support field; if there is a field supporting the white list for event filtering in the subscription support field, and / or there is a field supporting the black list for event filtering in the subscription support field, it is determined that the communication device supports the precise filtering mode; and / or, if there is the field supporting the event type for event filtering in the subscription support field, it is determined that the communication device supports the event type filtering mode; based on the target filtering mode, performing event subscription on the communication device.
2. The method of claim 1, wherein, The event subscription on the communication device based on the target filtering mode comprises: obtaining a subscription parameter; if the target filtering mode is the precise filtering mode, determining a first target subscription parameter based on the subscription parameter and the subscription support information, and performing event subscription on the communication device according to the first target subscription parameter; and / or, if the target filtering mode is the event type filtering mode, determining a second target subscription parameter based on the subscription parameter, and performing event subscription on the communication device according to the second target subscription parameter.
3. The method of claim 2, wherein, The determination of the first target subscription parameter based on the subscription parameter and the subscription support information comprises: if the subscription parameter contains a precise filtering parameter and does not contain an event type filtering parameter, determining that the first target subscription parameter is the precise filtering parameter; and / or, if the subscription parameter contains the event type filtering parameter and the communication device supports the event type filtering mode, determining that the first target subscription parameter is the event type filtering parameter; and / or, if the subscription parameter contains the precise filtering parameter and the event type filtering parameter, and the communication device does not support the event type filtering mode, determining the first target subscription parameter based on the precise filtering parameter and the event type filtering parameter.
4. The method of claim 3, wherein, The determination of the first target subscription parameter based on the precise filtering parameter and the event type filtering parameter comprises: if the event type filtering parameter contains an alarm event field and a resource change event field, determining that the first target subscription parameter is the precise filtering parameter; And / or, if the event type filter parameter includes the alarm event field or the resource change event field, and the precision filter parameter does not include a first precision filter parameter, determining the first target subscription parameter as the precision filter parameter; wherein the first precision filter parameter is capable of indicating a message ID of an event of the communication device; And / or, if the event type filter parameter includes the alarm event field or the resource change event field, and the precision filter parameter includes the first precision filter parameter, determining the first target subscription parameter based on an event level corresponding to the event type filter parameter and the first precision filter parameter.
5. The method of claim 4, wherein, The first precision filter parameter includes one or more event attribute arrays; and determining the first target subscription parameter based on the event level corresponding to the event type filter parameter and the first precision filter parameter includes: Obtaining message registry information of the communication device, the message registry information including message IDs of all events of the communication device; From the message registry information, obtaining a message ID set of an event indicated by each of the event attribute arrays, and obtaining an intersection of the message ID set as a message ID precision list; From the message ID precision list, obtaining a message ID of an event of the event level as a target message ID; Determining the first target subscription parameter based on the target message ID.
6. The method according to any one of claims 2-5, characterized in that, The event subscription to the communication device according to the first target subscription parameter includes: Verifying the legality of the first target subscription parameter; If the legality verification of the first target subscription parameter passes, performing event subscription to the communication device according to the first target subscription parameter based on the precision filter mode.
7. The method of claim 6, wherein, The method further includes: If the communication device supports the event type filter mode and the event subscription to the communication device according to the first target subscription parameter fails, determining a second target subscription parameter based on the first target subscription parameter, and performing event subscription to the communication device according to the second target subscription parameter.
8. A computing device, comprising: The computing device includes: a processor, a memory; The memory has instructions or codes stored therein; The processor is configured to communicate with the memory and execute the instructions or codes in the memory to perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Transaction subscribing method, filtering rule configuring method and related equipment
CN101364952A
Message subscription method, device and equipment
CN114443940A