Abnormality processing system, method, device and equipment and storage medium

By detecting the response information of the IIC slave device timeout in the exception handling system and using the exception handling circuit to automatically handle the exception, the system crash caused by the IIC slave device failure in the prior art is solved, and the fault resolution efficiency is improved.

CN119065877APending Publication Date: 2024-12-03TP-LINK INT CHENGDU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410958256.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, when the IIC slave device fails, manpower is required to find and solve, resulting in low fault resolution efficiency, resulting in the channel between the CPU and the IIC slave device being occupied, affecting communication, and thus causing system crash.

Method used

An exception handling system is designed, including a CPU, an IIC channel switching module and an exception handling circuit. The exception is determined by detecting whether the response information of the IIC slave device is timed out, and the exception handling circuit is used to automatically handle the exception to avoid manual intervention.

Benefits of technology

It improves the efficiency of IIC slave device failure resolution, reduces the risk of system crashes, avoids the waste of time to manually find faults, and realizes automated exception handling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065877A_ABST
    Figure CN119065877A_ABST
Patent Text Reader

Abstract

The invention discloses an exception handling system, method, device and equipment, and a storage medium, and the exception handling system comprises a CPU, an integrated circuit bus IIC channel switching module, a plurality of IIC slave devices, and an exception handling circuit. Wherein the CPU is connected with the IIC channel switching module through the exception handling circuit; the IIC channel switching module is also connected with the plurality of IIC slave devices, and the plurality of IIC slave devices are also connected with the CPU; and the CPU is used for processing the abnormity through the abnormity processing circuit when any IIC slave device in the plurality of IIC slave devices is detected to be abnormal. The abnormality is detected through the CPU, and the abnormality processing circuit is arranged to process the generated abnormality, so that fault searching and fault solving do not depend on manpower, and the efficiency of fault solving is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of embedded technology, and in particular, relates to an exception handling system, method, device, equipment and storage medium. Background Art

[0002] In the prior art, in the communication of multiple IIC (Inter-Integrated Circuit) slave devices, due to the abnormality of the IIC slave device, the CPU (Central Processing Unit) has not received the response signal of the IIC slave device for a long time, so that the CPU has been in a waiting state; or a hardware short circuit occurs in the IIC slave device, so that the CPU and the IIC slave device are always in a communication state, resulting in a communication jam, which will cause the channel between the CPU and the IIC slave device to be occupied all the time, affecting the communication between the IIC slave device and the CPU, and then causing the system to crash and fail to work normally. When the IIC slave device fails, manpower is required to find and solve the fault, which takes a long time and has low efficiency in solving the fault. Summary of the invention

[0003] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problem of low efficiency in solving the fault when a fault occurs in an IIC slave device in the prior art.

[0004] In a first aspect, the present application provides an exception handling system, comprising a CPU, an integrated circuit bus IIC channel switching module, multiple IIC slave devices, and an exception handling circuit; wherein: the CPU is connected to the IIC channel switching module through the exception handling circuit; the IIC channel switching module is also connected to the multiple IIC slave devices, and the multiple IIC slave devices are also connected to the CPU; the CPU is used to handle the exception through the exception handling circuit when an exception is detected in any IIC slave device among the multiple IIC slave devices.

[0005] In a second aspect, the present application provides an exception handling method, applicable to the CPU in the exception handling system in the first aspect, the method comprising: in the process of interacting with any IIC slave device among multiple IIC slave devices in the exception handling system, if it is detected that no response information of the any IIC slave device is received for more than a first preset time, determining that an exception occurs in the any IIC slave device; when an exception is detected in the any IIC slave device, handling the exception by an exception handling circuit in the exception handling system.

[0006] In a third aspect, the present application provides an exception handling device, which is applicable to the CPU in the exception handling system in the first aspect, and includes: a detection unit, which is used to determine that an exception has occurred in any IIC slave device among multiple IIC slave devices in the exception handling system if it is detected that no response information of the any IIC slave device is received for more than a first preset time during the interaction with the any IIC slave device; and a processing unit, which is used to process the exception through the exception handling circuit in the exception handling system when an exception is detected in the any IIC slave device.

[0007] In a fourth aspect, the present application provides an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any method in the second aspect or any possible implementation scheme of the second aspect by executing the executable instructions.

