Fault processing method and device, electronic equipment and storage medium

By detecting the network status of the CAN bus and restarting timing restart, the problem of entering the bus closure after the bus restart, and improving the effectiveness and communication efficiency of fault recovery.

CN119363567AActive Publication Date: 2025-01-24SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411191916.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-01-24
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

When the existing CAN bus restarts and resends data in a faulty state, it is easy for the bus to enter the bus off state again, affecting communication efficiency and real-time performance.

Method used

After detecting the failure state, the network status is detected, the controller is closed and the timing starts. After the timing is over, turn on the controller and detect the network status. If the network is continuously idle, the data is sent. If the data frame is successfully sent, it indicates that it returns to the working status.

Benefits of technology

It improves the normal operation possibility of nodes in the state of fault, enhances the effectiveness of fault recovery, reduces the probability of entering the bus closure of the bus again, thereby improving communication efficiency and real -time nature.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363567A_ABST
    Figure CN119363567A_ABST
Patent Text Reader

Abstract

The invention provides a fault processing method and device, electronic equipment and a storage medium, and the method comprises the following steps: detecting the state of a network after a fault state is detected; when it is detected that the network is continuously in the idle state, a controller is turned off, timing is started, and the controller is used for being connected with the network; when timing is finished, the controller is started, and the state of the network is detected; when it is detected that the network is continuously in an idle state, data sending is carried out, if a frame of data is successfully sent, it is represented that the network is recovered to a working state, the working states of other nodes in the network are detected through the network state, and after the continuous idle state is monitored, it is judged that the network is in the state before the nodes normally send information; and the information is sent, so that the possibility of normal operation can be improved, and the effectiveness of fault recovery is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a fault handling method, device, electronic equipment and storage medium. Background Art

[0002] CAN (Controller Area Network) bus is a serial communication bus, mostly used in industrial control fields, such as the automotive industry. CAN bus has a powerful error detection and processing mechanism, which can identify bit errors, fill errors, response errors, format errors and CRC errors. When the controller identifies any of the above errors, the node will send an error frame, causing the sending node to terminate the current valid frame or the receiving node to stop receiving valid frames. After the current error frame is sent, the sending node continues to send the previous frame and resends the request. When the errors accumulate to a specified number, the node will enter the bus-off state.

[0003] After a node enters the bus-off state, if there is no effective operation, the node will continue to detect the bus level until the conditions are met before it can work. The waiting time is very long, so that the node cannot send out emergency messages quickly or cannot receive messages from the other end to respond quickly, thus affecting the occurrence of accidents during use.

[0004] Therefore, the prior art adopts the method of shutting down the controller for 20ms and then restarting it, and then checking whether the current node has recovered to the normal working state by resending. However, if the sending fails after the restart, the bus will enter the bus off state again, and then restarting again will cause the node to send error frames repeatedly, causing the entire network to send and receive error frames, affecting the communication efficiency of the entire node network and the real-time communication of other nodes. Summary of the invention

[0005] The present invention provides a fault handling method, device, electronic equipment and storage medium, which are used to improve the possibility of normal operation and increase the effectiveness of fault recovery.

[0006] The present invention provides a fault handling method, comprising the following steps: after detecting a fault state, detecting the state of a network; when detecting that the network is continuously in an idle state, turning off a controller and starting timing, wherein the controller is used to connect to the network; when timing ends, turning on the controller and detecting the state of the network; when detecting that the network is continuously in an idle state, sending data, and if a frame of the data is successfully sent, it indicates that the system has recovered to a working state.

[0007] According to a fault handling method provided by the present invention, after detecting the fault state, detecting the state of the network includes: after detecting the fault, setting the controller to a reset mode; setting a sending error counter to a preset value, detecting the state of the network, and the sending error counter is used to record the number of errors.

[0008] According to a fault handling method provided by the present invention, the method further includes: if an idle state is detected once, subtracting a specified value from the sending error counter; if a non-idle state is detected once, resetting the sending error counter to the preset value.

[0009] According to a fault handling method provided by the present invention, the method further includes: detecting the value of the sending error counter in real time; if the value of the sending error counter is less than a first threshold, shutting down the controller and starting timing.

[0010] According to a fault handling method provided by the present invention, the controller is turned on and the state of the network is detected, including: if an idle state is detected once, the sending error counter is subtracted from the specified value; if a non-idle state is detected once, the sending error counter is reset to the preset value; the value of the sending error counter is detected in real time; if the value of the sending error counter is less than a second threshold value, the network is continuously in an idle state.

