Server and its button control method

By using interactive confirmation methods for server buttons, timing and detecting interactive information, the problem of false responses caused by abnormalities such as button aging and poor contact is solved, thereby improving the reliability and stability of the system.

CN115657929BActive Publication Date: 2026-07-17XFUSION DIGITAL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XFUSION DIGITAL TECH CO LTD
Filing Date
2022-09-26
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Server button aging, poor contact, or failure to rebound can cause erroneous responses, affecting system stability and reliability.

Method used

The duration of button activation is timed through interactive confirmation to determine the operation to be performed. Detection is performed within the interaction duration to obtain interaction information to determine whether to perform the operation, thus avoiding false responses caused by button malfunctions or accidental user touches.

Benefits of technology

This improves the system reliability of the server, avoids false responses caused by abnormal key presses or accidental user touches, and enhances system stability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115657929B_ABST
    Figure CN115657929B_ABST
Patent Text Reader

Abstract

This application provides a server and its key control method. The method includes: when a server key is triggered, timing the duration of the key trigger to obtain a first duration; determining an operation to be performed based on the first duration; after determining the operation to be performed, detecting the key within the interaction duration to obtain interaction information, the interaction information indicating that the key was triggered within the interaction duration; and confirming whether to execute the operation based on the interaction information. This interactive confirmation method avoids server malfunctions caused by key abnormalities or accidental key presses by the user, thus improving system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of button control technology, and in particular to a server and its button control method. Background Technology

[0002] The server has numerous buttons, such as a power button, and different button actions have defined corresponding response results. For example, a short press of the power button when the server is powered off indicates that the server is powered on, while a long press of the power button when the server is powered on indicates that the server is forced to power off.

[0003] However, in practical applications, server buttons often experience abnormalities such as aging, poor contact, or failure to rebound, or users may accidentally press the buttons, leading to erroneous server responses. For example, aging and failure of buttons can easily cause frequent interruption reports, resulting in system resources being preempted, system freezing, and business migration. Alternatively, buttons may become stuck and fail to rebound, causing the server to be forcibly powered down. Summary of the Invention

[0004] This application provides a server and its button control method, which can avoid server malfunctions caused by abnormal buttons or accidental button presses by users through interactive confirmation, thereby improving system reliability.

[0005] In a first aspect, embodiments of this application provide a button control method, the method comprising:

[0006] When a server button is triggered, the duration of the button being triggered is timed to obtain a first duration;

[0007] Based on the first duration, determine the operation to be performed;

[0008] After determining the operation to be performed, the button is detected within the interaction time to obtain interaction information, which is used to indicate that the button was triggered within the interaction time.

[0009] Based on the interaction information, determine whether to execute the operation to be performed.

[0010] In other words, after a server button is triggered and the operation to be performed is confirmed, the operation is not executed immediately. Instead, the button is checked within the interaction time, and the results of the checks (i.e., the interaction information mentioned above) are used to determine whether the operation to be performed is due to abnormalities such as button aging, poor contact, or failure to rebound, or due to accidental button press by the user. In other words, the interaction confirmation method avoids server erroneous responses caused by button abnormalities or accidental button presses by the user, thereby improving system reliability.

[0011] In one possible implementation, the interaction information includes a second duration during which the button is triggered within the interaction duration. The step of detecting the button within the interaction duration to obtain the interaction information, when the operation to be performed is determined, includes:

[0012] After determining the operation to be performed, if the button is detected to be triggered within the interaction time, the duration for which the button is triggered within the interaction time is timed to obtain the second duration.

[0013] In one possible implementation, determining whether to execute the operation to be executed based on the interaction information includes:

[0014] If the operation to be performed is a long press operation, and the button is not triggered within the interaction time, then the long press operation will not be performed.

[0015] If the button is triggered within the interaction duration and the second duration is less than the first threshold, then the long press operation is performed;

[0016] If the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold, the long press operation is not performed and an alarm is issued, where the first threshold is less than the interaction duration.

[0017] In one possible implementation, determining whether to execute the operation to be executed based on the interaction information includes:

[0018] If the operation to be performed is a short press, and the button is not triggered within the interaction duration, then the short press operation is performed.

[0019] If the button is triggered within the interaction duration and the second duration is less than the second threshold, the short press operation will not be performed and an alarm will be issued.

[0020] If the button is triggered within the interaction duration and the second duration is greater than or equal to the second threshold, then the short press operation is not performed, where the second duration threshold is less than the interaction duration.

[0021] In one possible implementation, the alarm is issued by the baseboard controller of the server.

[0022] In one possible implementation, determining the operation to be performed based on the first duration includes:

[0023] When the server is powered on, if the first duration reaches a preset duration, the operation to be performed is a long press operation, which is used to indicate that the server is powered off.

[0024] If the first duration has not reached the preset duration when the server is powered off, the operation to be performed is a short press operation, which is used to indicate that the server is powered on.