[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the computer program implements any method in the second aspect or any possible implementation manner of the second aspect.

[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any method in the second aspect or any possible implementation manner of the second aspect.

[0010] The exception handling system provided by the present application includes a CPU, an integrated circuit bus IIC channel switching module, multiple IIC slave devices, and an exception handling circuit; wherein: the CPU is connected to the IIC channel switching module through the exception handling circuit; the IIC channel switching module is also connected to multiple IIC slave devices, and multiple IIC slave devices are also connected to the CPU; the CPU is used to handle the exception through the exception handling circuit when an exception is detected in any IIC slave device among the multiple IIC slave devices. The CPU detects the exception, sets the exception handling circuit to handle the exception, does not rely on human power to find and solve the fault, and improves the efficiency of solving the fault. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0012] Figure 1 A schematic diagram of the structure of an exception handling system provided in one embodiment of the present application;

[0013] Figure 2 A schematic diagram of the structure of another exception handling system provided in one embodiment of the present application;

[0014] Figure 3 A detailed structural diagram of an exception handling system provided in one embodiment of the present application;

[0015] Figure 4 A flowchart of an exception handling method is provided for an embodiment of the present application;

[0016] Figure 5 A flowchart of an exception handling process provided in one embodiment of the present application;

[0017] Figure 6 A schematic diagram of the structure of an exception handling device provided in one embodiment of the present application;

[0018] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.

[0020] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0021] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0022] SDA: (SerialData, data signal line), usually refers to the serial data line in IIC, which is used to connect the microcontroller and its peripheral devices for data transmission.

[0023] SCL: (Serial Clock Line), usually refers to the serial clock line in IIC, used to transmit clock signals.

[0024] CPLD: (Complex Programmable Logic Device) is a digital integrated circuit in which users can construct logical functions according to their own needs.

[0025] MOSFET: (Metal Oxide Semiconductor Field Effect Transistor) It is a device made of three materials: metal, oxide and semiconductor. It is a type of switching component.

[0026] GPIO: (General-purpose input / output, port expander), also known as general-purpose input and output port, referred to as IO port, is used to configure pin functions.

[0027] In the prior art, in the communication of multiple IIC (Inter-Integrated Circuit, integrated circuit bus) slave devices, due to the abnormality of the IIC slave device, the CPU has not received the response signal of the IIC slave device for a long time, so that the CPU has been in a waiting state; or the IIC slave device has a hardware short circuit, so that the CPU and the IIC slave device have been in a communication state, resulting in communication stuck, which will cause the channel between the CPU and the IIC slave device to be occupied all the time, affecting the communication between the IIC slave device and the CPU, and then causing the system to crash and fail to work normally. When the IIC slave device fails, it takes manpower to find and solve the fault, which takes a long time and has low efficiency in solving the fault.

[0028] At present, the topology of multiple IIC slave devices often uses IIC channel switching modules to build a topology with one IIC input and multiple IIC outputs. The IIC channel switching module is similar to a channel switcher. The IIC input is connected to multiple IIC outputs through multiple parallel switches. In a single communication process, the channel switcher only chooses to open one switch to establish a channel between the IIC input and the IIC output. Since the control of the IIC channel switching module is also realized through the IIC input, when the IIC slave device is stuck, the IIC channel switching module cannot recognize the control information of the IIC input, which will cause the IIC bus to be stuck.

[0029] In the prior art, abnormal resetting of the CPU and abnormal closing of the IIC channel between the CPU and the IIC slave device will cause the IIC slave device to freeze.

[0030] The reason is: during the read and write operation of the IIC master device (i.e., CPU), after the IIC master device is started, it controls SCL to generate 8 clock pulses, and then pulls down the voltage of the two SCL ports, pulls the voltage of the two ports to a low level, and the IIC slave device outputs a response signal, and pulls the voltage of the two SDA ports to a low level. At this time, the IIC master device and the IIC slave device are in a normal communication state. If the IIC master device is abnormally reset or the IIC channel is abnormally closed, the voltage of the two SCL ports is pulled to a high level. At this time, if the IIC slave device is not reset, it will continue to respond to the IIC master device and pull the voltage of the two SDA ports to a low level. At this time, the IIC slave device is stuck until the voltage of the two SCL ports becomes a low level, and the IIC slave device will end its response to the IIC master device.

