Key delay acquisition method and device, equipment and storage medium

By connecting the keyboard and key execution module through computer equipment, the keyboard key delay is automatically collected and calculated, solving the problems of cumbersome and low efficiency in the prior art, and achieving efficient and reliable key delay acquisition.

CN118944650AActive Publication Date: 2024-11-12SHENZHEN XINGSHAN YUEDONG TECH CO LTD

Patent Information

Application Number
CN202411150287.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-12
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

The delay acquisition process of existing keyboard keys is cumbersome, consumes a lot of human resources and time, and is susceptible to human factors, resulting in low efficiency and poor reliability.

Method used

Connect the keyboard and key execution module through a computer device, sample parameters and send execution instructions, obtain the pressing and release timestamp of the key, calculate the key trigger and release delay, generate the average delay value, and display it in the display window.

Benefits of technology

No manual acquisition is required, which reduces the delay acquisition time of keyboard keys, improves efficiency, and improves the reliability of obtaining results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944650A_ABST
    Figure CN118944650A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computers, and discloses a key delay obtaining method, device and equipment and a storage medium, and the method comprises the steps: obtaining a trigger signal, setting the receiving time of the trigger signal as a trigger timestamp of a target key, obtaining a release signal, and setting the receiving time of the release signal as a release timestamp of the target key; according to the pressing timestamp of the target key and the triggering timestamp of the target key, key triggering delay of the target key is generated, and according to the loosening timestamp of the target key and the releasing timestamp of the target key, key releasing delay of the target key is generated; and adding different key trigger delays to generate a first sum, dividing the first sum by the number of the key trigger delays, generating an average trigger delay of the target key, adding different key release delays to generate a second sum, dividing the second sum by the number of the key release delays, and generating an average release delay of the target key. According to the invention, the acquisition efficiency of the key delay is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a key delay acquisition method, device, equipment and storage medium. Background Art

[0002] In computer operation, the key delay of the keyboard is very important for users who pursue efficient work, professional competition or simply enjoy the convenience of technology. Because of understanding the key delay of the keyboard, users can choose the right keyboard to improve the operation experience.

[0003] However, the acquisition process of the existing keyboard key delay is cumbersome, which is not conducive to improving the acquisition efficiency of the key delay. The reason is that the existing technology mainly adopts a manual acquisition method to obtain the keyboard key delay, which consumes a lot of human resources and time resources, increases the acquisition time of the keyboard key delay, and is easily affected by human factors. Therefore, it is not conducive to improving the acquisition efficiency of the key delay. Summary of the invention

[0004] The present invention provides a key delay acquisition method, device, computer equipment and storage medium to solve the technical problem that the key delay acquisition process of the existing keyboard is complicated and is not conducive to improving the key delay acquisition efficiency.

[0005] In a first aspect, a key delay acquisition method is provided, which is applied to a computer device, wherein the computer device is respectively connected to a keyboard and a key execution module, and the key delay acquisition method comprises: Acquire sampling parameters corresponding to the target key of the keyboard, and send the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used to instruct the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; Obtaining a timestamp of the key execution module executing a pressing operation on the target key, and setting the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; Obtaining a timestamp of the key execution module executing a release operation on the target key, and setting the timestamp of the key execution module executing the release operation on the target key as the release timestamp of the target key; Obtain a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, obtain a release signal of the target key sent by the keyboard, set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is the signal of the target key when it is pressed, and the release signal is the signal of the target key when it is released; Generate a key trigger delay of the target key according to the pressing timestamp of the target key and the triggering timestamp of the target key, and generate a key release delay of the target key according to the releasing timestamp of the target key and the releasing timestamp of the target key; The different key trigger delays are added together to generate a first sum, the first sum is divided by the number of key trigger delays to generate an average trigger delay of the target key, the different key release delays are added together to generate a second sum, the second sum is divided by the number of key release delays to generate an average release delay of the target key.

[0006] Further, the acquiring the timestamp of the key execution module executing the pressing operation on the target key, and setting the timestamp of the key execution module executing the pressing operation on the target key as the pressing timestamp of the target key, includes: Receive a first execution result returned by the key execution module according to the execution instruction; In the first execution result, the timestamp of the key execution module performing the pressing operation on the target key is obtained, and the timestamp of the key execution module performing the pressing operation on the target key is set as the pressing timestamp of the target key.

