Key instruction function triggering method and device and storage medium
By obtaining the button click duration and flashing mode, using database mapping to trigger preset instructions, the problem of single key function is solved, and multi-function buttons are realized, reducing costs and improving product competitiveness.
Patent Information
- Application Number
- CN202510639058.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art is difficult to realize multiple functions through a single button, resulting in high costs and difficult function expansion, affecting product competitiveness.
By obtaining the button click duration and flicker mode, using database mapping to trigger preset instructions, achieving diversification of key functions.
It realizes the implementation of multiple functions through a single physical button, reducing costs and improving product competitiveness.
Smart Images

Figure CN120406804A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of button control, and particularly to a method, device, and storage medium for triggering button instruction functions. Background Art
[0002] In recent years, with the increasingly fierce competition in the communication field, how to provide customers with high-quality and low-cost products has become a major concern for every enterprise. At the same time, enterprises are also paying more and more attention to cost control to ensure sufficient profits to maintain their own survival in the highly competitive market. Summary of the Invention
[0003] In view of this, the present invention provides a method, device, and storage medium for triggering button instruction functions.
[0004] Specifically, the present invention is implemented through the following technical solutions:
[0005] According to a first aspect of the present invention, there is provided a method for triggering button instruction functions, the method comprising the steps of:
[0006] Obtain the duration of the button click;
[0007] Flash the light strip according to the click duration;
[0008] Obtain the flashing mode of the light strip;
[0009] Trigger a preset instruction according to the click duration and the flashing mode.
[0010] Optionally, the obtaining the duration of the button click includes the steps of:
[0011] Determine whether the button is clicked;
[0012] If so, determine whether the timer is activated;
[0013] If so, time through the timer;
[0014] If not, activate the timer;
[0015] If not, maintain the current state.
[0016] Optionally, the determining whether the button is clicked includes the steps of:
[0017] Obtain the deformation amount of the button in the vertical direction;
[0018] Determine whether the deformation amount exceeds a preset value;
[0019] If so, confirm that the button is clicked;
[0020] If not, confirm that the button is not clicked.
[0021] Optionally, the step of determining whether the button is clicked includes:
[0022] Obtaining the pressure value of the button in the vertical direction;
[0023] Determining whether the pressure value exceeds a preset value;
[0024] If so, confirm that the button is clicked;
[0025] If not, confirm that the button is not clicked.
[0026] Optionally, the step of flashing the light strip according to the click duration includes:
[0027] Obtaining a pre-set database;
[0028] Obtaining the click duration;
[0029] Retrieving the flashing pattern corresponding to the click duration in the database;
[0030] Controlling the light strip to flash according to the flashing pattern.
[0031] Optionally, the step of obtaining the flashing pattern of the light strip includes:
[0032] Obtaining a pre-set database;
[0033] Obtaining the click duration;
[0034] Retrieving the flashing pattern corresponding to the click duration in the database.
[0035] Optionally, the step of triggering a preset instruction according to the click duration and the flashing pattern includes:
[0036] Obtaining a pre-set database;
[0037] Obtaining the click duration and the flashing pattern;
[0038] Retrieving the trigger instruction corresponding to the click duration and the flashing pattern in the database;
[0039] Triggering a preset function instruction according to the trigger instruction.
[0040] According to a second aspect of the present invention, there is provided a button instruction function triggering device, including:
[0041] A time acquisition module for acquiring the button click duration;
[0042] A light strip flashing module for flashing the light strip according to the click duration;
[0043] A mode acquisition module for acquiring the flashing mode of the light strip;
[0044] An instruction trigger module for triggering a preset instruction according to the click duration and the flashing mode.
[0045] According to a third aspect of the present invention, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the method described in any one of the foregoing are implemented.
[0046] According to a fourth aspect of the present invention, there is provided a storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the method described in any one of the foregoing are implemented.
[0047] The technical solution provided by the present invention at least brings the following beneficial effects:
[0048] A method, device, and storage medium for triggering a key instruction function provided by the present application can implement multiple functions through a single physical key, which can reduce costs and can also expand functions without changing the cost, thereby enhancing the competitiveness of products. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0051] Figure 1 A flowchart showing a method for triggering a key instruction function provided by an embodiment of the present invention;
[0052] Figure 2 A structural diagram showing a device for triggering a key instruction function provided by an embodiment of the present invention;
[0053] Figure 3 A structural diagram showing an electronic device provided by an embodiment of the present invention;
[0054] Figure 4 A structural diagram showing a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0056] Figure 1 A flowchart schematically showing a method for triggering a key command function applicable to an embodiment of the present invention is shown.
[0057] See Figure 1 , an embodiment of the present invention provides a method for triggering a key command function. This method can be applied to electronic devices such as PCs, servers, terminals, etc. The method may include the following steps:
[0058] S1: Obtain the duration of the key click;
[0059] Exemplarily, the obtaining of the duration of the key click includes the steps of:
[0060] Determine whether the key is clicked;
[0061] If so, determine whether the timer is activated;
[0062] If so, time through the timer;
[0063] If not, activate the timer;
[0064] If not, maintain the current state.
[0065] In the embodiments of the present application, when the key is clicked, if the timer set in the key is activated, the timer is used for timing; if the timer is not activated, the timer is activated for timing.
[0066] Exemplarily, the determining whether the key is clicked includes the steps of:
[0067] Obtain the deformation amount of the key in the vertical direction;
[0068] Determine whether the deformation amount exceeds a preset value;
[0069] If so, confirm that the key is clicked;
[0070] If not, confirm that the key is not clicked.
[0071] In the embodiment of the present application, the button is a push-button. When this type of button is pressed, it will deform in the vertical direction and generate a deformation amount. If the deformation amount exceeds a preset value, it indicates that the button has been clicked; if the deformation amount does not exceed the preset value, it indicates that the button may not have been accidentally touched or pressed.
[0072] Exemplarily, the determining whether the button has been clicked includes the steps of:
[0073] Obtain the pressure value of the button in the vertical direction;
[0074] Determine whether the pressure value exceeds a preset value;
[0075] If so, confirm that the button has been clicked;
[0076] If not, confirm that the button has not been clicked.
[0077] In the embodiment of the present application, the button is a touch button. When this type of button is pressed, it will receive pressure in the vertical direction and generate a pressure value. If the pressure value exceeds a preset value, it indicates that the button has been clicked; if the pressure value does not exceed the preset value, it indicates that the button may not have been accidentally touched or pressed.
[0078] S2: Flash the light strip according to the click duration;
[0079] Exemplarily, the flashing the light strip according to the click duration includes the steps of:
[0080] Obtain a pre-set database;
[0081] Obtain the click duration;
[0082] Retrieve the flashing pattern corresponding to the click duration in the database;
[0083] Control the light strip to flash according to the flashing pattern.
[0084] In the embodiment of the present application, a database is pre-set in a storage medium. The database stores the click duration and the flashing pattern that are mapped to each other. Each click duration corresponds to a flashing pattern. When a click duration is retrieved, a corresponding flashing pattern can be retrieved along with it, and then the light strip is controlled to flash according to the flashing pattern.
[0085] S3: Obtain the flashing pattern of the light strip;
[0086] Exemplarily, the obtaining the flashing pattern of the light strip includes the steps of:
[0087] Obtain a pre-set database;
[0088] Obtain the click duration;
[0089] Retrieve the blinking pattern corresponding to the click duration in the database.
[0090] In the embodiment of the present application, a database is pre - set in a storage medium. The data in this database can be input manually or by an electronic device as needed. The database stores the mutually - mapped click durations and blinking patterns. Each click duration corresponds to a blinking pattern. When a click duration is retrieved, a corresponding blinking pattern can be retrieved accordingly.
[0091] S4: Trigger a preset instruction according to the click duration and the blinking pattern.
[0092] Exemplarily, the triggering of the preset instruction according to the click duration and the blinking pattern includes the steps of:
[0093] Obtain the pre - set database;
[0094] Obtain the click duration and the blinking pattern;
[0095] Retrieve the trigger instruction corresponding to the click duration and the blinking pattern in the database;
[0096] Trigger a preset function instruction according to the trigger instruction.
[0097] In the embodiment of the present application, a database is pre - set in a storage medium. The data in this database can be input manually or by an electronic device as needed. The database stores the mutually - mapped click durations, blinking patterns, and trigger instructions. Each set of click duration and blinking pattern corresponds to a trigger instruction. When a set of click duration and blinking pattern is retrieved, a corresponding trigger instruction can be retrieved accordingly, and then a corresponding function instruction is triggered according to the trigger instruction.
[0098] Specifically, when the click duration of the button is within 3s, the blinking pattern of the light strip is the fast - flash pattern, and at this time, the wps function is triggered; when the click duration of the button is 3s - 6s, the blinking pattern of the light strip is the slow - flash pattern, and at this time, the wifi switch function is triggered; when the click duration of the button is 6s - 9s, the blinking pattern of the light strip is the fast - flash pattern, and at this time, the factory reset function is triggered.
[0099] Such as Figure 2 , the present application provides a button instruction function trigger device, including:
[0100] A time acquisition module 10 for obtaining the button click duration;
[0101] The light strip flashing module 20 is configured to flash the light strip according to the click duration;
[0102] The mode acquisition module 30 is configured to acquire the flashing mode of the light strip;
[0103] The instruction trigger module 40 is configured to trigger a preset instruction according to the click duration and the flashing mode.
[0104] A key instruction function trigger device provided by the present application can execute a key instruction function trigger method provided by the above steps.
[0105] It should be understood that the above specific embodiments of the present invention are only used for exemplary illustration or explanation of the principles of the present invention, and do not constitute a limitation to the present invention. Therefore, any modifications, equivalent replacements, improvements, etc. made without departing from the spirit and scope of the present invention shall be included within the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.
[0106] Next, refer to Figure 3 , which shows a schematic structural diagram of an electronic device 100 suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0107] As Figure 3 shown, the electronic device 100 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 101, which can execute various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage device 108 into a random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the electronic device 100 are also stored. The processing device 101, the ROM 102, and the RAM 103 are connected to each other through a bus 104. The input / output (I / O) interface 105 is also connected to the bus 104.
[0108] Typically, the following devices can be connected to the I / O interface 105: an input device 106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 109. The communication device 109 can allow the electronic device 100 to communicate with other devices wirelessly or wiredly to exchange data. Although the electronic device 100 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.
[0109] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 109, or installed from the storage device 108, or installed from the ROM 102. When the computer program is executed by the processing device 101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0110] The following refers to Figure 4 , which shows a schematic structural diagram of a computer-readable storage medium suitable for implementing the embodiment of the present disclosure. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement the key instruction function triggering method described in any one of the above.
[0111] The present application also provides a computer program product. It includes a computer program / computer executable instructions, and when the computer program / computer executable instructions are executed by a processor of an electronic device, the steps of the key instruction function triggering method described in any one of the foregoing are implemented.
[0112] The key instruction function triggering method, device and storage medium provided by the present application can implement multiple functions through a single physical key, which can reduce costs and can also expand functions without changing the cost, thereby enhancing the competitiveness of products.
[0113] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0114] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for triggering a key command function, characterized in that The method includes the steps of: Obtaining the duration of the button click; Flashing the light strip according to the click duration; Obtaining the flashing mode of the light strip; Triggering a preset instruction according to the click duration and the flashing mode.
2. The key command function triggering method according to claim 1, wherein The obtaining of the duration of the button click includes the steps of: Judging whether the button is clicked; If so, judging whether the timer is activated; If so, timing through the timer; If not, activating the timer; If not, maintaining the current state.
3. The key command function triggering method according to claim 2, wherein The judging whether the button is clicked includes the steps of: Obtaining the deformation amount of the button in the vertical direction; Judging whether the deformation amount exceeds a preset value; If so, confirming that the button is clicked; If not, confirming that the button is not clicked.
4. The key command function triggering method according to claim 2, wherein The judging whether the button is clicked includes the steps of: Obtaining the pressure value of the button in the vertical direction; Judging whether the pressure value exceeds a preset value; If so, confirming that the button is clicked; If not, confirming that the button is not clicked.
5. The key command function triggering method according to claim 1, wherein The flashing of the light strip according to the click duration includes the steps of: Obtaining a preset database; Obtaining the click duration; Retrieving the flashing mode corresponding to the click duration in the database; Controlling the light strip to flash according to the flashing mode.
6. The key command function triggering method according to claim 1, wherein The obtaining of the flashing mode of the light strip includes the steps of: Obtaining a preset database; Obtaining the click duration; Retrieving the flashing mode corresponding to the click duration in the database.
7. The key command function triggering method according to claim 1, wherein The triggering of the preset instruction according to the click duration and the flashing mode includes the steps of: Obtaining a preset database; Obtaining the click duration and the flashing mode; Retrieving the triggering instruction corresponding to the click duration and the flashing mode in the database; Triggering a preset function instruction according to the triggering instruction.
8. A key command function triggering device, characterized in that, Includes: A time acquisition module for obtaining the duration of the button click; A light strip flashing module for flashing the light strip according to the click duration; A mode acquisition module for obtaining the flashing mode of the light strip; An instruction triggering module for triggering a preset instruction according to the click duration and the flashing mode.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the method according to any one of claims 1-7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the steps of the method according to any one of claims 1-7 are implemented.
Citation Information
Patent Citations
IO port key action information acquisition method and device and electronic equipment
CN118394685A
Smart home configuration method and electronic device
WO2024140349A1