[0031] Moreover, in the case where the IIC slave device is stuck, once the IIC bus is also stuck, the access and control of multiple optical ports will fail, causing the devices in the entire system to become "bricked". In addition, the isolation between different IIC slave devices is poor, and the jam of one IIC slave device will cause the jam of nearby IIC slave devices. If the jam is released through the CPU, it is often necessary to switch the IIC port corresponding to the CPU to GPIO mode, and the CPU must also support the switching, which places high requirements on the CPU and has too limited applicable scenarios.

[0032] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0033] Figure 1 A structural diagram of an exception handling system provided by an exemplary embodiment of the present application, the exception handling system comprises: a CPU, an integrated circuit bus IIC channel switching module, a plurality of IIC slave devices, and an exception handling circuit; wherein:

[0034] The CPU is connected to the IIC channel switching module through the exception processing circuit;

[0035] The IIC channel switching module is also connected to the multiple IIC slave devices, and the multiple IIC slave devices are also connected to the CPU;

[0036] The CPU is configured to process the exception through the exception processing circuit when detecting that any IIC slave device among the plurality of IIC slave devices has an exception.

[0037] In some optional embodiments of the present application, during the interaction between the CPU and the arbitrary IIC slave device, if it is detected that no response information of the arbitrary IIC slave device is received for more than a first preset time, it is determined that an abnormality has been detected in the arbitrary IIC slave device among the multiple IIC slave devices.

[0038] Optionally, the first preset duration can be flexibly set, such as 1s or 3s.

[0039] In summary, by detecting the abnormality through the CPU and setting the abnormality handling circuit to handle the abnormality that occurs, it does not rely on human power to find and solve the fault, thereby improving the efficiency of solving the fault.

[0040] In some optional embodiments of the present application, please refer to Figure 2 As shown, the exception handling circuit includes: a channel closing circuit and a signal generating circuit;

[0041] The channel closing circuit is used to close the communication channel between the CPU and the multiple IIC slave devices;

[0042] The signal generating circuit is used to generate an exception processing signal for processing the exception;

[0043] The CPU is connected to the IIC channel switching module through the channel closing circuit;

[0044] One end of the signal generating circuit is connected to the CPU, and the other end of the signal generating circuit is connected to the channel closing circuit and the IIC channel switching module;

[0045] When the CPU is used to process the exception through the exception processing circuit, it is specifically used to: control the channel closing circuit to be closed, and control the transmission of the exception processing signal generated by the signal generating circuit to process the exception.

[0046] Optionally, the channel closing circuit may be a circuit that can control whether the channel is passable according to a control instruction. Controlling whether the channel is passable may be implemented by a physical switch or only by software.

[0047] Optionally, the aforementioned physical switch may be a buffer switch.

[0048] In summary, the exception handling circuit processes the exception occurring in the IIC slave device through the exception handling signal, and there is no need to manually handle the exception, thereby improving the efficiency of handling the exception.

[0049] In some optional embodiments of the present application, please refer to Figure 2As shown, the first end of the channel closing circuit is connected to the CPU for receiving a channel closing control signal from the CPU; the second end of the channel closing circuit is also connected to the CPU for receiving a data transmission control signal from the CPU; the third end of the channel closing circuit is connected to the IIC channel switching module for transmitting the data transmission control signal to the IIC channel switching module.

[0050] In some optional embodiments of the present application, please refer to Figure 3 As shown, the signal generating circuit includes a sequence generating module and a buffer module, the sequence generating module is connected to the buffer module, and the buffer module is connected to the CPU and the third end of the channel closing circuit;

[0051] The CPU is used to control the transmission of the exception processing signal generated by the signal generating circuit to process the exception, specifically used to: send a first enable signal to the buffer module to change the level inside the buffer module, thereby connecting and transmitting the exception processing signal;

[0052] When the sequence generation module detects that the level in the buffer module changes, the sequence generation module sends the exception processing signal to the IIC channel switching module through the buffer module, so that the channel switching module transmits the exception processing signal to the arbitrary IIC slave device, so that the arbitrary IIC slave device performs exception processing.

[0053] In summary, the exception handling signal is generated by the sequence generation module, so that the exception handling signal is relied upon to handle the exception occurring in any IIC slave device. There is no need to manually generate the exception handling signal, and there is no need to manually handle the exception, thus improving the exception handling efficiency.