[0007] Furthermore, the acquiring the timestamp of the release operation performed by the key execution module on the target key, and setting the timestamp of the release operation performed by the key execution module on the target key as the release timestamp of the target key, includes: Receive a second execution result returned by the key execution module according to the execution instruction; In the second execution result, the timestamp of the release operation performed by the key execution module on the target key is obtained, and the timestamp of the release operation performed by the key execution module on the target key is set as the release timestamp of the target key.

[0008] Further, the acquiring the trigger signal of the target key sent by the keyboard, setting the receiving time of the trigger signal as the trigger timestamp of the target key, acquiring the release signal of the target key sent by the keyboard, and setting the receiving time of the release signal as the release timestamp of the target key, comprises: Acquire the trigger signal of the target key sent by the keyboard through a preset keyboard interface, wherein the keyboard interface includes one of a USB interface and a PS / 2 interface; The receiving time of the trigger signal is set as the trigger timestamp of the target key, a release signal of the target key sent by the keyboard is acquired, and the receiving time of the release signal is set as the release timestamp of the target key.

[0009] Further, the generating a key trigger delay of the target key according to the pressing timestamp of the target key and the triggering timestamp of the target key, and generating a key release delay of the target key according to the releasing timestamp of the target key and the releasing timestamp of the target key, comprises: Generate a key trigger delay of the target key by subtracting the trigger timestamp of the target key from the press timestamp of the target key; The key release delay of the target key is generated by subtracting the trigger timestamp of the target key from the press timestamp of the target key.

[0010] Further, the adding of the different key trigger delays to generate a first sum, dividing the first sum by the number of the key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, dividing the second sum by the number of the key release delays to generate an average release delay of the target key, includes: Obtaining a maximum trigger delay and a minimum trigger delay from among the different key trigger delays, eliminating the maximum trigger delay and the minimum trigger delay from among the different key trigger delays to obtain the screened key trigger delays, adding the screened key trigger delays to generate a first sum, dividing the first sum by the number of the screened key trigger delays to generate an average trigger delay for the target key; A maximum release delay and a minimum release delay among the different key release delays are obtained, and the maximum release delay and the minimum release delay are eliminated from the different key release delays to obtain the screened key release delays, and the screened key release delays are added to generate a second sum, and the second sum is divided by the number of the screened key release delays to generate an average release delay of the target key.

[0011] Further, after adding the different key trigger delays to generate a first sum, dividing the first sum by the number of key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, and dividing the second sum by the number of key release delays to generate an average release delay of the target key, the key delay acquisition method includes: A preset display window is obtained, and an average trigger delay of the target key and an average trigger delay of the target key are displayed through the display window.

[0012] In a second aspect, a key delay acquisition device is provided, which is applied to a computer device, wherein the computer device is respectively connected to a keyboard and a key execution module, and the key delay acquisition device comprises: A first acquisition module, used for acquiring sampling parameters corresponding to a target key of the keyboard, and sending the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used for instructing the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; A second acquisition module is used to acquire a timestamp of the key execution module executing a pressing operation on the target key, and set the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; A third acquisition module is used to acquire a timestamp when the key execution module performs a release operation on the target key, and set the timestamp when the key execution module performs a release operation on the target key as the release timestamp of the target key; A fourth acquisition module is used to acquire a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, acquire a release signal of the target key sent by the keyboard, set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is a signal when the target key is pressed, and the release signal is a signal when the target key is released; A first generating module, configured to generate a key trigger delay of the target key according to a pressing timestamp of the target key and a triggering timestamp of the target key, and to generate a key release delay of the target key according to a releasing timestamp of the target key and a releasing timestamp of the target key; The second generating module is used to add the different key trigger delays to generate a first sum, divide the first sum by the number of the key trigger delays to generate an average trigger delay of the target key, add the different key release delays to generate a second sum, divide the second sum by the number of the key release delays to generate an average release delay of the target key.

[0013] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned key delay acquisition method when executing the computer program.

[0014] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned key delay acquisition method are implemented.