[0011] According to a fault handling method provided by the present invention, the method also includes: detecting the value of the sending error counter in real time; if the value of the sending error counter is greater than a third threshold, determining that a fault state is detected, and increasing the first threshold and the second threshold.

[0012] The present invention also provides a fault handling device, comprising the following modules: a first detection module, used to detect the state of the network after detecting the fault state; a timing module, used to turn off the controller and start timing when detecting that the network is continuously in an idle state, and the controller is used to connect to the network; a second detection module, used to turn on the controller at the end of the timing and detect the state of the network; a communication module, used to send data when detecting that the network is continuously in an idle state, and if a frame of the data is successfully sent, it indicates that it has recovered to the working state.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned fault handling methods when executing the computer program.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the fault handling method described in any one of the above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the fault handling method described above is implemented.

[0016] The fault handling method, device, electronic device and storage medium provided by the present invention detect the working status of other nodes in the network through the network status, and after monitoring the continuous idle state, it is determined that the network is in a state before the node normally sends information. Sending information at this time can improve the possibility of normal operation and increase the effectiveness of fault recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is a jump relationship diagram of the fault state provided by the present invention.

[0019] Figure 2 It is one of the flow charts of the flow chart of the fault handling method provided by the present invention.

[0020] Figure 3 This is the second flowchart of the flowchart of the fault handling method provided by the present invention.

[0021] Figure 4 It is a structural schematic diagram of the fault handling device provided by the present invention.

[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] The CAN bus consists of two signal lines, CANH and CANL, and there is no clock synchronization signal, so CAN is an asynchronous communication method. The voltage difference between the two signal lines, CANH-CANL, represents the level of the CAN bus, corresponding to the transmitted logic signal 1 or 0. The corresponding to logic 1 is called the recessive level, and the corresponding to logic 0 is called the dominant level.

[0025] In a CAN bus network, a terminal device on the CAN bus is called a node. In a CAN network, there is no distinction between master devices and slave devices. The hardware part of a CAN node generally consists of two parts: a CAN controller and a CAN transceiver. The CAN controller is responsible for the logical control of the CAN bus and implements the CAN transmission protocol; the CAN transceiver is mainly responsible for the conversion between the MCU logic level and the CAN bus level.

[0026] Each node of the CAN controller has a send error counter and a receive error counter. Based on the above counters, each CAN node can be divided into three fault states: active error state, passive error state, and bus off state. The jump relationship between the three fault states is as follows: Figure 1 shown.

[0027] like Figure 1 As shown, when the send error counter and the receive error counter are both less than 128, the node is in the active error state. The bus in this state can participate in the bus activities normally, sending data frames, overload frames and active error frames; when one of the send error counter or the receive error counter is greater than or equal to 128 and less than or equal to 255, the node is in the passive error state. The bus in this state is prone to errors and can send data frames, overload frames and passive error frames; when the send error counter is greater than 255, the bus is in the bus-off state, and the node is not allowed to send and receive information.

[0028] In the prior art, in order to restore a node from a bus-off state to a working state, the controller is shut down for 20ms and then restarted. Then, the node is resent to see whether it has resumed normal working state. However, if the transmission fails after the restart, the bus will enter the bus-off state again. Then, the node will be restarted again, which will cause the node to send error frames repeatedly, causing the entire network to send and receive error frames, affecting the communication efficiency of the entire node network and the real-time communication of other nodes.

[0029] In response to the above problems, some existing technologies count the bus off time after being in the bus off state. When the shutdown threshold is reached, the CAN controller is cleared and shut down. Then the shutdown time is counted. When the threshold is reached, the node controller is restarted. Try to send a message. If an error occurs, the counter increases. When entering the bus off state again, the above method is repeated until the message is successfully sent. The existing technology uses timing to shut down and restart the node controller according to the time counting method. Although it reduces the average duration of node opening and closing, it still has a high degree of randomness and may repeat the previous process, send frame data, and generate error frames until the bus node is closed, and then repeat the operation.

[0030] In view of this, an embodiment of the present invention provides a fault handling method, which detects the working status of other nodes in the network through the network status, and after monitoring the continuous idle state, it is determined that the network is in a state before the node normally sends information. Sending information at this time can improve the possibility of normal operation and increase the effectiveness of fault recovery.