[0054] Figure 4 A flowchart of an exception handling method provided by an exemplary embodiment of the present application is provided. The execution subject of the method may be a CPU in the aforementioned exception handling system. The method at least includes the following steps S401-S402:

[0055] S401, in the process of interacting with any IIC slave device among the multiple IIC slave devices in the exception handling system, if it is detected that no response information of the any IIC slave device is received for more than a first preset time, it is determined that an abnormality occurs in the any IIC slave device;

[0056] Optionally, if the CPU establishes communication with an IIC slave device, the CPU sends a data signal carrying data information to the IIC slave device through the serial data line SDA, the IIC channel switching module, and the channel corresponding to the IIC slave device.

[0057] Exemplarily, if the CPU establishes communication with the IIC slave device 1 , the CPU sends a data signal carrying data information to the IIC slave device 1 through the SDA and IIC channel switching module and the channel 1 corresponding to the IIC slave device 1 .

[0058] Optionally, when a new IIC slave device is connected to the exception handling system, the CPU will generate a device access identification signal, which will be converted from a high level to a low level. If the CPU establishes communication with the newly inserted IIC slave device, the CPU will identify the newly inserted IIC slave device and establish communication, and then send instructions / instructions to the IIC channel switching module, so that the IIC channel switching module opens the channel corresponding to the newly inserted IIC slave device and closes the remaining channels. At the same time, the CPU will set the buffer module to a preset state so that the CPU is connected to the IIC channel switching module through a channel closing circuit. The preset state can be high impedance.

[0059] S402: When an exception is detected in any IIC slave device, the exception is processed by an exception processing circuit in the exception processing system.

[0060] In summary, by detecting that the time when the IIC slave device responds to the CPU exceeds the first preset time length, it is confirmed that the IIC slave device is abnormal, and the abnormality is handled by the abnormality handling circuit. There is no need to manually check the abnormal IIC slave device, and there is no need to manually solve the abnormality, which improves the efficiency of abnormality checking, thereby improving the efficiency of abnormality handling.

[0061] Optionally, the abnormality of any IIC slave device includes any of the following situations, or any combination of multiple situations:

[0062] Case 1: When the CPU is performing normal read and write operations, the CPU sends 8 clock pulses through the line between the sequence generation module and the channel closing circuit, pulling the second and third ends of the channel closing circuit to a low level. If the CPU operates abnormally, the second and third ends of the channel closing circuit are pulled to a high level. The corresponding IIC slave device is not reset and continues to respond to the CPU, causing the IIC slave device to become stuck abnormally.

[0063] For example, see Figure 3 As shown, when the CPU performs read and write operations, 8 clock pulses are sent through SCL2 between the CPU and the channel closing circuit, and the levels of the second and third ends of the channel closing circuit are pulled to a low level. If the CPU is abnormally reset or the CPU abnormally closes the corresponding communication channel, the second and third ends of the channel closing circuit are released to a high level, and the corresponding slave device is not reset and continues to respond to the CPU, causing the IIC slave device to become abnormally stuck.

[0064] Case 2: When the IIC slave device has a hardware abnormality. For example, the abnormality caused by the gold finger adhesion of the IIC slave device. Among them, the gold finger adhesion will cause the CPU's SDA to be grounded, causing the CPU's SDA to be forced to be pulled low, thereby causing the IIC slave device to have a hardware abnormality. Among them, the gold finger adhesion refers to the short circuit between the metal PIN pins of the gold finger.

[0065] Optionally, the exception handling circuit described in the aforementioned S402 includes: a channel closing circuit and a signal generating circuit; the channel closing circuit is used to close the communication channel between the CPU and the multiple IIC slave devices; the signal generating circuit is used to generate an exception handling signal for handling the exception; the handling of the exception by the exception handling circuit in the exception handling system includes: controlling the channel closing circuit to close the communication channel, and controlling the transmission of the exception handling signal generated by the signal generating circuit to handle the exception.

[0066] Optionally, the channel refers to a communication channel between the CPU and the plurality of IIC slave devices, for example, Figure 3 Channel 1, channel 2, channel 3, channel n in.

[0067] The exception handling signal refers to an exception handling signal for handling the exception.