[0015] The present application provides a key delay acquisition method, device, computer equipment and storage medium, which obtain sampling parameters corresponding to a target key of the keyboard, send the sampling parameters and execution instructions of the sampling parameters to the key execution module, the execution instruction is used to instruct the key execution module to perform a press operation or a release operation on the target key according to the sampling parameters; obtain the timestamp of the key execution module performing the press operation on the target key, and set the timestamp of the key execution module performing the press operation on the target key as the press timestamp of the target key; obtain the timestamp of the key execution module performing the release operation on the target key, and set the timestamp of the key execution module performing the release operation on the target key as the release timestamp of the target key; obtain a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, obtain a release signal of the target key sent by the keyboard, and set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is the signal of the target key when it is pressed, and the release signal is the signal of the target key when it is released; according to the press timestamp of the target key The invention relates to a method for realizing a keyboard key release method, wherein the keyboard key release delay is generated by adding the different key trigger delays to generate a first sum, dividing the first sum by the number of the key trigger delays, and generating an average trigger delay of the target key; the keyboard key release delay is generated by adding the different key release delays to generate a second sum, and dividing the second sum by the number of the key release delays to generate an average release delay of the target key; the keyboard key release delay is generated by adding the different key trigger delays to generate a first sum, and dividing the first sum by the number of the key trigger delays to generate an average trigger delay of the target key; the keyboard key release delay is generated by adding the different key release delays to generate a second sum, and dividing the second sum by the number of the key release delays to generate an average release delay of the target key; and the keyboard key release delay is generated by adding the different key trigger delays to generate a second sum, and dividing the second sum by the number of the key release delays to generate an average release delay of the target key. Since manual acquisition is not required, the acquisition time of the keyboard key delay is reduced, which is beneficial to improving the acquisition efficiency of the keyboard key delay; on the other hand, it will not be affected by human factors, so it is beneficial to improve the reliability of the acquired keyboard key delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] 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 of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only 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 creative labor.

[0017] Figure 1 is a schematic diagram of an application environment of a key delay acquisition method in an embodiment of the present invention; Figure 2 A schematic flow chart of a method for acquiring key delay provided by an embodiment of the present invention; Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S23; Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S25; Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S26; Figure 6 is a structural schematic diagram of a key delay acquisition device in one embodiment of the present invention; Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention; Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0018] 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.

[0019] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application environment of a key delay acquisition method according to an embodiment of the present invention. The key delay acquisition method provided by the embodiment of the present invention can be applied in the following embodiments: Figure 1 In an application environment, the computer device is respectively connected to a keyboard and a key execution module.

[0020] For the sake of illustration, an example is given below: For example, the keyboard is a wired magnetic axis keyboard, and the computer device is a PC host; Among them, the PC host is the host of a personal computer (Personal Computer).

[0021] The magnetic axis keyboard and key execution module are connected to the PC host, and the key execution module indicator light is red, indicating that the device is connected to the PC host; Set on the PC host: test times 3, test interval 5S, sampling times 300, sampling interval 20ms.

[0022] After the setting is completed, the acquisition parameters will be sent to the button execution module.

[0023] When the sampling interval is 20ms, the sampling frequency is 50Hz.

[0024] After the test starts, the key execution module samples the target key to be tested on the magnetic axis keyboard 300 times at a frequency of 50Hz, with one sample being a press + release. A total of three rounds of tests are performed, with an interval of 5S between each round. At the same time, the indicator light flashes green at a frequency of 50Hz. Each time the sampling PC host collects a set of T W0 , T W1 , T0, T1, and then obtain a set of ΔT0, ΔT1.

[0025] Where ΔT0=T W0 -T0, ΔT1=T W1 -T1; Among them, T W0 is the target key press timestamp, T W1 The release timestamp of the target key; Wherein, T0 is the trigger timestamp of the target key, and T1 is the release timestamp of the target key; Wherein, ΔT0 is the key triggering delay of the target key, and ΔT1 is the key releasing delay of the target key.

[0026] After the acquisition is completed, the indicator light turns green for 5 seconds. At the same time, the upper computer software processes the 300*3 groups of key delay data to obtain the average trigger delay and average release delay, and displays the results.

[0027] Among them, manufacturers, enthusiasts, and bloggers can use the above-mentioned key delay acquisition method to test existing keyboards, thereby meeting the usage needs of different user groups.