[0025] In one possible implementation, the method further includes:

[0026] After determining the operation to be performed, turn on the button indicator light;

[0027] If the button is not triggered within the interaction time, the button light is turned off;

[0028] If the button is triggered within the interaction time, the button light will be turned off while the operation to be performed is being carried out.

[0029] Secondly, embodiments of this application provide a server, including:

[0030] button;

[0031] A button detection device for detecting the button;

[0032] A processor connected to the key detection device, the processor being configured to perform the method as described in any of the first aspects.

[0033] In one possible implementation, the server further includes a key light connected to the processor. The key light is turned on after the processor determines the operation to be performed, and the key detection device detects the key during the interaction time. If the key is not triggered during the interaction time, the key light is turned off. If the key is triggered during the interaction time, the key light is turned off when the processor executes the operation to be performed.

[0034] In one possible implementation, the server further includes a baseboard controller connected to the processor, the baseboard controller being used to issue alarms.

[0035] Thirdly, this application provides an electronic device including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect.

[0036] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a computer, implements the method described in any one of the first aspects.

[0037] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a computer, implements the method described in any one of the first aspects.

[0038] In the button control method provided in this embodiment, when a server button is triggered, the duration of the button trigger is timed to obtain a first duration; based on the first duration, an operation to be executed is determined; after determining the operation to be executed, the button is detected within the interaction duration to obtain interaction information, which indicates that the button was triggered within the interaction duration; based on the interaction information, it is confirmed whether to execute the operation to be executed. In this way, interactive confirmation avoids server erroneous responses due to button malfunctions or user accidental button presses, improving system reliability. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram of a key detection method provided in an embodiment of this application;

[0041] Figure 2 This is a schematic diagram of steps S301 to S303 in a key detection method provided in an embodiment of this application;

[0042] Figure 3 This is a schematic diagram of steps S401 to S403 in a key detection method provided in an embodiment of this application;

[0043] Figure 4 A flowchart illustrating a button control method provided in an embodiment of this application;

[0044] Figure 5 This is a structural block diagram of a server provided in an embodiment of this application. Detailed Implementation

[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0046] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0047] One related technology involves performing a long press to power off the server while it is powered on, or performing a short press to power on the server while it is powered off. The disadvantages of this technology include: For issues such as button aging, poor contact, or failed rebound, or accidental button presses by users, this technology requires manual review of operation logs to confirm button malfunctions or accidental button presses, resulting in low maintenance efficiency. It also cannot prevent frequent interruptions due to button aging or failure, leading to system resource contention, system crashes, and business migrations. Furthermore, it can cause buttons to become stuck and fail to rebound, forcing the server to shut down. This results in poor system stability, lack of effective error messages, and a poor user experience.

[0048] The second related technique involves on-site manual inspection of the buttons for abnormalities or accidental button presses, which is time-consuming, labor-intensive, and inefficient.

[0049] To address this, embodiments of this application provide a server and its button control method, an electronic device, and a computer-readable storage medium. When a server button is triggered, the method counts the duration of the button trigger to obtain a first duration; based on the first duration, it determines an operation to be performed; after determining the operation to be performed, it detects the button within the interaction duration to obtain interaction information, which indicates that the button was triggered within the interaction duration; based on the interaction information, it confirms whether to execute the operation to be performed. This interactive confirmation method avoids server malfunctions caused by button abnormalities or accidental button presses by the user, improving system reliability.

[0050] In some embodiments of this application, the above-described button control method can be applied to a server to determine whether to respond to the corresponding operation when a button action is triggered on the server. This addresses issues such as button aging, poor contact, or failed rebound, or erroneous responses caused by user accidental button presses, thereby improving system reliability. In this application, the application of the above-described button control method to a server is used as an example. In other optional embodiments, the above-described button control method can be applied to electronic devices or apparatuses equipped with triggerable (e.g., press-triggered, inductively triggered, or electronically triggered) buttons, such as mobile phones, computers, electronic watches, and mechanical equipment. The type of button includes, but is not limited to, power buttons and volume buttons.

[0051] The technical solutions of this application will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0052] Figure 1 This is a schematic diagram of a button control method provided in an embodiment of this application. Please refer to... Figure 1 The method may include:

[0053] S101. When a server button is triggered, the duration of the button being triggered is timed to obtain a first duration.

[0054] In this embodiment, the power button of the server is used as an example. The server may include a button detection device for detecting whether the button is triggered and the duration of the button being triggered. This button detection device may be a CPLD (Complex Programmable Logic Device, a digital integrated circuit whose logic functions can be constructed by the user as needed), etc., to implement the above-mentioned button detection function. The triggering of the server button can indicate that the user has pressed the button. For example, when the user presses the button, the button detection device can detect that the server button has been triggered.

[0055] It should be noted that, in the embodiments of this application, the triggering of the server button is represented by the user pressing a single button on the server, such as the user pressing the power button. In some optional embodiments, the triggering of the server button may be represented by the user pressing a combination of buttons, such as a combination of the power button and the volume button, for example, the user pressing the power button and the volume button simultaneously.