[0068] Optionally, the abnormal processing signal refers to 9 clock pulses generated by the signal generating circuit, and then the aforementioned Figure 2 The voltage of SCL1 is pulled to a low level. The 9 clock pulses are used to activate some models of IIC slave devices and release at least some abnormally stuck IIC slave devices.

[0069] Optionally, the signal generation circuit includes a sequence generation module and a buffer module, and the sequence generation module is connected to the buffer module. The aforementioned control of the channel closing circuit to close the channel and control of transmitting the exception processing signal generated by the signal generation circuit to process the exception include the following steps S1-S2:

[0070] S1, sending a second enable signal to the channel closing circuit to close or open the channel closing circuit;

[0071] Optionally, in this embodiment, the second enable signal is a high impedance signal, and the high impedance signal puts the channel closing circuit into a closed state, so that the CPU cannot send a signal to the IIC channel switching module through the channel closing circuit.

[0072] Optionally, the second enable signal includes a high impedance signal and a low impedance signal. In one embodiment, the low impedance signal causes the channel closing circuit to be in an on state, so that the CPU can send a signal to the IIC channel switching module through the channel closing circuit.

[0073] S2. Sending a first enable signal to the buffer module to change the internal level of the buffer module and enable the buffer module to have a signal transmission function to control the transmission of the exception processing signal generated by the sequence generation module in the signal generation circuit to handle the exception.

[0074] Optionally, the first enable signal includes a high impedance signal and a low impedance signal.

[0075] In this embodiment, the first enable signal is a low impedance signal, which can put the buffer module in a conducting (or connected) state, so that the sequence generation module can send an exception processing signal to the IIC channel switching module through the buffer module.

[0076] Optionally, the IIC channel switching module may be one of a CPLD switching switch, a series MOSFET, a multi-analog switch, and a relay.

[0077] Optionally, the sequence generation module refers to a module that generates 9 clock pulses.

[0078] Optionally, the IIC channel switching module is used to switch the communication between the CPU and multiple IIC slave devices.

[0079] Optionally, when the sequence generation module detects that the level in the buffer module changes, the sequence generation module sends the exception processing signal to the IIC channel switching module through the buffer module, so that the IIC channel switching module transmits the exception processing signal to the arbitrary IIC slave device, so that the arbitrary IIC slave device performs exception processing.

[0080] Optionally, the exception handling signal refers to a signal used to handle an exception of any IIC slave device.

[0081] In other optional embodiments, the sequence generation module can be a module for GPIO to simulate a specific sequence. If the module generation module is a module for GPIO to simulate a specific sequence, the signal generating circuit includes a buffer module, and the CPU controls the buffer module in the signal generating circuit to transmit the exception handling signal generated by the CPU.

[0082] In summary, this solution adopts a mechanism of inputting 9 clock pulses to forcibly lower the voltage of the SDA terminal of the CPU (i.e., the IIC input hard switching mechanism), so that when the CPU cannot switch the IIC port to GPIO mode, the IIC slave device can be automatically recovered from being stuck, thereby solving the abnormal problem of at least some IIC slave devices.

[0083] Optionally, if no abnormality is detected in any of the IIC slave devices, the CPU does not send a second enable signal to the channel closing circuit, and the CPU sends a data transmission control signal to the IIC channel switching module through the line between the CPU and the channel closing circuit and the channel closing circuit, wherein the data transmission control signal is used to instruct the IIC channel switching module to open or switch the communication channel between the CPU and the target IIC slave device, wherein the target IIC slave device refers to the IIC slave device that establishes communication with the CPU.

[0084] Optionally, the method further includes the following steps: setting a channel lock, if it is detected that the abnormality has not been resolved for more than a second preset time after determining that the arbitrary IIC slave device has an abnormality, marking the channel, releasing the channel lock, and reducing the frequency of sending data to the arbitrary IIC slave device through the channel.

[0085] Optionally, the channel lock is used to control the CPU to no longer communicate with other IIC slave devices when communicating with any IIC slave device.

[0086] In summary, by adopting the channel lock mechanism, before the IIC slave device communication is completed, there will be no problem of opening a new IIC slave device channel communication, resetting the CPU, or forcibly closing the channel, thus avoiding more IIC slave device anomalies.