[0028] In the scheme implemented by the above-mentioned key delay acquisition method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, the different key trigger delays are added to generate a first sum, and the first sum is divided by the number of the key trigger delays to generate the average trigger delay of the target key. The different key release delays are added to generate a second sum, and the second sum is divided by the number of the key release delays to generate the average release delay of the target key. Since manual acquisition is not required, the acquisition time of the keyboard key delay is reduced, which is beneficial to improving the acquisition efficiency of the keyboard key delay. On the other hand, it will not be affected by human factors, so it is beneficial to improve the reliability of the acquired keyboard key delay.

[0029] The client may include but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.

[0030] The server can be implemented with an independent task database or a task database cluster composed of multiple task databases. The present invention is described in detail below through specific embodiments.

[0031] See also Figure 2 , Figure 2 A flowchart of a key delay acquisition method provided by an embodiment of the present invention is applied to a computer device, wherein the computer device is connected to a keyboard and a key execution module respectively. The key delay acquisition method comprises the following steps: S21, obtaining sampling parameters corresponding to the target key of the keyboard, and sending the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used to instruct the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; Exemplarily, the sampling parameters include the number of tests, the test interval, the number of samples, and the sampling interval. The number of tests refers to the total number of tests, the test interval refers to the time difference between two adjacent tests, the number of samples refers to the total number of samples in one test, and the test interval refers to the time difference between two adjacent samples.

[0032] For the sake of explanation, an example is given below: Sampling parameters are set through the host computer, and the sampling parameters include the number of tests, test interval, number of samples, and sampling interval. The set sampling parameters will be sent to the key execution module.

[0033] The execution instructions are user-defined or system-default, and are not restricted here.

[0034] Among them, the data packet for executing instructions includes a header part, an ACK part, and a data part.

[0035] Among them, the packet header includes head, len, cmd, and crc.

[0036] Among them, the full Chinese name of head is: Head; the full English name of head is: Header.

[0037] Among them, the Chinese full name of len is: length; the English full name of len is: Length.

[0038] Among them, the Chinese full name of cmd is: command; the English full name of cmd is: Command.

[0039] Among them, the Chinese full name of crc: cyclic redundancy check, and the English full name of crc: Cyclic Redundancy Check.

[0040] For the sake of illustration, an example is given below: head: indicates the starting byte of the data packet. For example, head is 0x5C.

[0041] len: indicates the length of the data part.

[0042] cmd: indicates the command type, which includes write command 0x01, read command 0x02, start test command 0x03, physical trigger command 0x04, and physical release command 0x05.

[0043] crc: indicates the checksum of the data part.

[0044] ACK: Indicates the status of the response command. ack=0x01 indicates successful receipt of the other party's command, and ack=0x00 indicates failure to receive the other party's command.

[0045] Data part: instruction data, such as 0x0000 represents physical trigger, the timestamp of physical trigger is the timestamp when the key execution module performs the pressing operation on the target key; such as 0xFFFF represents physical release, the timestamp of physical release is the timestamp when the key execution module performs the releasing operation on the target key.

[0046] S22, obtaining a timestamp of the key execution module executing a pressing operation on the target key, and setting the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; The acquiring the timestamp of the key execution module executing the pressing operation on the target key, and setting the timestamp of the key execution module executing the pressing operation on the target key as the pressing timestamp of the target key, comprises: Receive a first execution result returned by the key execution module according to the execution instruction; In the first execution result, the timestamp of the key execution module performing the pressing operation on the target key is obtained, and the timestamp of the key execution module performing the pressing operation on the target key is set as the pressing timestamp of the target key.

[0047] S23, obtaining a timestamp of the key execution module executing a release operation on the target key, and setting the timestamp of the key execution module executing a release operation on the target key as the release timestamp of the target key; S24, obtaining a trigger signal of the target key sent by the keyboard, setting the receiving time of the trigger signal as the trigger timestamp of the target key, obtaining a release signal of the target key sent by the keyboard, setting the receiving time of the release signal as the release timestamp of the target key, the trigger signal being the signal of the target key when it is pressed, and the release signal being the signal of the target key when it is released; When the target key is pressed, the keyboard circuit will detect a pressing action on the target key, thereby generating a signal when the target key is pressed.

[0048] When the target key is released, the circuit of the keyboard will detect a release action for the target key, thereby generating a signal when the target key is released.