[0031] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0032] Figure 2 This is one of the flowcharts of the fault handling method provided by the present invention. The fault handling method can be applied to electronic devices, and the electronic devices can be various types of devices with information processing capabilities during implementation. For example, the electronic devices can include personal computers, laptops, PDAs or servers, etc.; the electronic devices can also be mobile terminals, such as mobile phones, car computers, tablet computers or projectors, etc. Figure 2 As shown, the method may include the following steps 210 to 250: Step 210: After the fault state is detected, the state of the network is detected.

[0033] After detecting the specified fault state, the node detects the working state of the CAN bus at that time.

[0034] For example, the fault state is the bus off state. After the node is in the bus off state, the CAN controller reports the system busoff state. The CAN controller monitors whether other nodes in the CAN bus are sending information.

[0035] In one embodiment of the present application, after detecting a fault state, detecting the state of the network includes: after detecting the fault, setting the controller to a reset mode; setting a sending error counter to a preset value, and detecting the state of the network, wherein the sending error counter is used to record the number of errors.

[0036] After reporting the system busoff status, the CAN controller is set to reset mode, the send error counter is set to 128, and the receive error counter is set to 0. At this time, the node cannot send and receive information, and the node does not affect the normal communication of other nodes. When in reset mode, the CAN controller can monitor the level of the bus.

[0037] In one embodiment of the present application, the method further includes: if an idle state is detected once, subtracting a specified value from the send error counter; if a non-idle state is detected once, resetting the send error counter to the preset value.

[0038] In the CAN bus protocol, the idle state is defined as 11 consecutive invisible levels. During normal operation, the first message must be sent after the bus is detected to be in the idle state.

[0039] The CAN controller monitors the bus level. When 11 consecutive invisible levels are detected, it means that an idle state has been detected.

[0040] Each time an idle state is detected, the send error counter is reduced by 1. If a detection in the middle is not 11 consecutive recessive bits, the CAN controller will reset the send error counter to 128.

[0041] Step 220: When it is detected that the network is continuously in an idle state, the controller is turned off and timing is started, and the controller is used to connect to the network.

[0042] In the CAN bus protocol, the idle state is defined as 11 consecutive invisible levels. After the CAN controller detects 11 consecutive invisible levels, it determines that an idle state has been detected.

[0043] In addition to detecting the idle state, the CAN controller in this application also determines whether the detected idle state is continuous, that is, adjacent idle states cannot have other states. It should be noted that this application does not limit the length of the continuous state, which can be two consecutive idle states or multiple consecutive idle states.

[0044] When the network is detected to be in an idle state continuously, the CAN controller is turned off and a timer is set. Turning off the CAN controller can temporarily stop the CAN controller with bus communication failure for a period of time to repair its own failure, or the faulty CAN controller can be completely withdrawn from the CAN communication line to give up CAN communication resource space.

[0045] In one embodiment of the present application, the method further includes: detecting the value of the sending error counter in real time; if the value of the sending error counter is less than a first threshold, shutting down the controller and starting timing.

[0046] In the embodiment where the send error counter is reduced by 1 each time the idle state is detected, after N consecutive idle state detections, the send error counter is also reduced by N. When N reaches the set threshold T, it is determined that the network is continuously in the idle state. The CAN controller is turned off and timing is performed.

[0047] Step 230: When the timing ends, turn on the controller to detect the status of the network.

[0048] At the end of the timing, for example, when the timing reaches the preset threshold T1, the timing is cleared. The CAN controller is turned on and the idle state of the bus is continuously detected.

[0049] In one embodiment of the present application, the controller is turned on to detect the state of the network, including: if an idle state is detected once, the send error counter is subtracted from the specified value; if a non-idle state is detected once, the send error counter is reset to the preset value; and the value of the send error counter is detected in real time; if the value of the send error counter is less than a second threshold value, the network is continuously in an idle state.

[0050] The CAN controller monitors the bus level. When 11 consecutive recessive levels are detected, it means an idle state is detected. Every time an idle state is detected, the send error counter is reduced by 1. If a detection in the middle is not 11 consecutive recessive bits, the CAN controller will reset the send error counter to 128.

[0051] When the send error counter reaches the preset threshold 128-M, the network is continuously in idle state. If the controller is turned on, and the idle state is continuously detected but the threshold 128-M is not reached, a non-idle state occurs. At this time, the send error counter TEC will be set to 128 and the idle state will be detected again; Step 240: When it is detected that the network is continuously in an idle state, data is sent. If a frame of the data is successfully sent, it indicates that the network has been restored to a working state.

[0052] When the send error counter reaches the preset threshold 128-M, the send error count is set to 0, the node enters the active error state, and exits the reset mode.