[0087] Optionally, if it is detected that the abnormality has not been resolved for more than a second preset time after it is determined that the arbitrary IIC slave device has an abnormality, the channel is marked, the channel lock is released, and the frequency of sending data to the arbitrary IIC slave device through the channel is reduced, including the following steps: setting a channel lock, if it is detected that the abnormality has not been resolved for more than a second preset time after it is determined that the arbitrary IIC slave device has an abnormality, the channel is marked as an abnormal channel, the channel lock is released, and the frequency of sending data to the arbitrary IIC slave device through the abnormal channel is reduced.

[0088] Optionally, if it is detected that the anomaly has not been resolved within a second preset time period after it is determined that an anomaly has occurred in any IIC slave device, the corresponding IIC slave device is accessed through the abnormal channel once every third preset time period until the anomaly corresponding to the abnormal channel is resolved, and the corresponding IIC slave device is accessed through the channel once every fourth preset time period, wherein the fourth preset time period is less than the third preset time period.

[0089] In summary, the present application reduces the frequency of access to the abnormal channel (i.e., increases the interval time for accessing the abnormal channel) to avoid accessing the channel to transmit data when the abnormality of the abnormal channel has not been resolved, which causes a waste of data transmission resources and reduces the efficiency of data transmission. At the same time, by setting a third preset time length to determine whether the abnormal channel has recovered from the abnormality, the present application avoids the situation where the abnormality of the abnormal channel has been resolved but the channel is still marked as an abnormal channel, so that the channel is not used to transmit data, thereby reducing the utilization rate of the channel.

[0090] Optionally, if it is detected that the abnormality has been resolved within a second preset time period after it is determined that the abnormality has occurred in any IIC slave device, the channel is marked as a normal channel.

[0091] Optionally, the second preset duration is the same as the aforementioned first preset duration.

[0092] Meanwhile, the sequence generation module includes a sequence generator, through which an exception processing signal, such as a sequence pulse signal, is generated and sent.

[0093] Optionally, the sequence generator is a square wave generator.

[0094] Optionally, the square wave generator includes two transistors and a capacitor.

[0095] The sequence generator can also be replaced by a square wave generator, which only requires a small amount of materials such as two transistors and a capacitor, thus saving costs.

[0096] In order to explain this solution more comprehensively, the following is a flowchart to further explain some contents of this solution: Figure 5A flowchart of an exception handling process provided for an embodiment of the present application, when the CPU has an access request, a channel lock and a reset timer are applied for at the same time; when the CPU establishes communication with an IIC slave device, the CPU interacts with the IIC slave device to implement the CPU's read and write operations, and each time a read and write operation starts, the CPU synchronously starts the reset timer. When the CPU detects that the IIC slave device sends a response signal, the reset timer is cleared. If the reset timer time exceeds the first preset duration, it means that the IIC slave device is abnormal. If the CPU's read and write process is still being executed at this time, the channel lock is released, the channel between the CPU and the IIC slave device is marked as an abnormal channel, and the access frequency of accessing the IIC slave device through the abnormal channel is reduced.

[0097] If the duration recorded by the reset timer does not exceed the first preset duration and the CPU read and write process ends, the channel is closed, the reset timer is stopped, the channel lock is released, and the channel is marked as a normal channel. If there is a reset requirement at the end of the process, the CPU performs a reset operation. If there is a new IIC slave device access requirement at the end of the read and write process, the current channel is closed and a new channel is opened.

[0098] In summary, the solution provided by the present application includes a CPU, an integrated circuit bus IIC channel switching module, multiple IIC slave devices, and an exception handling circuit; wherein: during the CPU's interaction with any of the multiple IIC slave devices in the exception handling system, if it detects that the response information of any IIC slave device has not been received for more than a first preset time, it is determined that an abnormality has occurred in any IIC slave device; when an abnormality is detected in any IIC slave device, the abnormality is handled by the exception handling circuit in the exception handling system. By detecting the abnormality through the CPU and setting the abnormality handling circuit to handle the abnormality that occurs, it does not rely on human power to find and solve the fault, thereby improving the efficiency of solving the fault.

[0099] This solution uses the IIC input hard switching mechanism to force the voltage of the CPU's SDA terminal to be forced to be lowered when 9 clock pulses are input. When the CPU cannot switch the IIC port to GPIO mode, the IIC slave device can be automatically recovered from being stuck. By using the channel lock mechanism, before the IIC slave device communication is completed, there will be no problems of opening new IIC slave device channel communication, resetting the CPU, or forcibly closing the channel. For the hardware stuck problem of the IIC slave device, by setting the second preset time and the channel lock mechanism, the abnormal IIC slave device channel is isolated, protecting the normal IIC slave device from the impact of the abnormal IIC slave device.