[0049] The step of obtaining a trigger signal of the target key sent by the keyboard, setting the receiving time of the trigger signal as the trigger timestamp of the target key, obtaining a release signal of the target key sent by the keyboard, and setting the receiving time of the release signal as the release timestamp of the target key comprises: Acquire the trigger signal of the target key sent by the keyboard through a preset keyboard interface, wherein the keyboard interface includes one of a USB interface and a PS / 2 interface; The receiving time of the trigger signal is set as the trigger timestamp of the target key, a release signal of the target key sent by the keyboard is acquired, and the receiving time of the release signal is set as the release timestamp of the target key.

[0050] The USB interface is a USB (Universal Serial Bus) interface.

[0051] PSPS / 2 interface is a circular 6-pin mini-DIN interface used to connect keyboard and mouse. PS / 2 communication protocol is a bidirectional synchronous serial communication protocol with pin definitions such as clock line and data line.

[0052] S25, generating a key trigger delay of the target key according to the pressing timestamp of the target key and the triggering timestamp of the target key, and generating a key release delay of the target key according to the releasing timestamp of the target key and the releasing timestamp of the target key; S26, adding the different key trigger delays to generate a first sum, dividing the first sum by the number of key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, dividing the second sum by the number of key release delays to generate an average release delay of the target key.

[0053] The number of key trigger delays is the number of samples of the key trigger delay.

[0054] The number of key release delays is the number of samples of the key release delay.

[0055] For the sake of illustration, an example is given below: For example, if the sampling is 50 times per second, the number of samples of the key trigger delay within 6 seconds is 300, so the number of key trigger delays is 300. Similarly, if the sampling is 50 times per second, the number of samples of the key release delay within 6 seconds is 300, so the number of key release delays is 300.

[0056] For example, if the sampling rate is 100 times per second, the number of samples of the key trigger delay within 8 seconds is 800, so the number of key trigger delays is 800. Similarly, if the sampling rate is 100 times per second, the number of samples of the key release delay within 8 seconds is 800, so the number of key release delays is 800.

[0057] Wherein, after adding the different key trigger delays to generate a first sum, dividing the first sum by the number of the key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, dividing the second sum by the number of the key release delays to generate an average release delay of the target key, the key delay acquisition method includes: Step A: obtaining a preset display window, and displaying the average trigger delay of the target key and the average trigger delay of the target key through the display window.

[0058] Exemplarily, after adding the different key trigger delays to generate a first sum, dividing the first sum by the number of key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, and dividing the second sum by the number of key release delays to generate an average release delay of the target key, the key delay acquisition method includes: Step B, adding the average trigger delays of different target keys to generate a third sum, dividing the third sum by the number of target keys to generate an overall trigger delay of the keyboard, adding the average release delays of different target keys to generate a fourth sum, dividing the third sum by the number of target keys to generate an overall release delay of the keyboard; Obtaining a first ratio between the overall trigger delay and the preset trigger delay, obtaining a second ratio between the overall release delay and the preset trigger delay, and adding the first ratio and the second ratio to generate an overall delay value; When the overall delay value is less than a preset value, a message indicating that the keyboard test has passed is output; and when the overall delay value is greater than or equal to the preset value, a message indicating that the keyboard test has failed is output.

[0059] Among them, the overall trigger delay is used to describe the delay degree of the keyboard in terms of trigger delay. When the overall trigger delay is larger, the delay degree of the keyboard in terms of trigger delay is larger. When the overall trigger delay is smaller, the delay degree of the keyboard in terms of trigger delay is smaller.

[0060] The overall release delay is used to describe the delay degree of the keyboard in terms of release delay. When the overall release delay is greater, the delay degree of the keyboard in terms of release delay is greater; when the overall release delay is smaller, the delay degree of the keyboard in terms of release delay is smaller.

[0061] Among them, the overall delay value is used to describe the delay degree of the keyboard in terms of trigger delay and release delay. When the overall delay value is larger, the delay degree of the keyboard in terms of trigger delay and release delay is larger. When the overall delay value is smaller, the delay degree of the keyboard in terms of trigger delay and release delay is smaller.

[0062] Wherein, the target key is any key on the keyboard.

[0063] Among them, the different target keys are set by the user or by system default.