[0056] Step S101 may include: when a key press action is detected, timing the duration of the key press action to obtain a first duration. That is, starting from the moment the user presses the key (or the start time of detecting the key press being triggered, i.e., the start of triggering), the duration of the key press being triggered is accumulated, and the accumulation is stopped when the user releases the key (or the moment the key press ends triggering), thus obtaining the first duration. Specifically, the first duration can represent the duration of one key press, or the time period from the start time of detecting the key press being triggered to the moment the key press ends triggering, or the time period from the moment the user presses the key to the moment the user releases the key. Alternatively, the first duration can represent the cumulative duration of multiple key presses within a preset time period, etc.

[0057] It should be noted that when a user presses a button, the triggering time will be extended due to button aging or failed rebound. Therefore, the first duration can include the triggering time caused by button aging or failed rebound. In other words, if the button rebounds normally after the user releases it, the first duration is the time from when the user presses the button to when the user releases it. If the button fails to rebound due to an abnormality such as getting stuck after the user releases it, the button will continue to be triggered. Therefore, the first duration is the sum of the time from when the user presses the button to when the user releases it and the triggering time caused by the button failing to rebound due to an abnormality.

[0058] S102. Determine the operation to be performed based on the first duration.

[0059] In other words, the operation to be executed can be determined based on the length of the first duration. For example, the operation to be executed can include a long press and a short press. If the first duration reaches a preset duration, the operation to be executed is a long press; if the first duration does not reach the preset duration, the operation to be executed is a short press. The preset duration can be determined based on the user's button-pressing habits. For example, the preset duration may be t1, where t1 is 6 seconds. This means that if the user presses the button for 6 seconds, the operation to be executed is a long press; if the user presses the button for less than 6 seconds, the operation to be executed is a short press. In some optional embodiments, there can be more than two types of operations to be executed, and each operation corresponds to a different duration range. The type of operation to be executed is determined based on the duration range of the first duration. Multiple duration ranges can be divided in chronological order, such as a duration range of 0 to 3 seconds corresponding to the first type of operation, a duration range of 3 to 6 seconds corresponding to the second type of operation, a duration range of 6 to 10 seconds corresponding to the third type of operation, and so on. There are no restrictions on this.

[0060] For example, step S102 may include:

[0061] S201. If the first duration reaches the preset duration, the operation to be performed is a long press operation. If the server is in a powered-on state, the long press operation is used to indicate that the server is powered off.

[0062] S202. If the first duration does not reach the preset duration, the operation to be performed is a short press operation. If the server is in a power-off state, the short press operation is used to indicate that the server is powered on.

[0063] In other words, in step S201, if the first duration of the server power button being triggered reaches the preset duration, the operation to be performed is a long press operation. For example, if the server is in a powered-on state, the long press operation indicates that the server is powered off. However, in order to avoid the server being forced to power off due to the long press operation caused by the button being stuck and unable to bounce back, the long press operation is not executed temporarily after the long press operation is determined.

[0064] In step S202, if the first duration of the server power button triggering does not reach the preset duration, the operation to be performed is a short press operation. For example, if the server is in a power-off state, this short press operation indicates that the server is powered on. If the power button is frequently triggered by short press operations due to aging or poor contact, it is easy to cause frequent interruption reports, resulting in system resource preemption, system freeze, and business migration. Therefore, in order to avoid this situation, after the short press operation is determined, it is temporarily not executed.

[0065] It is understood that the operation to be executed in this application embodiment is not limited to the two types of long press operation and short press operation mentioned above. For different types of operation to be executed, after determining the type of operation to be executed, in order to avoid false responses caused by button abnormalities, the operation to be executed may be temporarily suspended. Then, the button is detected within the interaction time according to step S103, and the operation to be executed is determined based on the detection result (such as interaction information), thereby improving system stability.

[0066] S103. After determining the operation to be performed, the button is detected within the interaction time to obtain interaction information, which is used to indicate that the button is triggered within the interaction time.

[0067] In other words, after determining the operation to be performed, in order to avoid false responses caused by accidental button presses or poor contact, the operation will not be executed immediately. Instead, after determining the operation to be performed, the information of button triggering within the interaction time, i.e., the interaction information, can be used to determine whether to execute the operation. That is, the interaction time is the human-computer interaction stage. Within the interaction time, the user can determine whether to execute the operation through human-computer interaction, so as to avoid false responses from the server caused by button abnormalities or accidental button presses by the user.

[0068] For example, the interaction duration represents a period of time after the moment the operation to be performed is determined, such as t2. The interaction duration t2 can be predetermined based on the actual application, such as a preset value, or it can be adjusted or updated based on historical interaction information (such as the historical duration of button triggers within the interaction duration). It should be noted that the interaction duration t2 needs to ensure sufficient time to detect button interaction information, thereby improving detection accuracy. In some optional embodiments, the interaction duration t2 is greater than the aforementioned preset duration t1. Of course, the duration t2 can be set or adjusted in real-time according to actual usage, and is not limited here.