[0053] The node attempts to send or receive information. When the first frame of data is sent, it means that the node has resumed normal working state. When the node fails to send a frame, the node's send error counter will increase according to the error counting rule. If the error frame can be ended normally, it will continue to try to send data frames.

[0054] The above fault handling method detects the working status of other nodes in the network through the network status. After monitoring the continuous idle state, it is determined that the network is in a state before the node normally sends information. Sending information at this time can improve the possibility of normal operation and increase the effectiveness of fault recovery.

[0055] In one embodiment of the present application, the method further includes: detecting the value of the sending error counter in real time; if the value of the sending error counter is greater than a third threshold, determining that a fault state is detected, and increasing the first threshold and the second threshold.

[0056] Detect the value of the sending error counter, which includes a sending error counter and a receiving error counter. When the error counter increases to 255 again, the bus enters the Busoff state again. At this time, the values ​​of the adjustment thresholds N and M are doubled, and the above steps 210 to 240 are repeated.

[0057] In the above embodiment, the value of the error counter is changed in combination with reaching the threshold of the sending error counter, so that the node enters the active error state and sends normal working information, which reduces the waiting time and further improves the node efficiency.

[0058] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario. Figure 3 The following is a schematic diagram of an overall process provided by an embodiment of the present invention. Figure 3As shown in the figure, after the node appears in the bus off state, the CAN controller reports the system busoff state, sets the controller to reset mode, and the hardware automatically sets the send error counter to 128 and the receive error counter to 0. At this time, the bus cannot send and receive information, and the node does not affect the normal communication of other nodes. When in reset mode, the controller can monitor the level of the bus. Every time an idle state is detected, that is, 11 consecutive invisible levels, the send error counter is reduced by 1. After continuously detecting the idle state N times, the send error counter will also be reduced by N. When N reaches the set threshold T, the CAN controller is turned off and the timing is started. When the timing reaches the preset threshold T1, the count value is cleared, the CAN controller is turned on, and then the idle state of the bus is continuously detected. When the send error counter reaches the preset threshold 128-M, the send error count is set to 0, the node enters the active error state, and exits the reset mode. At this time, the node attempts to send or receive information. For example, after the controller is turned on, when the idle state is continuously detected and the threshold value 128-M is not reached, a non-idle state occurs. At this time, the send error counter TEC will be set to 128 and the idle state will be re-detected; when the first frame of data is sent, it means that the node has resumed normal working state. When the node fails to send a frame, the node's send error counter will increase according to the error counting rule. If the error frame can end normally, continue to try to send the data frame; when the error counter increases to 255 again, the bus enters the Busoff state again, at this time, the values ​​of the adjustment thresholds N and M will be doubled, and the above operation will be repeated.

[0059] The values ​​of the thresholds N and M can be adjusted according to specific circumstances, and T1 is set to 20ms.

[0060] The above method monitors the idle state of the bus to refer to the working state of multiple nodes in the entire system, and compares it with the state before normal information transmission, so that sending information through the restored bus is more reliable, and further reduces the probability of the bus entering Busoff again due to the above method to restore the bus.

[0061] The above method configures the sending error count through the thresholds N and M, so that the bus can enter the active error state faster and enter the working state, reducing the waiting time.

[0062] Based on the foregoing embodiments, an embodiment of the present invention provides a device, and each module included in the device and each unit included in each module can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0063] The fault handling device provided by the present invention is described below. The fault handling device described below and the fault handling method described above can be referred to each other.

[0064] Figure 4 Schematic diagram of the structure of the fault handling device provided by the embodiment of the present invention. Figure 4 As shown, the device 400 includes a first detection module 410, a timing module 420, a second detection module 430 and a communication module 440, wherein: A first detection module 410 is used to detect the state of the network after detecting the fault state; A timing module 420, configured to shut down a controller and start timing when detecting that the network is continuously in an idle state, wherein the controller is used to connect to the network; A second detection module 430 is used to start the controller and detect the state of the network when the timing ends; The communication module 440 is used to send data when it is detected that the network is continuously in an idle state. If a frame of the data is successfully sent, it indicates that the network has been restored to a working state.

[0065] In some embodiments, the first detection module 410 is specifically used to set the controller to reset mode after detecting a fault; set the sending error counter to a preset value to detect the state of the network, and the sending error counter is used to record the number of errors.

[0066] In some embodiments, the first detection module 410 is further configured to, if an idle state is detected, reduce the send error counter by a specified value; if a non-idle state is detected, reset the send error counter to the preset value.

