Device control method, device, energy storage device, and storage medium
By obtaining the physical and communication connection status between the device and external devices and updating the communication connection status to avoid startup abnormalities, the problem of misjudgment of the device when the connection status does not match is solved, and the reliability and stability of the device are improved.
Patent Information
- Application Number
- CN202210833718.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-07-15
AI Technical Summary
The device is prone to abnormalities during the startup process, especially when it fails to boot normally after repeated power on and off, resulting in abnormal device startup.
By obtaining the physical connection status and communication connection status between the device and the external device, when it is determined that the physical connection status is physically absent and the communication connection status is communication present, the communication connection status is updated to the communication absent status, avoiding the use of the delayed communication connection status and the current physical connection status for power-on judgment.
Improves the reliability and stability of the device, avoids abnormal startup, and ensures that the device is not mistakenly booted when the connection status does not match.
Smart Images

Figure CN115343980B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of device control, and in particular to a device control method, device, energy storage device and storage medium. Background Art
[0002] During the connection process between some devices, the target device needs to determine whether to power on based on the external device's connectivity to avoid potential safety incidents caused by powering on without the external device properly connected. Traditional devices are prone to power failure during the power-on process, especially when repeatedly powered on and off, resulting in abnormal device startup.
[0003] Therefore, how to solve the abnormal startup of the device has become an urgent problem to be solved. Summary of the Invention
[0004] The present application provides a device control method, device, energy storage device and storage medium, which solve the problem of abnormal device startup.
[0005] In a first aspect, the present application provides a method for controlling a device, the method comprising:
[0006] Acquire a physical connection state between the device and an external device, wherein the physical connection state includes a physically present state and a physically absent state;
[0007] Acquiring a communication connection state between the device and the external device, wherein the communication connection state includes a communication in place state and a communication out of place state;
[0008] When the physical connection state is the physical absence state and the communication connection state is the communication presence state, the communication connection state is updated to the communication absence state.
[0009] In a second aspect, the present application further provides a device, comprising a device body and a controller; the controller is configured to execute the computer program and implement the device control method as described above when executing the computer program.
[0010] In a third aspect, the present application further provides an energy storage device, the energy storage device comprising a battery module, a charge and discharge circuit, a processor, and a memory;
[0011] The charging and discharging circuit is used to charge or discharge the battery module after the energy storage device is turned on;
[0012] The memory is used to store computer programs;
[0013] The processor is configured to execute the computer program and implement the control method of the device as described above when executing the computer program.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the control method of the device as described above.
[0015] The present application discloses a control method for a device, a device, an energy storage device and a storage medium. By acquiring the physical connection status between the device and an external device, it is possible to know whether the physical connection status between the device and the external device is in a physically present state or a physically absent state; by acquiring the communication connection status between the device and the external device, it is possible to know whether the communication connection status between the device and the external device is in a communication present state or a communication absent state; by updating the communication connection status to a communication absent state when the physical connection status is a physically absent state and the communication connection status is a communication present state, abnormal device startup caused by using the last delayed communication connection status and the current physical connection status for startup judgment is avoided, thereby improving the reliability and stability of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. 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 any creative work.
[0017] Figure 1 This is a schematic diagram of the structure of a device provided in an embodiment of the present application;
[0018] Figure 2 This is a schematic structural diagram of an energy storage device provided in an embodiment of the present application;
[0019] Figure 3 is a schematic flow chart of a control method for a device provided in an embodiment of the present application;
[0020] Figure 4 This is a schematic diagram of a physical connection state and a communication connection state in a device control method provided in an embodiment of the present application;
[0021] Figure 5 This is a schematic diagram of updating the communication connection status provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0023] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0024] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0026] The embodiments of the present application provide a device control method, device, energy storage device, and storage medium. The device control method can be applied to the device. By obtaining the physical connection status and communication connection status between the device and an external device, when the physical connection status is the physically absent state and the communication connection status is the communication present state, the communication connection status is updated to the communication absent state, thereby avoiding the use of the last delayed communication connection status and the current physical connection status for power-on determination, thereby resolving the problem of abnormal device power-on.
[0027] See also Figure 1 , Figure 1 1 is a schematic diagram of a device according to an embodiment of the present application. The device 100 includes a controller 101, wherein the controller 101 is configured to execute a control method for a device according to any embodiment of the present application.
[0028] The device 100 may be an energy storage device. The controller 101 may be a microcontroller unit (MCU), or other processors. It is understood that the device 100 may also be other devices that require hardware and software to be present when powered on.
[0029] Exemplarily, the controller 101 obtains the physical connection status between the device 100 and the external device, where the physical connection status includes a physical presence state and a physical absence state. The controller 101 obtains the communication connection status between the device 100 and the external device, where the communication connection status includes a communication presence state and a communication absence state. When the physical connection status is the physical absence state and the communication connection status is the communication presence state, the controller 101 updates the communication connection status to the communication absence state.
[0030] See also Figure 2 , Figure 2 1 is a schematic diagram of the structure of an energy storage device provided in an embodiment of the present application. Energy storage device 1000 may include a processor 1001, a memory 1002, a charge-discharge circuit 1003, and a battery module 1004. The processor 1001, the memory 1002, the charge-discharge circuit 1003, and the battery module 1004 may be connected via a bus, such as an I2C (Inter-Integrated Circuit) bus or any other suitable bus.
[0031] Memory 1002 may include a storage medium and internal memory. The storage medium may be either a non-volatile storage medium or a volatile storage medium. The storage medium may store an operating system and a computer program. The internal memory provides an environment for executing the computer program stored in the storage medium. The computer program includes program instructions that, when executed, cause the processor 1001 to execute a device control method provided in any embodiment of the present application.
[0032] The charge and discharge circuit 1003 is used to charge or discharge the battery module 1004 after the energy storage device 1000 is turned on. The specific circuit structure of the charge and discharge circuit 1003 is not limited here.
[0033] For example, when the external device connected to the energy storage device 1000 is a power-consuming device, the charge-discharge circuit 1003 can discharge the battery module 1004 to power the external device. When the external device connected to the energy storage device 1000 is a power supply device, the charge-discharge circuit 1003 charges the battery module 1004 based on the power input from the power supply device.
[0034] Among them, the processor 1001 is used to provide computing and control capabilities to support the operation of the energy storage device 1000.
[0035] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0036] In one embodiment, the processor 1001 is configured to run a computer program stored in the memory 1002 and implement the following steps when executing the computer program:
[0037] Obtain the physical connection status between the device and the external device, the physical connection status includes a physically present state and a physically absent state; obtain the communication connection status between the device and the external device, the communication connection status includes a communication present state and a communication absent state; when the physical connection status is the physically absent state and the communication connection status is the communication present state, update the communication connection status to the communication absent state.
[0038] In one embodiment, the processor 1001 is further configured to implement:
[0039] When the physical connection state is the physical in-place state and the communication connection state is the communication in-place state, a power-on instruction is generated; the power-on instruction is used to control the power-on of the device.
[0040] In one embodiment, the processor 1001 is further configured to implement:
[0041] A first control instruction is received, and the first control instruction is used to instruct the device to power on; within a preset time period after receiving the first control instruction, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated; the power-on instruction is used to control the device to power on.
[0042] In one embodiment, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, the processor 1001 generates a power-on instruction to implement:
[0043] When the physical connection state is the physical in-place state, a physical identifier of the physical in-place state is obtained; when the communication connection state is the communication in-place state, a communication identifier of the communication in-place state is obtained; when the physical identifier and the communication identifier match, a power-on instruction is generated.
[0044] In one embodiment, the processor 1001 is further configured to implement:
[0045] When the physical identifier and the communication identifier do not match, the communication connection state is updated to a communication not in place state.
[0046] In one embodiment, the processor 1001 is further configured to implement:
[0047] Within a preset time period after receiving the first control instruction, when the physical connection state is the physical absence state or the communication connection state is the communication absence state, the first control instruction is cleared.
[0048] In one embodiment, the processor 1001 is further configured to implement:
[0049] When the physical connection state is the physical absence state or the communication connection state is the absence state, a shutdown instruction is generated, and the shutdown instruction is used to control the device to shut down.
[0050] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other unless they conflict. The device control method provided in the embodiments of the present application can be applied to a scenario where a device establishes a connection with an external device, with the device being the executing entity.
[0051] Figure 3 FIG1 shows a schematic flow chart of a control method of a device provided in an embodiment of the present application. Figure 3 As shown, the device control method includes steps S10 to S30.
[0052] Step S10: Acquire the physical connection status between the device and the external device, where the physical connection status includes a physically present state and a physically absent state.
[0053] In step S10, the physical connection status is used to represent the electrical connection between the device and the external device. The physical connection status is a physical presence status, indicating that an electrical connection is established between the device and the external device. The physical connection status is a physical absence status, indicating that no electrical connection is established between the device and the external device.
[0054] It should be noted that the device and the external device can be electrically connected via a physical connection port. In other words, the external device is a device that can establish a physical connection relationship with the device.
[0055] For example, the physical connection status between the device and the external device can be detected in real time. The physical connection status includes a physically present state and a physically absent state. The physical connection status can be determined by a level signal. For example, a high level indicates that the physical connection status is a physically present state, while a low level indicates that the physical connection status is a physically absent state.
[0056] Step S20: Acquire the communication connection status between the device and the external device, where the communication connection status includes a communication in place state and a communication out of place state.
[0057] In this embodiment, the communication connection status is used to indicate the status of the communication handshake between the device and the external device.
[0058] For example, the communication connection status between the device and the external device can be detected in real time, and the communication connection status includes a communication-in-place state and a communication-out-place state. The communication connection status can be an indication state generated after attempting to handshake with the external device. For example, after a successful handshake with the external device, the communication connection status is a communication-in-place state, and after a failed handshake with the external device, the communication connection status is a communication-out-place state.
[0059] Based on the above example, illustratively, attempting to perform a handshake operation with an external device specifically includes: sending a handshake request message to the external device; if a response message is received from the external device based on the handshake request message within a certain period of time, determining that the handshake is successful; if no response message is received from the external device based on the handshake request message within a certain period of time, determining that the handshake has failed.
[0060] As another example, the communication connection state may also be determined by a level signal. For example, a high level indicates that the communication connection state is in a communication state, and a low level indicates that the communication connection state is in a communication state.
[0061] By acquiring the communication connection status between the device and the external device, it can be known whether the communication connection status between the device and the external device is in a communication-in-place state or a communication-out-place state.
[0062] Step S30: When the physical connection state is the physical absent state and the communication connection state is the communication present state, update the communication connection state to the communication absent state.
[0063] Exemplarily, when it is detected that the physical connection state is the physical absence state and the communication connection state is the communication presence state, the communication connection state is updated to the communication absence state.
[0064] By updating the communication connection state to the communication not-in-place state when the physical connection state is the physically not-in-place state and the communication connection state is the communication in-place state, it is possible to avoid startup erroneous operations caused by using the last delayed communication connection state and the current physical connection state for startup judgment during a new startup operation, thereby solving the problem of abnormal startup of the device and improving the reliability and stability of the device.
[0065] To better illustrate the effect of this embodiment, a comparative explanation is given below in conjunction with a traditional control method.
[0066] See also Figure 4 , Figure 4 This is a schematic diagram of the physical connection state and communication connection state of a device provided in an embodiment of the present application. Figure 4 As shown, a schematic diagram of instruction generation under the method of using traditional control method to perform power on and off operations. In the traditional method, as long as the physical connection and communication connection are detected at the same time, a power on instruction is generated, and if one of them is not in place, a power off instruction is generated.
[0067] Taking the target device as an execution subject as an example, the target device needs to determine whether to be powered on according to the physical connection status and the communication connection status between the target device and the external device. Figure 4 In the embodiment, whether it is a physical connection state or a communication connection state, a high level is used to represent a state of being in place, and a low level is used to represent a state of being out of place. Of course, in other embodiments, the opposite setting can also be used.
[0068] exist Figure 4 In the embodiment of the present invention, when it is detected at time T0 that the physical connection state is the physically present state and the communication connection state is the communication present state, a power-on instruction is generated. If the electrical connection between the target device and the external device is disconnected at this time, the physical connection state between the target device and the external device changes from the physically present state to the physically absent state. Since the communication connection state is provided with a delayed shutdown function, the communication connection state at this time is still the communication present state. If the physical connection between the target device and the external device is re-established, the physical connection state between the target device and the external device changes from the physically absent state to the physically present state, and the communication connection state is still the communication present state.
[0069] For example, in Figure 4 In the communication connection state, when the communication presence state is within the delay time of T1-T3, if the physical connection state switches from the physical presence state to the physical absence state and then switches to the physical presence state, then the physical connection state between the device and the external device is the physical presence state, and the device generates a power-on instruction under the combined effect of the physical presence state and the communication presence state corresponding to the previous physical presence state.
[0070] For example, in Figure 4 In the example, at time T1, the physical connection status switches from physically present to physically absent, and at time T2, the physical connection status switches from physically absent to physically present. During repeated startups from T2 to T4, if the communication connection status switches from communication present to communication absent due to the expiration of the delay at time T3, the device will mistakenly determine that a shutdown operation is required, resulting in a power outage and abnormal startup.
[0071] In the embodiment of the present application, by updating the communication connection state to the communication not in place state when the physical connection state is the physical not in place state and the communication connection state is the communication in place state, it is possible to avoid using the last delayed communication connection state and the current physical connection state for power-on judgment, thereby solving the problem of abnormal power-on of the target device, that is, it is possible to solve the problem of abnormal power-on of the target device. Figure 4 Problems that exist in .
[0072] See also Figure 5 , Figure 5 This is a schematic diagram of updating the communication connection status provided by the embodiment of the present application. Figure 5 As shown, during the time period T1-T2, the physical connection state is the physical absence state and the communication connection state is the communication presence state, and the level signal corresponding to the communication connection state can be adjusted to a low level.
[0073] It is understandable that in order to avoid the problem of misjudgment of power on due to the communication connection state being in the communication in place state within the delay time, and the physical connection state switching from the physical in place state to the physical not in place state and then switching back to the physical in place state, when it is detected that the physical connection state is the physical not in place state and the communication connection state is the communication in place state, the communication connection state is switched from the communication in place state to the communication not in place state, so that after the device is connected to the external device again, the power on judgment can be made with the new physical connection state and the new communication connection state. Figure 5 When the communication connection state switches to the communication not in place state, there will be a certain delay relative to the change of the physical connection state. This delay is mainly determined by the response speed of the system. The figure is just a schematic diagram.
[0074] In some embodiments, the control method of the device provided in the embodiments of the present application may further include: generating a power-on instruction when the physical connection state is a physical presence state and the communication connection state is a communication presence state; wherein the power-on instruction is used to control the power-on of the device.
[0075] It should be noted that in the embodiment of the present application, a power-on instruction is generated only when the physical connection state is the physical presence state and the communication connection state is the communication presence state, so that the device is powered on according to the power-on instruction. When the level signal corresponding to the physical connection state is high, the physical connection state is determined to be the physical presence state. When the level signal corresponding to the communication connection state is high, the communication connection state is determined to be the communication presence state.
[0076] By generating a power-on instruction when it is determined that the physical connection state is the physical presence state and the communication connection state is the communication presence state, it is possible to control the power-on of the device according to the power-on instruction.
[0077] In other embodiments, the control method of the device provided in the embodiments of the present application may further include: generating a shutdown instruction when the physical connection state is a physically absent state or the communication connection state is an absent state, and the shutdown instruction is used to control the shutdown of the device.
[0078] For example, in Figure 5 In the T1-T2 time period or the T3-T4 time period, when the level signal corresponding to the physical connection state is detected to be low or the level signal corresponding to the communication connection state is detected to be low, a shutdown instruction is generated.
[0079] By generating a shutdown instruction when determining that the physical connection state is the physical absence state or the communication connection state is the absence state, it is possible to control the device to shut down according to the shutdown instruction.
[0080] In some embodiments, the control method of the device provided in the embodiments of the present application may also include: receiving a first control instruction, the first control instruction is used to instruct the device to power on; within a preset time period after receiving the first control instruction, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, generating a power-on instruction; the power-on instruction is used to control the device to power on.
[0081] Illustratively, the first control instruction may be generated based on a user triggering a power button on the device, and is used to instruct the device to power on.
[0082] It should be noted that, in the embodiment of the present application, the user can power on the device by pressing a power button on the device. For example, the user can trigger the power button to start the device.
[0083] In some embodiments, when a trigger operation of a power button is detected, a first control instruction is generated based on the trigger operation. Then, within a preset duration after receiving the first control instruction, when the physical connection state is the physically present state and the communication connection state is the communication present state, a power-on instruction is generated; and then, the power-on operation is executed based on the power-on instruction. The preset duration can be set based on actual circumstances, and the specific value is not limited herein.
[0084] Exemplarily, within a preset time period after receiving the first control instruction, when the physical connection state is detected to be the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated. For example, within a preset time period after receiving the first control instruction, when the level signal corresponding to the physical connection state is detected to be a high level and the level signal corresponding to the communication connection state is detected to be a high level, a power-on instruction is generated.
[0085] By receiving a first control instruction and within a preset time period after receiving the first control instruction, when it is determined that the physical connection state is the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated, and the device can be powered on according to the user's operation of triggering the power button.
[0086] In other embodiments, the control method of the device provided in the embodiments of the present application may also include: within a preset time period after receiving the first control instruction, when the physical connection status is a physically absent state or the communication connection status is a communication absent state, clearing the first control instruction.
[0087] Exemplarily, when the physical connection state is detected to be a physical absence state or the communication connection state is an absence state, the first control instruction is cleared. When the level signal corresponding to the physical connection state is detected to be a low level or the level signal corresponding to the communication connection state is detected to be a low level, the first control instruction is cleared.
[0088] By clearing the first control instruction within a preset time period after receiving the first control instruction, when it is determined that the physical connection state is a physically absent state or the communication connection state is a communication absent state, the device can be prevented from starting up, thereby preventing the device from abnormally powering off during the startup process.
[0089] In some embodiments, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, generating a power-on instruction may include: when the physical connection state is the physical presence state, obtaining a physical identifier of the physical presence state; when the communication connection state is the communication presence state, obtaining a communication identifier of the communication presence state; and when the physical identifier and the communication identifier match, generating a power-on instruction.
[0090] As an example, the physical identifier is used to identify the physical uniqueness of the external device, and the communication identifier is used to identify the communication uniqueness of the external device. For example, the physical identifier can be at least one of the external device's input interface identifier, output interface identifier, and physical address; correspondingly, the communication identifier can be at least one of the external device's input interface identifier, output interface identifier, and physical address. For another example, the communication identifier can be a mapping identifier of the physical identifier, such as at least one of the mapping number of the external device's input interface identifier, the mapping number of the output interface identifier, and the mapping number of the physical address.
[0091] For example, when a first external device is connected and the level signal corresponding to the physical connection state is detected to be high, a physical identifier corresponding to the physical presence state is obtained, such as the interface address 001 of the first external device. When the level signal corresponding to the communication connection state is detected to be high, a communication identifier corresponding to the communication presence state is obtained, such as the mapping number A1 of the first external device. Since the interface address 001 of the first external device serves as the physical identifier, it matches the mapping number A1 of the first external device, thereby generating a power-on instruction.
[0092] By obtaining the physical identifier of the physical presence state and the communication identifier of the communication presence state, and generating a power-on instruction when the physical identifier and the communication identifier match, it is possible to avoid mixing the hardware presence and the communication presence after different external devices are connected to the device on the same interface in sequence, thereby avoiding the device from being mistakenly triggered to start up.
[0093] In some embodiments, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated, which may also include: when the physical identifier and the communication identifier do not match, re-acquiring a new physical identifier and comparing it with the new communication identifier; when the new physical identifier and the new communication identifier match, generating a power-on instruction.
[0094] Based on the above example, as another example, after disconnecting the first external device, connecting a second external device, and detecting that the level signal corresponding to the physical connection state is high, obtain the physical identifier corresponding to the physical presence state. Assume that the physical identifier obtained at this time is the interface address 002 of the second external device. Simultaneously, obtain the communication connection state. When the communication connection state is the communication presence state, obtain the communication identifier of the external device in communication connection. If the communication identifier at this time is A2, then the physical identifier and the communication identifier do not match, and no power-on command will be generated. If the two obtained identifiers still do not match within the preset time, then the received power-on control command is discarded.
[0095] As another example, the physical identifier can also be used to uniquely identify the physical presence state, and the communication identifier can also be used to uniquely identify the communication presence state. For example, the physical identifier can be the period sequence number or period number of the physical presence state, or the time when the physical presence state occurs; the communication identifier can be the period sequence number or period number of the communication presence state, or the time when the communication presence state occurs.
[0096] Exemplarily, when the level signal corresponding to the physical connection state is detected to be high, the physical identifier corresponding to the physical presence state is obtained, for example, identifier A. When the level signal corresponding to the communication connection state is detected to be high, the communication identifier corresponding to the communication presence state is obtained, for example, identifier B.
[0097] For example, when identifier A is a cycle number and identifier B is a cycle number, if identifiers A and B are the same, a power-on instruction can be generated. For another example, when identifier A is the time when the physical presence state is generated and identifier B is the time when the communication presence state is generated, if identifiers A and B are the same, a power-on instruction can be generated.
[0098] By obtaining the physical identifier of the physical presence state and the communication identifier of the communication presence state, and generating a power-on instruction when the physical identifier and the communication identifier match, it is possible to generate a power-on instruction based on the physical presence state and the communication presence state in the same cycle, thereby avoiding using the last communication presence state and the current physical presence state to generate a power-on instruction, which may lead to a power-on misjudgment.
[0099] In other embodiments, the control method of the device provided in the embodiments of the present application may further include: when the physical identifier and the communication identifier do not match, updating the communication connection state to a communication not in place state.
[0100] Exemplarily, when it is determined that the physical identifier and the communication identifier do not match, the communication connection state is updated to the communication not in place state. For example, when it is determined that identifier A and identifier B do not match, the communication connection state is switched from the communication in place state to the communication not in place state.
[0101] By updating the communication connection status to the communication not-in-place state when the physical identifier and the communication identifier do not match, the device can be prevented from starting up, thereby avoiding using the last communication in-place state and the current physical in-place state to generate a power-on instruction, which would cause a power-on misjudgment, thereby improving the reliability and stability of the device.
[0102] The control method of the device provided by the above embodiment can know whether the physical connection status between the device and the external device is in a physically present state or a physically absent state by obtaining the physical connection status between the device and the external device; can know whether the communication connection status between the device and the external device is in a communication present state or a communication absent state by obtaining the communication connection status between the device and the external device; by updating the communication connection status to a communication absent state when the physical connection status is a physically absent state and the communication connection status is a communication present state, it can avoid using the last delayed communication connection status and the current physical connection status for power-on judgment, solves the problem of abnormal power-on of the device, and improves the reliability and stability of the device; by generating a power-on instruction when it is determined that the physical connection status is a physically present state and the communication connection status is a communication present state, it can be realized according to the power-on instruction The control device is turned on; by clearing the first control instruction within a preset time period after receiving the first control instruction, when it is determined that the physical connection state is the physical absence state or the communication connection state is the communication absence state, the first control instruction can be cleared, so that the device can be prevented from being turned on, and thus the device can be prevented from being abnormally powered off during the startup process; by obtaining the physical identifier of the physical presence state and the communication identifier of the communication presence state, and generating a startup instruction when the physical identifier and the communication identifier match, it can be avoided that different external devices are connected to the device at the same interface in sequence, resulting in the mixing of hardware presence and communication presence, and the device is mistakenly triggered to start up; by updating the communication connection state to the communication absence state when the physical identifier and the communication identifier do not match, the device can be prevented from being turned on, and thus the use of the last communication presence state and the current physical presence state to generate a startup instruction can be avoided, resulting in a startup misjudgment, thereby improving the reliability and stability of the device.
[0103] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement the control method of any device provided in the embodiment of the present application.
[0104] For example, when the program is loaded by the processor, the following steps may be performed:
[0105] Obtain a physical connection state between the device and an external device, the physical connection state including a physically present state and a physically absent state; obtain a communication connection state between the device and the external device, the communication connection state including a communication present state and a communication absent state; when the physical connection state is a physically absent state and the communication connection state is a communication present state, update the communication connection state to a communication absent state.
[0106] The computer-readable storage medium may be an internal storage unit of the electronic device described in the aforementioned embodiment, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD card), a flash memory card, etc. equipped on the electronic device.
[0107] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0108] The blockchain referred to in this application is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0109] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for controlling a device, characterized in that: include: Acquiring a physical connection state between the device and the external device, the physical connection state including a physically present state and a physically absent state, the physical connection state being used to characterize an electrical connection between the device and the external device, the physical connection state being determined by a level signal; Acquire a communication connection state between the device and the external device, the communication connection state including a communication in place state and a communication not in place state, the communication connection state being used to indicate a state of a communication handshake between the device and the external device; wherein, if the handshake between the device and the external device succeeds, the communication connection state is a communication in place state; and if the handshake between the device and the external device fails, the communication connection state is a communication not in place state; When the physical connection state is the physical absence state and the communication connection state is the communication presence state, the communication connection state is updated to the communication absence state.
2. The device control method according to claim 1, characterized in that: The method further comprises: When the physical connection state is the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated; the power-on instruction is used to control the device to power on.
3. The device control method according to claim 1, characterized in that: The method further comprises: receiving a first control instruction, where the first control instruction is used to instruct the device to power on; Within a preset time period after receiving the first control instruction, when the physical connection state is the physical presence state and the communication connection state is the communication presence state, a power-on instruction is generated; the power-on instruction is used to control the device to power on.
4. The control method of the device according to claim 2 or 3, characterized in that: The generating of the power-on instruction when the physical connection state is the physical in-place state and the communication connection state is the communication in-place state includes: When the physical connection state is a physical presence state, obtaining a physical identifier of the physical presence state; When the communication connection state is a communication in place state, obtaining a communication identifier of the communication in place state; When the physical identifier and the communication identifier match, the power-on instruction is generated.
5. The method for controlling the device according to claim 4, characterized in that: The method further comprises: When the physical identifier and the communication identifier do not match, the communication connection state is updated to a communication not in place state.
6. The method for controlling the device according to claim 3, wherein: The method further comprises: Within a preset time period after receiving the first control instruction, when the physical connection state is a physical absence state or the communication connection state is a communication absence state, the first control instruction is cleared.
7. The method for controlling the device according to claim 1, wherein: The method further comprises: When the physical connection state is a physical absence state or the communication connection state is an absence state, a shutdown instruction is generated, where the shutdown instruction is used to control the device to shut down.
8. A device, characterized in that The device comprises a device body and a controller, wherein the controller is used to execute the control method of the device according to any one of claims 1 to 7.
9. An energy storage device, characterized in that: Including battery module, charging and discharging circuit, processor and memory; The charging and discharging circuit is used to charge or discharge the battery module after the energy storage device is turned on; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the control method of the device according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the control method of the device according to any one of claims 1 to 7.
Citation Information
Patent Citations
Electric energy output method of energy storage equipment and energy storage equipment
CN114665545A