[0069] S104. Based on the interaction information, determine whether to execute the operation to be executed.

[0070] Therefore, after a server button is pressed and the operation to be performed is confirmed, the operation is not executed immediately. Instead, the button is checked within the interaction time, and the results (i.e., the interaction information mentioned above) are used to determine whether the operation is due to an anomaly caused by button aging, poor contact, or failed rebound, or by accidental button presses by the user. This interactive confirmation method avoids erroneous server responses caused by button malfunctions or accidental button presses, thus improving system reliability. In other words, after the operation is confirmed, human-computer interaction is possible within the interaction time. For example, the user can press the button again within the interaction time to cancel or execute the operation. Alternatively, if the operation is caused by an anomaly such as button aging, poor contact, or failed rebound, it will not be executed.

[0071] In summary, the button control method provided in this application solves the problems of frequent interruptions caused by button aging and failure, resulting in system resource preemption, system freeze, and business migration; or buttons becoming stuck and unable to bounce back, causing the server to be forced to shut down; or users accidentally touching buttons, resulting in false responses.

[0072] In one possible implementation, the interaction information includes a second duration during which the button is triggered within the interaction duration, and step S103 may include:

[0073] After determining the operation to be performed, if the button is detected to be triggered within the interaction duration, the button action is timed to obtain a second duration.

[0074] In other words, after the button is triggered for the first time and the corresponding operation to be performed is determined, the button detection device re-detects the button within the interaction time. If the button is detected to be triggered within the interaction time, the duration of the button being triggered within the interaction time is timed to obtain a second duration. Specifically, the start time of the second duration can be represented as the start time of the button being triggered within the interaction time. In particular, if the duration of the button's first trigger (i.e., the first duration) reaches a preset duration t1, i.e., the operation to be performed is determined to be a long press operation, then the end time of the preset duration t1 is the start time of the interaction time t2. At this time, if the button continues to be triggered, then the start time of the interaction time t2 is the start time of the second duration. Correspondingly, the end time of the second duration can be represented as the time when the button ends triggering within the interaction time. In particular, if the duration of the button being triggered reaches the interaction time, then the end time of the second duration is the end time of the interaction time t2.

[0075] In other words, the second duration is denoted as t3, and the second duration t3 is less than or equal to the interaction duration t2. Furthermore, if the button is not triggered within the second duration, then the second duration is 0, i.e., t3 = 0.

[0076] It is worth noting that the aforementioned interactive information is not limited to the second duration during which the button is triggered within the interaction time. In some optional embodiments, the interactive information may also include the number of times the button is triggered within the interaction time, and / or the duration of each trigger, to improve the accuracy of avoiding false responses caused by button malfunctions or user misoperations. For example, if the number of times the button is triggered within the interaction time reaches a preset number (such as 2 or 3 times), and / or the duration of each trigger is less than a preset duration (such as 0.5 seconds or 1 second), it indicates that the button is frequently triggered due to poor contact or aging failure, and the pending operation will not be executed, and an alarm will be issued, etc., without limitation.

[0077] It should be noted that in this embodiment, for different types of operations to be executed, step S104 uses corresponding judgment logic steps to determine whether to execute that type of operation. In this embodiment, long press operations and short press operations are used as examples for illustration.

[0078] In one possible implementation, such as Figure 2 As shown, step S104 may include:

[0079] S301. If the operation to be performed is a long press operation, and the button is not triggered within the interaction time, then the long press operation will not be performed.

[0080] S302. If the button is triggered within the interaction duration and the second duration is less than the first threshold, then the long press operation is performed.

[0081] S303. If the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold, the long press operation is not performed and an alarm is issued, where the first threshold is less than the interaction duration.

[0082] It is understood that steps S301 to S303 are logical judgment steps performed when it is determined that the operation to be performed is a long press operation, in order to determine whether to perform the long press operation. The determination of the long press operation can refer to step S201 above.

[0083] Specifically, in step S301, if no button is detected to be triggered within the interaction duration t2, the long press operation is not executed, that is, the server power-off is not executed. This means that the user originally planned to long press the button to power off the server. If this plan is canceled, the user can cancel it by not pressing any button within the interaction duration t2. Therefore, it is beneficial to improve the user experience.

[0084] In step S302, if a button is detected to be triggered within the interaction duration t2, and the second duration t3 of the button trigger is less than the first threshold t4 (i.e., 0 < t3 < t4), then a long press operation is performed. It is worth noting that the first threshold t4 is less than or equal to the aforementioned preset duration t1. This means that after determining that the operation to be performed is a long press operation, if the user confirms the execution of the long press operation by short-pressing the button within the interaction duration (i.e., the second duration of the button trigger is less than the first threshold), then the long press operation is judged as a normal human operation and executed.