[0064] For the sake of illustration, an example is given below: For example, when the different target keys are the W key, the A key, the S key, and the D key, the average trigger delays of the different target keys are added to generate a third sum, the third sum is divided by the number of the target keys to generate the overall trigger delay of the keyboard, the average release delays of the different target keys are added to generate a fourth sum, and the third sum is divided by the number of the target keys to generate the overall release delay of the keyboard, including: Add the average trigger delays of the W key, A key, S key, and D key to generate a third sum, divide the third sum by the number of target keys to generate the overall trigger delay of the keyboard, add the average release delays of the W key, A key, S key, and D key to generate a fourth sum, divide the third sum by the number of target keys to generate the overall release delay of the keyboard.

[0065] In the embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, the different key trigger delays are added to generate a first sum, and the first sum is divided by the number of the key trigger delays to generate the average trigger delay of the target key. The different key release delays are added to generate a second sum, and the second sum is divided by the number of the key release delays to generate the average release delay of the target key. Since manual acquisition is not required, the acquisition time of the keyboard key delay is reduced, which is beneficial to improving the acquisition efficiency of the keyboard key delay. On the other hand, it will not be affected by human factors, which is beneficial to improving the reliability of the acquired keyboard key delay.

[0066] See also Figure 3 , Figure 3 yes Figure 1 A specific implementation flow diagram of step S23 is described in detail as follows: S31, receiving a second execution result returned by the key execution module according to the execution instruction; S32: in the second execution result, obtain the timestamp of the release operation performed by the key execution module on the target key, and set the timestamp of the release operation performed by the key execution module on the target key as the release timestamp of the target key.

[0067] In the embodiment of the present invention, the time point when the target key is released can be determined by the release timestamp.

[0068] See also Figure 4 , Figure 4 yes Figure 1 A specific implementation flow diagram of step S25 is described in detail as follows: S41, generating a key trigger delay of the target key by subtracting a trigger timestamp of the target key from a press timestamp of the target key; S42: Generate a key release delay of the target key by subtracting the trigger timestamp of the target key from the press timestamp of the target key.

[0069] In the embodiment of the present invention, the delay degree of the target key can be determined according to the key trigger delay and the key release delay.

[0070] See also Figure 5 , Figure 5 yes Figure 1 A specific implementation flow diagram of step S26 is described in detail as follows: S51, obtaining the maximum trigger delay and the minimum trigger delay among the different key trigger delays, eliminating the maximum trigger delay and the minimum trigger delay among the different key trigger delays, obtaining the filtered key trigger delays, adding the filtered key trigger delays to generate a first sum, dividing the first sum by the number of the filtered key trigger delays to generate an average trigger delay of the target key; S52, obtaining the maximum release delay and the minimum release delay among the different key release delays, eliminating the maximum release delay and the minimum release delay among the different key release delays to obtain the screened key release delays, adding the screened key release delays to generate a second sum, dividing the second sum by the number of the screened key release delays to generate an average release delay of the target key.

[0071] In the embodiment of the present invention, since manual acquisition is not required, the acquisition time of the keyboard key delay is reduced, which is beneficial to improving the acquisition efficiency of the keyboard key delay.

[0072] See also Figure 6 , Figure 6 is a structural diagram of a key delay acquisition device in an embodiment of the present invention. The key delay acquisition device is applied to a computer device, and the computer device is connected to a keyboard and a key execution module, such as Figure 6 As shown, the key delay acquisition device includes a first acquisition module 101, a second acquisition module 102, a third acquisition module 103, a fourth acquisition module 104, a first generation module 105, and a second generation module 106. The functional modules are described in detail as follows: A first acquisition module 101 is used to acquire sampling parameters corresponding to a target key of the keyboard, and send the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used to instruct the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; A second acquisition module 102 is used to acquire a timestamp of the key execution module executing a pressing operation on the target key, and set the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; A third acquisition module 103 is used to acquire a timestamp when the key execution module performs a release operation on the target key, and set the timestamp when the key execution module performs a release operation on the target key as the release timestamp of the target key; A fourth acquisition module 104 is used to acquire a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, acquire a release signal of the target key sent by the keyboard, set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is a signal when the target key is pressed, and the release signal is a signal when the target key is released; A first generating module 105, configured to generate a key trigger delay of the target key according to a pressing timestamp of the target key and a triggering timestamp of the target key, and to generate a key release delay of the target key according to a releasing timestamp of the target key and a releasing timestamp of the target key; The second generating module 106 is used for adding the different key trigger delays to generate a first sum, dividing the first sum by the number of the key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, dividing the second sum by the number of the key release delays to generate an average release delay of the target key.