[0100] Figure 6A schematic diagram of the structure of an exception handling device provided for an exemplary embodiment of the present application; wherein the device is applicable to a CPU in the above-mentioned exception handling system, comprising:

[0101] The detection unit 61 is used to determine that an abnormality occurs in any IIC slave device if it is detected that no response information of any IIC slave device is received for more than a first preset time during the interaction with any IIC slave device among the multiple IIC slave devices in the abnormality handling system;

[0102] The processing unit 62 is used to process the exception through the exception processing circuit in the exception processing system when detecting that the any IIC slave device has an exception.

[0103] Optionally, the exception handling circuit in the device includes: a channel closing circuit and a signal generating circuit; the channel closing circuit is used to close the communication channel between the CPU and the multiple IIC slave devices; the signal generating circuit is used to generate an exception handling signal for handling the exception; the device is used to handle the exception through the exception handling circuit in the exception handling system, specifically for: controlling the channel closing circuit to close the channel, and controlling the transmission of the exception handling signal generated by the signal generating circuit to handle the exception.

[0104] Optionally, the signal generating circuit in the device includes a sequence generating module and a buffer module, and the sequence generating module is connected to the buffer module. The device is used to control the channel closing circuit to close the channel, and control the transmission of the exception processing signal generated by the signal generating circuit to handle the exception, specifically for: sending a second enable signal to the channel closing circuit to close or open the communication channel; sending a first enable signal to the buffer module to change the level inside the buffer module, and enabling the buffer module to have a signal transmission function to control the transmission of the exception processing signal generated by the sequence generating module in the signal generating circuit to handle the exception.

[0105] Optionally, when the sequence generation module in the device detects that the level in the buffer module changes, the sequence generation module sends the exception processing signal to the IIC channel switching module through the buffer module, so that the channel switching module transmits the exception processing signal to the arbitrary IIC slave device, so that the arbitrary IIC slave device performs exception processing.

[0106] Optionally, the device is also used to set a channel lock. If it is detected that the abnormality has not been resolved for more than a second preset time after the abnormality is determined to have occurred in any IIC slave device, the channel is marked, the channel lock is released, and the frequency of sending data to the arbitrary IIC slave device through the channel is reduced.

[0107] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.

[0108] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0109] Figure 7 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:

[0110] The memory 701 and the processor 702, the memory 701 is used to store the computer program and transmit the program code to the processor 702. In other words, the processor 702 can call and run the computer program from the memory 701 to implement the method in the embodiment of the present application.

[0111] For example, the processor 702 may be configured to execute the above method embodiments according to instructions in the computer program.

[0112] In some embodiments of the present application, the processor 702 may include but is not limited to:

[0113] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0114] In some embodiments of the present application, the memory 701 includes but is not limited to:

[0115] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0116] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 701 and executed by the processor 702 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0117] like Figure 7 As shown, the electronic device may also include:

[0118] The transceiver 707 may be connected to the processor 702 or the memory 701 .

[0119] The processor 702 may control the transceiver 707 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 707 may include a transmitter and a receiver. The transceiver 707 may further include an antenna, and the number of antennas may be one or more.

[0120] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0121] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0122] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0123] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0124] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0125] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0126] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An exception handling system, characterized in that: It includes a CPU, an integrated circuit bus IIC channel switching module, multiple IIC slave devices, and an exception handling circuit; wherein: The CPU is connected to the IIC channel switching module through the exception processing circuit; The IIC channel switching module is also connected to the multiple IIC slave devices, and the multiple IIC slave devices are also connected to the CPU; The CPU is configured to process the exception through the exception processing circuit when detecting that any IIC slave device among the plurality of IIC slave devices has an exception.

2. The system according to claim 1, characterized in that During the interaction between the CPU and the arbitrary IIC slave device, if it is detected that no response information of the arbitrary IIC slave device is received for more than a first preset time period, it is determined that an abnormality is detected in the arbitrary IIC slave device among the multiple IIC slave devices.

