Protection methods and control circuits for electronic components

By placing electronic components in a power-off state before updating the programmable controller code and controlling the power supply state using hardware circuitry, the problem of component damage during code updates is solved, thus achieving component protection and improved circuit stability.

CN115224672BActive Publication Date: 2026-04-03HILLSTONE NETWORKS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-08
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

When updating the code of a programmable controller, other electronic components may be damaged due to the power-on state, leading to malfunction.

Method used

Before updating the programmable controller code, the electronic components to be protected are placed in a power-off state, and the code is updated when the programmable controller is powered on. The power supply status is controlled by determining the programmer connection status through hardware circuitry.

Benefits of technology

This avoids unexpected power loss of electronic components during code updates, extending their service life and improving the stability of the control circuit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115224672B_ABST
    Figure CN115224672B_ABST
Patent Text Reader

Abstract

This application provides a protection method and control circuit for electronic components. The solution provided by this application controls the electronic components to a power-off state when it is determined that the code in the programmable controller needs to be updated. The code in the programmable controller is then updated only when the programmable controller is powered on and the electronic components are powered off. This avoids the problem of damage to the electronic components caused by updating the code in the programmable controller while the electronic components are powered on, thus extending the service life of the electronic components and improving the stability of the control circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic components technology, and more specifically, to a protection method and control circuit for electronic components. Background Technology

[0002] For circuits containing programmable logic controllers (PLCs) and other electronic components, the PLC typically stores control code used to control these components. When updating or upgrading the PLC's code, the PLC must first be powered on, then its existing code erased and new code written. Currently, the common practice is to power on the entire circuit, thus powering on the PLC. This method also powers on the other electronic components. Erasing the PLC's code while these other components are powered on can cause them to malfunction, such as due to unexpected power outages, potentially leading to damage. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, control circuit, and electronic device for protecting electronic components, so as to solve the above-mentioned technical problems.

[0004] In a first aspect, embodiments of this application provide a method for protecting electronic components, applied to a control circuit, the control circuit including a programmable controller and the electronic component to be protected; the method includes:

[0005] When it is determined that the code in the programmable controller needs to be updated, the electronic components are controlled to enter a power-off state;

[0006] When the programmable controller is powered on and the electronic components are powered off, the code in the programmable controller is updated.

[0007] In the above embodiments, updating the code in the programmable controller when the programmable controller is powered on and the electronic components are powered off can avoid the problem of damaging the electronic components caused by updating the code in the programmable controller when the electronic components are powered on. This can extend the service life of the electronic components and improve the stability of the control circuit.

[0008] As one possible implementation, the control circuit includes a programmer interface sub-circuit, and the determination that the code in the programmable controller needs to be updated includes:

[0009] When it is determined that the programmer is connected to the programmer interface sub-circuit, it is determined that the code in the programmable controller needs to be updated.

[0010] In the above implementation, when it is determined that the programmer is connected to the programmer interface sub-circuit, the programmable controller is controlled to be in the power-on state and the electronic components are controlled to be in the power-off state, so as to prevent the electronic components from being damaged due to accidental power loss caused by the programmable controller erasing internal code during the code update process.

[0011] As one possible implementation, the programmer interface sub-circuit includes a first pin and a second pin, the first pin being grounded and the second pin being pulled up; the control circuit also includes a power supply module for supplying power to the electronic components;

[0012] The step of determining that the programmer is connected to the programmer interface sub-circuit includes:

[0013] When the output signal of the second pin is a low level signal, it is determined that the programmer is connected to the programmer interface sub-circuit;

[0014] The control of the electronic components to be in a power-off state includes:

[0015] The low-level signal controls the power module to stop supplying power to the electronic components.

[0016] In the above implementation, the control circuit is determined by hardware circuitry. The circuit structure is simple. Once a programmer is connected, the second pin will output a low level, thereby controlling the electronic components to be in a power-off state.

[0017] As one possible implementation, the method further includes:

