Firmware startup control method and device, computer equipment and readable storage medium
By detecting the handle and mapping its key data to the keyboard scanning code in the starting firmware, the problem of starting the firmware does not support the handle equipment in traditional technologies, and the convenient handle control on small devices is achieved, which improves the operating efficiency.
Patent Information
- Application Number
- CN202411921367.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The startup firmware such as BIOS of traditional electronic devices does not support the use of handle devices during the startup stage. Users need to enter the operating system to load the handle driver before using the handle function. Moreover, on small devices such as handheld machines, it is inconvenient to use the keyboard to enter the control interface of the startup firmware. High complexity and low control efficiency.
When starting the firmware to detect the handle, obtain the original data transmitted by the handle, and map the corresponding relationship between the handle button and the keyboard scan code to obtain the keyboard scan code and coding value after the mapping, and then control the startup firmware based on this information. Essence
The startup firmware is directly controlled during the startup phase through the handle, which improves control efficiency and reduces dependence on the keyboard. It is suitable for small devices and is easy to operate.
Smart Images

Figure CN119356745A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile terminal technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for controlling startup firmware. Background Art
[0002] In traditional technology, the BIOS and other startup firmware of electronic devices do not support the use of handle devices during the startup phase. Users usually need to enter the operating system and load the corresponding handle driver before they can use the handle functions normally. Therefore, the electronic device needs to be connected to an external keyboard to configure the startup firmware.
[0003] However, the screens of small devices such as handheld game consoles are relatively small, and it is inconvenient to use the keyboard to enter the control interface of the startup firmware, the operation is complex, and the control efficiency is low. Summary of the invention
[0004] Based on this, it is necessary to provide a control method, device, computer equipment, computer-readable storage medium and computer program product for startup firmware that can improve control efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for controlling startup firmware, the method comprising:
[0006] When the startup firmware detects a handle, obtaining original data transmitted by the handle; the handle is provided with a handle button;
[0007] According to the correspondence between the handle buttons and the keyboard scan codes, the numerical values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan codes and the encoding values that match the mapped keyboard scan codes;
[0008] The startup firmware is controlled according to the mapped keyboard scan code and the operation instruction corresponding to the encoding value.
[0009] In one embodiment, mapping the value at the preset byte position in the original data according to the correspondence between the handle button and the keyboard scan code to obtain the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code includes:
[0010] Parsing the value at the preset byte position in the original data to obtain a handle key value; the handle key value is a key value corresponding to the handle key having a pressing event;
[0011] According to the correspondence between the handle keys and the keyboard scan codes, the handle key values are mapped to obtain a mapped keyboard scan code and an encoding value that matches the mapped keyboard scan code; the mapped keyboard scan code is a scan code corresponding to a keyboard key.
[0012] In one embodiment, the original data includes first original data and second original data, and the first original data is transmitted before the second original data;
[0013] The parsing of the value at the preset byte position in the original data to obtain the handle key value includes:
[0014] Determining whether a value at a preset byte position in the second original data is the same as a value at a preset byte position in the first original data;
[0015] If they are the same, continue to obtain new second original data;
[0016] If they are not the same, the changed value is determined based on the value at the preset byte position in the second original data and the value at the preset byte position in the first original data; and the handle key value corresponding to the second original data is determined according to the changed value.
[0017] In one embodiment, determining the handle key value corresponding to the second original data according to the changed value includes:
[0018] Storing the changed value in the queue corresponding to the handle button;
[0019] According to a preset time interval, obtaining a pending handle key value from a queue corresponding to the handle key value;
[0020] In the pending handle key value, the handle key value corresponding to the second original data is determined according to the bit whose value matches the preset value.
[0021] In one embodiment, the method further comprises:
[0022] The handle driver is loaded through the startup firmware; the handle driver is created based on the UEFI protocol, and the handle driver has a keyboard value reading interface under the UEFI protocol;
[0023] The keyboard value reading interface is used to obtain the mapped keyboard scan code and the encoding value.
[0024] In one embodiment, before the startup firmware detects the handle, it also includes:
[0025] When the component to be detected is connected, the device descriptor and the interface descriptor of the component to be detected are obtained through a data transmission protocol;
[0026] The startup firmware detects the handle, including:
[0027] When the device descriptor indicates a handle and the interface descriptor corresponds to an interface of the handle, it is determined that the startup firmware detects the handle.
[0028] In a second aspect, the present application further provides a control device for starting firmware, comprising:
[0029] An acquisition module, used for acquiring original data transmitted by the handle when the startup firmware detects the handle; the handle is provided with a handle button;
[0030] A conversion module, used for mapping the numerical value at the preset byte position in the original data according to the correspondence between the handle button and the keyboard scan code, to obtain a mapped keyboard scan code and a coding value matching the mapped keyboard scan code;
[0031] The control module is used to control the startup firmware according to the mapped keyboard scan code and the operation instruction corresponding to the encoding value.
[0032] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for controlling the startup of firmware in any of the above embodiments are implemented.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for controlling the startup of firmware in any of the above embodiments are implemented.
[0034] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the control method for starting firmware in any of the above embodiments are implemented.
[0035] The control method, device, computer equipment, computer-readable storage medium and computer program product of the boot firmware described above, the method comprises: when the boot firmware detects the handle, obtaining the original data transmitted by the handle, so that the boot firmware running in the startup phase can form a data transmission process with the handle, and lay the foundation for the control of the boot firmware. On this basis, since the original data transmitted by the handle each time contains multiple bytes, the purpose and meaning of each byte may be different. Therefore, in order to reduce the amount of data used in this process, according to the correspondence between the handle button and the keyboard scan code, the numerical value located at the preset byte position in the original data is mapped to obtain the mapped keyboard scan code, and the encoding value matched by the mapped keyboard scan code is determined through the correspondence to form two-dimensional control information. Then, according to the operation instruction corresponding to the mapped keyboard scan code and the encoding value, the boot firmware is controlled to more accurately control the boot firmware through the operation instructions in two dimensions. As a result, a smaller handle is used to enter the control interface of the boot firmware, and the operation buttons are relatively few, and there is no need to connect to the keyboard, which is convenient to operate and has high control efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 An application environment diagram of a control method for starting firmware in an embodiment;
[0038] Figure 2 A schematic diagram of a flow chart of a control method for starting firmware in one embodiment;
[0039] Figure 3 A schematic diagram of a process for mapping a value of a preset byte position in one embodiment;
[0040] Figure 4 A schematic diagram of a process of determining a handle key value in one embodiment;
[0041] Figure 5 A structural block diagram of a control device for starting firmware in one embodiment;
[0042] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The control method for starting firmware provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 may be, but is not limited to, various smart phones, handheld game consoles, IoT devices and portable wearable devices. IoT devices may be smart speakers, smart car devices, etc. Portable wearable devices may be smart watches, smart bracelets, etc.
[0045] In an exemplary embodiment, Figure 2 As shown, a control method for starting firmware is provided, which is applied to Figure 1 The terminal 102 in the embodiment includes the following steps 202 to 206. Among them:
[0046] Step 202, when the startup firmware detects the handle, the original data transmitted by the handle is obtained; the handle is provided with handle buttons.
[0047] The boot firmware is the firmware that the terminal runs during the boot phase. The boot firmware is used to ensure that the terminal can boot and enter the operating system in a normal working state, so controlling the boot firmware can form the control of the terminal during the boot phase. Exemplarily, the boot firmware includes but is not limited to BIOS and UEFI.
[0048] The handle is an input device with fewer keys than a standard keyboard. The size of the handle is smaller than that of a standard keyboard, so the handle and the screen can be integrated into the same side of the terminal to form a more compact layout, thereby reducing the size of the terminal. Exemplarily, the handle can be distributed on both sides of the screen or around the screen.
[0049] The handle button is a button set on the handle, and the original data can be changed by the handle button so that the handle transmits different content to the startup firmware of the terminal. Each handle button corresponds to the value of the preset byte position in the original data, so the original data can be accurately and efficiently adjusted through the value of the same preset byte position.
[0050] The original data is the data transmitted from the handle to the processor of the terminal 102. The transmission protocol between the original data and the processor may be a USB protocol, a HID protocol or other protocols.
[0051] When the boot firmware detects the handle, the boot firmware has completed the hardware initialization and can therefore receive the corresponding control instructions. For example, when the boot firmware is BIOS, when the computer is powered on, the BIOS will execute POST (Power-On Self Test) to check whether the hardware is working properly. POST will detect key hardware such as the CPU, memory, hard disk, keyboard, and report any errors. Next, the BIOS will initialize various hardware components on the motherboard, including the CPU, memory controller, PCIe bus, USB controller, etc. Furthermore, in the presence of a handle driver, the BIOS can detect the handle and provide an interface that allows the user to control the interface parameters through the handle buttons, such as the boot sequence, clock frequency, memory settings, etc.
[0052] In some embodiments, obtaining the raw data transmitted by the handle includes: obtaining the raw data transmitted by the handle; wherein the raw data is obtained by adjusting each handle button according to the value at the preset byte position when a press event exists; and the raw data is obtained by adjusting each handle button according to the reset value at the preset byte position when the press event ends. Thus, each handle button corresponds to two values, one for transmitting information through the value at the preset byte position, and the other number is the reset value, so as to avoid the raw data being interfered by the two handle buttons, thereby more accurately controlling the startup firmware.
[0053] In some embodiments, obtaining the original data transmitted by the handle includes: obtaining the original data transmitted by the handle; wherein the original data is a value at a first preset byte position obtained by adjusting the first type of handle buttons; the original data is a value at a second preset byte position obtained by adjusting the second type of handle buttons; the first type of handle buttons and the second type of handle buttons belong to two types of handle buttons, and the first preset byte position and the second preset byte position are two different preset byte positions. Thus, one or more handle buttons belonging to the first type of handle buttons transmit information based on the value of a preset byte position, and one or more handle buttons belonging to the second type of handle buttons also transmit information based on the value of another preset byte position, so that the information generated by the same type of handle buttons will not interfere with each other, and the information generated by different types of handles can be transmitted simultaneously, so as to improve the accuracy of information transmission.
[0054] Among them, the value of the first preset byte position is composed of multiple bits, each bit corresponds to each handle button in the first category of handle buttons, and in the case of a press event, each handle button is adjusted according to its bit in the preset byte position. In addition, the value of the second preset byte position is composed of multiple bits, each bit corresponds to each handle button in the second category of handle buttons, and in the case of a press event, each handle button is adjusted according to its bit in the preset byte position. Therefore, since each bit actually corresponds to a level in the register contained in the processor, each handle button corresponds to a bit in the preset byte position one by one, and the information represented by each handle button can be more efficiently conveyed through the level of the register, thereby improving the processing efficiency of the processor to more efficiently control the startup firmware.
[0055] In an exemplary embodiment, the handle buttons include a first type of handle buttons and a second type of handle buttons; the first type of handle buttons include an up button, a down button, a left button, and a right button; the second type of handle buttons include an A button, a B button, an X button, and a Y button; in the case of hexadecimal, the third byte has four bits corresponding to the up button, the down button, the left button, and the right button, and in the case of a press event, each handle button is numerically adjusted according to its respective bit at a preset byte position, and 0x01, 0x02, 0x04, and 0x08 are obtained; correspondingly, the reset value is 0x00. In the case of hexadecimal, the fourth byte has four bits corresponding to the A button, the B button, the X button, and the Y button, and in the case of a press event, each handle button is numerically adjusted according to its respective bit at a preset byte position, and 0x10, 0x20, 0x40, and 0x80 are obtained; correspondingly, the reset value is 0x00; the example relationship is shown in Table 1, and Table 1 is as follows:
[0056] Table 1
[0057] Controller buttons The value of the press event The value at the end of the press event Up key 0x01 0x00 Down key 0x02 0x00 Left button 0x04 0x00 Right button 0x08 0x00 A 0x10 0x00 B Key 0x20 0x00 X Key 0x40 0x00 Y Key 0x80 0x00
[0058] In some embodiments, the transmission process of raw data is implemented based on the USB 10 protocol, so the parameters specified by the protocol include but are not limited to: specifying the target endpoint address of the handle in the communication, specifying the transmission direction, sending data from the handle to the processor, specifying the polling interval, and specifying the size of each data packet, that is, the maximum amount of data transmitted each time; wherein, the polling interval refers to the number of milliseconds at which the handle sends data to the processor in USB communication. It affects the frequency of data transmission between the handle and the processor. The USB asynchronous interrupt transmission method is adopted to obtain the raw data of the handle device, and the asynchronous interrupt transmission is initiated by the USB 10 protocol pointer. The asynchronous interrupt transmission method is adopted to obtain the raw data of the handle device, and the asynchronous interrupt transmission is initiated by the protocol pointer.
[0059] Step 204, mapping the numerical value at the preset byte position in the original data according to the correspondence between the handle button and the keyboard scan code, and obtaining the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code.
[0060] The keyboard scan code is the scan code corresponding to the keyboard keys of the standard keyboard. The keyboard scan code is used to represent the keys of the standard keyboard. The standard keyboard is an input device set up for the PC. The standard keyboard includes various English letter keys and function keys. The function keys include but are not limited to the keyboard up key, keyboard down key, keyboard left key, keyboard right key, keyboard Enter key, keyboard Esc key, keyboard Delete key or keyboard F7 key; correspondingly, in some boot firmware, the keyboard Enter key function: confirm; the keyboard Esc key function: return; the keyboard Delete key function: hot key to enter the BIOS menu interface; the keyboard F7 key function: hot key to enter the boot device selection. The keyboard up key represented by the upward arrow "↑" and the encoding value of the Unicode string are used as an example. Its keyboard scan code is 0x48 in hexadecimal, and the encoding value of the keyboard scan code matching is U+2191.
[0061] The correspondence between the joystick buttons and the keyboard scan codes is used to indicate the correspondence between the values adjusted by the joystick buttons and the keyboard scan codes, and is used to indicate the correspondence between the values adjusted by the joystick buttons and the encoding values. The correspondence is a pre-configured mapping relationship, which can be in the form of a function, a curve, or a mapping table.
[0062] The preset byte position is a position in the multiple bytes contained in each piece of original data. The preset byte position may be a preset byte number in each piece of original data.
[0063] In an exemplary embodiment, the handle sends raw data to the processor of the terminal through USB asynchronous interrupt transmission. The raw data sent by the handle to the processor includes a lot of information such as button status, joystick and touch axis, vibration feedback, device information, battery status (wireless handle), etc. The data at the preset byte position is the status corresponding to the button, so only the handle button status information needs to be parsed out.
[0064] The mapped keyboard scan code is the result of mapping the numerical value of the preset byte position. The encoded value matched by the mapped keyboard scan code is also the result of mapping the numerical value of the preset byte position. The mapped keyboard scan code and its matching encoded value form a whole to more accurately reflect the data indicated by the handle button.
[0065] In some embodiments, according to the correspondence between the handle buttons and the keyboard scan codes, the numerical values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan code and the coded value that matches the mapped keyboard scan code, including: according to the correspondence between the handle buttons and the keyboard scan codes, the numerical values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan code; according to the mapped keyboard scan code, mapping is performed to obtain the coded value that matches the mapped keyboard scan code. Thus, two mappings are performed in sequence, and the original mapping logic of the keyboard scan code can be reused to reduce the modification of the mapping rules, and two information dimensions of the operation instruction can still be formed.
[0066] In some embodiments, according to the correspondence between the handle button and the keyboard scan code, the numerical value at the preset byte position in the original data is mapped to obtain the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code, including: according to the first correspondence between the handle button and the keyboard scan code, the numerical value at the preset byte position in the original data is mapped to obtain the mapped keyboard scan code; according to the second correspondence between the handle button and the keyboard scan code, the numerical value at the preset byte position in the original data is mapped to obtain the encoding value matching the mapped keyboard scan code. Thus, two mappings are performed respectively, and the mapped keyboard scan code and the encoding value matching it can be obtained respectively, so as to form two irrelevant mapping relationships, so as to avoid the abnormality of a single mapping process affecting the accurate expression of the operation instruction, and to form two information dimensions of the operation instruction.
[0067] Step 206, controlling the startup firmware according to the operation instruction corresponding to the mapped keyboard scan code and the encoding value.
[0068] The operation instruction is an operation instruction for configuring the startup firmware. The mapped keyboard scan code and the encoding value can be stored in the corresponding queue, and the operation instruction is determined in sequence through the mapped keyboard scan code and the encoding value output by the queue to control the startup firmware.
[0069] In one embodiment, the boot firmware is controlled according to the operation instruction corresponding to the mapped keyboard scan code and the encoding value, including: when the mapped keyboard scan code represents SCAN_NULL and the encoding value represents CHAR_CARRIAGE_RETURN (keyboard Enter key), the boot firmware is controlled according to the confirmation instruction. Thus, the configuration of the corresponding instruction is implemented.
[0070] In one embodiment, the startup firmware is controlled according to the operation instructions corresponding to the mapped keyboard scan code and the encoding value, including: when the mapped keyboard scan code represents SCAN_RIGHT and the encoding value represents CHAR_NULL (keyboard right key), the startup firmware is controlled according to the filter box right shift instruction. Thus, the option adjustment to the right side of the interface is implemented.
[0071] In the control method of the above-mentioned startup firmware, when the startup firmware detects the handle, the original data transmitted by the handle is obtained, so that the startup firmware running in the startup phase can form a data transmission process with the handle, laying the foundation for the control of the startup firmware. On this basis, since the original data transmitted by the handle each time contains multiple bytes, the purpose and meaning of each byte may be different. Therefore, in order to reduce the amount of data used in this process, according to the correspondence between the handle button and the keyboard scan code, the numerical value located at the preset byte position in the original data is mapped to obtain the mapped keyboard scan code, and the encoding value matched by the mapped keyboard scan code is determined through the correspondence to form two-dimensional control information. Then, according to the operation instruction corresponding to the mapped keyboard scan code and the encoding value, the startup firmware is controlled to more accurately control the startup firmware through the operation instructions in two dimensions.
[0072] In some embodiments, before the firmware is started to detect the handle, the method further includes: when the component to be detected is connected, obtaining a device descriptor and an interface descriptor of the component to be detected through a data transmission protocol;
[0073] Correspondingly, the startup firmware detects the handle, including: when the device descriptor represents the handle and the interface descriptor corresponds to the interface of the handle, determining that the startup firmware detects the handle.
[0074] The component to be detected is capable of data transmission with the startup firmware, and the startup firmware needs to determine the type of the component to be detected. Since this solution is compatible with the configuration method of the traditional startup firmware, the component to be detected may be a standard keyboard, or a handle or other components, so it is necessary to detect the component to be detected to determine whether the device to be detected is the handle detected by the startup firmware.
[0075] The situations in which the component to be detected is connected include but are not limited to the situation in which the level signal between the startup firmware and the component to be detected can be identified, the situation in which the data signal between the startup firmware and the component to be detected can be identified, and the situation in which the data transmission protocol between the startup firmware and the component to be detected is established.
[0076] The data transmission protocol is a rule for data transmission. The data transmission protocol is a transmission protocol with device descriptors and interface descriptors. For example, the data transmission protocol may be a USB protocol or other interface protocol with device descriptors and interface descriptors.
[0077] The device descriptor is a device identifier. The device descriptor can be used to characterize the type of the device to be detected, so as to determine whether the component to be detected belongs to a handle or a keyboard, thereby forming a device-level judgment.
[0078] The interface descriptor is an interface identifier. The interface descriptor can be used to characterize the interface type of the device to be detected, so as to more accurately determine whether the component to be detected uses a handle interface or a keyboard interface, thereby forming a judgment on the interface level.
[0079] In an exemplary embodiment, this embodiment is used to identify the handle device in the BIOS stage. Since the UEFI specification only uses the mouse and the standard keyboard as standard input devices, the handle cannot be directly identified. Therefore, the handle is a USB input device. In this case, the device descriptor and interface descriptor of the component to be detected are obtained through the data transmission protocol, including: obtaining the USB device descriptor and interface descriptor through the standard USBIO protocol.
[0080] In an exemplary embodiment, when the device descriptor represents a handle and the interface descriptor corresponds to the interface of the handle, determining that the startup firmware detects the handle includes: when the Vender ID and Product ID in the device descriptor represent the handle and the InterfaceClass in the interface descriptor corresponds to the interface of the handle. Determining that the startup firmware detects the handle. Thus, the device descriptor is decoupled into the Vender ID and the Product ID to more accurately identify the handle, and at the same time, the InterfaceClass in the interface descriptor belongs to a general class, which helps to more accurately identify the interface.
[0081] In this embodiment, when both the handle and the terminal are detachable, the device descriptor and interface descriptor are obtained based on the data transmission protocol to form device granularity and interface granularity. These two granularities can verify each other to more accurately determine whether the startup firmware has detected the handle to avoid misidentification.
[0082] In some embodiments, Figure 3 As shown, according to the correspondence between the handle buttons and the keyboard scan codes, the values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan codes and the encoding values matching the mapped keyboard scan codes, including:
[0083] Step 302, parse the value at the preset byte position in the original data to obtain the handle key value; the handle key value is the key value corresponding to the handle key that has a press event.
[0084] The handle key value includes a value at a preset byte position, and the handle key value and the original data are located in a different data structure. The data structure for storing the value at the preset byte position stores the value of each original data at the preset byte position in the original data transmitted a preset number of times in the order of transmission time, so as to store the value of the original data at the preset byte position of the preset number of times, and form a queue corresponding to the handle key. Therefore, the correspondence between the handle key and the keyboard scan code is set for the handle key value data structure to improve the mapping efficiency.
[0085] The data structure for storing the value of the preset byte position and the data structure for storing the original data have different lengths, and the data structure for storing the value of the preset byte position can be in the form of a queue, etc. For example, it can be a USB key queue.
[0086] The handle key value is the key value corresponding to the handle button with a press event, that is, when the user presses the handle button to form a press event, the handle key value exists; and when the user stops pressing the handle button to eliminate the press event, the handle key value does not exist, and the value of the preset byte position is the reset value. In this case, the handle key value can accurately reflect the user's press situation.
[0087] In some embodiments, the value at the preset byte position in the original data is parsed to obtain the handle key value, including: each time a new value at the preset byte position is received, the value at the preset byte position is stored in a queue; and the handle key value is obtained based on the output result of the queue. Therefore, it is not necessary to process the value at the preset byte position immediately, and the process of obtaining the value at the preset byte position will not block the processor from processing other tasks to ensure processing efficiency. Moreover, since input capture and event processing are performed asynchronously, the system can respond to user input more quickly, improving response speed.
[0088] In some embodiments, parsing the value at the preset byte position in the original data to obtain the handle key value includes: using a data transmission protocol analysis tool to capture the data packet containing the original data sent by the handle to the processor; parsing the value at the preset byte position in the data packet to obtain the handle key value. The data transmission protocol analysis tool can be a USB analysis tool.
[0089] Since the handle key values are captured and parsed through the analysis tool, input capture and key value parsing are separated into two independent processes, which is convenient for debugging and optimization. It avoids the situation where the original data is used for simultaneous capture and parsing, reduces data reuse, and avoids exceptions.
[0090] Step 304, mapping the handle key values according to the correspondence between the handle keys and the keyboard scan codes, obtaining the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code; the mapped keyboard scan code is the scan code corresponding to the keyboard key.
[0091] In some embodiments, the handle key values are mapped according to the correspondence between the handle keys and the keyboard scan codes to obtain a coding value that matches the mapped keyboard scan code, including: substituting the most recently acquired handle key value into the mapping formula according to the correspondence between the handle keys and the keyboard scan code to obtain a coding value that matches the mapped keyboard scan code.
[0092] In some embodiments, the handle key values are mapped according to the correspondence between the handle keys and the keyboard scan codes to obtain a coding value that matches the mapped keyboard scan code, including: substituting the most recently acquired handle key value into the mapping table between the handle keys and the keyboard scan codes for mapping, to obtain a coding value that matches the mapped keyboard scan code.
[0093] For example, the corresponding relationship is a mapping relationship. After mapping, the keyboard scan code is used to represent the corresponding keyboard key, and the encoding value matched with it is a Unicode string. Because the keyboard will also generate a keyboard scan code and a Unicode string after pressing a key, mapping is equivalent to simulating the key input of the handle into the key input corresponding to the keyboard. Among them, the function of the keyboard Enter key represents "confirmation"; the function of the keyboard Esc key represents "return", the function of the keyboard Delete key represents "hot key for entering the BIOS menu interface", and the function of the keyboard F7 key represents "hot key for entering the boot device selection". The mapping relationship is shown in Table 2.
[0094] Table 2
[0095] Controller buttons Mapped keyboard scan codes Unicode string (corresponding keyboard key) Up SCAN_UP CHAR_NULL (key on keyboard) Down SCAN_DOWN CHAR_NULL (keyboard down key) Left SCAN_LEFT CHAR_NULL (left keyboard key) Right SCAN_RIGHT CHAR_NULL (right key) A SCAN_NULL CHAR_CARRIAGE_RETURN (keyboard Enter key) B SCAN_ESC CHAR_NULL (Esc key on keyboard) X SCAN_DELEAT CHAR_NULL (Keyboard Delete key) Y SCAN_F7 CHAR_NULL (keyboard F7 key)
[0096] In this embodiment, the value at the preset byte position in the original data is parsed to obtain the handle key value, so as to decouple the handle key value from the original data and form a separate data structure of the handle key value, which is convenient for subsequent processing; and since the handle key value is the key value corresponding to the handle button with a press event, the handle key value exists based on the press event, so the user can more accurately control the existence of the handle key value. In this case, the correspondence between the handle button and the keyboard scan code is set for the handle key value data structure to improve the mapping efficiency; and then according to the correspondence, the handle key value is mapped to obtain the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code to improve the processing efficiency.
[0097] In some embodiments, the raw data includes first raw data and second raw data, and the first raw data is transmitted before the second raw data. The first raw data and the second raw data are raw data transmitted at different times, and the first raw data may be raw data transmitted to the processor at least one round before the second raw data. The first raw data is a reference to the second raw data, and is used to determine whether the second raw data is different from the first raw data, and determine the latest handle key value based on the different changed data.
[0098] like Figure 4 As shown, the value at the preset byte position in the original data is parsed to obtain the handle key value, including:
[0099] Step 402, determining whether the value at the preset byte position in the second original data is the same as the value at the preset byte position in the first original data.
[0100] In some embodiments, determining whether a numerical value at a preset byte position in the second original data is the same as a numerical value at a preset byte position in the first original data includes: comparing the second original data with the first original data to obtain consistency results for each byte position; and determining whether the numerical value at a preset byte position in the second original data is the same as a numerical value at a preset byte position in the first original data based on the consistency results for each byte position.
[0101] Step 404: If they are the same, continue to obtain new second original data.
[0102] In some embodiments, continuing to acquire new second original data includes: acquiring original data transmitted by the handle in the next time interval to obtain new second original data.
[0103] In some embodiments, continuing to acquire new second original data includes: acquiring original data transmitted by the handle according to a preset protocol to obtain new second original data.
[0104] Step 406: If they are not the same, determine the changed value based on the value at the preset byte position in the second original data and the value at the preset byte position in the first original data.
[0105] The changed value is the result of the value change of the two preset data at the preset byte position. For example: the value at the preset byte position in the first original data is 0x00, and the value at the preset byte position in the second original data is 0x01, then 0x01 is the changed value, indicating that the corresponding handle key value is mapped to obtain the mapped keyboard scan code and its matching encoding value; similarly, the value at the preset byte position in the first original data is 0x01, and the value at the preset byte position in the second original data is 0x00, then 0x00 is the changed value, indicating that the corresponding handle key value is reset to serve as the first original data.
[0106] In some embodiments, determining whether a value at a preset byte position in the second original data is the same as a value at a preset byte position in the first original data includes: using two pointer variables to store the first original data and the second original data sent before and after the handle, respectively, and determining whether a new button has been pressed by comparing whether the value at the preset byte position of the data has changed.
[0107] Correspondingly, based on the numerical value at the preset byte position in the second original data and the numerical value at the preset byte position in the first original data, the changed numerical value is determined, including: when a key is pressed, the numbers at the preset byte position of the first original data and the second original data change to obtain the changed numerical value; the changed numerical value is stored in the queue corresponding to the handle key.
[0108] Step 408, determining the handle key value corresponding to the second original data according to the changed value.
[0109] In some embodiments, determining the handle key value corresponding to the second original data based on the changed value includes: if the changed value corresponds to the existence of a press event, mapping the changed value to obtain the handle key value corresponding to the second original data.
[0110] In some embodiments, determining the handle key value corresponding to the second original data according to the changed value includes: if the changed value corresponds to the situation where the pressing event stops, determining the handle key value corresponding to the second original data according to the preset handle key value for resetting. The preset handle key value for resetting indicates that the corresponding handle key value is reset, for example, it is determined to be 0.
[0111] In this embodiment, it is determined whether the values at the preset byte positions in the original data acquired successively are the same; if they are the same, the next round of original data is acquired, and the new handle key value is not determined, and there is no need to store it to avoid repeated parsing process; if they are not the same, the changed value is determined based on the value at the preset byte position in the second original data and the value at the preset byte position in the first original data, so as to reduce the amount of data by extracting the changed value from the original data, and then determine the handle key value corresponding to the second original data according to the changed value, and form a new data structure with the handle key value corresponding to the second original data.
[0112] In some embodiments, determining the handle key value corresponding to the second original data based on the changed numerical value includes: storing the changed numerical value in a queue corresponding to the handle button; obtaining the pending handle key value from the queue corresponding to the handle key value at a preset time interval; and determining the handle key value corresponding to the second original data based on the bit that matches the numerical value with the preset numerical value in the pending handle key value.
[0113] The pending handle key value is the result of the queue corresponding to the handle key value being output in sequence. The handle key value actually represented by the pending handle key value is not yet determined. The queue corresponding to the handle key value is a first-in-first-out table, which can output the values input into it in chronological order and form an asynchronous output structure.
[0114] In some embodiments, storing the changed value in the queue corresponding to the handle button includes: storing the changed value in the queue corresponding to the handle button in chronological order. The queue is a first-in-first-out table, which is used to provide pending handle key values in the order of storage.
[0115] In some embodiments, obtaining the pending handle key value from the queue corresponding to the handle key value at a preset time interval includes: determining the preset time interval through a timer processing function; taking out the value in the queue corresponding to the handle key value at the preset time interval to obtain the pending handle key value. Thus, the value in the queue corresponding to the handle key value is obtained every 1s or other time period to form an asynchronous data acquisition process.
[0116] In some embodiments, in the pending handle key value, according to the bit whose value matches the preset value, the handle key value corresponding to the second original data is determined, including: determining the handle key value corresponding to the second original data by judging the bit contained in the byte that is 1. The handle key value corresponding to the second original data indicates which button of the handle is pressed. In addition, the mapped keyboard scan code and Unicode string of the standard keyboard can be stored in the keyboard key queue for subsequent calls.
[0117] In this embodiment, the changed value is stored in the queue corresponding to the handle button, thereby forming an asynchronous data reading process. In this case, the pending handle key value is obtained from the queue corresponding to the handle key value according to the time interval corresponding to the original data in the transmission process, so that the handle key value can be obtained relatively timely, and the handle key value acquisition process according to the time interval has a relatively small impact on the processor's processing of other tasks; finally, in the pending handle key value, the handle key value corresponding to the second original data is determined according to the bit matching the value with the preset value. Since each bit actually corresponds to a level in the register contained in the processor, each handle button corresponds to the bit in the preset byte position one by one, and the information represented by each handle button can be more efficiently conveyed through the register level, thereby improving the processing efficiency of the processor to more efficiently control the startup firmware.
[0118] In some embodiments, the method also includes: loading a handle driver by starting the firmware; the handle driver is created based on the UEFI protocol, and the handle driver has a keyboard value reading interface under the UEFI protocol; the keyboard value reading interface is used to obtain the mapped keyboard scan code and encoding value.
[0119] UEFI protocol is a protocol defined by UEFI (Unified Extensible Firmware Interface), which is a computer firmware interface standard. Under the traditional UEFI protocol, there is no gamepad driver, only a keyboard driver; therefore, after setting the gamepad driver, if the keyboard driver has a keyboard value reading interface, the keyboard value reading interface is set in the gamepad driver to form the keyboard value reading interface in the two drivers.
[0120] The keyboard value reading interface is the interface of the ReadKeyStroke() function; the keyboard value reading interface is used to obtain the keyboard input value according to the UEFI protocol.
[0121] Since the mapped keyboard scan code and encoding value have data compatible with the standard keyboard, the mapped keyboard scan code and encoding value are obtained through the keyboard value reading interface, which takes the mapped keyboard scan code and encoding value as the keyboard input value. The function of the keyboard value reading interface is to read the next mapped keyboard scan code and encoding value of the keyboard. If there is no mapped keyboard scan code and encoding value to be processed, the function will return the EFI_NOT_READY status. If the mapped keyboard scan code and encoding value are detected, the function will return the key information through a pointer to the EFI_INPUT_KEY structure to obtain the corresponding operation instruction.
[0122] The ReadKeyStroke() function is non-blocking, so when there is no key press event, the function will immediately return to the EFI_NOT_READY state instead of waiting for user input. When there is a key press event, the function will return to the EFI_SUCCESS state and fill in the EFI_INPUT_KEY structure to provide key information.
[0123] The controller driver is the intermediary software between the operating system where the boot firmware is located and the controller. The controller driver enables the operating system to communicate with the controller. The controller driver does not exist in the UEFI protocol, but can be defined according to the USB protocol or other protocols. The controller driver has a keyboard value reading interface, so the operating system can call data through the keyboard value reading interface.
[0124] In one embodiment, a keyboard value reading interface is used to obtain a mapped keyboard scan code and a coded value, which means that the keyboard value reading interface is driven by a handle, and an external interface ReadkeyStoke() function for reading key presses is provided, and data in the keyboard key queue is extracted in the interface; the data in the keyboard key queue includes a mapped keyboard scan code and its coded value; that is, the mapped keyboard scan code acts as a keyboard scan code, and its coded value can be a Unicode string.
[0125] In one embodiment, the keyboard value reading interface is used to obtain the mapped keyboard scan code and encoding value, or to add the handle device path to the system console input, so that when the external device calls the key input interface through the system console input, the mapped keyboard scan code of the handle key input can be identified as the keyboard scan code.
[0126] In one embodiment, loading the handle driver program by starting the firmware includes: loading the handle driver program by starting the firmware when the starting firmware detects a handle.
[0127] In another embodiment, loading the handle driver by starting the firmware includes: when obtaining a mapped keyboard scan code and an encoding value matching the mapped keyboard scan code, loading the handle driver by starting the firmware.
[0128] In this embodiment, since the system console input device does not include a handle device in the standard UEFI protocol, the standard UEFI protocol does not have a handle driver; in this case, the keyboard value reading interface under the UEFI protocol is reused to create a handle driver, so that the handle driver can use the keyboard value reading interface of the standard keyboard to obtain data. As a result, the handle driver and the keyboard driver under the UEFI protocol have the same keyboard value reading interface, and the startup firmware uses different keyboard value reading interfaces for data transmission, so that the two drivers can run in their respective situations without interfering with each other, and the modification required for the startup firmware is relatively small, so as to ensure reuse.
[0129] In an exemplary embodiment, since there is no direct handle driver available in the BIOS stage, it is necessary to create a handle driver, map the handle buttons to standard keyboard buttons, provide an external calling interface, and add it to the system console input to implement the function of controlling the BIOS interface with the handle buttons. Specifically, during the boot process, when the BIOS recognizes the handle device, it will load the created handle driver. In the driver, the handle transmits through USB asynchronous interrupts, and will continue to send raw data to the processor every certain milliseconds. When the user presses the handle button, it detects that the raw data has changed, determines which button of the handle is pressed, and parses the key value of the handle button, converts it into the keyboard scan code and Unicode string corresponding to the standard keyboard, and provides an interface for reading the button. When the system console input interface is called externally, the corresponding keyboard key scan code and Unicode string will be read out, and the next step is the same operation as the standard keyboard.
[0130] In another exemplary embodiment, during the boot process, in the absence of an external keyboard, the user can enter the BIOS configuration interface by pressing the X button on the handheld device, or enter the boot device selection interface by pressing the Y button. After entering the BIOS configuration interface, the user can achieve the same configuration effect as using a keyboard by pressing the up, down, left, right, A key (corresponding to the keyboard Enter key), and B key (corresponding to the keyboard Esc key) on the handheld device.
[0131] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0132] Based on the same inventive concept, the embodiment of the present application also provides a control device for startup firmware for implementing the control method of startup firmware involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more control devices for startup firmware provided below can refer to the limitations of the control method for startup firmware above, and will not be repeated here.
[0133] In an exemplary embodiment, Figure 5 As shown, a control device for starting firmware is provided, comprising:
[0134] The acquisition module 502 is used to acquire the original data transmitted by the handle when the startup firmware detects the handle; the handle is provided with a handle button;
[0135] The conversion module 504 is used to map the numerical value at the preset byte position in the original data according to the correspondence between the handle button and the keyboard scan code, and obtain the mapped keyboard scan code and the encoding value matching the mapped keyboard scan code;
[0136] The control module 506 is used to control the startup firmware according to the mapped keyboard scan code and the operation instruction corresponding to the encoding value.
[0137] In one embodiment, the conversion module 504 is used to:
[0138] Parsing the value at the preset byte position in the original data to obtain a handle key value; the handle key value is a key value corresponding to the handle key having a pressing event;
[0139] According to the correspondence between the handle keys and the keyboard scan codes, the handle key values are mapped to obtain a mapped keyboard scan code and an encoding value that matches the mapped keyboard scan code; the mapped keyboard scan code is a scan code corresponding to a keyboard key.
[0140] In one embodiment, the original data includes first original data and second original data, and the first original data is transmitted before the second original data;
[0141] The conversion module 504 is used to:
[0142] Determining whether a value at a preset byte position in the second original data is the same as a value at a preset byte position in the first original data;
[0143] If they are the same, continue to obtain new second original data;
[0144] If they are not the same, the changed value is determined based on the value at the preset byte position in the second original data and the value at the preset byte position in the first original data; and the handle key value corresponding to the second original data is determined according to the changed value.
[0145] In one embodiment, the conversion module 504 is used to:
[0146] Storing the changed value in the queue corresponding to the handle button;
[0147] According to a preset time interval, obtaining a pending handle key value from a queue corresponding to the handle key value;
[0148] In the pending handle key value, the handle key value corresponding to the second original data is determined according to the bit whose value matches the preset value.
[0149] In one embodiment, the control module 506 is used to:
[0150] The handle driver is loaded through the startup firmware; the handle driver is created based on the UEFI protocol, and the handle driver has a keyboard value reading interface under the UEFI protocol;
[0151] The keyboard value reading interface is used to obtain the mapped keyboard scan code and the encoding value.
[0152] In one embodiment, the acquisition module 502 is used to:
[0153] Before the firmware is started to detect the handle, and when the component to be detected is connected, the device descriptor and the interface descriptor of the component to be detected are obtained through the data transmission protocol;
[0154] When the device descriptor indicates a handle and the interface descriptor corresponds to an interface of the handle, it is determined that the startup firmware detects the handle.
[0155] Each module in the control device of the above startup firmware can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0156] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a control method for starting firmware is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0157] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0160] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0162] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for controlling startup firmware, characterized in that: The method comprises: When the startup firmware detects a handle, obtaining original data transmitted by the handle; the handle is provided with a handle button; According to the correspondence between the handle buttons and the keyboard scan codes, the numerical values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan codes and the encoding values that match the mapped keyboard scan codes; The startup firmware is controlled according to the mapped keyboard scan code and the operation instruction corresponding to the encoding value.
2. The method according to claim 1, characterized in that According to the correspondence between the handle buttons and the keyboard scan codes, the numerical values at the preset byte positions in the original data are mapped to obtain the mapped keyboard scan codes and the encoding values matching the mapped keyboard scan codes, including: Parsing the value at the preset byte position in the original data to obtain a handle key value; the handle key value is a key value corresponding to the handle key having a pressing event; According to the correspondence between the handle keys and the keyboard scan codes, the handle key values are mapped to obtain a mapped keyboard scan code and an encoding value that matches the mapped keyboard scan code; the mapped keyboard scan code is a scan code corresponding to a keyboard key.
3. The method according to claim 2, characterized in that The original data includes first original data and second original data, and the first original data is transmitted before the second original data; The parsing of the value at the preset byte position in the original data to obtain the handle key value includes: Determining whether a value at a preset byte position in the second original data is the same as a value at a preset byte position in the first original data; If they are the same, continue to obtain new second original data; If they are not the same, the changed value is determined based on the value at the preset byte position in the second original data and the value at the preset byte position in the first original data; and the handle key value corresponding to the second original data is determined according to the changed value.
4. The method according to claim 3, characterized in that The determining the handle key value corresponding to the second original data according to the changed value includes: Storing the changed value in the queue corresponding to the handle button; According to a preset time interval, obtaining a pending handle key value from a queue corresponding to the handle key value; In the pending handle key value, the handle key value corresponding to the second original data is determined according to the bit whose value matches the preset value.
5. The method according to claim 1, characterized in that: The method further comprises: The handle driver is loaded through the startup firmware; the handle driver is created based on the UEFI protocol, and the handle driver has a keyboard value reading interface under the UEFI protocol; The keyboard value reading interface is used to obtain the mapped keyboard scan code and the encoding value.
6. The method according to claim 1, characterized in that Before the startup firmware detects the handle, it also includes: When the component to be detected is connected, the device descriptor and the interface descriptor of the component to be detected are obtained through a data transmission protocol; The startup firmware detects the handle, including: When the device descriptor indicates a handle and the interface descriptor corresponds to an interface of the handle, it is determined that the startup firmware detects the handle.
7. A control device for starting firmware, characterized in that: The device comprises: An acquisition module, used for acquiring original data transmitted by the handle when the startup firmware detects the handle; the handle is provided with a handle button; A conversion module, used for mapping the numerical value at the preset byte position in the original data according to the correspondence between the handle button and the keyboard scan code, to obtain a mapped keyboard scan code and a coding value matching the mapped keyboard scan code; The control module is used to control the startup firmware according to the mapped keyboard scan code and the operation instruction corresponding to the encoding value.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Event processing method and device, electronic equipment and readable medium
CN112068713A
Handle-based BIOS setting method, equipment, a storage medium and a device
CN113672299A
Keyboard and mouse converter and key mapping method thereof
CN114546129A
Method for simulating computer keyboard or mouse operation
CN1591336A
Universal remote controller and control code setup method thereof
US20100082351A1