[0073] In the embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, the different key trigger delays are added to generate a first sum, and the first sum is divided by the number of the key trigger delays to generate the average trigger delay of the target key. The different key release delays are added to generate a second sum, and the second sum is divided by the number of the key release delays to generate the average release delay of the target key. Since manual acquisition is not required, the acquisition time of the keyboard key delay is reduced, which is beneficial to improving the acquisition efficiency of the keyboard key delay. On the other hand, it will not be affected by human factors, which is beneficial to improving the reliability of the acquired keyboard key delay.

[0074] The specific definition of the key delay acquisition device can be found in the above definition of the key delay acquisition method, which will not be repeated here.

[0075] Each module in the above-mentioned key delay acquisition device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules 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 corresponding operations of each of the above modules.

[0076] See also Figure 7 , Figure 7 is a schematic diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a server. The internal structure diagram thereof may be as shown in FIG. Figure 7The computer device includes a processor, a memory, a network interface and a database connected through a system bus.

[0077] The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, the functions or steps on the server side of a key delay acquisition method are implemented.

[0078] See also Figure 8 , Figure 8 is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, 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 network interface of the computer device is used to communicate with an external task database through a network connection. When the computer program is executed by the processor, the functions or steps of a key delay acquisition method are realized.

[0079] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.

[0080] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0081] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0082] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for obtaining key delay, It is characterized in that Applied to a computer device, the computer device is connected to a keyboard and a key execution module respectively, and the key delay acquisition method includes: Acquire sampling parameters corresponding to the target key of the keyboard, and send the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used to instruct the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; Obtaining a timestamp of the key execution module executing a pressing operation on the target key, and setting the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; Obtaining a timestamp of the key execution module executing a release operation on the target key, and setting the timestamp of the key execution module executing the release operation on the target key as the release timestamp of the target key; Obtain a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, obtain a release signal of the target key sent by the keyboard, set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is the signal of the target key when it is pressed, and the release signal is the signal of the target key when it is released; Generate a key trigger delay of the target key according to the pressing timestamp of the target key and the triggering timestamp of the target key, and generate a key release delay of the target key according to the releasing timestamp of the target key and the releasing timestamp of the target key; The different key trigger delays are added together to generate a first sum, the first sum is divided by the number of key trigger delays to generate an average trigger delay of the target key, the different key release delays are added together to generate a second sum, the second sum is divided by the number of key release delays to generate an average release delay of the target key.

2. The key delay acquisition method according to claim 1, It is characterized in that The obtaining the timestamp of the key execution module executing the pressing operation on the target key, and setting the timestamp of the key execution module executing the pressing operation on the target key as the pressing timestamp of the target key, comprises: Receive a first execution result returned by the key execution module according to the execution instruction; In the first execution result, the timestamp of the key execution module performing the pressing operation on the target key is obtained, and the timestamp of the key execution module performing the pressing operation on the target key is set as the pressing timestamp of the target key.

3. The key delay acquisition method according to claim 1, It is characterized in that The obtaining the timestamp of the release operation performed by the key execution module on the target key, and setting the timestamp of the release operation performed by the key execution module on the target key as the release timestamp of the target key, comprises: Receive a second execution result returned by the key execution module according to the execution instruction; In the second execution result, the timestamp of the release operation performed by the key execution module on the target key is obtained, and the timestamp of the release operation performed by the key execution module on the target key is set as the release timestamp of the target key.

4. The key delay acquisition method according to claim 1, It is characterized in that The acquiring the trigger signal of the target key sent by the keyboard, setting the receiving time of the trigger signal as the trigger timestamp of the target key, acquiring the release signal of the target key sent by the keyboard, and setting the receiving time of the release signal as the release timestamp of the target key, comprises: Acquire the trigger signal of the target key sent by the keyboard through a preset keyboard interface, wherein the keyboard interface includes one of a USB interface and a PS / 2 interface; The receiving time of the trigger signal is set as the trigger timestamp of the target key, a release signal of the target key sent by the keyboard is acquired, and the receiving time of the release signal is set as the release timestamp of the target key.