[0018] When the output signal of the second pin is a high-level signal, it is determined that the connection between the programmer and the programmer interface sub-circuit is disconnected, and the power module is controlled to supply power to the electronic components through the high-level signal.

[0019] In the above implementation, the connection between the programmer and the control circuit is determined by the hardware circuit. Once the connection is broken, the second pin will output a high level, thereby controlling the electronic components to power on.

[0020] As one possible implementation, the control circuit also includes a power control sub-circuit connected to the second pin;

[0021] The step of controlling the power module to stop supplying power to the electronic components via the low-level signal includes:

[0022] The power control sub-circuit controls the power module to stop supplying power to the electronic components based on the received low-level signal;

[0023] The step of controlling the power module to supply power to the electronic components via the high-level signal includes:

[0024] The power control sub-circuit controls the power module to supply power to the electronic components based on the received high-level signal.

[0025] In the above implementation, the power control sub-circuit controls the power module based on the received signal.

[0026] Secondly, embodiments of this application provide a control circuit, including: a programmable controller, an electronic component to be protected, a programmer interface sub-circuit, and a power supply module for supplying power to the electronic component;

[0027] The programmer interface sub-circuit is used to provide a programmer connection interface;

[0028] When it is necessary to update the code in the programmable controller, the output signal of the programmer interface sub-circuit controls the power module to stop supplying power to the electronic components.

[0029] As one possible implementation, the programmer interface sub-circuit includes a first pin and a second pin connected to the power module, wherein the first pin is grounded and the second pin is pulled up;

[0030] When the output signal of the second pin is a low-level signal, the power module is controlled to stop supplying power to the electronic components by the low-level signal.

[0031] When the output signal of the second pin is a high-level signal, the power supply module is controlled to supply power to the electronic components through the high-level signal.

[0032] As one possible implementation, the control circuit further includes a power control sub-circuit connected to the second pin; the power control sub-circuit is used to connect or disconnect the connection between the power module and the electronic components according to the output signal of the second pin.

[0033] In one possible implementation, the second pin is connected to the power module; when the power module receives the low-level signal, it stops supplying power to the electronic component; when the power module receives the high-level signal, it supplies power to the electronic component. Attached Figure Description

[0034] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 A flowchart illustrating the method for protecting electronic components provided in this application embodiment;

[0036] Figure 2 This is a partial structural schematic diagram of the control circuit provided in an embodiment of this application;

[0037] Figure 3 This is a first structural schematic diagram of the control circuit provided in an embodiment of this application;

[0038] Figure 4 This is a second structural schematic diagram of the control circuit provided in an embodiment of this application;

[0039] Figure 5 This is a third structural schematic diagram of the control circuit provided in an embodiment of this application. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0041] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of the present invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0042] In the description of this invention, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are performed, but are only used to facilitate the description of this invention and to distinguish each step, and therefore should not be construed as a limitation of this invention.

[0043] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0044] Example 1

[0045] Many existing electronic products typically use programmable logic controllers (PLCs) to control the power-down timing of internal electronic components. For example, firewalls often use programmable logic controllers (CPLDs) to control the CPU's power supply timing. When a firmware upgrade is required for the CPLD, both the CPLD and the CPU must be powered on first. During the firmware upgrade process, the control code stored in the CPLD is erased, which can cause the CPU to unexpectedly lose power. In other words, the CPU's power-down timing cannot be controlled as required, potentially damaging the CPU.

[0046] Therefore, embodiments of this application provide a method for protecting electronic components, which can be applied to any control circuit that includes a programmable controller and the electronic components to be protected.

[0047] The electronic component to be protected can be any electronic component in the control circuit, such as a processor, memory, or another programmable controller. The electronic component to be protected can also be an electronic component that can be controlled by the programmable controller, thereby avoiding the control of unrelated electronic components that are not related to the programmable controller to be in a power-off state, which would affect the normal operation of the unrelated electronic components.

[0048] For example, the programmable controller in this embodiment may store code for controlling the electronic component to be protected. For instance, it may store code for controlling the power supply to the electronic component, thus enabling control of the power supply. In addition, the programmable controller may also store code for controlling other electronic components.