[0085] In step S303, if a button is detected to be triggered within the interaction duration t2, and the second duration t3 of the button being triggered is greater than or equal to the first threshold t4 (i.e., t4≤t3), then the long press operation is not performed, and an alarm is issued, indicating that the button is stuck or has failed to bounce back. Therefore, the second duration t3 of the button being triggered within the interaction duration is relatively long (i.e., t3≥t4). In order to avoid the situation where the server is forced to shut down due to the button being stuck and unable to bounce back, the long press operation is not performed, and an alarm is issued to remind relevant staff that the button is abnormal.

[0086] In one possible implementation, such as Figure 3 As shown, step S104 may include:

[0087] S401. If the operation to be performed is a short press operation, and the button is not triggered within the interaction time, then the short press operation is performed.

[0088] S402. If the button is triggered within the interaction duration and the second duration is less than the second threshold, the short press operation is not performed and an alarm is issued.

[0089] S403. If the button is triggered within the interaction duration and the second duration is greater than or equal to the second threshold, then the short press operation is not performed, and the second duration threshold is less than the interaction duration.

[0090] It is understood that steps S401 to S403 are logical judgment steps performed when it is determined that the operation to be performed is a short press operation, in order to determine whether to perform the short press operation. The determination of the short press operation can refer to step S202 above.

[0091] Specifically, in step S401, if no key is detected to be triggered within the interaction duration t2, the short press operation is executed, that is, the server is powered on. This means that if the user does not perform any key operation within the interaction duration t2, the short press operation is considered a normal user operation and is executed.

[0092] In step S402, if a button is detected to be triggered within the interaction duration t2, and the second duration t3 of the button triggering is less than the second threshold t5 (i.e., 0 < t3 < t5), then the short press operation is not performed, and an alarm is issued. This indicates that the button was triggered by poor contact or aging, etc., and therefore, the short press operation is not performed, and an alarm is issued to alert relevant personnel that the button is malfunctioning. Optionally, in step S402, the number of times the button is triggered within the interaction duration t2 (e.g., the number of triggers reaches a preset number) can be used to determine whether the button is frequently or repeatedly triggered due to poor contact or aging, thereby improving the accuracy of the judgment.

[0093] It is worth mentioning that the second threshold t5 is less than or equal to the preset duration t1 mentioned above. This means that after determining that the operation to be performed is a short press operation, if the button is pressed again within the interaction duration (i.e., the second duration of the button being triggered is less than the first threshold), the short press operation will not be executed. In other words, the short press operation is judged as an abnormal operation and will not be executed.

[0094] In step S403, if a button is detected to be triggered within the interaction duration t2, and the second duration t3 of the button trigger is greater than or equal to the second threshold t5 (i.e., t5 ≤ t3), then the short press operation is not executed. This means that after the button is accidentally pressed, the short press operation is canceled by pressing the button for a longer duration (i.e., the second duration t3 ≥ the second threshold t5). In other words, after the user accidentally presses the button (generally the duration of the accidental press is short) and it is determined that the operation to be executed is a short press operation, the user can avoid canceling the short press operation by pressing the button for a longer duration within the interaction duration (i.e., the second duration t3 ≥ the second threshold t5), thereby avoiding erroneous responses caused by user misoperation.

[0095] Furthermore, the server may include a baseboard controller, such as an out-of-band baseboard management controller (BMC). In step S302 and / or step S402, the baseboard controller issues an alarm. The alarm information may include, but is not limited to, server location, abnormal button conditions such as button jamming, button aging, or poor contact. The alarm methods include, but are not limited to, alarm light flashing, voice alarm, or transmitting alarm information to the server maintenance terminal via the network and providing alarm prompts, so as to notify the server maintenance personnel to handle the fault in a timely manner and avoid affecting the business and causing losses to users.

[0096] In one possible implementation, the server may further include key indicators, which are used to provide human-computer interaction indications after an operation to be performed is determined, thereby instructing the user to enter the human-computer interaction phase. Specifically, the method may further include:

[0097] S501. After determining the operation to be performed, turn on the button light;

[0098] S502. If the button is not triggered within the interaction time, then turn off the button light;

[0099] S503. If the button is triggered within the interaction time, the button light is turned off while the operation to be performed is being carried out.

[0100] In this embodiment, turning on the button light may include controlling the button light to emit light (such as adjustable light color or brightness), or controlling the button light to blink (such as adjustable blink frequency or blink color), where the blink frequency may be nHz.

[0101] In step S501, at the moment when the operation to be performed is determined, or at the start of the interaction duration, the button light is turned on to prompt the user to enter the human-computer interaction stage.

[0102] In step S502, if the button is not triggered within the interaction time, the button light is turned off at the end of the interaction time to indicate to the user that the human-computer interaction phase has ended.

[0103] In step S503, if the button is triggered within the interaction time, the button light is turned off when the operation to be performed is determined, so as to prompt the user that the human-computer interaction phase has ended.