3. The system according to claim 1, characterized in that The abnormality processing circuit includes: a channel closing circuit and a signal generating circuit; The channel closing circuit is used to close the communication channel between the CPU and the multiple IIC slave devices; The signal generating circuit is used to generate an exception processing signal for processing the exception; The CPU is connected to the IIC channel switching module through the channel closing circuit; One end of the signal generating circuit is connected to the CPU, and the other end of the signal generating circuit is connected to the channel closing circuit and the IIC channel switching module; When the CPU is used to process the exception through the exception processing circuit, it is specifically used to: control the channel closing circuit to be closed, and control the transmission of the exception processing signal generated by the signal generating circuit to process the exception.

4. The system according to claim 3, characterized in that The first end of the channel closing circuit is connected to the CPU for receiving a channel closing control signal from the CPU; the second end of the channel closing circuit is also connected to the CPU for receiving a data transmission control signal from the CPU; the third end of the channel closing circuit is connected to the IIC channel switching module for transmitting the data transmission control signal to the IIC channel switching module.

5. The system according to claim 3, characterized in that The signal generating circuit comprises a sequence generating module and a buffer module, wherein the sequence generating module is connected to the buffer module, and the buffer module is connected to the CPU and the third end of the channel closing circuit; The CPU is used to control the transmission of the exception processing signal generated by the signal generating circuit to process the exception, specifically used to: send a first enable signal to the buffer module to change the level inside the buffer module, thereby connecting and transmitting the exception processing signal; When the sequence generation module detects that the level in the buffer module changes, the sequence generation module sends the exception processing signal to the IIC channel switching module through the buffer module, so that the channel switching module transmits the exception processing signal to the arbitrary IIC slave device, so that the arbitrary IIC slave device performs exception processing.

6. An exception handling method, characterized in that: Applicable to a CPU in the exception handling system of claim 1, the method comprising: During the interaction with any IIC slave device among the multiple IIC slave devices in the exception handling system, if it is detected that no response information of the any IIC slave device is received for more than a first preset time, it is determined that an abnormality occurs in the any IIC slave device; When an abnormality occurs in any IIC slave device, the abnormality is processed by an abnormality processing circuit in the abnormality processing system.

7. The method according to claim 6, characterized in that The abnormality processing circuit includes: a channel closing circuit and a signal generating circuit; The channel closing circuit is used to close the communication channel between the CPU and the multiple IIC slave devices; The signal generating circuit is used to generate an exception processing signal for processing the exception; The processing of the exception by an exception processing circuit in the exception processing system includes: The channel closing circuit is controlled to close the channel, and the exception processing signal generated by the signal generating circuit is controlled to be transmitted to process the exception.

8. The method according to claim 7, characterized in that The signal generating circuit includes a sequence generating module and a buffer module, wherein the sequence generating module is connected to the buffer module, and the controlling the channel closing circuit to close the channel and controlling the transmission of the exception processing signal generated by the signal generating circuit to process the exception include: Sending a second enable signal to the channel closing circuit to close or open the communication channel; A first enable signal is sent to the buffer module to change the internal level of the buffer module and enable the buffer module to have a signal transmission function to control the transmission of the exception processing signal generated by the sequence generation module in the signal generation circuit to handle the exception.

9. The method according to claim 8, characterized in that When the sequence generation module detects that the level in the buffer module changes, the sequence generation module sends the exception processing signal to the IIC channel switching module through the buffer module, so that the channel switching module transmits the exception processing signal to the arbitrary IIC slave device, so that the arbitrary IIC slave device performs exception processing.

10. The method according to claim 6, characterized in that The method further includes: setting a channel lock, and if it is detected that the abnormality has not been resolved for more than a second preset time after determining that the abnormality has occurred in the arbitrary IIC slave device, marking the channel, releasing the channel lock, and reducing the frequency of sending data to the arbitrary IIC slave device through the channel.

11. An exception handling device, characterized in that: A CPU suitable for use in the exception handling system of claim 1, comprising: A detection unit, configured to determine that an abnormality occurs in any IIC slave device if it is detected that no response information of any IIC slave device is received for more than a first preset time period during interaction with any IIC slave device among the plurality of IIC slave devices in the abnormality handling system; The processing unit is used to process the exception through the exception processing circuit in the exception processing system when detecting that the any IIC slave device has an exception.

12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to perform the method of any of claims 6-10 by executing the executable instructions.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method described in any one of claims 6 to 10 is implemented.