[0049] Please see Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for protecting electronic components provided in an embodiment of this application. The protection method includes:

[0050] S11: When it is determined that the code in the programmable controller needs to be updated, the control electronic components are powered off.

[0051] S12: When the programmable controller is powered on and the electronic components are powered off, update the code in the programmable controller.

[0052] In this embodiment, updating the code in the programmable controller when the programmable controller is powered on and the electronic components are powered off can avoid the problem of damaging the electronic components caused by updating the code in the programmable controller when the electronic components are powered on. This can extend the service life of the electronic components and improve the stability of the control circuit.

[0053] The detailed implementation of this protection method will be described below.

[0054] It is understood that in step S11, the electronic component can be controlled to enter the power-off state by a programmable controller, another controller, or other hardware circuits in the control circuit.

[0055] In step S11, determining whether the code in the programmable controller needs to be updated can be done in several ways.

[0056] In one optional implementation, the control circuit may include a programmer interface sub-circuit. In this implementation, it can determine whether the programmer is connected to the programmer interface sub-circuit. If so, it is determined that the code in the programmable controller needs to be updated. Otherwise, it is determined that the code in the programmable controller does not need to be updated at present. When it is determined that the code in the programmable controller does not need to be updated at present, the electronic components can be controlled to enter the power-on state.

[0057] In another alternative implementation, it can be determined whether an update instruction issued by the user has been received. If it is determined that an update instruction issued by the user for updating the code in the programmable controller has been received, then it is determined that the code in the programmable controller needs to be updated.

[0058] In step S12, the code in the programmable controller is updated when the programmable controller is powered on and the electronic components are powered off.

[0059] Keeping the programmable controller (PLC) powered on is for subsequent code updates, while keeping electronic components powered off is to prevent accidental power loss during the code update process.

[0060] In some embodiments, the control circuit may further include a programmable controller power supply module for supplying power to the programmable controller, or the programmable controller may be powered by a power source other than the control circuit to put it into a powered-on state.

[0061] In this embodiment of the application, the code in the programmable controller can be updated using a programmer, and the specific process may include:

[0062] Connect the programmer to the programmer interface sub-circuit, erase the code in the programmable controller through the programmer, and then write the new code into the programmable controller through the programmer.

[0063] It should be noted that, in order to better protect electronic components, the electronic component can be kept in a power-off state while the code in the programmable controller is being updated.

[0064] There are several ways to determine whether the programmer is connected to the programmer interface sub-circuit. For example, it can be detected by a sensor or by hardware circuitry.

[0065] In one optional implementation, the programmer interface sub-circuit includes a first pin and a second pin, with the first pin grounded and the second pin pulled up. When the output level of the second pin is low, it is determined that the programmer is connected between the first and second pins, that is, it is determined that the programmer is correctly connected to the control circuit. At this time, the low level output of the second pin can be used to control the electronic component to be in a power-down state. In this embodiment, when the output level of the second pin is high, it can be determined that the programmer is not connected to the control circuit. At this time, the high level output of the second pin can be used to control the electronic component to be in a power-on state.

[0066] It should be noted that the control circuit may also include a power supply module for supplying power to the electronic components. In this embodiment, the power supply module can be controlled to stop supplying power to the electronic components by a low-level signal output from the second pin, that is, to control the electronic components to enter a power-down state. Alternatively, the power supply module can be controlled to supply power to the electronic components by a high-level signal output from the second pin, that is, to control the electronic components to enter a power-on state.

[0067] For example, the second pin can be directly connected to the power module. In this case, the output signal of the second pin can directly control the power module to turn on or off. When the power module is on, it can supply power to the electronic components; when the power module is off, it stops supplying power to the electronic components.