[0104] It should be noted that the flashing frequency, color, or brightness of the button light can vary depending on the type of operation to be performed. For example, if the operation to be performed is a long press, the button light will flash at a frequency of nHz or be green during the interaction duration. If the operation to be performed is a short press, the button light will flash at a frequency of 2nHz or be yellow during the interaction duration, allowing users to distinguish the type of operation to be performed by the flashing frequency, color, or brightness of the button light.

[0105] It should be noted that, if the operation to be performed is determined to be a long press operation, and the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold (i.e., step S303 above), the light color or flashing frequency of the button light is adjusted, such as adjusting the button light to emit red light and increasing the flashing frequency, to prompt the user that the button is stuck and needs to be dealt with in time.

[0106] Accordingly, if the operation to be performed is determined to be a short press operation, and if the button is triggered within the interaction duration and the second duration is less than the second threshold (i.e., step S402 above), the light color or flashing frequency of the button light is adjusted, such as adjusting the button light to emit red light or high-frequency flashing, to prompt the user that poor button contact or aging causes the button to be frequently triggered and needs to be dealt with in time.

[0107] Optionally, the server may also include an alarm light, which is activated when the server issues an alarm, such as emitting a red light and / or flashing, to alert the user that there is an abnormality in the key, such as a key stuck and unable to rebound, key aging, or poor contact.

[0108] like Figure 4 The diagram shown is a flowchart of the key detection method according to an embodiment of this application. The process specifically includes:

[0109] S1. The button detection device detects the button to determine whether the button has been triggered.

[0110] S2. If the button is triggered, proceed to step S3. If the button is not triggered, return to step S1 to continue button detection.

[0111] S3. Count the duration for which the button is triggered to obtain the first duration;

[0112] S4. Determine whether the first duration is less than the preset duration. If yes, it means that the operation to be performed is a short press operation, and execute steps S5 to S11. If no, it means that the operation to be performed is a long press operation, and execute steps S12 to S18.

[0113] S5. Detect whether the button is triggered within the interaction time and turn on the button light to indicate the human-computer interaction stage.

[0114] S6. If the button is not triggered, proceed to step S7; if the button is triggered, proceed to step S8.

[0115] S7. Perform a short press and turn off the button lights to indicate the end of the human-computer interaction phase;

[0116] S8. Count the duration for which the button is triggered to obtain the second duration;

[0117] S9. Determine whether the second duration is less than the first threshold. If yes, proceed to step S10; otherwise, proceed to step S11.

[0118] S10. Do not perform short press operation, issue BMC alarm, turn off key light to indicate the end of human-computer interaction stage, and / or turn on alarm light such as alarm light flashing red light to prompt user of abnormal key press.

[0119] S11. Do not perform short press operation, turn off button light, indicating the end of the human-computer interaction stage.

[0120] S12. Detect whether the button is triggered within the interaction time and turn on the button light to indicate the human-computer interaction stage.

[0121] S13. If the button is not triggered, proceed to step S14; if the button is triggered, proceed to step S15.

[0122] S14. Do not perform a long press operation and turn off the button light to indicate the end of the human-computer interaction phase;

[0123] S15. The duration of the button being triggered is timed to obtain the second duration;

[0124] S16. Determine whether the second duration is less than the second threshold. If yes, proceed to step S17; otherwise, proceed to step S18.

[0125] S17. Perform a long press operation to turn off the button lights, indicating the end of the human-computer interaction phase;

[0126] S18. Do not perform a long press operation, issue a BMC alarm, turn off the button light to indicate the end of the human-computer interaction phase, and / or turn on the alarm light, such as the alarm light flashing red to prompt the user of abnormal button press.

[0127] In summary, the key detection method provided in this application, when a server key is triggered, counts the duration of the key trigger to obtain a first duration; based on the first duration, determines the operation to be executed; after determining the operation to be executed, detects the key within the interaction duration to obtain interaction information, which indicates that the key was triggered within the interaction duration; based on the interaction information, confirms whether to execute the operation to be executed. In this way, interactive confirmation avoids server erroneous responses due to key anomalies or user accidental key presses, improving system reliability.

[0128] like Figure 5 As shown, this application embodiment provides a server 100, which includes: a button 110; a button detection device 120 for detecting the button 110; and a processor 130 connected to the button detection device 120, which is used to execute the button detection method provided in the above method embodiment.

[0129] Specifically, the processor 130 of the server 100 can perform the following steps:

[0130] When a server button is triggered, the duration of the button being triggered is timed to obtain a first duration;

[0131] Based on the first duration, determine the operation to be performed;

[0132] After determining the operation to be performed, the button is detected within the interaction time to obtain interaction information, which is used to indicate that the button was triggered within the interaction time.

[0133] Based on the interaction information, determine whether to execute the operation to be performed.