[0067] In some embodiments, the first detection module 410 is further used to detect the value of the sending error counter in real time; if the value of the sending error counter is less than a first threshold, the controller is turned off and timing is started.

[0068] In some embodiments, the second detection module 430 is also used to subtract the specified value from the send error counter if an idle state is detected; reset the send error counter to the preset value if a non-idle state is detected; and detect the value of the send error counter in real time; if the value of the send error counter is less than a second threshold, the network is continuously in an idle state.

[0069] The above-mentioned device also includes: a third detection module, which is used to detect the value of the sending error counter in real time; if the value of the sending error counter is greater than a third threshold, it is determined that a fault state is detected, and the first threshold and the second threshold are increased.

[0070] Figure 5 A schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the fault handling method, which includes: after detecting the fault state, detecting the state of the network; when detecting that the network is continuously in an idle state, turning off the controller and starting the timing, the controller is used to connect to the network; when the timing ends, turning on the controller and detecting the state of the network; when detecting that the network is continuously in an idle state, sending data, if a frame of the data is successfully sent, it indicates that it has recovered to the working state.

[0071] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fault handling method provided by the above methods, which includes: after detecting a fault state, detecting the state of the network; when it is detected that the network is continuously in an idle state, turning off the controller and starting timing, the controller is used to connect to the network; when the timing ends, turning on the controller and detecting the state of the network; when it is detected that the network is continuously in an idle state, sending data, and if a frame of the data is successfully sent, it indicates that it has recovered to the working state.

[0073] 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 described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0074] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the fault handling method provided by the above-mentioned methods, the method comprising: after detecting a fault state, detecting the state of the network; when detecting that the network is continuously in an idle state, turning off the controller and starting timing, the controller being used to connect to the network; when the timing ends, turning on the controller and detecting the state of the network; when detecting that the network is continuously in an idle state, sending data, and if a frame of the data is successfully sent, it indicates recovery to the working state.

[0075] The above-mentioned computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0076] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0077] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0078] Computer program code for performing the operations of the present specification may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, 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. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fault handling method, characterized in that: include: After the fault state is detected, detecting the state of the network; When it is detected that the network is continuously in an idle state, turning off the controller and starting timing, the controller being used to connect to the network; When the timing ends, turning on the controller to detect the state of the network; When it is detected that the network is continuously in an idle state, data is sent. If a frame of the data is successfully sent, it indicates that the network is restored to a working state.

2. The method according to claim 1, characterized in that After the fault state is detected, detecting the state of the network includes: After detecting a fault condition, placing the controller in a reset mode; The sending error counter is set to a preset value to detect the state of the network, and the sending error counter is used to record the number of errors.

3. The method according to claim 2, characterized in that The method further comprises: If an idle state is detected once, the sending error counter is reduced by a specified value; If a non-idle state is detected once, the sending error counter is reset to the preset value.

4. The method according to claim 3, characterized in that: The method further comprises: Detecting the value of the sending error counter in real time; If the value of the sending error counter is less than the first threshold, the controller is turned off and timing is started.

5. The method according to claim 4, characterized in that The step of starting the controller and detecting the state of the network includes: If an idle state is detected once, the sending error counter is reduced by the specified value; If a non-idle state is detected once, the sending error counter is reset to the preset value; Detecting the value of the sending error counter in real time; If the value of the sending error counter is less than the second threshold, the network is continuously in an idle state.

6. The method according to claim 5, characterized in that The method further comprises: Detecting the value of the sending error counter in real time; If the value of the sending error counter is greater than the third threshold, it is determined that a fault state is detected, and the first threshold and the second threshold are increased.

7. A fault handling device, characterized in that: include: A first detection module, used to detect the state of the network after detecting the fault state; A timing module, used to shut down a controller and start timing when detecting that the network is continuously in an idle state, wherein the controller is used to connect to the network; A second detection module is used to turn on the controller and detect the state of the network when the timing ends; The communication module is used to send data when it is detected that the network is continuously in an idle state. If a frame of the data is successfully sent, it indicates that the network has been restored to a working state.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the fault handling method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fault handling method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the fault handling method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Failure carrier recovery method, system and baseband resource configuring method

    CN101312581A

  • Bus error recovery processing method

    CN101783759A

  • Fault node determination method in CAN (Controller Area Network) bus network

    CN108063687A

  • Non-inductive switching redundancy communication implementation method and system based on bus

    CN113572673A

  • Electric energy meter communication method and device, computer equipment and medium

    CN116192560A