[0068] Please see Figure 2As shown in this embodiment, based on the JTAG (Joint Test Action Group) protocol, the first pin can be grounded and the second pin can be connected to a pull-up circuit. When the programmer is connected between the first and second pins, specifically, pin 2 of the JTAG programmer can be connected to the first pin and pin 10 of the JTAG programmer can be connected to the second pin. Due to the connection of the programmer, the second pin will become low. At this time, the low level output of the second pin can be used to control the power module to pause the power supply to the electronic components to be protected. That is, by controlling the power module to turn off, the electronic components are controlled to be in a power-down state. When the programmer is not connected to the control circuit, the second pin will output a high level because it is connected to the pull-up circuit. At this time, the high level output of the second pin can be used to control the power module to supply power to the electronic components to be protected. That is, by controlling the power module to turn on, the electronic components are controlled to be in a power-on state.

[0069] For example, the second pin can be connected to a power control sub-circuit. In this case, the power control sub-circuit can control the connection between the power module and the electronic components to disconnect based on a received low-level signal. The power control sub-circuit can also control the connection between the power module and the electronic components to connect based on a received high-level signal.

[0070] In the above implementation, the level signal output from the second pin can directly determine whether the programmer is connected to the programmer interface sub-circuit, thereby realizing the control of the power-on / power-off state of the electronic components to be protected. There is no need to introduce additional hardware devices for detection and judgment. For example, there is no need to introduce an additional processor to determine whether the programmer is connected, nor is there a need to introduce an additional processor to send control signals to control the power-on / power-off state of the electronic components to be protected. This simplifies hardware resource costs and achieves a simple structure.

[0071] For example, the control circuit in this application embodiment may include a circuit board, with the first pin and the second pin located on the circuit board, and the programmable controller, electronic components, programmer interface sub-circuit, and power module can all be disposed on the circuit board. Disposing of the programmable controller and electronic components on the same circuit board can save hardware resources.

[0072] In traditional implementations, when a programmable logic controller (PLC) and the protected electronic component are located on the same circuit board, powering on the circuit board will simultaneously power on both the PLC and the protected electronic component. Updating the code in the PLC at this time could potentially cause the electronic component to unexpectedly power down. However, the technical solution provided in this application allows the protected electronic component to automatically power down via a low-level output from the second pin when the programmer is connected to the control circuit. This prevents the electronic component from accidentally powering down during the process of updating the PLC's code.

[0073] The following section will provide a detailed explanation of methods for protecting electronic components using a practical application scenario.

[0074] When updating the code in the programmable controller (PLC), first power off the circuit board, connect the programmer between the first and second pins on the board, and then power on the board. After powering on, the board will detect a low-level output on the second pin. This low level will automatically power down the electronic component to be protected. Once the PLC is powered on and the electronic component is powered down, the code in the PLC can be updated. After updating the code in the PLC, disconnect the programmer from the control circuit. At this point, a high-level output on the second pin will be detected, and this high level will automatically power on the electronic component to be protected.

[0075] Example 2

[0076] Based on the same inventive concept, please refer to Figure 3 This application embodiment also provides a control circuit, including: a programmable controller 31, an electronic component 32 to be protected, a programmer interface sub-circuit 33, and a power module 34 for supplying power to the electronic component 32; the programmer interface sub-circuit 33 is used to provide a programmer connection interface; when it is necessary to update the code in the programmable controller, the power module 34 is controlled to stop supplying power to the electronic component 32 through the output signal of the programmer interface sub-circuit 33.

[0077] The programmer interface sub-circuit may include a first pin 331 and a second pin 332 connected to the power module. The first pin 331 is grounded and the second pin 332 is pulled up. When the output signal of the second pin 332 is a low-level signal, the power module 34 is controlled to stop supplying power to the electronic component 32 through the low-level signal. When the output signal of the second pin 332 is a high-level signal, the power module 34 is controlled to supply power to the electronic component 32 through the high-level signal.

[0078] Please see Figure 4As shown, the control circuit may further include a power control sub-circuit 35 connected to the second pin 332; the power control sub-circuit 35 is used to control the power module 34 to supply power to the electronic component 32 or to pause supplying power to the electronic component 32 according to the output signal of the second pin 332. Specifically, the power control sub-circuit 35 is used to connect or disconnect the connection between the power module 34 and the electronic component 32 according to the output signal of the second pin 332.