[0134] In one possible implementation, the interaction information includes a second duration during which the button is triggered within the interaction duration. The processor 130, upon determining the operation to be performed, detects the button within the interaction duration to obtain the interaction information, including:

[0135] After determining the operation to be performed, if the button is detected to be triggered within the interaction time, the duration for which the button is triggered within the interaction time is timed to obtain the second duration.

[0136] In one possible implementation, the processor 130 performs the process of determining whether to execute the operation to be executed based on the interaction information, including:

[0137] If the operation to be performed is a long press operation, and the button is not triggered within the interaction time, then the long press operation will not be performed.

[0138] If the button is triggered within the interaction duration and the second duration is less than the first threshold, then the long press operation is performed;

[0139] If the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold, the long press operation is not performed and an alarm is issued, where the first threshold is less than the interaction duration.

[0140] In one possible implementation, the processor 130 performs the process of determining whether to execute the operation to be executed based on the interaction information, including:

[0141] If the operation to be performed is a short press, and the button is not triggered within the interaction duration, then the short press operation is performed.

[0142] If the button is triggered within the interaction duration and the second duration is less than the second threshold, the short press operation will not be performed and an alarm will be issued.

[0143] If the button is triggered within the interaction duration and the second duration is greater than or equal to the second threshold, then the short press operation is not performed, where the second duration threshold is less than the interaction duration.

[0144] In one possible implementation, the processor 130 executes the step of determining the operation to be performed based on the first duration, including:

[0145] If the first duration reaches the preset duration, the operation to be performed is a long press operation; if the server is in a powered-on state, the long press operation is used to indicate that the server is powered off.

[0146] If the first duration does not reach the preset duration, the operation to be performed is a short press operation. If the server is in a power-off state, the short press operation is used to indicate that the server is powered on.

[0147] In one possible implementation, the processor 130 further performs the following steps:

[0148] After determining the operation to be performed, turn on the button indicator light;

[0149] If the button is not triggered within the interaction time, the button light is turned off;

[0150] If the button is triggered within the interaction time, the button light will be turned off while the operation to be performed is being carried out.

[0151] In one possible implementation, the server 100 further includes a key light 140 connected to the processor 130. After the processor 130 determines an operation to be performed, it controls the key light 140 to turn on. The processor 130 also receives interaction information obtained by the key detection device 120 detecting the key 110 within the interaction time. If the key 110 is not triggered within the interaction time, the processor 130 controls the key light 140 to turn off. If the key 110 is triggered within the interaction time, the key light 140 is turned off while the processor 130 is performing the operation to be performed. Optionally, the server may also include an alarm light connected to the processor 130. When the server issues an alarm, the processor controls the alarm light to turn on, such as emitting a red light and / or flashing, to alert the user to abnormal key presses, such as stuck keys, keys aging, or poor contact.

[0152] In one possible implementation, the server 100 further includes a baseboard controller 150, such as an out-of-band baseboard management controller (BMC). The baseboard controller 150 is connected to the processor 130 and is used to issue alarms. That is, the processor 130 sends an alarm signal to the baseboard controller 150, and the baseboard controller 150 issues an alarm. The alarm information may include, but is not limited to, server location, abnormal button conditions such as button jamming, button aging, or poor contact. The alarm methods include, but are not limited to, flashing alarm lights, voice alarms, or transmitting alarm information to the server maintenance terminal via the network and providing alarm prompts, so as to notify the server maintenance personnel to handle the fault in a timely manner and avoid affecting business and causing losses to users.

[0153] As will be understood by those skilled in the art, server 100 may also include circuit board 160, memory board 170, etc. For example, processor 130 and memory board 170 may be mounted on circuit board 160, and processor 130 and memory board 170 are electrically connected. Alternatively, server 100 may also include a power supply for providing the electrical power required for server 100 to operate.

[0154] The server provided in this application embodiment is such as a rack server, blade server, tower server, or a cabinet server or equipment cabinet containing multiple server nodes. The server can execute the scheme shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0155] This application provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0156] When a server button is triggered, the duration of the button being triggered is timed to obtain a first duration;

[0157] Based on the first duration, determine the operation to be performed;

[0158] After determining the operation to be performed, the button is detected within the interaction time to obtain interaction information, which is used to indicate that the button was triggered within the interaction time.

[0159] Based on the interaction information, determine whether to execute the operation to be performed.

[0160] In one possible implementation, the interaction information includes a second duration during which the button is triggered within the interaction duration. When the processor executes the computer program, it performs the step of detecting the button within the interaction duration to obtain the interaction information, including: (The second duration is missing from the original text).

[0161] After determining the operation to be performed, if the button is detected to be triggered within the interaction time, the duration for which the button is triggered within the interaction time is timed to obtain the second duration.

[0162] In one possible implementation, when the processor executes the computer program, it performs the step of determining whether to execute the operation to be executed based on the interaction information, including:

[0163] If the operation to be performed is a long press operation, and the button is not triggered within the interaction time, then the long press operation will not be performed.

