Iic host and method and system for time-aware slave event sensing
Patent Information
- Application Number
- CN202211031990.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-08-26
AI Technical Summary
[0003]有鉴于此,本发明的目的在于提出一种IIC主机及时感知从机事件的方法和系统,解决了只能通过主机轮询才能获取从机告警等重要通知事件的问题
[0032]This invention proposes a method and system for a master unit to promptly detect slave events, solving the problem that important notification events such as slave alarms can only be obtained through master polling. Specifically, slave notification events are categorized, such as alarm events and hot-plug events, and then the event generators are categorized by module, such as the controller module, logic disk module, BBU module, and hard disk module in a RAID card. These modules are defined in an 8-bit variable using a fixed-bit configuration. When a slave unit needs to return data to the master, it appends this variable value to a fixed position in the data header as a marker indicating whether an event has occurred. The master unit parses the data returned by the slave unit to determine whether a notification event has occurred, and thus decides whether to send a request to the slave unit for detailed event information.
Smart Images

Figure CN115391249B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and specifically to a method and system for an IIC master to promptly sense events from slave devices. Background Technology
[0002] The IIC protocol is typically used in BMCs to monitor peripheral devices such as network interface cards (NICs) and RAID cards. In this scenario, the BMC acts as the IIC master, while the NICs and RAID cards act as IIC slaves. There is often a large amount of data that needs to be frequently transmitted between these devices and the BMC. This data includes, but is not limited to, configuration data sent from the master to the slave, and sensor data from the slave that the master needs to obtain from the slave. This sensor data includes both normal sensor data and abnormal alarm data. In existing technologies, the BMC often obtains this slave data by frequently polling the device. This data acquisition method is based on the characteristics of the IIC protocol. This method creates a near-constant data transmission requirement between the IIC master and slave, and a large portion of this transmitted data is useless, placing a significant load on the IIC bandwidth. More importantly, due to the characteristics of the polling method, information that needs to be processed by the master in a timely manner, such as slave alarms, is difficult to obtain in a timely manner, potentially leading to serious incidents. Summary of the Invention
[0003] In view of this, the purpose of this invention is to propose a method and system for IIC master to promptly detect slave events, which solves the problem that important notification events such as slave alarms can only be obtained through master polling.
[0004] To achieve the above objectives, in one respect, the present invention provides a method for an IIC host to promptly detect slave events, the method comprising the following steps:
[0005] The host receives the event notification, retrieves the event data, parses it, and notifies the user.
[0006] The slave device senses module events and generates an event Bitmap;
[0007] The host parses the Bitmap and generates an event to retrieve the command;
[0008] After receiving the event data returned by the slave device, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
[0009] As a further aspect of the present invention, the host receives an event notification, acquires and parses the event data, and then notifies the user, including:
[0010] The host sends request data to the slave based on a normal query command;
[0011] The server analyzes alarm events to generate event Bitmaps, includes the event Bitmaps in the header of the returned data, and sends them to the host side. The host side receives the data and parses the event Bitmaps according to normal query commands.
[0012] The host side will acquire event data and send it to the slave side to populate the event data and return the data. The host side will parse the event information according to the requested event information and issue an alarm.
[0013] As a further aspect of the present invention, the slave device sensing module event and generating an event Bitmap includes:
[0014] After the slave program starts, it checks whether any events are generated by the sensor;
[0015] If so, determine the module type, determine the event type, fill the event information in the event details structure, set the corresponding bit in the event flag to 1, obtain the combined data, send the data and then proceed with other processes;
[0016] If not, determine if there is data to send. If so, obtain the combined data, send the data, and then proceed with other processes. If not, proceed with other processes.
[0017] As a further aspect of the present invention, the slave sensing module events and generating event Bitmaps contain event details structures, which are information structures of all events generated by the slave function, wherein a union structure type is used to distinguish the specific information of different events.
[0018] As a further aspect of the present invention, in the event-sensing module event and event-generating Bitmap, the Bitmap is an 8-bit data, where each bit represents an event module. If a bit is 0, it means that no event has occurred in the module represented by that bit; if a bit is 1, it means that an event has occurred in the module represented by that bit, and event acquisition is performed.
[0019] As a further aspect of the present invention, when the host parses the Bitmap and generates an event acquisition command, the host parses each packet of data returned by the slave and determines whether the Bitmap information in its header is set. If it is set, the host iterates through the set BIT bits, parses out the event module represented by the bit, retrieves the event acquisition command corresponding to the module from the global static array, inserts the command into the head of the sending queue, and waits to be sent to the slave.
[0020] After parsing the current bit, set the bit to 0, then check if the Bitmap is 0. If it is not 0, it means that the Bitmap carries more than one event information. Continue the above parsing process until the Bitmap is 0. In this way, all event details can be obtained in a loop.
[0021] As a further aspect of the present invention, during event data acquisition and event processing, the host obtains a command from the head of the queue to be sent and sends it to the slave. After receiving the event data returned by the slave, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
[0022] If it is an alarm event, it will be handled according to the user's preset alarm event handling process. If it is a hot-plug event, it will be clearly stated when displaying device information that the device has been hot-plugged. If it is an error event, it will be alarmed through the user's preset alarm channel.
[0023] As a further aspect of the present invention, the master is made aware of slave events by actively notifying the slave; the components of the slave that may have events are distinguished by module, and a Bitmap is used to represent the module of the slave where an event has occurred.
[0024] As a further aspect of the present invention, a Bitmap flag is added to the message returned to the host to notify the slave that an event has occurred. After the host detects the event, it actively obtains detailed event data.
[0025] In another aspect, the present invention provides a system for an IIC master to promptly sense events from a slave device, comprising a master side and a slave side;
[0026] The host side is used to receive event notifications, obtain event data, parse it, and notify the user.
[0027] The slave device is used to sense module events and generate an event Bitmap, and the host device parses the Bitmap and generates an event acquisition command.
[0028] The host side is also used to parse the event data returned by the slave device, obtain the event type and its detailed information, and perform different processing on different events.
[0029] In another aspect, the present invention provides a computer-readable storage medium storing computer program instructions that, when executed, implement the method of timely sensing of slave events by the IIC master according to any of the above-described methods.
[0030] In another aspect, the present invention provides a computer device including a memory and a processor, the memory storing a computer program which, when executed by the processor, performs any of the above-described methods for timely sensing of slave events by an IIC master according to the present invention.
[0031] The present invention has at least the following beneficial technical effects:
[0032] This invention proposes a method and system for a master unit to promptly detect slave events, solving the problem that important notification events such as slave alarms can only be obtained through master polling. Specifically, slave notification events are categorized, such as alarm events and hot-plug events, and then the event generators are categorized by module, such as the controller module, logic disk module, BBU module, and hard disk module in a RAID card. These modules are defined in an 8-bit variable using a fixed-bit configuration. When a slave unit needs to return data to the master, it appends this variable value to a fixed position in the data header as a marker indicating whether an event has occurred. The master unit parses the data returned by the slave unit to determine whether a notification event has occurred, and thus decides whether to send a request to the slave unit for detailed event information.
[0033] The advantage of this approach is that the master does not need to frequently poll the slave for notification events; it only needs to send an event retrieval request to the slave once an event is detected. When the slave generates a notification event, this method only requires occupying the IIC bus once to retrieve the event. This significantly helps to relieve IIC bandwidth pressure and improve the real-time performance of normal data acquisition.
[0034] By categorizing events into modules, the host can perceive all modules where events have occurred at once. After obtaining the event details, it can parse the event details for each module based on the Bitmap information. Through event categorization, the host can also parse the event type and cause from the event details.
[0035] By adding an event occurrence flag only to the data header, the integrity of the original data can be preserved, thus avoiding resource consumption caused by the slave device combining the original data and event data, and the master device splitting the original data and event data.
[0036] These or other aspects of this application will become more apparent from the following description of embodiments. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the application. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0038] In the diagram:
[0039] Figure 1The flowchart of the method for timely detection of slave events by the IIC master according to the present invention is shown, which describes the process of the master acquiring, parsing, and issuing an alarm for the slave.
[0040] Figure 2 The flowchart illustrating the method for timely sensing of slave events by the IIC master according to the present invention, and the process of the slave sensing events and generating a Bitmap, is shown.
[0041] Figure 3 The flowchart illustrates a method for a master to promptly detect slave events according to the present invention, in which the master parses a Bitmap and generates an event acquisition command.
[0042] Figure 4 A flowchart illustrating the event data acquisition and event processing process in the method for timely sensing of slave events by the IIC master according to the present invention is shown.
[0043] Figure 5 A schematic diagram of an embodiment of a computer-readable storage medium for implementing a method for timely sensing of slave events by an IIC master according to the present invention is shown;
[0044] Figure 6 A schematic diagram of the hardware structure of a computer device according to an embodiment of the method for implementing timely sensing of slave events by an IIC master according to the present invention is shown.
[0045] Figure 7 A schematic diagram of the framework of an embodiment of the chip according to the present invention is shown. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0047] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two different entities or different parameters with the same name. Therefore, "first" and "second" are merely for convenience of expression and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as other steps or units inherent in a process, method, system, product, or device that includes a series of steps or units.
[0048] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0051] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0052] Because BMC typically acquires data from these slave devices through frequent polling, a method based on the characteristics of the IIC protocol, there is a near-constant data transmission requirement between the IIC master and slaves. A significant portion of this transmitted data is useless, placing a heavy load on IIC bandwidth. More importantly, due to the polling mechanism, information requiring timely master processing, such as slave alarms, is difficult to obtain in a timely manner, potentially leading to serious incidents.
[0053] In view of this, embodiments of the present invention provide a method and system for an IIC master to promptly detect slave events, solving the problem that important notification events such as slave alarms can only be obtained through master polling. Specifically, slave notification events are categorized, such as alarm events and hot-plug events, and then the event generators are categorized by module, such as the controller module, logic disk module, BBU module, and hard disk module in a RAID card. These modules are defined in an 8-bit variable using a fixed bit method. When the slave needs to return data to the master, it attaches this variable value to a fixed position in the data header as a flag indicating whether an event has occurred and returns it to the master. The master parses the data returned by the slave to determine whether a notification event has occurred, and thus decides whether to send a request to the slave for detailed event information.
[0054] The advantage of this approach is that the master does not need to frequently poll the slave for notification events; it only needs to send an event retrieval request to the slave once an event is detected. When the slave generates a notification event, this method only requires occupying the IIC bus once to retrieve the event. This significantly helps to relieve IIC bandwidth pressure and improve the real-time performance of normal data acquisition.
[0055] By classifying modules, the host can perceive all modules where events have occurred at once. After obtaining the event details, it only needs to parse the event details of each module according to the Bitmap information.
[0056] By classifying events, the host can parse the event type and cause from the event details.
[0057] By adding an event occurrence flag only to the data header, the integrity of the original data can be preserved, thus avoiding resource consumption caused by the slave device combining the original data and event data, and the master device splitting the original data and event data.
[0058] See Figures 1 to 4 As shown, in some embodiments of the present invention, a method for an IIC host to promptly detect slave events is provided, comprising the following steps:
[0059] The host receives the event notification, retrieves the event data, parses it, and notifies the user.
[0060] The slave device senses module events and generates an event Bitmap;
[0061] The host parses the Bitmap and generates an event to retrieve the command;
[0062] After receiving the event data returned by the slave device, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
[0063] See Figure 1 As shown, the host receives the event notification, retrieves the event data, parses it, and notifies the user, including:
[0064] The host sends request data to the slave based on a normal query command;
[0065] The server analyzes alarm events to generate event Bitmaps, includes the event Bitmaps in the header of the returned data, and sends them to the host side. The host side receives the data and parses the event Bitmaps according to normal query commands.
[0066] The host side will acquire event data and send it to the slave side to populate the event data and return the data. The host side will parse the event information according to the requested event information and issue an alarm.
[0067] See Figure 2 As shown, the slave device senses the module events and generates an event Bitmap, including:
[0068] If so, determine the module type, determine the event type, fill the event information in the event details structure, set the corresponding bit in the event flag to 1, obtain the combined data, send the data and then proceed with other processes;
[0069] If not, determine if there is data to send. If so, obtain the combined data, send the data, and then proceed with other processes. If not, proceed with other processes.
[0070] Among them, the event Bitmap is generated by the event sensing module. The event details structure is the information structure of all events generated by the function. The union structure type is used to distinguish the specific information of different events.
[0071] (1) Bitmap structure
[0072] In the event bitmap generated by the slave sensing module, the bitmap is an 8-bit data, and each bit represents an event module. If a bit is 0, it means that no event has occurred in the module represented by that bit. If a bit is 1, it means that an event has occurred in the module represented by that bit, and the event is acquired.
[0073] (2) Event Information Structure
[0074] Taking a RAID card as an example, the event information structure is as follows:
[0075]
[0076]
[0077]
[0078] The seqNum is used to identify a single message transmission, avoiding multiple notifications for the same event;
[0079] eventType indicates the event type, which is parsed by the host to determine whether to trigger an alarm or notify the user.
[0080] eventComponents indicates the module to which the event belongs. In order to reduce the amount of data on the IIC bus, the event data is defined in the same data structure in the form of a union. Through this identifier, the host can accurately parse the meaning of the data. In addition, this identifier can be used together with Bitmap information to verify whether the obtained event is an event notified by Bitmap information.
[0081] The advantage of defining the data structure of each event module in a union is that users can define the relevant structures in the union according to their own device characteristics. Having multiple event modules will not cause a waste of transmission bandwidth, and each event transmission will only occupy the space of the corresponding structure in the union.
[0082] See Figure 3As shown, when the host parses the Bitmap and generates the event acquisition command, the host parses each packet of data returned by the slave and determines whether the Bitmap information in its header is set. If it is set, the host loops through the set BIT bits, parses out the event module represented by the bit, retrieves the event acquisition command corresponding to the module from the global static array, inserts the command into the head of the sending queue, and waits to be sent to the slave.
[0083] After parsing the current bit, set the bit to 0, then check if the Bitmap is 0. If it is not 0, it means that the Bitmap carries more than one event information. Continue the above parsing process until the Bitmap is 0. In this way, all event details can be obtained in a loop.
[0084] The host parses each packet of data returned by the slave, determines whether the Bitmap information in its header is set, and if it is set, it loops to obtain the set BIT bit, parses out the event module represented by the bit, retrieves the event acquisition command corresponding to the module from the global static array, inserts the command into the head of the sending queue, and waits to be sent to the slave.
[0085] See Figure 4 As shown, in the event data acquisition and event processing flow, the host obtains a command from the head of the queue to be sent and sends it to the slave. Due to the high priority of events, the event data acquisition command is always inserted at the head of the queue, so the slave event is always responded to first.
[0086] After receiving event data from the slave device, the host parses the data to obtain the event type and its detailed information. Users can then handle different events in different ways. For alarm events, the system can process them according to user-defined alarm event handling procedures, such as saving logs and notifying the user. For hot-plug events, the system can clearly indicate that the device has been hot-plugged when displaying device information. For error events, the system can issue alerts through user-defined alarm channels such as SNMP or email alerts.
[0087] This invention provides a method and system for a master to promptly detect slave events using IIC, solving the problem of wasted IIC bus bandwidth caused by the master frequently querying the slave due to the uncertainty of the timing of slave events, and improving the speed of master response to slave events. Furthermore, by abstracting slave events into a Bitmap and attaching it to the data header returned to the master, not only is the original data not affected, but the master's data parsing efficiency is also not affected. Moreover, after parsing the slave event flag from the Bitmap, the master does not directly retrieve the event data, but instead inserts the corresponding retrieval command into a waiting queue for execution. This avoids affecting the current command, and users can set priorities for events based on event type, controlling the data retrieval order by inserting the event data retrieval command at the head or tail of the queue.
[0088] This invention is designed to reduce unnecessary bus usage and useless data transmission between IIC master and slave devices. The master can detect various event messages occurring on the slave device by waiting for notifications instead of frequent polling.
[0089] In this embodiment of the invention, the slave device actively notifies the master device to detect slave device events, instead of the master device frequently polling the slave device; the components of the slave device that may have events are distinguished by module, and a Bitmap is used to represent the module of the slave device where an event has occurred.
[0090] In this embodiment of the invention, the host is notified that an event has occurred by adding a Bitmap flag to the message returned to the host. After the host detects the event, it actively obtains detailed event data. The definition of the event detail data structure, including the method of using unions to save space, is also within the scope of protection of this invention.
[0091] In some embodiments of the present invention, the present invention provides a method and related data structure for an IIC host to promptly perceive slave events. Although the implementation methods of the present invention are described above, the above descriptions and definitions are only for the purpose of understanding the implementation methods of the present invention and are not intended to limit the present invention. Any modifications and changes made without departing from the spirit and scope of the present invention, especially modifications and changes to the way the host perceives slave events, the way the event module is represented, the detailed event data structure and its parsing method, are all within the protection scope of the present invention.
[0092] It should be understood that although the above description follows a certain order, these steps are not necessarily executed in that order. Unless otherwise expressly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, some steps in this embodiment may include multiple steps or multiple stages, which are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least a portion of the steps or stages in other steps.
[0093] A second aspect of the invention is described in [reference needed]. Figures 1 to 4 As shown, a system for timely detection of slave events by an IIC master is also provided. This system includes a master side and a slave side;
[0094] The host side is used to receive event notifications, obtain event data, parse it, and notify the user.
[0095] The slave device is used to sense module events and generate an event Bitmap, and the host device parses the Bitmap and generates an event acquisition command.
[0096] The host side is also used to parse the event data returned by the slave device, obtain the event type and its detailed information, and perform different processing on different events.
[0097] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0098] A third aspect of the present invention also provides a computer-readable storage medium. Figure 5 A schematic diagram of a computer-readable storage medium illustrating a method for a timely sensing of slave events by an IIC master according to an embodiment of the present invention is shown. Figure 5 As shown, the computer-readable storage medium 300 stores computer program instructions 310, which can be executed by a processor. When executed, the computer program instructions 310 implement the method of any of the above embodiments.
[0099] It should be understood that, where there is no conflict, all the embodiments, features and advantages described above for the method of timely sensing of slave events by the IIC master according to the present invention are equally applicable to the system and storage medium for timely sensing of slave events by the IIC master according to the present invention.
[0100] A fourth aspect of the present invention also provides a computer device 400, including a memory 420 and a processor 410. The memory stores a computer program, which, when executed by the processor, implements the method of any of the above embodiments, including the following steps:
[0101] The host receives the event notification, retrieves the event data, parses it, and notifies the user.
[0102] The slave device senses module events and generates an event Bitmap;
[0103] The host parses the Bitmap and generates an event to retrieve the command;
[0104] After receiving the event data returned by the slave device, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
[0105] In this embodiment, the host receives an event notification, obtains the event data, parses it, and notifies the user, including:
[0106] The host sends request data to the slave based on a normal query command;
[0107] The server analyzes alarm events to generate event Bitmaps, includes the event Bitmaps in the header of the returned data, and sends them to the host side. The host side receives the data and parses the event Bitmaps according to normal query commands.
[0108] The host side will acquire event data and send it to the slave side to populate the event data and return the data. The host side will parse the event information according to the requested event information and issue an alarm.
[0109] In this embodiment, the slave device senses the module events and generates an event Bitmap, including:
[0110] After the slave program starts, it checks whether any events are generated by the sensor;
[0111] If so, determine the module type, determine the event type, fill the event information in the event details structure, set the corresponding bit in the event flag to 1, obtain the combined data, send the data and then proceed with other processes;
[0112] If not, determine if there is data to send. If so, obtain the combined data, send the data, and then proceed with other processes. If not, proceed with other processes.
[0113] like Figure 6 The diagram shown is a hardware structure schematic of an embodiment of a computer device for executing the method of timely sensing of slave events by an IIC master according to the present invention. Figure 6 Taking the computer device 400 shown as an example, this computer device includes a processor 410 and a memory 420, and may also include an input device 430 and an output device 440. The processor 410, memory 420, input device 430, and output device 440 can be connected via a bus or other means. Figure 6 Taking a bus connection as an example, input device 430 can receive input digital or character information, and generate signal inputs related to the IIC master's timely detection of slave events. Output device 440 may include display devices such as a display screen.
[0114] Memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for timely sensing of slave events by the IIC host in this embodiment. Memory 420 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created by the use of the method for timely sensing of slave events by the IIC host, etc. In addition, memory 420 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 420 may optionally include memory remotely located relative to processor 410, and these remote memories can be connected to the local module via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0115] Processor 410 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in memory 420, thereby realizing the method of timely detection of slave events by the IIC host in the above method embodiment. The steps are as follows:
[0116] The host receives the event notification, retrieves the event data, parses it, and notifies the user.
[0117] The slave device senses module events and generates an event Bitmap;
[0118] The host parses the Bitmap and generates an event to retrieve the command;
[0119] After receiving the event data returned by the slave device, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
[0120] In this embodiment, the host receives an event notification, obtains the event data, parses it, and notifies the user, including:
[0121] The host sends request data to the slave based on a normal query command;
[0122] The server analyzes alarm events to generate event Bitmaps, includes the event Bitmaps in the header of the returned data, and sends them to the host side. The host side receives the data and parses the event Bitmaps according to normal query commands.
[0123] The host side will acquire event data and send it to the slave side to populate the event data and return the data. The host side will parse the event information according to the requested event information and issue an alarm.
[0124] In this embodiment, the slave device senses the module events and generates an event Bitmap, including:
[0125] After the slave program starts, it checks whether any events are generated by the sensor;
[0126] If so, determine the module type, determine the event type, fill the event information in the event details structure, set the corresponding bit in the event flag to 1, obtain the combined data, send the data and then proceed with other processes;
[0127] If not, determine if there is data to send. If so, obtain the combined data, send the data, and then proceed with other processes. If not, proceed with other processes.
[0128] A fifth aspect of the present invention also provides a chip 500 for flow control according to the method of timely sensing of slave events by an IIC master according to any of the above-mentioned embodiments. Figure 7 A schematic diagram of the frame of the chip 500 according to the present invention is shown. (As shown) Figure 7 As shown, in this embodiment, the chip 500 architecture includes a CPU reset vector register 510, a CPU release control pin 520, a CPU release control register 530, and a debug interface 540, wherein...
[0129] The CPU reset vector register 510 is used to control the address of the instructions read and executed after the CPU is released;
[0130] The CPU release control register 520 is used to control the CPU release when the chip 500 is powered on.
[0131] The CPU release control pin 530 is used to control the validity of the CPU release control register 520;
[0132] The debug interface 540 is used to read and write on-chip RAM and registers to perform flow control of the chip.
[0133] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0134] Finally, it should be noted that the computer-readable storage medium (e.g., memory) described herein can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. By way of example, and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which can act as external cache memory. By way of example, and not limitation, RAM can be obtained in various forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices disclosed herein are intended to include, but are not limited to, these and other suitable types of memory.
[0135] The various exemplary logic blocks, modules, and circuits described herein can be implemented or performed using the following components designed to perform the functions herein: general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP, and / or any other such configuration.
[0136] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0137] It should be understood that, as used herein, the singular form "a" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the associatedly listed items. The embodiment numbers disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0138] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for a IIC master to promptly detect slave events, characterized in that, The method by which the IIC master promptly detects slave events includes the following steps: When the host receives an event notification, it retrieves and parses the event data and notifies the user. This process includes: the host sending request data to the slave based on a normal query command; the slave analyzing the alarm event and generating an event Bitmap, including the event Bitmap in the header of the returned data and sending it to the host; the host receiving the data and parsing the event Bitmap based on a normal query command; the host sending the retrieved event data to the slave to populate the event data and returning the data; and the host parsing the event information based on the requested event information and issuing an alarm. The slave device senses module events and generates an event Bitmap, where the Bitmap is an 8-bit data, and each bit represents an event module. If a bit is 0, it means that no event has occurred in the module represented by that bit; if a bit is 1, it means that an event has occurred in the module represented by that bit. Event acquisition is then performed. The host parses the Bitmap and generates an event to retrieve the command; After receiving the event data returned by the slave device, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events.
2. The method for timely sensing of slave events by an IIC master according to claim 1, characterized in that, The slave sensing module events and the generation of event Bitmaps include: After the slave program starts, it checks whether any events are generated by the sensor; If so, determine the module type, determine the event type, fill the event information in the event details structure, set the corresponding bit in the event flag to 1, obtain the combined data, send the data and then proceed with other processes; If not, determine if there is data to send. If so, obtain the combined data, send the data, and then proceed with other processes. If not, proceed with other processes.
3. The method for timely sensing of slave events by the IIC master according to claim 2, characterized in that, The event details structure in the event Bitmap generated by the machine sensing module is an information structure of all events generated by the machine, in which the specific information of different events is distinguished by a union structure type.
4. The method for timely detection of slave events by the IIC master according to claim 1, characterized in that, When the host parses the Bitmap and generates the event acquisition command, it parses each packet of data returned by the slave and determines whether the Bitmap information in its header is set. If it is set, it loops to get the set BIT bit, parses out the event module represented by the bit, retrieves the event acquisition command corresponding to the module from the global static array, inserts the command into the head of the sending queue, and waits to be sent to the slave. After parsing the current bit, set the bit to 0, then check if the Bitmap is 0. If it is not 0, it means that the Bitmap carries more than one event information. Continue the above parsing process until the Bitmap is 0. In this way, all event details can be obtained in a loop.
5. The method for timely detection of slave events by the IIC master according to claim 4, characterized in that, During event data acquisition and event processing, the host retrieves a command from the head of the queue to be sent and sends it to the slave. After receiving the event data returned by the slave, the host parses the data, obtains the event type and its detailed information, and performs different processing on different events. If it is an alarm event, it will be handled according to the user's preset alarm event handling process. If it is a hot-plug event, it will be clearly stated when displaying device information that the device has been hot-plugged. If it is an error event, it will be alarmed through the user's preset alarm channel.
6. The method for timely detection of slave events by an IIC master according to claim 1, characterized in that, The master is made aware of slave events by actively notifying the slave; the components of the slave that may have events are distinguished by module, and a Bitmap is used to represent the module of the slave where an event has occurred.
7. The method for timely detection of slave events by an IIC master according to claim 6, characterized in that, The slave device is notified of an event by adding a Bitmap flag to the message returned to the host. After the host detects the event, it actively retrieves the detailed event data.
8. A system for timely sensing of slave events by an IIC master, characterized in that, Including the master side and the slave side; The host side is used to receive event notifications, acquire event data, parse and notify users; it is also used to send request data to the slave side based on normal query instructions; receive data and parse the event Bitmap according to normal query instructions; send the acquired event data to the slave side to fill the event data and return the data; parse the event information according to the requested event information and issue an alarm. The slave device is used to sense module events and generate an event Bitmap, and the host device parses the Bitmap and generates an event acquisition command. It is also used to analyze alarm events and generate event Bitmaps, include the event Bitmaps in the return data header and send them to the host side. The Bitmap is an 8-bit data, and each bit represents an event module. If a bit is 0, it means that no event has occurred in the module represented by that bit. If a bit is 1, it means that an event has occurred in the module represented by that bit. Event acquisition is then performed. The host side is also used to parse the event data returned by the slave device, obtain the event type and its detailed information, and perform different processing on different events.
Citation Information
Patent Citations
Dual-computer communication structure
CN208819201U
In-band event polling
TW200817917A