5. The key delay acquisition method according to claim 1, It is characterized in that The step of generating a key trigger delay of the target key according to the pressing timestamp of the target key and the triggering timestamp of the target key, and generating a key release delay of the target key according to the releasing timestamp of the target key and the releasing timestamp of the target key, comprises: Generate a key trigger delay of the target key by subtracting the trigger timestamp of the target key from the press timestamp of the target key; The key release delay of the target key is generated by subtracting the trigger timestamp of the target key from the press timestamp of the target key.

6. The key delay acquisition method according to claim 1, It is characterized in that The adding of different key trigger delays to generate a first sum, dividing the first sum by the number of key trigger delays to generate an average trigger delay of the target key, adding of different key release delays to generate a second sum, dividing the second sum by the number of key release delays to generate an average release delay of the target key, comprises: Obtaining a maximum trigger delay and a minimum trigger delay from among the different key trigger delays, eliminating the maximum trigger delay and the minimum trigger delay from among the different key trigger delays to obtain the screened key trigger delays, adding the screened key trigger delays to generate a first sum, dividing the first sum by the number of the screened key trigger delays to generate an average trigger delay for the target key; A maximum release delay and a minimum release delay among the different key release delays are obtained, and the maximum release delay and the minimum release delay are eliminated from the different key release delays to obtain the screened key release delays, and the screened key release delays are added to generate a second sum, and the second sum is divided by the number of the screened key release delays to generate an average release delay of the target key.

7. The key delay acquisition method according to any one of claims 1 to 6, It is characterized in that After adding the different key trigger delays to generate a first sum, dividing the first sum by the number of key trigger delays to generate an average trigger delay of the target key, adding the different key release delays to generate a second sum, and dividing the second sum by the number of key release delays to generate an average release delay of the target key, the key delay acquisition method includes: A preset display window is obtained, and an average trigger delay of the target key and an average trigger delay of the target key are displayed through the display window.

8. A key delay acquisition device, It is characterized in that Applied to a computer device, the computer device is connected to a keyboard and a key execution module respectively, and the key delay acquisition device includes: A first acquisition module, used for acquiring sampling parameters corresponding to a target key of the keyboard, and sending the sampling parameters and an execution instruction of the sampling parameters to the key execution module, wherein the execution instruction is used for instructing the key execution module to perform a pressing operation or a releasing operation on the target key according to the sampling parameters; A second acquisition module is used to acquire a timestamp of the key execution module executing a pressing operation on the target key, and set the timestamp of the key execution module executing a pressing operation on the target key as the pressing timestamp of the target key; A third acquisition module is used to acquire a timestamp when the key execution module performs a release operation on the target key, and set the timestamp when the key execution module performs a release operation on the target key as the release timestamp of the target key; A fourth acquisition module is used to acquire a trigger signal of the target key sent by the keyboard, set the receiving time of the trigger signal as the trigger timestamp of the target key, acquire a release signal of the target key sent by the keyboard, set the receiving time of the release signal as the release timestamp of the target key, the trigger signal is a signal when the target key is pressed, and the release signal is a signal when the target key is released; A first generating module, configured to generate a key trigger delay of the target key according to a pressing timestamp of the target key and a triggering timestamp of the target key, and to generate a key release delay of the target key according to a releasing timestamp of the target key and a releasing timestamp of the target key; The second generating module is used to add the different key trigger delays to generate a first sum, divide the first sum by the number of the key trigger delays to generate an average trigger delay of the target key, add the different key release delays to generate a second sum, divide the second sum by the number of the key release delays to generate an average release delay of the target key.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the key delay acquisition method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the key delay acquisition method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Automatic testing method for reliability of keyboard input system

    CN102778617A

  • Speed adjustable USB keyboard

    CN103838387A

  • Key delay test method and device, computer equipment and readable storage medium

    CN112788391A

  • Key event processing method and device, equipment and storage medium

    CN112882850A

  • Key jitter elimination device and method and jitter elimination key

    CN116846367A

Cited By

  • Key delay test method and device

    CN121231887A