[0164] If the button is triggered within the interaction duration and the second duration is less than the first threshold, then the long press operation is performed;

[0165] If the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold, the long press operation is not performed and an alarm is issued, where the first threshold is less than the interaction duration.

[0166] In one possible implementation, when the processor executes the computer program, it performs the step of determining whether to execute the operation to be executed based on the interaction information, including:

[0167] If the operation to be performed is a short press, and the button is not triggered within the interaction duration, then the short press operation is performed.

[0168] If the button is triggered within the interaction duration and the second duration is less than the second threshold, the short press operation will not be performed and an alarm will be issued.

[0169] If the button is triggered within the interaction duration and the second duration is greater than or equal to the second threshold, then the short press operation is not performed, where the second duration threshold is less than the interaction duration.

[0170] In one possible implementation, the alarm is issued by the baseboard controller of the server.

[0171] In one possible implementation, when the processor executes the computer program, it performs the step of determining the operation to be executed based on the first duration, including:

[0172] If the first duration reaches the preset duration, the operation to be performed is a long press operation; if the server is in a powered-on state, the long press operation is used to indicate that the server is powered off.

[0173] If the first duration does not reach the preset duration, the operation to be performed is a short press operation. If the server is in a power-off state, the short press operation is used to indicate that the server is powered on.

[0174] In one possible implementation, the processor, when executing the computer program, further performs the following steps:

[0175] After determining the operation to be performed, turn on the button indicator light;

[0176] If the button is not triggered within the interaction time, the button light is turned off;

[0177] If the button is triggered within the interaction time, the button light will be turned off while the operation to be performed is being carried out.

[0178] The electronic devices provided in this application embodiment, such as mobile phones, computers, servers, smart home devices, and vehicles, can execute the solutions shown in the above method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.

[0179] This application provides a readable storage medium storing a computer program; the computer program is used to implement the key control method as described in any of the above embodiments.

[0180] This application provides a computer program product, which includes instructions that, when executed, cause a computer to perform the above-described key control method.

[0181] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.

[0182] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0183] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0184] These computer program instructions can also be loaded onto a computer or other programmable terminal device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0185] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

[0186] In this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". The terms "first", "second", etc., in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

Claims

1. A button control method, characterized in that, The method includes: When a server button is triggered, the duration of the button being triggered is timed to obtain a first duration; Based on the first duration, determine the operation to be performed; After determining the operation to be performed, if the button is detected to be triggered within the interaction time, the duration for which the button is triggered within the interaction time is timed to obtain a second duration. The interaction information includes the second duration for which the button is triggered within the interaction time. Based on the interaction information, determine whether to execute the operation to be executed; The step of determining whether to execute the pending operation based on the interaction information includes: If the operation to be performed is a long press operation, and the button is not triggered within the interaction duration, the long press operation will not be performed; if the button is triggered within the interaction duration and the second duration is less than the first threshold, the long press operation will be performed; if the button is triggered within the interaction duration and the second duration is greater than or equal to the first threshold, the long press operation will not be performed, and an alarm will be issued, where the first threshold is less than the interaction duration. Alternatively, if the operation to be performed is a short press operation, and the button is not triggered within the interaction duration, then the short press operation is performed; if the button is triggered within the interaction duration and the second duration is less than the second threshold, then the short press operation is not performed and an alarm is issued; if the button is triggered within the interaction duration and the second duration is greater than or equal to the second threshold, then the short press operation is not performed, and the second duration threshold is less than the interaction duration.

2. The method according to claim 1, characterized in that, An alarm is issued by the baseboard controller of the server.

3. The method according to claim 1, characterized in that, The step of determining the operation to be performed based on the first duration includes: If the first duration reaches the preset duration, the operation to be performed is a long press operation; if the server is in a powered-on state, the long press operation is used to indicate that the server is powered off. If the first duration does not reach the preset duration, the operation to be performed is a short press operation. If the server is in a power-off state, the short press operation is used to indicate that the server is powered on.

4. The method according to claim 1, characterized in that, The method further includes: After determining the operation to be performed, turn on the button indicator light; If the button is not triggered within the interaction time, the button light is turned off; If the button is triggered within the interaction time, the button light will be turned off while the operation to be performed is being carried out.

5. A server, characterized in that, include: button; A button detection device for detecting the button; A processor connected to the key detection device, the processor being used to perform the method as described in any one of claims 1 to 4.

6. The server according to claim 5, characterized in that, The server also includes a key light connected to the processor. The key light is turned on after the processor determines the operation to be performed, and the key detection device detects the key within the interaction time. If the key is not triggered within the interaction time, the key light is turned off. If the key is triggered within the interaction time, the key light is turned off when the processor executes the operation to be performed.

7. The server according to claim 5, characterized in that, The server also includes a baseboard controller connected to the processor, the baseboard controller being used to issue alarms.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer, enables the computer to perform the method as described in any one of claims 1 to 4.