A data synchronization method and centralized management device
Through the event synchronization mechanism of the Redfish protocol and the parallel processing of event messages, the problem of low data synchronization efficiency and real-time performance of centralized management software in large-scale Redfish device scenarios is solved, and efficient and accurate data synchronization is achieved.
Patent Information
- Application Number
- CN202211297387.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-10-21
AI Technical Summary
Existing centralized management software is inefficient in data synchronization and cannot achieve real-time updates, especially in large-scale Redfish device scenarios, resulting in untimely and inaccurate database data.
Using the event synchronization mechanism of the Redfish protocol, centralized management devices subscribe to Redfish device events, and update the database in real time through event messages to synchronize only changed data, combined with parallel processing and flow control of alarm and non-alarm events to prevent message overload.
It improves the efficiency and accuracy of data synchronization, ensures the real-time and stability of database data, and supports efficient synchronization of large-scale Redfish devices.
Smart Images

Figure CN115914254B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data synchronization method and a centralized management device. Background Art
[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 users with centralized management software. Centralized management software generally has monitoring and alarm functions, which can obtain the status data of each server in the data center through the network and save the obtained status data in the local database (that is, synchronize the server status data to the database) for user use.
[0003] At present, the data synchronization methods supported by centralized management software mainly include manual synchronization and periodic automatic synchronization. Manual synchronization needs to be triggered manually, and periodic automatic synchronization can synchronize data periodically, but the synchronization time granularity is generally large, so the data in the database may not be updated in time. In addition, each manual synchronization and periodic automatic synchronization will synchronize all data, and the data synchronization efficiency is low. Summary of the invention
[0004] The embodiment of the present application discloses a data synchronization method and a centralized management device, which can improve the efficiency of data synchronization.
[0005] The first aspect discloses a data synchronization method, which can be applied to a central management device, or to a module (e.g., a chip) in the central management device, or to a logic module or software that can implement all or part of the functions of the central management device. The central management device can be used to manage multiple Redfish devices, and the following description is based on the application to the central management device. The data synchronization method may include: subscribing to some or all events of the multiple Redfish devices; receiving event messages from the multiple Redfish devices; and updating data in a database based on the event message, the database being used to store status data of the multiple Redfish devices.
[0006] In an embodiment of the present application, the centralized management device may first subscribe to some or all events of multiple Redfish devices. Afterwards, when each Redfish device monitors that a subscribed event has occurred, it may send a relevant event message to the centralized management device. Accordingly, the centralized management device may receive the event messages of the multiple Redfish devices. Afterwards, the centralized management device may update the data in the database based on the received event messages. It can be seen that the centralized management device synchronizes the data of the multiple Redfish devices based on the Redfish event synchronization mechanism, and may only synchronize the data of the subscribed related events, without the need to synchronize the full amount of data, thereby improving the efficiency of data synchronization. In addition, since each Redfish device may send a relevant event message in a timely manner when monitoring that a subscribed event has occurred, the centralized management device may update the data in the database based on the event message in a timely manner, thereby ensuring the real-time and accuracy of the data in the database.
[0007] As a possible implementation manner, the receiving event messages from the multiple Redfish devices includes: receiving a first event message, the first event message is an event message from a first Redfish device, and the first Redfish device is any device among the multiple Redfish devices; the method also includes: if a first condition is met, placing the first event message into an alarm message queue; if a second condition is met, placing the first event message into an event message queue; updating data in a database based on the event message includes: processing event messages in the alarm message queue and the event message queue in parallel, and updating data in the database.
[0008] In the embodiment of the present application, the centralized management device can classify and filter the received event messages, and put the first event message into the alarm message queue when the first condition is met; and put the first event message into the event message queue when the second condition is met. Afterwards, the centralized management device can process the event messages in the alarm message queue and the event message queue in parallel, which can improve the processing efficiency of the event messages, thereby improving the efficiency of data updating.
[0009] As a possible implementation method, the first condition includes: the event type corresponding to the first event message is an alarm event; or, the event type corresponding to the first event message is an alarm event, and the traffic of the current alarm event message is less than the resources currently processing the alarm event message; the alarm event message is an event message whose event type is an alarm event.
[0010] In the embodiment of the present application, since there is no dependency between the alarm event message and the non-alarm event message, the centralized management device can process the alarm event message and the non-alarm event message in parallel. Furthermore, in some cases, the centralized management device can also perform flow limiting processing on the alarm event message, so that the message flow overload can be prevented, thereby avoiding the collapse of the entire processing system, improving the stability of the system, and then supporting large-scale Redfish device data synchronization scenarios.
[0011] As a possible implementation, the second condition includes: the event type corresponding to the first event message is not an alarm event; or, when the event type corresponding to the first event message is not an alarm event, one or more of the following is satisfied: the total message traffic of the current non-alarm event message is less than the resource currently processing the non-alarm event message, the resource URI associated with the first event message is in a preset resource URI whitelist, and the resource URI associated with the first event message is not in the resource URI blacklist; the non-alarm event message is an event message whose event type is a resource state change event, a resource update event, a resource update event, or a resource removal event, the resource URI whitelist includes one or more resource URIs, the resource URI blacklist includes one or more resource URIs, and the number of reports of related events of one or more resource URIs in the URI blacklist within the first time period is greater than Y, and Y is an integer greater than or equal to 1.
[0012] In the embodiment of the present application, in some cases, the centralized management device can also perform flow limiting processing on non-alarm event messages, so that the entire processing system can be prevented from crashing, the stability of the system can be improved, and large-scale Redfish device data synchronization scenarios can be supported. Furthermore, the centralized management device can also filter event messages through resource URI whitelists and / or resource URI blacklists, so that some unimportant event messages or event messages that do not require frequent data updates can be filtered out, thereby improving the efficiency of data synchronization, so as to support efficient synchronization of large-scale Redfish device data.
[0013] As a possible implementation method, the parallel processing of the alarm message queue and the event messages in the event message queue, and updating of the data in the database, includes: parallel processing of the event messages in the alarm message queue by an alarm thread pool, and updating of the data in the database, the alarm thread pool includes one or more threads; parallel processing of the event messages in the event message queue by an event thread pool, and updating of the data in the database, the event thread pool includes one or more threads.
[0014] In the embodiment of the present application, the centralized management device may be provided with an alarm thread pool and an event thread pool. The centralized management device may process event messages in the alarm message queue in parallel through one or more threads in the alarm thread pool, and may also process event messages in the event message queue in parallel through one or more threads in the event thread pool. In this way, the processing efficiency of event messages may be improved, and the efficiency of data synchronization may be further improved.
[0015] As a possible implementation method, the event messages in the alarm message queue are processed in parallel through an alarm thread pool, and the data in the database is updated, including: obtaining a first alarm message from the alarm message queue, the first alarm message being the event message at the head of the alarm message queue; distributing the first alarm message to a first alarm thread, the first alarm thread being any idle thread in the alarm thread pool; processing the first alarm message through the first alarm thread, and updating relevant data in the database.
[0016] In the embodiment of the present application, the centralized management device can process event messages in the order in which the event messages enter the alarm message queue, thereby ensuring the real-time nature of the data in the database.
[0017] As a possible implementation, processing the first alarm message through the first alarm thread includes: when the first alarm thread determines through the identifier of the associated device of the first alarm message that no other thread is processing the related alarm message of the associated device, processing the first alarm message through the first alarm thread; or, when the first alarm thread determines through the identifier of the associated device of the first alarm message that other threads are processing the related alarm message of the associated device, waiting for the other alarm threads to complete the processing before processing the first alarm message through the first alarm thread.
[0018] In the embodiment of the present application, since different alarm event messages of the same Redfish device may have dependencies, the centralized management device can process at most one alarm event message of the same Redfish device at the same time. In this way, the accuracy of the data in the database can be guaranteed.
[0019] As a possible implementation method, the event messages in the event message queue are processed in parallel through an event thread pool, and the data in the database is updated, including: obtaining a second event message from the event message queue, the second event message being the event message at the head of the event message queue; distributing the second event message to a first event thread, the first event thread being any idle thread in the event thread pool; processing the second event message through the first event thread, and updating relevant data in the database.
[0020] In the embodiment of the present application, the centralized management device can process event messages in the order in which the event messages enter the event message queue, thereby ensuring the real-time nature of the data in the database.
[0021] As a possible implementation, processing the second event message through the first event thread includes: when the first event thread determines through the identifier of the associated device of the second event message that no other thread is processing the related event message of the associated device, processing the second event message through the first event thread; or, when the first event thread determines through the identifier of the associated device of the second event message that other threads are processing the related event message of the associated device, waiting for other alarm threads to complete processing before processing the second event message through the first event thread.
[0022] In the embodiment of the present application, since different non-alarm event messages of the same Redfish device may have dependencies, the centralized management device can process at most one non-alarm event message of the same Redfish device at the same time. In this way, the accuracy of the data in the database can be guaranteed.
[0023] As a possible implementation method, the second event message is processed by the first event thread, and the relevant data in the database is updated, including: when the event type corresponding to the second event message is a resource addition event, the first event thread obtains the data of the corresponding resource from the associated device through the associated resource URI of the second event message, and inserts it into the database; when the event type corresponding to the second event message is a resource state change event or a resource update event, the first event thread obtains the data of the corresponding resource from the associated device through the associated resource URI of the second event message, and updates the relevant data in the database; when the event type corresponding to the second event message is a resource removal event, the first event thread deletes the relevant data of the resource corresponding to the associated resource URI of the second event message from the database.
[0024] In the embodiment of the present application, different types of event messages in the event message queue may be classified and processed, so that data may be synchronized more accurately.
[0025] The second aspect discloses a centralized management device, which includes a processor, a memory and a communication interface, the communication interface is used to receive information from other electronic devices outside the centralized management device, and output information to other electronic devices outside the centralized management device, the processor calls the computer program stored in the memory to implement the data synchronization method provided in the above-mentioned first aspect and any possible implementation method of the first aspect.
[0026] The third aspect discloses a computer-readable storage medium, on which a computer program or computer instructions are stored. When the computer program or computer instructions are executed, the data synchronization method disclosed in the above aspects is implemented.
[0027] A fourth aspect discloses a chip, including a processor for executing a program stored in a memory. When the program is executed, the chip executes the data synchronization method disclosed in the above aspects.
[0028] As a possible implementation, the memory is located outside the chip.
[0029] A fifth aspect discloses a computer program product, which includes a computer program code. When the computer program code is run, the data synchronization method disclosed in the above aspects is executed.
[0030] It can be understood that the computing device provided in the second aspect, the computer-readable storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the data synchronization method provided in the first aspect of the present application and any possible implementation of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 It is a schematic diagram of a system architecture disclosed in an embodiment of the present application;
[0033] Figure 2 It is a schematic diagram of the software structure of a centralized management device disclosed in an embodiment of the present application;
[0034] Figure 3 It is a software structure diagram of another centralized management device disclosed in an embodiment of the present application;
[0035] Figure 4 It is a flowchart of a data synchronization method disclosed in an embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of a processing flow of an event receiving module disclosed in an embodiment of the present application;
[0037] Figure 6It is a schematic diagram of a process for processing an alarm event message disclosed in an embodiment of the present application;
[0038] Figure 7 It is a schematic diagram of a process for processing event messages disclosed in an embodiment of the present application;
[0039] Figure 8 It is a structural diagram of a centralized management device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The embodiment of the present application discloses a data synchronization method and a centralized management device, which can ensure the real-time and accuracy of data in the database and improve the efficiency of data synchronization. The technical solution in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application.
[0041] In order to better understand the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below.
[0042] Redfish is a management standard designed to provide simple and secure management capabilities for converged, hybrid information technology (IT) and software defined data centers (SDDC). It uses representational state transfer (RESTful) interface semantics to access data defined in a model format to perform out of band systems management. The Redfish standard (i.e., protocol) is suitable for large-scale servers, from stand-alone servers to rack-mounted and blade server environments, and is also suitable for large-scale cloud environments, data centers, etc.
[0043] Among them, the RESTful application programming interface (API) refers to an interface that meets the REST design style. Currently, the Redfish protocol uses the open data protocol (OData), which is an organization for the advancement of structured information standards (OASIS) standard that describes how to create and access RESTful services. Through the OData protocol (such as OData v4), a queryable and operable RESTful API can be built in a simple and standard way.
[0044] A uniform resource identifier (URI) can be used in the Redfish protocol to identify a resource, a service, or a group of resources (i.e., a collection of resources). In general, a URI can include three parts. The first part includes the service mode, and the host Internet Protocol (IP) address or domain name (sometimes including the port number), the second part includes the root service and the redfish protocol version, and the third part is a unique resource identifier. For example, the following uniform resource locator (URL): https: / / mgmt.vendor.com / redfish / v1 / Systems / 1 / EthernetInterfaces / 1, where the service mode of the first part is https (i.e., communication is carried out using the https protocol), and the host domain name is mgmt.vendor.com. The root service and redfish protocol version of the second part are redfish and v1, respectively, and / redfish / v1 is generally also referred to as the root URL. The unique resource identifier of the third part is / Systems / 1 / EthernetInterfaces / 1, which is generally also referred to as the resource path.
[0045] In some embodiments, the root URL of the second part and the resource path of the third part can also be used as a resource URI, which can uniquely identify the relevant resources of a Redfish device. For example, for a POST request sent by a client, the following URI may be returned in the header of the response (i.e., indicating the location of the new resource created by POST): / redfish / v1 / Systems / 2. Afterwards, if you want to access this new resource, you also need to add the content of the first part (i.e., the service mode, and the host IP address or domain name) in front of the URI. Assuming that the domain name of the server is mgmt.vendor.com, the complete URL required to access this new resource can be https: / / mgmt.vendor.com / redfish / v1 / Systems / 2.
[0046] The Redfish protocol uses the hypertext transfer protocol (HTTP) or the secure hypertext transfer protocol (HTTPS) technology. Therefore, in the Redfish protocol, the client can send a request (i.e., a request message) to the server, and the server can return a response (i.e., a response message) to the client. The request generally includes a request header and a request body (i.e., a request message body), and the response generally includes 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 the Redfish protocol may include GET, POST, PATCH, DELETE, etc. A GET request can obtain a representation of a resource (i.e., a description or data of a resource), a POST request can create a new resource, a PATCH request can modify a resource (e.g., modify the attributes of a resource), and a DELETE request can delete a specified resource. It is understood that a resource can be represented using the JSON (javascript object notation) media type (i.e., "application / json"), and in an HTTP message, the media type can be specified by the Content-Type attribute in the request header or the response header.
[0047] With the advancement of computer technology, the functions and performance of servers are constantly improving and perfecting, and they are playing an increasingly important role in cloud computing, data centers, big data and other fields. In addition, in order to meet the growing demand for data processing, the number of data centers deployed by various enterprises 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 users with centralized management software. Centralized management software generally has monitoring and alarm functions, and can obtain the status data of each server in the data center through Redfish protocol, SNMP (simple network management protocol), IPMI (intelligent platform management interface), etc., and save the obtained status data in the local database of the centralized management software for user use.
[0048] At present, the data synchronization methods supported by the centralized management software of various server manufacturers mainly include manual synchronization, regular automatic synchronization and real-time reporting of alarm data. Among them, alarms generally use SNMP Trap to receive alarms in real time (such as hard disk failure alarms). Manual synchronization (i.e. manual refresh for synchronization) and regular automatic synchronization are full data synchronization. The amount of data to be synchronized is large, and the time granularity of regular synchronization is generally large (usually hourly). In addition, the centralized management software provided by some manufacturers also supports triggering synchronization when the configuration is modified through the centralized management software. For example, when the user controls the server to power off through the centralized management software, the centralized management software can trigger the synchronization of the server status (i.e. change the server from the power-on state to the power-off state). However, if the user does not modify the configuration through the centralized management software (such as directly logging in to the BMC management network port address to modify it), the server status cannot be synchronized and the data in the database cannot be updated in time.
[0049] It can be seen that among the above-mentioned data synchronization methods, except for alarm data, the server status data cannot be synchronized in real time, and each manual synchronization and regular automatic synchronization will perform full data synchronization (i.e., synchronize all status data of all servers), and the data synchronization efficiency is low.
[0050] In order to solve the above problems, in an embodiment of the present application, the event synchronization mechanism of the Redfish protocol can be used to synchronize the relevant status data of the Redfish device, so that when the state of the Redfish device changes, the Redfish device can send a Redfish event message to the centralized management software. Afterwards, the centralized management software can update the data in the database based on the received Redfish event message, thereby ensuring the real-time and accuracy of the data in the database. Moreover, this synchronization method can only synchronize the data that has changed, and does not require synchronization of the entire data, which can improve the efficiency of data synchronization. In addition, in an embodiment of the present application, a complete flow control mechanism and event filtering mechanism are added, which can be applicable to large-scale Redfish device data synchronization scenarios.
[0051] In order to better understand the embodiments of the present application, the system architecture used in the embodiments of the present application is first described below.
[0052] See also Figure 1 , Figure 1 Schematic diagram of a system architecture disclosed in the embodiment of this application. Figure 1 As shown, the system architecture may include: a centralized management device 101, a network 102 and multiple Redfish devices, such as Figure 1The illustrated Redfish device 1 103, Redfish device 2 104, ..., Redfish device N-1 105, and Redfish device N 106. N is an integer greater than or equal to 2, for example, the system architecture 100 may include 8 Redfish devices, 16 Redfish devices, and so on.
[0053] The centralized management device 101 and multiple Redfish devices (ie, Redfish device 1 to Redfish device N) can be connected to the network 102 respectively, and can communicate with each other through the network 102. In some embodiments, the N Redfish devices can communicate with each other through the network.
[0054] The centralized management device 101 can remotely manage the N Redfish devices (including status monitoring, power on and off control, etc.). The centralized management device 101 can be a server or an electronic device with remote management function.
[0055] It should be noted that Redfish devices refer to devices that support the Redfish protocol. In the embodiment of the present application, the Redfish devices may be blade servers, high-density servers, rack servers, cabinet servers, etc. that support the Redfish protocol. Moreover, the N Redfish devices may be produced by different manufacturers.
[0056] It should be understood that any server is generally provided with an out-of-band controller. The out-of-band controller may be an out-of-band processor independent of the central processing unit (CPU). The out-of-band controller may include a monitoring management unit outside the computer device, a management system in a management chip outside the processor, a baseboard management controller (BMC) of the computer device, a system management module (SMM), etc.
[0057] The out-of-band controller is mainly used to monitor and manage the server, and supports remote management (such as server reset, power on and off, etc.) through the management network port. For example, the out-of-band controller can monitor the status of each hardware device in the server (such as humidity, temperature, voltage, current, etc.). For another example, the out-of-band controller can be used to perform system configuration, firmware upgrades, fault diagnosis, etc. In the embodiment of the present application, the centralized management device 101 can realize remote management of each Redfish device (including status monitoring, power on and off control, etc.) through the management network port provided by the out-of-band controllers of N Redfish devices.
[0058] In some embodiments, the centralized management device 101 and the N Redfish devices may further include a processor, a memory, etc. The memory may include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM). The processor may 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 devices, transistor logic devices, hardware components, or any combination thereof.
[0059] It should be noted that Figure 1 The system architecture shown is only an example and does not constitute a limitation. Figure 1 The system architecture depicted may include more or fewer devices than shown.
[0060] See also Figure 2 , Figure 2 1 is a schematic diagram of the software structure of a centralized management device disclosed in an embodiment of the present application. The centralized management device 101 may include centralized management software 1011 and a database 1012. The centralized management software 1011 and the database 1012 may communicate with each other.
[0061] The centralized management software 1011 and the database 1012 may be two software modules deployed in the centralized management device 101. The centralized management device 101 may remotely manage the N Redfish devices through the centralized management software 1011, and may synchronize the status data of the N Redfish devices in real time. In addition, the centralized management software 1011 may store the status data of the N Redfish devices in the database 1012. In some embodiments, the database 1012 may be a database such as mysql, oracle, etc. In other embodiments, the database 1012 may also be a cloud database, without limitation.
[0062] The status data of the Redfish device may include the status data of each hardware device in the Redfish device. For example, the temperature, humidity, voltage, current, etc. of the processor, memory, hard disk, power supply, etc. collected by sensors such as temperature sensors, humidity sensors, voltage sensors, current sensors, etc., and another example is the CPU temperature, memory health status, power consumption, firmware information (such as firmware version) of each hardware device of the Redfish device. In addition, it may also include the data of virtual resources such as storage, network, virtual machine, etc. in the Redfish device. In some embodiments, the status data of the Redfish device may also include the data of various resources specified in the Redfish protocol.
[0063] In one possible implementation, the centralized management software 1011 can present the status data of the Redfish device in a visual manner (such as a web page), which may specifically include the CPU information (such as CPU temperature, whether the CPU is faulty, etc.), memory information, voltage information, power supply information, fan speed, etc. of each Redfish device. In another possible implementation, the centralized management software 1011 can send the status data of the Redfish device to other devices through the network, and can receive requests from other devices to manage the Redfish device (such as power on and off control).
[0064] In some embodiments, the centralized management device 101 can perform real-time data synchronization through the event mechanism of the Redfish protocol. Accordingly, the centralized management software 1011 may include: Figure 3 Modules shown include a subscription module 10111, an event receiving module 10112, and an event processing module 10113.
[0065] Among them, the subscription module (subscriber) 10111 is mainly responsible for the event subscription of the Redfish device by the centralized management software 1011, that is, creating event subscription resources through the POST operation. It can subscribe to all events supported by the Redfish device, and can also subscribe to some events supported by the Redfish device. In addition, the Redfish protocol stipulates 5 types of events, namely StatusChanged (resource status change event), ResourceUpdated (resource update event), ResourceAdded (resource added event), ResourceRemoved (resource removed event), and Alert (alert event). It should be understood that the subscription module 10111 can subscribe to the relevant events of the Redfish device when the centralized management device 101 manages the Redfish device.
[0066] Taking the first Redfish device 300 as an example, the URL for the subscription module 10111 to subscribe to the event of the first Redfish device 300 may be https: / / IP address of the first Redfish device / redfish / v1 / EventService / Subscriptions. When creating an event subscription resource through this URL, the subscription module 10111 may send the event receiving address (i.e., a legal http / https receiving address), the monitored event type (i.e., a combination of the above five event types), and the authentication information (such as an account number and password) to the first Redfish device in the format specified by the Redfish protocol to complete the creation of the event subscription resource. The authentication information may be used for identity authentication when the Redfish device reports an event.
[0067] It should be understood that after the subscription module 10111 creates an event subscription resource, the first Redfish device can monitor the subscribed events. When a subscribed event occurs (i.e., when the relevant resources change), the first Redfish device can report the occurred event to the event receiving address, i.e., send the relevant event message. It should be understood that an event message can be related to (i.e., associated with) a specific resource. Accordingly, an event message can be associated with the URI corresponding to the resource. The first Redfish device can be any of the above-mentioned N Redfish devices. It should be understood that the above-mentioned event subscription-related steps are explained using the first Redfish device 300 as an example. In an embodiment of the present application, the subscription module 10111 can complete the event subscription of the above-mentioned N Redfish devices so as to synchronize the status data of the above-mentioned N Redfish devices in real time.
[0068] The event receiving module (eventreceiver) 10112 is mainly responsible for receiving the event message sent by the first Redfish device, and performing flow control and filtering on the event message. In this way, the message flow can be controlled and the event message of no concern can be discarded, thereby avoiding event blocking and saving processing resources.
[0069] Specifically, the event receiving module 10112 can first perform flow control on the event message, and then accurately filter the event messages that the business does not pay attention to through the preset resource URI whitelist. Since the alarm event message is generally more important, in some embodiments, the event receiving module 10112 may not filter the alarm event message, and only filter the event messages of other event types except the alarm event message. At the same time, for the alarm event message, the event receiving module 10112 can put it into the alarm message queue, waiting for the event processing module 10113 to process it. Resource state change event messages, resource update event messages, resource addition event messages and resource removal event messages can be put into the event message queue, waiting for the event processing module 10113 to process it.
[0070] It should be understood that when the above subscription module 10111 creates an event subscription resource, the event receiving address sent to the Redfish device can be a related address of the event receiving module 10112 or the centralized management software 1011 or the centralized management device 101, so that the event receiving module 10112 can receive event messages from each Redfish device.
[0071] The event handling module (eventhandler) 10113 is mainly responsible for processing event messages and updating the data stored in the database 1012 (i.e., adding data, deleting data, modifying data, etc.). In some embodiments, the event handling module 10113 can improve the processing efficiency of event messages through parallel processing. Specifically, the event handling module 10113 can simultaneously process messages in the alarm message queue and the event message queue, can obtain the latest relevant status data of each Redfish device, and can write the latest data into the database 1012 to complete data synchronization.
[0072] It should be noted that Figure 2 and Figure 3 The software structure shown is only an example and does not constitute a limitation. In other embodiments of the present application, Figure 2 and Figure 3 The software architecture shown may include more or fewer software modules than shown.
[0073] Based on the above system architecture, please refer to Figure 4 , Figure 4 Schematic diagram of a data synchronization method disclosed in an embodiment of the present application. Figure 4 As shown, the data synchronization method may include but is not limited to the following steps:
[0074] 401. Centralized management device subscribes to some or all events of multiple Redfish devices.
[0075] Specifically, in order to synchronize the data of multiple Redfish devices (i.e., the N Redfish devices mentioned above) managed by the centralized management device, the centralized management device can create relevant event subscription resources through a POST operation to subscribe to some or all events of these multiple Redfish devices (i.e., the subscription module can subscribe to some or all events of these multiple Redfish devices).
[0076] 402. The centralized management device receives event messages from the multiple Redfish devices.
[0077] Specifically, after the subscription module of the centralized management software subscribes to the events of the N Redfish devices, the N Redfish devices can monitor the subscribed events respectively. When each Redfish device monitors the occurrence of the subscribed event, each Redfish device can report the event, that is, send the relevant event message defined by the Redfish protocol to the specified event receiving address. Correspondingly, the centralized management device (i.e., the event receiving module) can receive the event message from each Redfish device.
[0078] It should be noted that after the event receiving module receives the event messages from the multiple Redfish devices, the event receiving module will perform flow control processing and event filtering, and then put the filtered messages into the event message queue or the alarm message queue. For a more detailed description of step 402 and the event receiving module, please refer to Figure 5 . Figure 5 FIG. 1 is a schematic diagram of a processing flow of an event receiving module disclosed in an embodiment of the present application. Figure 5 As shown, the processing flow of the event receiving module may include but is not limited to the following steps:
[0079] 501. The event receiving module receives a first event message.
[0080] Specifically, when the first Redfish device monitors that a subscribed event has occurred, the first Redfish device can send a related event message (i.e., a first event message) to the event receiving module of the centralized management device. Correspondingly, the event receiving module can receive the first event message from the first Redfish device. The first Redfish device is any one of the N Redfish devices.
[0081] It should be understood that event messages may include five types, namely, StatusChanged, ResourceUpdated, ResourceAdded, ResourceRemoved and Alert event type event messages.
[0082] Among them, when the Redfish device monitors a resource with an alarm (such as the memory temperature is too high), it can generate an event message of the Alert event type and send it to the centralized management device. When the Redfish device monitors a new resource (such as a new solid-state drive), it can generate an event message of the ResourceAdded event type and send it to the centralized management device. When the Redfish device monitors that a resource is deleted (such as the removal of a solid-state drive), it can generate an event message of the ResourceRemoved event type and send it to the centralized management device. When the Redfish device monitors a change in the status of a resource (such as the sub-attribute health of the status attribute changes from 'ok' to 'warning'), it can generate an event message of the StatusChanged event type and send it to the centralized management device. When the Redfish device monitors a change in the attribute value of a resource (such as a change in the CPU frequency of the Redfish device), it can generate an event message of the ResourceUpdated event type and send it to the centralized management device. It should be understood that the Redfish protocol has relevant definitions for the above five types of event messages, including the specific attribute fields included in each type of event message.
[0083] For the convenience of description, the event message of the Alert event type is called an alarm event message, and the event messages of the four event types of StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved are called non-alarm event messages.
[0084] For example, assuming that the subscription module creates a memory-related event subscription resource (i.e., subscribes to memory-related events), when the Redfish device monitors changes in its own memory-related resources, the Redfish device can send relevant event messages to the event receiving module. For example, when the memory of the Redfish device is removed, the Redfish device can send an event message of the ResourceRemoved event type to the event receiving module in the format defined by the Redfish protocol.
[0085] 502. The event receiving module determines whether the received first event message is an alarm event message. If it is determined to be an alarm event message, step 509 may be executed. If it is determined not to be an alarm event message, step 503 may be executed.
[0086] Specifically, after the event receiving module receives the first event message, the first event message can be parsed according to the relevant event message definition of the Redfish protocol, and then, it can be determined whether the received first event message is an alarm event message (i.e., whether the event type corresponding to the event message is Alert) according to the parsing result of the first event message. If the event type corresponding to the first event message is Alert, it can be determined that the first event message is an alarm event message, and step 509 can be executed. If the event type corresponding to the first event message is not Alert, it can be determined that the first event message is not an alarm event message, and step 503 can be executed.
[0087] The event receiving module can determine whether the received first event message is an alarm event message according to the value of the EventType field in the first event message. If the value of the EventType field is "Alert", it means that the event message is an alarm event message, and if the value of the EventType field is "ResourceRemoved", "ResourceUpdated", "StatusChanged" or "ResourceAdded", it means that the event message is not an alarm event message.
[0088] The following is a Redfish standard definition of the format of the event message content:
[0089]
[0090]
[0091] 503. The event receiving module determines whether the total message flow of other event messages except the alarm event messages is less than the resources currently processing non-alarm event messages. If it is less than the resources currently processing non-alarm event messages, step 504 can be executed. If it is greater than or equal to the resources currently processing non-alarm event messages, step 508 can be executed.
[0092] It should be understood that if the subscription module creates a large number of Redfish devices with relevant event subscription resources, or these Redfish devices send too many event messages in a short period of time, the event receiving module may receive too many event messages, which may cause the centralized management device to be unable to handle them, and may cause the event messages to be blocked all the time and unable to be processed in time, and even in some cases, may cause the entire processing system to crash. Therefore, in the embodiment of the present application, the event message flow can be limited.
[0093] Specifically, the event receiving module can determine whether the total message flow of other event messages (i.e., event messages of StatusChanged, ResourceUpdated, ResourceAdded and ResourceRemoved event types) other than the alarm event messages is less than the resources currently processing non-alarm event messages. If it is greater than or equal to the resources currently processing non-alarm event messages, it indicates that the event message flow of the four event types of StatusChanged, ResourceUpdated, ResourceAdded and ResourceRemoved is too large and the processing resources are insufficient. At this time, in order to avoid the collapse of the entire processing system, the first event message received can be discarded and step 508 can be executed. If it is less than the resources currently processing non-alarm event messages, step 504 can be executed.
[0094] In some embodiments, the event receiving module can use a token bucket algorithm to control the event message flow. The token bucket algorithm includes parameters such as rate and brust. The rate parameter is the rate at which tokens are put into the token bucket, and the brust parameter is the capacity of the token bucket (i.e., the maximum number of tokens that can be stored). In an embodiment of the present application, receiving a non-alarm event message requires one token. Therefore, after receiving the first event message, if the number of tokens in the token bucket is 0, it can be determined that the total message flow of the current four event types, StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved, is greater than or equal to the resources currently processing non-alarm event messages. At this time, the received first event message can be discarded, and step 508 can be executed. Otherwise, step 504 can be executed.
[0095] It should be understood that when the token bucket algorithm is used to control the event message flow, the total message flow of the other event messages can be the number of non-alarm event messages currently received, and the resources currently processing non-alarm event messages can be the number of tokens in the current token bucket. Therefore, when the total message flow of other event messages is greater than or equal to the resources currently processing non-alarm event messages, the tokens in the token bucket will be consumed. At this time, if a new event message is received, it can be directly discarded.
[0096] It should be noted that the upper limit of resources used to process non-alarm event messages can be determined based on the number of Redfish devices, the system resources of the central management device (such as CPU resources), etc. For example, when the CPU performance of the central management device is good and the memory storage capacity is large, the upper limit of resources used to process non-alarm event messages can be large. Accordingly, the values of the above-mentioned rate parameter and brust parameter can be determined based on the number of Redfish devices, the system resources of the central management device (such as CPU resources), etc. For example, when the CPU performance of the central management device is good and the memory storage capacity is large, the values of the rate parameter and brust parameter can be large.
[0097] It should be understood that in other embodiments of the present application, the event receiving module may also use a leaky bucket algorithm or other flow control algorithms to control the event message flow, which is not limited here.
[0098] 504. The event receiving module obtains the resource URI associated with this event from the OriginOfConditon field in the received first event message.
[0099] When the event receiving module determines that the total message traffic of the four event types StatusChanged, ResourceUpdated, ResourceAdded and ResourceRemoved is less than the resources currently processing non-alarm event messages, the event receiving module can obtain the resource URI associated with the first event message from the OriginOfConditon field in the received first event message.
[0100] 505. The event receiving module determines whether the resource URI corresponding to the received first event message is in the preset resource URI whitelist. If it is in the preset resource URI whitelist, step 506 can be executed. If it is not in the preset resource URI whitelist, the received first event message can be discarded and step 508 can be executed.
[0101] Specifically, since some events of the four event types, StatusChanged, ResourceUpdated, ResourceAdded and ResourceRemoved, reported by the Redfish device may be events that are not of concern to the business or users, the event receiving module can filter the event messages of these event types through the preset resource URI whitelist, and can filter out events that are not of concern to the business or users, thereby improving the processing efficiency of event messages.
[0102] The preset resource URI whitelist is a resource list set consisting of resource URIs that are of interest to businesses or users. The resource list set may include specific resource URIs or resource URIs in the form of regular expressions. It should be understood that a specific resource URI can match a specific resource, while a resource URI in the form of a regular expression can match multiple specific resources, which is more flexible.
[0103] The following is an example of a resource URI whitelist:
[0104] {" / redfish / v1 / systems / [^ / ]+ / storages / [^ / ]+ / ?$":
[0105] " / redfish / v1 / systems / [^ / ]+ / storages / [^ / ]+ / volumes / [^ / ]+ / ?$":
[0106] " / redfish / v1 / systems / [^ / ]+ / memory / [^ / ]+ / ?$":
[0107] " / redfish / v1 / systems / [^ / ]+ / processors / [^ / ]+ / ?$":}
[0108] The resource URI whitelist includes four regular expressions. [^ / ] can represent all non-" / " contents. + can represent that the preceding content appears at least once. Therefore, [^ / ]+ can represent that non-" / " contents appear once or multiple times. ? can represent that the preceding content appears at most once. Therefore, / ? can represent that one " / " appears or no " / " appears. $ is a locator that can match the end position of a string.
[0109] For example, assuming that the resource URI corresponding to the first event message received is " / redfish / v1 / systems / 1 / memory / 1", when the event receiving module matches it with the regular expression in the above resource URI whitelist, it can be determined that the resource URI matches the above regular expression " / redfish / v1 / systems / [^ / ]+ / memory / [^ / ]+ / ?$". At this time, the event receiving module can determine that the resource URI corresponding to the first event message is in the preset resource URI whitelist.
[0110] It is understandable that for different Redfish devices, the resource URIs that users are concerned about may be different. Therefore, in some embodiments, different resource URI whitelists can be preset for different Redfish devices. After that, for event messages from different Redfish devices, the event messages can be filtered through the resource URI whitelists corresponding to each Redfish device. In this way, the event messages can be filtered more accurately, and some unnecessary event message processing can be avoided, thereby improving the efficiency of event processing.
[0111] 506. The event receiving module determines whether the resource URI corresponding to the received first event message is in the resource URI blacklist. If it is in the resource URI blacklist, the received first event message can be discarded and step 508 can be executed. If it is not in the resource URI blacklist, step 507 can be executed.
[0112] Specifically, in actual scenarios, some resource URIs of concern to businesses or users may have related events reported too frequently. Processing event messages corresponding to these resource URLs will consume a large amount of processing resources of the centralized management device. However, in fact, the event receiving module does not need to process these event messages too frequently. For example, the fan speed of a Redfish device may change frequently. At this time, events of the ResourceUpdated type corresponding to the fan resource URI may be frequently reported. Such events do not need to be processed frequently. Therefore, the event receiving module can filter the received event messages through the resource URI blacklist, and can filter out event messages that do not need to be processed, thereby saving processing resources of the centralized management device.
[0113] It should be noted that the resource URI blacklist is an empty list when the system is initialized (that is, before any event message is received). When the event receiving module detects that related events of the same resource URI are frequently reported, the resource URI can be added to the resource URI blacklist, and an expiration time (such as 10 minutes) can be configured for the URI resource in the resource URI blacklist. When the expiration time exceeds, the URI resource can be deleted from the resource URI blacklist.
[0114] In some embodiments, if the related events of the same resource URI are reported more than Y times within X minutes (i.e., within the first time period), it can be considered that the related events of the resource URI are reported too frequently, and the resource URI can be added to the resource URI blacklist. X and Y are both integers greater than or equal to 1.
[0115] It is understandable that for different Redfish devices, the resource URIs of frequently reported events may be different. Therefore, in some embodiments, different resource URI blacklists can be set for different Redfish devices. After that, for event messages from different Redfish devices, the event messages can be filtered through the resource URI blacklists corresponding to each Redfish device. In this way, the event messages can be filtered more accurately and the efficiency of event processing can be improved.
[0116] In some embodiments, the event receiving module may first filter the received event message through the resource URI whitelist and blacklist, and then control the event message flow, that is, the above steps 504-506 may be performed first, and then the above step 503 may be performed. In other embodiments, the event receiving module may not perform step 506, but directly perform step 507. In still other embodiments, the event receiving module may not perform step 505, but directly perform step 506. In still other embodiments, the event receiving module may not perform steps 505 and 506, but directly perform step 507.
[0117] 507. The event receiving module puts the received first event message into the event message queue.
[0118] When the event receiving module determines that the resource URI corresponding to the received first event message is not in the resource URI blacklist, the event receiving module may put the received first event message into an event message queue to wait for processing by the event processing module.
[0119] The event message queue may include event messages of four event types: StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved.
[0120] 508. The event receiving module discards the received first event message.
[0121] Specifically, when the total message traffic of event messages other than alarm event messages is greater than or equal to the resources currently processing non-alarm event messages, or when the resource URI corresponding to the received event message is not in the preset resource URI whitelist, or when the resource URI corresponding to the received event message is in the resource URI blacklist, the event receiving module can discard the received first event message.
[0122] 509. The event receiving module determines whether the current alarm event message traffic is less than the resources currently used to process the alarm event messages. If it is greater than or equal to the resources currently used to process the alarm event messages, the received first event message can be discarded and step 511 can be executed. If it is less than the resources currently used to process the alarm event messages, step 510 can be executed.
[0123] It should be understood that if the event receiving module receives too many alarm event messages in a short period of time, the centralized management device may not be able to handle them, which may cause the alarm event messages to be blocked and unable to be processed in a timely manner, and even in some cases, may cause the entire processing system to crash. Therefore, on the basis of limiting the flow of non-alarm event messages in step 503, in the embodiment of the present application, the flow of alarm event messages can also be limited.
[0124] Specifically, the event receiving module can determine whether the message flow of the current alarm event message is less than the resources currently processing the alarm event message. If it is greater than or equal to the resources currently processing the alarm event message, it indicates that the alarm event message flow is too large. At this time, in order to avoid the collapse of the entire processing system, the received first event message can be discarded, and step 511 can be executed. If it is less than the resources currently processing the alarm event message, step 510 can be executed.
[0125] In some embodiments, the event receiving module may use a token bucket algorithm to control the alarm event message flow. In the embodiment of the present application, receiving an alarm event message requires a token. Therefore, after receiving the first event message, if the number of tokens in the token bucket is 0, it can be determined that the current alarm event message flow is greater than or equal to the resources currently processing the alarm event message. At this time, the received first event message can be discarded, and step 511 can be executed. Otherwise, step 510 can be executed.
[0126] It should be understood that when the above token bucket algorithm is used to control the alarm event message flow, the message flow of the above alarm event message can be the message number of the alarm event message currently received, and the above resource for currently processing the alarm event message can be the number of tokens in the current token bucket, so when the message flow of the alarm event message is greater than or equal to the resource for currently processing the alarm event message, the tokens in the token bucket will be consumed. At this time, if a new alarm event message is received, it can be directly discarded.
[0127] It should be noted that the resource upper limit for processing alarm event messages can be determined based on the number of Redfish devices, the system resources of the centralized management device (such as CPU resources), etc. For example, when the CPU performance of the centralized management device is good and the memory storage capacity is large, the resource upper limit for processing alarm event messages can be larger. It should be understood that the above-mentioned flow control of non-alarm event messages and alarm event messages is only an exemplary description and does not constitute a limitation. In other embodiments of the present application, the event receiving module may also use a leaky bucket algorithm or other flow control algorithm to control the flow of alarm event messages, which is not limited here. It should also be understood that the above-mentioned resource upper limit for processing alarm event messages and the resource upper limit for processing non-alarm event messages may be the same or different. Accordingly, the values of the rate parameter and the brust parameter configured when the alarm event message and the non-alarm event message are subjected to flow limiting processing may be the same or different.
[0128] It should be understood that, although in the above-mentioned processing, the alarm event message and the message of other event types except the alarm event message are separately flow controlled. But in other embodiments of the present application, the event message flow of all event types can be subjected to unified flow control. For example, after step 501, after receiving an event message, it is not necessary to judge whether the event message is an alarm event message or a message of other event types, directly judge whether the current total event message flow is less than the total resources of the current processing event message, if it is greater than or equal to the total resources of the current processing event message, the event message can be discarded, if it is less than the total resources of the current processing event message, then it can be judged again whether the event message is an alarm event message or a message of other event types, if it is an alarm event message, then step 510 can be executed, if it is not an alarm event message, then step 504 can be executed.
[0129] 510. The event receiving module puts the received first event message into the alarm message queue.
[0130] When the current alarm event message flow is less than the resources currently used to process the alarm event messages, the event receiving module may put the received first event message into the alarm message queue to wait for processing by the event processing module.
[0131] Among them, the alarm message queue can include event messages of the event type Alert. It can be seen that the event message queue can provide cache for event messages of the four event types of StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved, and the alarm message queue can provide cache for event messages of the event type Alert, so that the event processing module can process the event messages in the event message queue and the alarm message queue in parallel.
[0132] 511. The event receiving module discards the received first event message.
[0133] When the current alarm event message flow is greater than or equal to the resources currently used to process the alarm event messages, the event receiving module may discard the received first event message.
[0134] It should be understood that the above steps 501 to 511 are detailed descriptions of step 402 and the event receiving module. The following introduces the specific implementation of the centralized management device updating the data in the database based on the received event message.
[0135] 403. The centralized management device updates the data in the database based on the received event message.
[0136] After the centralized management device receives the event message from each Redfish device, it can update the relevant data in the database (i.e., add data, delete data, modify data, etc.) based on the received event message.
[0137] Specifically, when there are corresponding messages in the alarm message queue and the event message queue, the event processing module can process the messages in the alarm message queue and the event message queue. In addition, since there is no dependency between the alarm event message and the event messages of other event types (i.e., event messages of the four event types of StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved), that is, there is no dependency between the alarm event messages of different Redfish devices and the event messages of other event types, and there is no dependency between the alarm event messages of the same Redfish device and the event messages of other event types, the event processing module can process the messages in the alarm message queue and the event message queue in parallel. However, since there may be dependencies between different alarm event messages of the same Redfish device, and between event messages of different other event types, the event processing module can process at most one alarm event message of the same Redfish device and one event message of other event types at the same time. Specifically, a more detailed description of step 403 and the event processing module can be found below. Figure 6 and Figure 7 Related description of the corresponding embodiment.
[0138] Figure 6 The following is a flow chart of the process of the event processing module processing the alarm event message in the alarm message queue. Figure 7 A flowchart of the event processing module processing event messages in the event message queue.
[0139] Next, Figure 6 The processing flow shown is explained as follows: Figure 6 As shown, the process of the event processing module processing the alarm event message in the alarm message queue may include but is not limited to the following steps:
[0140] 601. The event processing module obtains a first alarm message from an alarm message queue, and obtains an associated device identifier of the first alarm message.
[0141] When there is an alarm event message in the alarm message queue, the event processing module can obtain the first alarm message from the alarm message queue and obtain the associated device identifier of the first alarm message. Among them, the alarm message queue can be a first-in first-out (FIFO) queue, and the first alarm message can be the event message that first enters the alarm message queue among all event messages in the alarm message queue (that is, the event message at the head of the alarm message queue). The associated device of the first alarm message can be a Redfish device that sends the first alarm message, and accordingly, the associated device identifier of the first alarm message can be an identifier of the Redfish device that sends the first alarm message, and the identifier can be information that can uniquely identify the Redfish device, and can be the IP address of the Redfish device, or can be the MAC (media access control) address, number, index, name, etc. of the Redfish device, which is not limited here.
[0142] In some embodiments, the event processing module can obtain the associated device identifier of the first warning message from the first warning message. For example, the event processing module can obtain the IP address of the associated device of the first warning message from the message header of the first warning message, and the IP address can be used as the associated device identifier of the first warning message.
[0143] 602. The event processing module distributes the first alarm message to the first alarm thread in the alarm thread pool.
[0144] Specifically, in order to improve the processing efficiency of alarm event messages, the event processing module can create an alarm processing thread pool in advance, which can include multiple alarm threads. These multiple alarm threads can be used to process the alarm event messages of different Redfish devices in parallel. Therefore, after the event processing module obtains the first alarm message, the event processing module can distribute the first alarm message to the first alarm thread in the alarm thread pool. Among them, the first alarm thread can be any idle thread in the alarm thread pool. It can be understood that the idle thread in the alarm thread pool refers to a thread that has not been assigned an alarm event message by the event processing module, or a thread that has processed the alarm event message assigned by the event processing module.
[0145] It should be noted that after the event processing module distributes the first alarm message to the first alarm thread in the alarm thread pool, if there are still idle alarm threads in the alarm thread pool and there are still alarm event messages in the alarm message queue, the event processing module can continue to obtain other alarm event messages from the alarm message queue, as well as the associated device identifiers of other alarm event messages, and then distribute the obtained alarm event messages to the idle threads in the alarm thread pool for processing. If there are no idle alarm threads in the alarm thread pool, the event processing module can wait for other alarm threads to complete processing, or, if there are no alarm event messages in the alarm message queue, the event processing module can wait for the event receiving module to put a new alarm event message into the alarm message queue.
[0146] It should be understood that when the event processing module distributes the first alarm message to the first alarm thread in the alarm thread pool, the event processing module may also transmit the associated device identifier of the first alarm message to the first alarm thread.
[0147] 603. The first alarm thread determines, through the associated device identifier, whether other alarm threads are processing related alarm messages of the associated device.
[0148] It should be understood that there may be dependencies between different alarm event messages of the same Redfish device. For example, at a certain moment, the memory temperature of Redfish device 1 is too high. At this time, Redfish device 1 reports an alarm event of excessive memory temperature, but then in a very short time (such as a few seconds), the memory temperature returns to normal. At this time, Redfish device 1 reports an alarm event of memory temperature returning to normal. Accordingly, the centralized management device may receive event messages of these two events in a short period of time, and then the centralized management device may process these two alarm event messages in parallel through two different threads. At this time, if the alarm event message of memory temperature returning to normal is processed first, it may cause wrong data to be stored in the database. Specifically, when the alarm event message processing of the memory temperature returning to normal is completed, since the value of the alarm status attribute corresponding to the memory of Redfish device 1 in the database is OK (i.e. normal, no alarm) at this time, the centralized management device does not need to update the value of the alarm status attribute corresponding to the memory of Redfish device 1 in the database. Later, when the alarm event message processing of the memory temperature being too high is completed, the centralized management device can modify the value of the alarm status attribute corresponding to the memory of Redfish device 1 in the database to "temperature is too high", which will result in erroneous data being stored in the database.
[0149] In order to avoid the above problems, in the embodiment of the present application, the event processing module can process at most one alarm event message of the same Redfish device at the same time. Therefore, before processing the first alarm message, the first alarm thread can determine whether other alarm threads are currently processing the relevant alarm messages of the associated device through the associated device identifier of the first alarm message. If other alarm threads are processing the relevant alarm messages of the associated device, it can wait for the other alarm threads to complete the processing and execute step 604. If no other alarm threads are processing the relevant alarm messages of the associated device, it can execute step 605.
[0150] Specifically, the first alarm thread can determine the alarm processing status corresponding to the associated device identifier based on the associated device identifier of the first alarm message. If the alarm processing status corresponding to the associated device identifier is "processing", it means that other alarm threads are currently processing the relevant alarm messages of the associated device. If the alarm processing status corresponding to the associated device identifier is "idle", it means that no other alarm threads are currently processing the relevant alarm messages of the associated device.
[0151] 604. The first alarm thread waits for other alarm threads to complete processing.
[0152] When the first alarm thread determines that other alarm threads are currently processing the relevant alarm message of the associated device, the first alarm thread can wait for the other alarm threads to process, and then when the alarm processing status corresponding to the associated device identifier becomes "idle", the first alarm thread can process the first alarm message again, and step 605 can be executed first.
[0153] 605. The first alarm thread sets the alarm processing status corresponding to the associated device identifier of the first alarm message to being processed.
[0154] Before the first alarm thread processes the first alarm message, the first alarm thread may first set the alarm processing status corresponding to the associated device identifier of the first alarm message to "processing". In this way, before the first alarm thread processes the first alarm message, other alarm threads will not process other alarm messages of the associated device of the first alarm message, thereby avoiding erroneous data from being stored in the database.
[0155] 606. The first alarm thread processes the first alarm message.
[0156] After the first alarm thread sets the alarm processing state corresponding to the associated device identifier of the first alarm message to “processing”, the first alarm thread may process the first alarm message.
[0157] Specifically, the first alarm message may include relevant information of the corresponding alarm event (such as the alarm name, detailed information of the alarm, alarm level, associated resource URI, etc.), and the relevant definition of the Redfish protocol can be specifically referred to. Accordingly, the first alarm thread can parse the relevant information of the first alarm message, and then insert data into the database or update the relevant data in the database based on this information. In addition, the centralized management software can present the relevant alarm information (such as detailed information of the alarm, alarm level, etc.) in a visual manner (such as a web page) so that relevant management personnel can handle it in a timely manner.
[0158] In some embodiments, the database may include an alarm information table, which is used to store relevant alarm data of the Redfish device. The following example illustrates that when the hard disk of the Redfish device 1 fails, a relevant alarm message can be sent to the centralized management device. Accordingly, the centralized management device can receive the alarm message from the Redfish device 1, and then the centralized management device can insert the relevant information of the alarm message into the alarm information table in the database, and can update the value of the alarm status attribute corresponding to the hard disk of the Redfish device 1 in the database to "failure". If the hard disk of the Redfish device 1 returns to normal later, the Redfish device 1 can send an alarm event message indicating that the hard disk has returned to normal to the centralized management device, and accordingly, the centralized management device can update the relevant data in the database, such as updating the value of the alarm status attribute corresponding to the hard disk of the Redfish device 1 in the database to OK.
[0159] In some embodiments, the first alarm thread can obtain detailed data of the corresponding resource from the associated device through the IP address of the associated device of the first alarm message and the resource URI associated with the first alarm message, and then use the data to replace the old data corresponding to the resource in the database.
[0160] 607. The first alarm thread sets the alarm processing state corresponding to the associated device identifier of the first alarm message to idle.
[0161] After the first alarm thread has processed the first alarm message, the first alarm thread may change the alarm processing state corresponding to the associated device identifier of the first alarm message from "processing" to "idle". Afterwards, the first alarm thread may become an idle thread and may wait for the distribution of a new alarm event message.
[0162] Below Figure 7 The processing flow shown is explained as follows: Figure 7 As shown, the process of the event processing module processing the event message in the event message queue may include but is not limited to the following steps:
[0163] 701. The event processing module obtains a second event message from the event message queue, and obtains an associated device identifier of the second event message.
[0164] When there are event messages (i.e., event messages of the four event types of StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved) in the event message queue, the event processing module can obtain the second event message from the event message queue and obtain the associated device identifier of the second event message. Among them, the event message queue can be a first-in-first-out queue, and the second event message can be the event message at the head of the event message queue. The associated device of the second event message can be a Redfish device that sends the second event message, and accordingly, the associated device identifier of the second event message can be the identifier of the Redfish device that sends the second event message, and the identifier can be information that can uniquely identify the Redfish device, and can be the IP address of the Redfish device, or can be the MAC address, number, index, name, etc. of the Redfish device, which is not limited here.
[0165] 702. The event processing module distributes the second event message to the first event thread in the event thread pool.
[0166] Specifically, in order to improve the processing efficiency of event messages in the event message queue, the event processing module can create an event processing thread pool in advance, which may include multiple event threads, and these multiple event threads can be used to process event messages of different Redfish devices in parallel. Therefore, after the event processing module obtains the second event message, the event processing module can distribute the second event message to the first event thread in the event thread pool. Among them, the first event thread can be any idle thread in the event thread pool. It can be understood that the idle thread in the event thread pool refers to a thread that has not been assigned an event message by the event processing module, or a thread that has processed the event message assigned by the event processing module.
[0167] It should be noted that after the event processing module distributes the second event message to the first event thread in the event thread pool, if there are still idle event threads in the event thread pool and event messages in the event message queue, the event processing module can continue to obtain other event messages from the event message queue, as well as the associated device identifiers of other event messages, and then distribute the obtained event messages to the idle threads in the event thread pool for processing. If there are no idle event threads in the event thread pool, the event processing module can wait for other event threads to complete processing, or, if there are no event messages in the event message queue, the event processing module can wait for the event receiving module to put a new event message into the event message queue.
[0168] It should be understood that when the event processing module distributes the second event message to the first event thread in the event thread pool, the event processing module may also pass the associated device identifier of the second event message to the first event thread.
[0169] 703. The first event thread determines, through the associated device identifier, whether other event threads are processing related event messages of the associated device.
[0170] It should be understood that there may be dependencies between different event messages of the same Redfish device (i.e., event messages of the four event types StatusChanged, ResourceUpdated, ResourceAdded, and ResourceRemoved). For example, at a certain moment, the hard disk of Redfish device 1 is unplugged. At this time, Redfish device 1 reports the relevant event of hard disk unplugging (event type is ResourceRemoved), but then in a very short time, the hard disk that has just been unplugged is reinserted into Redfish device 1. At this time, Redfish device 1 reports the relevant event of hard disk insertion (event type is ResourceAdded). Accordingly, the centralized management device may receive the event messages of these two events in a short period of time. After that, the centralized management device may process these two event messages in parallel through two different threads. At this time, if the event message of hard disk insertion is processed first, it may cause incomplete errors stored in the database. Specifically, when the hard disk insertion event message processing is completed, since the database originally stores the data corresponding to the hard disk, the centralized management device does not need to update the relevant data of the hard disk of Redfish device 1 in the database. Afterwards, when the hard disk removal event message processing is completed, the centralized management device can delete the relevant data of the hard disk of Redfish device 1 in the database, which may cause incomplete data stored in the database.
[0171] In order to avoid the above problems, in the embodiment of the present application, the event processing module can process at most one event message of the same Redfish device at the same time. Therefore, before processing the second event message, the first event thread can determine whether there are other event threads currently processing the relevant event messages of the associated device through the associated device identifier of the second event message. If there are other event threads processing the relevant event messages of the associated device, it can wait for the other event threads to complete the processing and execute step 704. If there are no other event threads processing the relevant event messages of the associated device, it can execute step 705.
[0172] Specifically, the first event thread can determine the event processing status corresponding to the associated device identifier based on the associated device identifier of the second event message. If the event processing status corresponding to the associated device identifier is "processing", it means that other event threads are currently processing the relevant event messages of the associated device. If the event processing status corresponding to the associated device identifier is "idle", it means that no other event thread is currently processing the relevant event messages of the associated device.
[0173] 704. The first event thread waits for other event threads to complete processing.
[0174] When the first event thread determines that other event threads are currently processing related event messages of the associated device, the first event thread can wait for other event threads to process, and then when the event processing status corresponding to the associated device identifier becomes "idle", the first event thread can process the second event message and can execute step 705 first.
[0175] 705. The first event thread sets the event processing state corresponding to the associated device identifier to being processed.
[0176] Before the first event thread processes the second event message, the first event thread may first set the event processing state corresponding to the associated device identifier of the second event message to "processing". In this way, before the first event thread completes processing the second event message, other event threads will not process other event messages of the associated device of the second event message, thereby avoiding storage of erroneous data (such as incomplete data) in the database.
[0177] 706. The first event thread obtains the resource URI and event type associated with the second event message.
[0178] After the first event thread sets the event processing status corresponding to the associated device identifier of the second event message to "processing", the first event thread can obtain the resource URI associated with the second event message from the OriginOfCondition field in the second event message, and can obtain the event type corresponding to the second event message from the EventType field in the second event message.
[0179] 707. The first event thread determines the event type corresponding to the second event message. If it is a ResourceAdded event type, execute step 708; if it is a StatusChanged or ResourceUpdated event type, execute step 709; if it is a ResourceRemoved event type, execute step 710.
[0180] Since the processing procedures for event messages of different event types are different, the first event thread can first determine the event type corresponding to the second event message. If it is determined that the event type corresponding to the second event message is the ResourceAdded event type, step 708 can be executed. If it is determined that the event type corresponding to the second event message is the StatusChanged or ResourceUpdated event type, step 709 can be executed. If it is determined that the event type corresponding to the second event message is the ResourceRemoved event type, step 710 can be executed.
[0181] 708. The first event thread obtains the data of the corresponding resource from the associated device through the associated resource URI and inserts it into the database.
[0182] When the event type corresponding to the second event message is ResourceAdded, it indicates that a resource addition event has occurred (i.e., a new resource has been added to the corresponding Redfish device). The first event thread can obtain detailed data of the corresponding newly added resource from the associated device through the IP address of the associated device of the second event message and the resource URI associated with the second event message. Afterwards, the first event thread can add the obtained detailed data of the corresponding resource to the database. In some embodiments, when these data are saved in the database, an index (such as a resource ID) can be generated for these data, so that it is convenient to find, modify or delete these data later.
[0183] For example, Redfish device 1 adds a new solid-state drive, and then can send a corresponding event message to the centralized management device. Correspondingly, the centralized management device can receive the event message from Redfish device 1, and then the centralized management device can obtain the corresponding data through the resource URI associated with the event message, and then insert it into the database, such as inserting a tuple into a table in the database.
[0184] It should be understood that in some embodiments, a table for storing data can be created in advance in the database, and specific fields can be specified. Therefore, after the centralized management device obtains the detailed data of the corresponding newly added resources from the associated device, it can extract part of the data (i.e., the data specified in the data table) and then insert a tuple into the database.
[0185] 709. The first event thread obtains the data of the corresponding resource from the associated device through the associated resource URI, and updates the corresponding data in the database.
[0186] When the event type corresponding to the second event message is StatusChanged or ResourceUpdated, it indicates that a resource status change event (i.e., the status of the corresponding URI resource has changed) or a resource update event (i.e., the relevant attribute value of the corresponding URI resource has changed) has occurred. The first event thread can obtain the detailed data of the corresponding resource from the associated device through the IP address of the associated device of the second event message and the resource URI associated with the second event message. Afterwards, the first event thread can update the relevant data in the database according to the obtained detailed data of the corresponding resource. In some embodiments, the first event thread can update the corresponding data in the database through the resource ID of the corresponding resource.
[0187] 710. The first event thread deletes relevant data of the resource corresponding to the associated resource URI from the database.
[0188] When the event type corresponding to the second event message is ResourceRemoved, it indicates that a resource removal event has occurred (i.e., the corresponding URI resource has been removed). At this time, the first event thread can delete the relevant data of the URI resource in the database. In some embodiments, the first event thread can delete the corresponding data in the database through the resource ID of the URI resource.
[0189] 711. The first event thread sets the event processing state corresponding to the associated device identifier to idle.
[0190] After the first event thread has processed the second event message, the first event thread may change the event processing state corresponding to the associated device identifier of the second event message from "processing" to "idle". Afterwards, the first event thread may become an idle thread and may wait for a new event message to be distributed.
[0191] In some embodiments, on the basis of synchronizing data through the event mechanism of the Redfish protocol, the status data of the Redfish device may also be synchronized in full at regular intervals, which may further ensure the reliability and accuracy of the data stored in the database.
[0192] It should be understood that the operations performed by the above alarm thread (such as the first alarm thread) and the event thread (such as the first event thread) can be operations performed by the event processing module. It should also be understood that the event processing module can perform the above operations in parallel. Figure 6 and Figure 7 In this way, the overall processing efficiency can be improved.
[0193] In the above method flow, the real-time synchronization of the changed data of the Redfish device can be achieved through the event mechanism of the Redfish protocol, that is, only the relevant data of the resources that have changed in the Redfish device is synchronized, so that the amount of data to be synchronized is small, which can improve the efficiency of data synchronization. In addition, event messages of different event types can be classified and processed, so that data can be synchronized more accurately. In addition, the event receiving module can also control the message flow, which can prevent the message flow from being overloaded, and can filter the event messages by means of resource URI whitelist and resource URI blacklist, so that it can support efficient synchronization of large-scale Redfish device data (such as second-level synchronization).
[0194] It should be noted that the relevant information (ie, the same information or similar information) and the relevant descriptions in the above different embodiments may refer to each other.
[0195] It should be understood that the above Figure 4 , Figure 5 , Figure 6 and Figure 7 The relevant steps in can all be executed by the centralized management device, but this application does not limit the execution subject. For example, Figure 4 , Figure 5 , Figure 6 and Figure 7 The relevant steps in the method can also be executed by a chip, a chip system, or a processor that supports the centralized management device to implement the method, or can be executed by a logic module or software that can implement all or part of the functions of the centralized management device.
[0196] Based on the above system architecture, please refer to Figure 8 , Figure 8 800 is a schematic diagram of a centralized management device disclosed in an embodiment of the present application. The centralized management device 800 may include: a processor 801, a communication interface 802, and a memory 803. The processor 801, the communication interface 802, and the memory 803 may be interconnected or connected to each other through a bus 804.
[0197] Exemplarily, the memory 803 is used to store computer programs and data of the centralized management device 800. The memory 803 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or portable read-only memory (CD-ROM). The communication interface 802 is used to support the centralized management device 800 to communicate, such as receiving or sending data.
[0198] Exemplarily, the processor 801 may 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. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0199] In one embodiment, the centralized management device 800 may be the centralized management device described above, and the processor 801 may be used to read the program stored in the memory 803 and execute the program. Figure 4 , Figure 5 , Figure 6 and Figure 7 The operations performed by the centralized management device or components in the centralized management device in the illustrated method embodiment may refer to the above-mentioned related descriptions and will not be described in detail here.
[0200] It should be noted that Figure 8 The centralized management device 800 shown is only one implementation of the embodiment of the present application. In actual applications, the centralized management device 800 may also include more or fewer components, which is not limited here.
[0201] The embodiment of the present application also discloses a computer-readable storage medium having instructions stored thereon, and when the instructions are executed, the method in the above method embodiment is executed.
[0202] The embodiment of the present application also discloses a computer program product including instructions, which, when executed, execute the method in the above method embodiment.
[0203] Obviously, the embodiments described above are only part of the embodiments of the present application, rather than all the embodiments. The reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present embodiment application. The phrase appearing in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It can be understood by those skilled in the art explicitly and implicitly that the embodiments described herein can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application. The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are distinguished from different objects, rather than used to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or alternatively, steps or units not listed are also included, or other steps or units inherent to these processes, methods, products or devices are also included. It can be understood that the equal sign of the above conditional judgment can be greater than one end or less than one end. For example, the above conditional judgment that a threshold is greater than, less than or equal to can also be changed to the conditional judgment that the threshold is greater than or equal to, or less than, and this is not limited here.
[0204] It is to be understood that only the part relevant to the present application but not all the contents are shown in the accompanying drawings. It should be understood that some exemplary embodiments are described as the processing or method described as a flow chart. Although the flow chart describes each operation (or step) as a sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0205] As used in this specification, the terms "component", "module", "system", "unit", etc. are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate through local and / or remote processes, for example, based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).
[0206] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation methods of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A data synchronization method, It is characterized in that Applied to a centralized management device, the centralized management device is used to manage multiple Redfish devices, the method includes: Subscribe to some or all events of the multiple Redfish devices; Receiving event messages from the plurality of Redfish devices; Update data in a database based on the event message, wherein the database is used to store status data of the multiple Redfish devices; The receiving event messages from the plurality of Redfish devices comprises: receiving a first event message, where the first event message is an event message from a first Redfish device, and the first Redfish device is any one of the multiple Redfish devices; The method further comprises: When the first condition is met, the first event message is placed into an alarm message queue; When the second condition is met, putting the first event message into an event message queue; The updating of data in the database based on the event message comprises: Processing the event messages in the alarm message queue and the event message queue in parallel, and updating the data in the database; The parallel processing of the event messages in the alarm message queue and the event message queue, and updating the data in the database, includes: Processing event messages in the alarm message queue in parallel through an alarm thread pool, and updating data in a database, wherein the alarm thread pool includes one or more threads; Processing event messages in the event message queue in parallel through an event thread pool, and updating data in the database, wherein the event thread pool includes one or more threads; The process of processing the event messages in the event message queue in parallel through the event thread pool and updating the data in the database includes: Acquire a second event message from the event message queue, where the second event message is the event message at the head of the event message queue; Distribute the second event message to a first event thread, where the first event thread is any idle thread in the event thread pool; Processing the second event message through the first event thread, and updating relevant data in the database; The processing of the second event message by the first event thread includes: When the first event thread determines that no other thread is processing the related event message of the associated device through the identifier of the associated device of the second event message, the second event message is processed through the first event thread; Alternatively, when the first event thread determines through the identifier of the associated device of the second event message that other threads are processing related event messages of the associated device, the first event thread processes the second event message after waiting for other alarm threads to complete processing.
2. The method according to claim 1, It is characterized in that The first condition includes: The event type corresponding to the first event message is an alarm event; Alternatively, the event type corresponding to the first event message is an alarm event, and the traffic of the current alarm event message is less than the resources currently processing the alarm event message; the alarm event message is an event message whose event type is an alarm event.
3. The method according to claim 2 or 1, It is characterized in that The second condition includes: The event type corresponding to the first event message is not an alarm event; Alternatively, when the event type corresponding to the first event message is not an alarm event, one or more of the following is satisfied: the total message traffic of the current non-alarm event message is less than the resource currently processing the non-alarm event message, the resource URI associated with the first event message is in the preset resource URI whitelist, and the resource URI associated with the first event message is not in the resource URI blacklist; the non-alarm event message is an event message whose event type is a resource state change event, a resource update event, a resource update event, or a resource removal event, the resource URI whitelist includes one or more resource URIs, the resource URI blacklist includes one or more resource URIs, and the number of reports of related events of one or more resource URIs in the URI blacklist within the first time period is greater than Y, and Y is an integer greater than or equal to 1.
4. The method according to claim 3, It is characterized in that The process of processing the event messages in the alarm message queue in parallel through the alarm thread pool and updating the data in the database includes: Acquire a first alarm message from the alarm message queue, where the first alarm message is the event message at the head of the alarm message queue; Distribute the first alarm message to a first alarm thread, where the first alarm thread is any idle thread in the alarm thread pool; The first alarm message is processed by the first alarm thread, and relevant data in the database is updated.
5. The method according to claim 4, It is characterized in that The processing of the first alarm message by the first alarm thread includes: When the first alarm thread determines that no other thread is processing a related alarm message of the associated device through an identifier of the associated device of the first alarm message, processing the first alarm message through the first alarm thread; Alternatively, when the first alarm thread determines that other threads are processing related alarm messages of the associated device through the identifier of the associated device of the first alarm message, the first alarm thread processes the first alarm message after waiting for other alarm threads to complete processing.
6. The method according to claim 5, It is characterized in that The processing of the second event message by the first event thread and updating the relevant data in the database includes: In the case where the event type corresponding to the second event message is a resource addition event, the first event thread obtains data of the corresponding resource from the associated device through the associated resource URI of the second event message, and inserts the data into the database; In the case where the event type corresponding to the second event message is a resource state change event or a resource update event, the first event thread obtains data of the corresponding resource from the associated device through the associated resource URI of the second event message, and updates the relevant data in the database; In a case where the event type corresponding to the second event message is a resource removal event, the first event thread deletes relevant data of a resource corresponding to the resource URI associated with the second event message from the database.
7. A centralized management device, It is characterized in that The centralized management device includes a processor, a memory and a communication interface, wherein the communication interface is used to receive information from other electronic devices outside the centralized management device, and output information to other electronic devices outside the centralized management device, and the processor calls the computer program stored in the memory to implement the method described in any one of claims 1-6.