[0079] Please see Figure 5 As shown, the second pin 332 is connected to the power supply module 34; when the power supply module 34 receives a low-level signal, it stops supplying power to the electronic component 32; when the power supply module 34 receives a high-level signal, it supplies power to the electronic component 32.

[0080] It should be understood that, for the sake of brevity, some of the content described in Embodiment 1 will not be repeated in this embodiment.

[0081] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0083] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for protecting electronic components, characterized in that, The method is applied to a control circuit, which includes a programmable controller and electronic components to be protected; the method includes: When it is determined that the code in the programmable controller needs to be updated, the electronic components are controlled to enter a power-off state; When the programmable controller is powered on and the electronic components are powered off, the code in the programmable controller is updated. The control circuit includes a programmer interface sub-circuit, and the step of determining that the code in the programmable controller needs to be updated includes: when it is determined that the programmer is connected to the programmer interface sub-circuit, it is determined that the code in the programmable controller needs to be updated; The programmer interface sub-circuit includes a first pin and a second pin, the first pin being grounded and the second pin being pulled up; the control circuit also includes a power supply module for supplying power to the electronic components; The step of determining that the programmer is connected to the programmer interface sub-circuit includes: determining that the programmer is connected to the programmer interface sub-circuit when the output signal of the second pin is a low-level signal; The control of the electronic components to be in a power-off state includes: controlling the power module to stop supplying power to the electronic components through the low-level signal.

2. The method for protecting electronic components as described in claim 1, characterized in that, The method further includes: When the output signal of the second pin is a high-level signal, it is determined that the connection between the programmer and the programmer interface sub-circuit is disconnected, and the power module is controlled to supply power to the electronic components through the high-level signal.

3. The method for protecting electronic components as described in claim 2, characterized in that, The control circuit also includes a power control sub-circuit connected to the second pin; The step of controlling the power module to stop supplying power to the electronic components via the low-level signal includes: The power control sub-circuit controls the connection between the power module and the electronic component to be disconnected based on the received low-level signal; The step of controlling the power module to supply power to the electronic components via the high-level signal includes: The power control sub-circuit controls the connection between the power module and the electronic components based on the received high-level signal.

4. The method for protecting electronic components as described in claim 2, characterized in that, The second pin is connected to the power module; The step of controlling the power module to stop supplying power to the electronic components via the low-level signal includes: When the power module receives the low-level signal, it stops supplying power to the electronic components. The step of controlling the power module to supply power to the electronic components via the high-level signal includes: When the power module receives the high-level signal, it supplies power to the electronic components.

5. A control circuit, characterized in that, include: The programmable controller, the electronic components to be protected, the programmer interface sub-circuit, and the power supply module for supplying power to the electronic components; The programmer interface sub-circuit is used to provide a programmer connection interface; When it is necessary to update the code in the programmable controller, the output signal of the programmer interface sub-circuit controls the power module to stop supplying power to the electronic components. The programmer interface sub-circuit includes a first pin and a second pin, the first pin being grounded and the second pin being pulled up; when the output signal of the second pin is a low-level signal, the power supply module is controlled to stop supplying power to the electronic components through the low-level signal; when the output signal of the second pin is a high-level signal, the power supply module is controlled to supply power to the electronic components through the high-level signal.

6. The control circuit as described in claim 5, characterized in that, The control circuit further includes a power control sub-circuit connected to the second pin; the power control sub-circuit is used to connect or disconnect the connection between the power module and the electronic components according to the output signal of the second pin.

7. The control circuit as described in claim 5, characterized in that, The second pin is connected to the power supply module; when the power supply module receives the low-level signal, it stops supplying power to the electronic component; when the power supply module receives the high-level signal, it supplies power to the electronic component.

Citation Information

Patent Citations

  • System and method for updating firmware in real time

    CN106354524A