Key control method and device based on all-in-one machine, all-in-one machine and storage medium
By analyzing and executing the key instructions in the BIOS of the all -in -one machine, the problem of high resource and cost of the existing all -in -one key control methods is solved, and the effect of resource conservation and cost reduction is achieved.
Patent Information
- Application Number
- CN202411410401.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
AI Technical Summary
The key control method of existing all-in-one machines occupies high resources and also has high costs.
Provide a key control method based on the all -in -one machine, to analyze the button instruction to obtain the key type and key events, and confirm and perform the corresponding key movement based on this information. This method does not need to rely on the MCU, and it is directly implemented in the BIOS of the all -in -one machine.
This method reduces the use of resources, reduces costs, and achieves direct control of the volume and brightness of the all -in -one machine.
Smart Images

Figure CN119376552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of all-in-one machines, and in particular to a key control method and device based on an all-in-one machine, an all-in-one machine and a storage medium. Background Art
[0002] All-in-one computers based on the X86 architecture are widely used in the industrial field. They can withstand harsh industrial conditions such as extreme temperature, humidity and vibration. With the development of technology, people have higher and higher requirements for the simplicity of the all-in-one computer. For example, the volume and brightness of the all-in-one computer can be directly controlled. However, there is currently no built-in keyboard that supports this function. The common solution is to implement notification of volume and screen events based on the MCU. However, this will occupy the motherboard interface resources, resulting in resource waste and increasing costs. Summary of the invention
[0003] The embodiments of the present invention provide a key control method and device based on an all-in-one machine, an all-in-one machine and a storage medium, aiming to solve the problem that the key control of the current all-in-one machine occupies a large number of resources and has a high cost.
[0004] In a first aspect, an embodiment of the present invention provides a key control method based on an all-in-one machine, the method comprising:
[0005] In response to a key instruction for performing key control on the all-in-one machine, parsing the key instruction to obtain a key type and a key event;
[0006] A key action is confirmed according to the key type and the key event, and the key action is executed.
[0007] In a second aspect, an embodiment of the present invention further provides a key control device based on an all-in-one machine, the device comprising:
[0008] A first parsing unit, configured to respond to a key instruction for performing key control on the all-in-one machine and parse the key instruction to obtain a key type and a key event;
[0009] The first execution unit is used to confirm a key action according to the key type and the key event and execute the key action.
[0010] In a third aspect, an embodiment of the present invention further provides an all-in-one machine, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0011] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0012] The embodiment of the present invention provides a key control method, device, all-in-one machine and storage medium based on an all-in-one machine. The key control method based on an all-in-one machine includes: in response to a key command for key control of the all-in-one machine, parsing the key command to obtain a key type and a key event; confirming a key action according to the key type and the key event and executing the key action. The embodiment of the present invention can match the key type with the key event. When a key command is detected, the key command is parsed to confirm the key type and the key event, and then the corresponding key action is executed, which can reduce the utilization of resources and reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0014] Figure 1 is a flow chart of a key control method based on an all-in-one machine provided by an embodiment of the present invention;
[0015] Figure 2 is a schematic block diagram of a key control device based on an all-in-one machine provided by an embodiment of the present invention;
[0016] Figure 3 It is a schematic block diagram of an all-in-one machine provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, operations, elements, components and / or groups thereof.
[0019] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, the singular forms of "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0020] See also Figure 1 , Figure 1 1 is a flow chart of a key control method based on an all-in-one machine provided by an embodiment of the present invention. The key control method based on an all-in-one machine according to an embodiment of the present invention can be applied to an all-in-one machine. The all-in-one machine can be an all-in-one machine based on an X86 architecture, and is used to control the volume and brightness of the all-in-one machine. Figure 1 As shown, the method includes steps S100 to S110.
[0021] S100, in response to a key instruction for performing key control on the all-in-one machine, parsing the key instruction to obtain a key type and a key event.
[0022] In an embodiment of the present invention, physical buttons may be provided on the all-in-one machine, including but not limited to volume +, volume -, brightness +, brightness - and a mute button, wherein volume + indicates increasing the volume of the all-in-one machine, volume - indicates decreasing the volume of the all-in-one machine, brightness + indicates increasing the brightness of the all-in-one machine, brightness - indicates decreasing the brightness of the all-in-one machine, and the mute button indicates turning off the sound of the all-in-one machine.
[0023] The user can trigger a key command through any of the above keys, and the all-in-one machine can receive and parse the key command to obtain a key type and a key event, wherein the key type refers to any of the above five keys, for example, volume +. A key event can be a mapping rule for identifying a user key action.
[0024] Key events can include key actions and trigger methods. Key actions can include single click and long press. Single click means that the user clicks the key once, and long press means that the user holds the key down for a period of time. In addition to the above two actions, key actions can also include clicking the key twice in a predetermined time, clicking the key three times in a row, etc. The trigger method is the method used by the all-in-one machine to identify key actions. For example, key actions can be identified through SCI interrupts.
[0025] The mapping between key actions and SCI interrupts can be established in advance. For example, SCI interrupts can include edge triggers and level triggers. The edge trigger corresponds to a single click, and the level trigger corresponds to a long press. Thus, the mapping between key actions and SCI interrupts is established, and the key events are created. The above method can be completed through the BIOS on the motherboard of the all-in-one machine, that is, the control of the all-in-one machine can be realized without relying on the MCU.
[0026] S110: confirm a key action according to the key type and the key event and execute the key action.
[0027] In the embodiment of the present invention, the key type may include volume+, volume-, brightness+, brightness- and mute key, and the key event is a mapping rule for identifying the user's key. After the key type and key event are confirmed, the key action can be executed to complete the control of the all-in-one machine.
[0028] In actual use, when the user clicks the Volume+ button once, the BIOS recognizes that the button type is Volume+ and the button event is a single click, that is, side pressure trigger, and can increase the volume by one level according to the preset level. When the user long presses the Brightness+ button once, the BIOS recognizes that the button type is Brightness+ and the button event is a long press, that is, horizontal trigger, and can continuously increase the brightness of the all-in-one computer during the duration of the long press until the user releases the button.
[0029] In some embodiments, such as this embodiment, the key control method based on the all-in-one machine further includes the following steps:
[0030] A preset key mode is obtained, and the preset key mode is matched with a preset interrupt type to obtain the key event.
[0031] In an embodiment of the present invention, the preset key mode may refer to a mode in which a user presses a key, which includes but is not limited to a long press and a single click, and a single click may include a single click once, twice, or three times or more. The preset interrupt type may be an SCI interrupt, which includes an edge trigger and a horizontal trigger. When matching, a single click may be matched with an edge trigger, and a long press may be matched with a horizontal trigger.
[0032] In some embodiments, such as the present embodiment, the step of obtaining a preset key mode and matching the preset key mode with a preset interrupt type to obtain the key event further includes the following steps:
[0033] Matching the first type of keys with the first type of events to obtain first type of events;
[0034] The second-type key is matched with the first-type event to obtain a second-type event, wherein the first-type event and the second-type event constitute the key event.
[0035] In the embodiment of the present invention, the first type of key may be a single click, and the second type of key may be a long press key, then the first type of event may be an edge trigger, and the second type of event may be a horizontal trigger, so that a single click is matched with an edge trigger, and a long press is matched with a horizontal trigger. When the user clicks a key once, the GPIO port of the BIOS detects an edge trigger and recognizes that the user has clicked, and when the user long presses the key, the GPIO port of the BIOS detects a horizontal trigger and recognizes that the user has long pressed.
[0036] In some embodiments, such as this embodiment, the step S110 further includes the following steps:
[0037] If the button type is a volume adjustment button, and the button event is the first type of event, adjusting the volume of the integrated device once;
[0038] If the button type is the volume adjustment button and the button event is the second type of event, the volume of the all-in-one machine is continuously adjusted during the button duration.
[0039] In the embodiment of the present invention, the volume adjustment button may include volume+ and volume-. And volume+ includes single click and long press, and volume- also includes single click and long press. During recognition, first confirm whether the volume+ or volume- controlled by the user is, then confirm whether the user single clicks the button or long presses the button, and finally execute the corresponding action.
[0040] For example, if the user clicks the volume + button once, the key type is identified as volume +, and the key event is a single click, that is, edge triggering, then the volume is increased by one level; if the user long presses the volume - button, the key type is identified as volume -, and the key event is a long press, that is, horizontal triggering, then the volume is continuously decreased during the duration of the user's long press until the user releases the button.
[0041] In some embodiments, such as this embodiment, the step S110 further includes the following steps:
[0042] If the button type is a brightness adjustment button and the button event is the first type of event, the brightness of the integrated device is adjusted once;
[0043] If the button type is the brightness adjustment button and the button event is the second type of event, the brightness of the integrated device is continuously adjusted during the button duration.
[0044] In the embodiment of the present invention, the brightness adjustment button may include brightness+ and brightness-. Brightness+ includes single click and long press, and brightness- also includes single click and long press. During recognition, first confirm whether the user controls brightness+ or brightness-, then confirm whether the user single clicks the button or long presses the button, and finally execute the corresponding action.
[0045] For example, if the user clicks brightness+ once, the key type is identified as brightness+, and the key event is a single click, that is, edge triggering, then the brightness is increased by one level; if the user long presses brightness-, the key type is identified as brightness-, and the key event is a long press, that is, horizontal triggering, then the brightness is continuously reduced during the duration of the user's long press until the user releases the key.
[0046] In some embodiments, such as this embodiment, the step S110 further includes the following steps:
[0047] If the key type is a mute key and the key event is the first type of event, the sound of the all-in-one machine is turned off.
[0048] In the embodiment of the present invention, the mute key is used to turn off the sound of the integrated machine. It is generally set to only one type of event, for example, the first type of event, when the user clicks the mute key once, the sound of the integrated machine is turned off. It can also be set to be triggered by the second type of event, when the user long presses the mute key, the sound of the integrated machine is turned off.
[0049] Figure 2 FIG. 1 is a schematic block diagram of a key control device 100 based on an all-in-one machine provided by an embodiment of the present invention. Figure 2 As shown, corresponding to the above-mentioned key control method based on the integrated machine, the present invention also provides a key control device 100 based on the integrated machine. The key control device 100 based on the integrated machine includes a unit for executing the above-mentioned key control method based on the integrated machine. Figure 2 The key control device 100 based on the all-in-one machine includes a first parsing unit 110 and a first execution unit 120 .
[0050] The first parsing unit 110 is used to respond to a key command for key control of the all-in-one machine and parse the key command to obtain a key type and a key event;
[0051] The first execution unit 120 is used to confirm a key action according to the key type and the key event and execute the key action.
[0052] An embodiment of the present invention further provides a key control device based on an all-in-one machine, which adds a first acquisition unit on the basis of the above embodiment.
[0053] The first acquisition unit is used to acquire a preset key mode, and match the preset key mode with a preset interrupt type to obtain the key event.
[0054] In some embodiments, such as this embodiment, the first acquisition unit includes a first matching unit and a second matching unit.
[0055] The first matching unit is used to match the first type of keys with the first type of events to obtain the first type of events;
[0056] The second matching unit is used for matching the second-type key with the first-type event to obtain a second-type event, wherein the first-type event and the second-type event constitute the key event.
[0057] In some embodiments, such as this embodiment, the first execution unit 120 includes a first volume adjustment unit and a second volume adjustment unit.
[0058] The first volume adjustment unit is used to adjust the volume of the integrated machine once if the key type is a volume adjustment key and the key event is the first type of event;
[0059] The second volume adjustment unit is used for continuously adjusting the volume of the integrated machine within the key pressing duration if the key type is the volume adjustment key and the key pressing event is the second type event.
[0060] In some embodiments, such as this embodiment, the first execution unit 120 further includes a first brightness adjustment unit and a second brightness adjustment unit.
[0061] The first brightness adjustment unit is used to adjust the brightness of the integrated device once if the key type is a brightness adjustment key and the key event is the first type of event;
[0062] The second brightness adjustment unit is used for continuously adjusting the brightness of the integrated device within the key pressing duration if the key type is the brightness adjustment key and the key event is the second type event.
[0063] In some embodiments, such as this embodiment, the first execution unit 120 further includes a mute unit.
[0064] The mute unit is used to turn off the sound of the all-in-one machine if the key type is a mute key and the key event is the first type of event.
[0065] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned all-in-one key control device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0066] The above-mentioned key control device based on the all-in-one machine and the device for creating a writing page can be implemented in the form of a computer program, and the computer program can be used in a computer system such as Figure 2 Run on the all-in-one shown.
[0067] See also Figure 3 , Figure 3 is a schematic block diagram of an all-in-one machine provided in an embodiment of the present application. Figure 3 The all-in-one machine 500 includes a processor 502 , a memory and an interface 507 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0068] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a key control method based on an all-in-one machine and a method for creating a writing page.
[0069] The processor 502 is used to provide computing and control capabilities to support the operation of the entire all-in-one machine 500 .
[0070] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a key control method based on an all-in-one machine and a method for creating a writing page.
[0071] The interface 505 is used to communicate with other devices. Those skilled in the art will appreciate that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the all-in-one machine 500 to which the solution of the present application is applied. The specific all-in-one machine 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0072] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0073] In response to a key instruction for performing key control on the all-in-one machine, parsing the key instruction to obtain a key type and a key event;
[0074] A key action is confirmed according to the key type and the key event, and the key action is executed.
[0075] In one embodiment, the processor 502 further implements the following steps:
[0076] A preset key mode is obtained, and the preset key mode is matched with a preset interrupt type to obtain the key event.
[0077] In one embodiment, the processor 502 further implements the following steps:
[0078] Matching the first type of keys with the first type of events to obtain first type of events;
[0079] The second-type key is matched with the first-type event to obtain a second-type event, wherein the first-type event and the second-type event constitute the key event.
[0080] In one embodiment, the processor 502 further implements the following steps:
[0081] If the button type is a volume adjustment button, and the button event is the first type of event, adjusting the volume of the integrated device once;
[0082] If the button type is the volume adjustment button and the button event is the second type of event, the volume of the all-in-one machine is continuously adjusted during the button duration.
[0083] In one embodiment, the processor 502 further implements the following steps:
[0084] If the button type is a brightness adjustment button and the button event is the first type of event, the brightness of the integrated device is adjusted once;
[0085] If the button type is the brightness adjustment button and the button event is the second type of event, the brightness of the integrated device is continuously adjusted during the button duration.
[0086] In one embodiment, the processor 502 further implements the following steps:
[0087] If the key type is a mute key and the key event is the first type of event, the sound of the all-in-one machine is turned off.
[0088] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (FSP), 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. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0089] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0090] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, any embodiment of the above-mentioned key control method based on the all-in-one machine and the method for creating a writing page is implemented.
[0091] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, or any other computer-readable storage medium that can store program codes.
[0092] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0093] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0094] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling an all-in-one machine to perform all or part of the steps of the method described in each embodiment of the present invention.
[0096] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0097] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0098] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A key control method based on an all-in-one machine, characterized in that: The method comprises: In response to a key instruction for performing key control on the all-in-one machine, parsing the key instruction to obtain a key type and a key event; A key action is confirmed according to the key type and the key event, and the key action is executed.
2. The method according to claim 1, characterized in that The method further comprises: A preset key mode is obtained, and the preset key mode is matched with a preset interrupt type to obtain the key event.
3. The method according to claim 2, characterized in that The preset key mode includes a first type of key and a second type of key, the preset interrupt type includes a first type of event and a second type of event, and the step of obtaining the preset key mode and matching the preset key mode with the preset interrupt type includes: The first-category keys are matched with the first-category events to obtain first-category events.
4. The method according to claim 3, characterized in that The method further comprises: The second-type key is matched with the first-type event to obtain a second-type event, wherein the first-type event and the second-type event constitute the key event.
5. The method according to claim 4, characterized in that The step of confirming a key action according to the key type and the key event and executing the key action comprises: If the button type is a volume adjustment button, and the button event is the first type of event, adjusting the volume of the integrated device once; If the button type is the volume adjustment button and the button event is the second type of event, the volume of the all-in-one machine is continuously adjusted during the button duration.
6. The method according to claim 4, characterized in that The step of confirming a key action according to the key type and the key event and executing the key action comprises: If the button type is a brightness adjustment button and the button event is the first type of event, the brightness of the integrated device is adjusted once; If the button type is the brightness adjustment button and the button event is the second type of event, the brightness of the integrated device is continuously adjusted during the button duration.
7. The method according to claim 4, characterized in that The step of confirming a key action according to the key type and the key event and executing the key action comprises: If the key type is a mute key and the key event is the first type of event, the sound of the all-in-one machine is turned off.
8. A key control device based on an all-in-one machine, characterized in that: The device comprises: A first parsing unit, configured to respond to a key instruction for performing key control on the all-in-one machine and parse the key instruction to obtain a key type and a key event; The first execution unit is used to confirm a key action according to the key type and the key event and execute the key action.
9. An all-in-one machine, characterized in that: The all-in-one machine includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to execute the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 can be implemented.