A wireless keyboard and a method for improving transmission efficiency through dynamic coding

By adopting dynamic encoding technology on wireless keyboards, selecting the optimal encoding method according to the key state or state changes, the problem of low data transmission rate of wireless keyboards is solved, and efficient data transmission and power consumption saving is achieved.

CN119536531BActive Publication Date: 2025-04-18NANJING QINHENG MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510105264.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-18
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The data transmission rate of existing wireless keyboards is low, and it is impossible to achieve an efficient 8K transmission rate, resulting in low transmission efficiency in daily use.

Method used

Through dynamic encoding technology, the scanning results of the wireless keyboard are encoded and the optimal encoding method is selected to reduce the amount of data transmitted. The specific method includes encoding according to the key state or state change, and selecting the shortest encoded data by comparing the data lengths of different encoding methods.

Benefits of technology

Through dynamic encoding technology, the amount of data to be transmitted is significantly reduced, the data transmission efficiency of wireless keyboards is improved, the high Reporter rate is achieved, and power consumption is saved under battery power conditions, and battery life is extended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536531B_ABST
    Figure CN119536531B_ABST
Patent Text Reader

Abstract

The present invention discloses a wireless keyboard and a method for improving transmission efficiency through dynamic coding. The keyboard keys are scanned to obtain scanning results. In the scanning results, the states of all keys are arranged according to the order of the keys. The scanning results are encoded to obtain coded data. The coded data includes information of the selected coding method and information of the scanning result. The coded data obtained by selecting the optimal coding method is transmitted wirelessly. The wireless keyboard of the present invention has a small amount of data transmission and high transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of wireless communications, and in particular relates to a wireless keyboard and a method for improving transmission efficiency thereof through dynamic coding. Background Art

[0002] A standard keyboard has 104 keys. According to the bit definition, each key requires at least 104 bits of binary data. A 1 in the corresponding bit indicates that the key is pressed, and a 0 indicates that the key is not pressed. Therefore, when we express keyboard data, we need to transmit 104 bits of binary data each time, which requires at least 13 bytes.

[0003] For example, the data rate of a common 2.4G wireless keyboard is 1Mbps. When transmitting 104 bits of valid data, plus the protocol overhead such as the preamble, access address, CRC check, and RF startup time, it has exceeded 125us, and the transmission rate of 8K cannot be achieved. In actual use, in order to ensure the reliability of data transmission, it is necessary to respond to the data packet. Even if the data rate is 2Mbps, the transmission rate of 8K cannot be achieved. The data transmission efficiency is low because of the excessive amount of data transmitted. Summary of the invention

[0004] Purpose of the invention: In order to solve the problem of low data transmission rate of wireless keyboards in the prior art, the present invention provides a wireless keyboard and a method for improving transmission efficiency thereof through dynamic coding.

[0005] Technical solution: A method for improving transmission efficiency of a wireless keyboard through dynamic coding, comprising the following steps:

[0006] Scan the keyboard keys to obtain the scan results, in which the states of all keys are arranged in the order of the keys;

[0007] The scanning result is encoded to obtain encoded data, wherein the encoded data includes information of the selected encoding method and information of the scanning result, and the encoded data obtained by selecting the optimal encoding method is transmitted wirelessly; the encoding method includes at least two of the following:

[0008] The first encoding method: encoding is performed according to the state of the key, and the information of the scanning result includes the coordinates of the key in the specified state;

[0009] The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state;

[0010] The third encoding method: encoding according to the change of the key state, the change of the key state means that the state of the same key has changed compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change;

[0011] The fourth encoding method: encoding is performed according to the change of the key state, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the key from the first specified change state to the last specified change state.

[0012] Furthermore, the optimal encoding method is the encoding method that obtains the shortest length of encoded data; the scanning results are first encoded using different encoding methods, and then the lengths of the encoded data obtained by various encoding methods are compared to obtain the shortest encoded data.

[0013] Furthermore, the optimal encoding method is first obtained by judgment, and the scanning result is directly encoded using the optimal encoding method. The judgment method includes:

[0014] Preset a first threshold value S1 and a second threshold value S2;

[0015] Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results;

[0016] First compare the sizes of M and N. If M<N, then compare the sizes of M and S1. If M≤S1, use the first encoding method for encoding. If M>S1, use the second encoding method for encoding. If M>N, then compare the sizes of N and S2. If N≤S2, use the third encoding method for encoding. If N>S2, use the fourth encoding method for encoding.

[0017] Furthermore, the optimal encoding method is first obtained by judgment, and the scanning result is directly encoded using the optimal encoding method. The judgment method includes:

[0018] Preset a first threshold value S1 and a second threshold value S2;

[0019] Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results;

[0020] First compare the sizes of M and S1. If M≤S1, use the first encoding method for encoding; if M>S1, compare the sizes of N and S2. If N≤S2, use the third encoding method for encoding; if N>S2, use the second encoding method or the fourth encoding method for encoding.

[0021] Furthermore, the specified state is a pressed state.

[0022] Furthermore, the specified change condition is that a key state has changed.

[0023] Further, in the second encoding mode, the local segment is any one of the following:

[0024] From the first key to the last key in the specified state;

[0025] From the first key in a specified state to the last key;

[0026] From the key in the first specified state to the key in the last specified state, at this time, the encoded data also includes the coordinates of the key in the first specified state or the coordinates of the key in the last specified state.

[0027] Furthermore, in the fourth encoding mode, the local segment is any one of the following:

[0028] From the first key to the last key that specifies the change;

[0029] From the first key that specifies the change to the last key;

[0030] From the first key that specifies a change to the last key that specifies a change, at this time, the encoded data also includes the coordinates of the first key that specifies a change or the coordinates of the last key that specifies a change.

[0031] A wireless keyboard, comprising:

[0032] The scanning detection module is used to scan the keyboard keys to obtain the scanning results. In the scanning results, the states of all keys are arranged according to the order of the keys;

[0033] The dynamic encoding module is used to encode the scanning result to obtain the encoded data, wherein the encoded data includes information of the selected encoding method and information of the scanning result; the encoding method includes at least two of the following:

[0034] The first encoding method: encoding is performed according to the state of the key, and the information of the scanning result includes the coordinates of the key in the specified state;

[0035] The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state;

[0036] The third encoding method: encoding according to the change of the key state, the change of the key state means that the state of the same key has changed compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change;

[0037] Fourth encoding method: encoding according to the change of key status, the information of the scanning result includes the status codes of all keys in the local segment, and the local segment includes the key from the first key of the specified change status to the last key of the specified change status;

[0038] The wireless communication module is used to transmit the encoded data obtained by the optimal encoding method.

[0039] Furthermore, it also includes a comparison module, which is used to select the encoding data with the shortest length as the encoding data obtained by the optimal encoding method, or to compare the number of keys M in the specified state and the number of keys N in the specified change situation in the scanning results with the preset first threshold S1 and second threshold S2, so as to determine the optimal encoding method.

[0040] Compared with the prior art, the wireless keyboard and the method for improving transmission efficiency by dynamic coding provided by the present invention have at least the following beneficial effects:

[0041] (1) In daily use of wireless keyboards, only a few keys are pressed in most cases, and the number of keys that change state each time is also small. In addition, the keys that are pressed are highly random and do not follow a certain pattern. Taking full advantage of this usage characteristic of wireless keyboards, a dynamic encoding method is proposed. According to the different situations of key pressing on the wireless keyboard, including the number of keys in a specified state and the number of keys in a specified change situation, the scanning results are encoded by dynamically selecting the optimal encoding method. This can greatly reduce the amount of data that needs to be transmitted, greatly improve the efficiency of wireless transmission, and achieve a high reporting rate for wireless keyboards.

[0042] (2) Since wireless keyboards are all battery-powered, under the same reporting rate, this method can reduce the amount of transmitted data, save power consumption, extend the battery life of wireless keyboards, and reduce the need for frequent battery replacement;

[0043] (3) Since wireless transmission is easily affected by interference and has a certain bit error rate, once a data error occurs in the entire data frame, the entire data frame becomes invalid. In the transmission of a keyboard scan result, the larger the amount of transmitted data, the higher the probability of error in the entire data frame. This method can reduce the amount of transmitted data as much as possible, thereby reducing the probability of wireless transmission errors and improving the accuracy of keyboard data. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flow chart of the method of embodiment 1;

[0045] Figure 2 is a flow chart of the method of Embodiment 2;

[0046] Figure 3This is a flow chart of the method of embodiment 3. DETAILED DESCRIPTION

[0047] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments.

[0048] Embodiment 1:

[0049] A method for improving transmission efficiency of a wireless keyboard by dynamic coding, such as Figure 1 As shown, the following steps are included:

[0050] Scan the keyboard keys to get the scan results. In the scan results, the states of all keys are arranged in the order of the keys. The states of keys include two types: pressed and not pressed. The order of keys is the order agreed upon by the wireless transmitter and receiver of the wireless keyboard (for example, the size of the keyboard code table value). The coordinates of each key can be determined according to the order of keys. For example, the coordinates of the first key are 0000000, and the coordinates of the 104th key are 1100111. If more keys need to be added, the number of digits can be increased.

[0051] The scan result is encoded to obtain encoded data, which includes information about the selected encoding method and information about the scan result. The encoded data obtained by selecting the optimal encoding method is transmitted wirelessly. The encoding method includes at least two of the following, that is, at least two of the following encoding methods are selected for encoding respectively, and finally the encoded data with the shortest length is selected as the encoded data obtained by the optimal encoding method. The following four encoding methods can be used for encoding respectively, and then compared. The information of the encoding method is a flag indicating which encoding method is used, which can be multi-bit data to distinguish between multiple different encoding methods, such as using 00, 01, 10, and 11 to represent the first encoding method, the second encoding method, the third encoding method, and the fourth encoding method respectively. Specific encoding methods include:

[0052] The first encoding method: Encoding is performed according to the state of the key, and the information of the scan result includes the coordinates of the key in the specified state; in this embodiment, the specified state is that the key is pressed, and the scan result information includes the coordinates of the pressed key. When the number of pressed keys is large and the number of unpressed keys is small, the specified state can also be defined as the key is not pressed, and the coordinates of the unpressed keys need to be encoded.

[0053] The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state;

[0054] The third encoding method: encoding is performed according to the change of the key state, where the change of the key state refers to the change of the state of the same key compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change; in this embodiment, the specified change is the situation where the key state has changed, including from pressed to not pressed, or from not pressed to pressed. Similarly, the specified change can also be defined as the situation where the key state has not changed.

[0055] The fourth encoding method: encoding is performed according to the change of the key state, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the key from the first specified change state to the last specified change state.

[0056] In the second encoding mode, the local segment is any of the following:

[0057] From the first key to the last key in the specified state;

[0058] From the first key in a specified state to the last key;

[0059] From the key in the first specified state to the key in the last specified state, at this time, the encoded data also includes the coordinates of the key in the first specified state or the coordinates of the key in the last specified state.

[0060] In the fourth encoding mode, the local segment is any of the following:

[0061] From the first key to the last key that specifies the change;

[0062] From the first key that specifies the change to the last key;

[0063] From the first key that specifies a change to the last key that specifies a change, at this time, the encoded data also includes the coordinates of the first key that specifies a change or the coordinates of the last key that specifies a change.

[0064] In setting the local segment, you can directly select one of the above methods, or dynamically select the appropriate local segment definition based on the scanning results, which can be used as an independent encoding method to further subdivide the encoding method.

[0065] A wireless keyboard, comprising:

[0066] The scanning detection module is used to scan the keyboard keys to obtain the scanning results. In the scanning results, the states of all keys are arranged according to the order of the keys;

[0067] The dynamic encoding module is used to encode the scanning result to obtain the encoded data, wherein the encoded data includes information of the selected encoding method and information of the scanning result; the encoding method includes at least two of the following:

[0068] The first encoding method: encoding is performed according to the state of the key, and the information of the scanning result includes the coordinates of the key in the specified state;

[0069] The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state;

[0070] The third encoding method: encoding according to the change of the key state, the change of the key state means that the state of the same key has changed compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change;

[0071] Fourth encoding method: encoding according to the change of key status, the information of the scanning result includes the status codes of all keys in the local segment, and the local segment includes the key from the first key of the specified change status to the last key of the specified change status;

[0072] A wireless communication module, used for transmitting the encoded data obtained by the optimal encoding method;

[0073] It also includes a comparison module, which is used to select the encoded data with the shortest length as the encoded data obtained by the optimal encoding method.

[0074] Embodiment 2:

[0075] The difference between the second embodiment and the first embodiment is that the first embodiment first uses multiple encoding methods for encoding, and finally selects the encoded data with the shortest length as the optimal encoded data for subsequent wireless transmission. The second embodiment first determines which encoding method is the optimal encoding method, and then directly uses the optimal encoding method to encode the encoded data for subsequent wireless transmission. Figure 2 The method for determining which encoding method is the optimal encoding method includes:

[0076] Preset a first threshold value S1 and a second threshold value S2;

[0077] Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results;

[0078] First, M and S1 are compared. If M≤S1, the first encoding method is used for encoding. If M>S1, N and S2 are compared. If N≤S2, the third encoding method is used for encoding. If N>S2, the second encoding method or the fourth encoding method is used for encoding.

[0079] In this embodiment, the number of keys in the specified state is compared first, that is, the first encoding method is selected first. Alternatively, the size of N and S2 may be compared first, and the third encoding method is selected first.

[0080] Compared with the first embodiment, the comparison module of the wireless keyboard of this embodiment has a different function. The comparison module of this embodiment is used to compare the number of keys M in the specified state and the number of keys N in the specified change state in the scanning results with the preset first threshold S1 and second threshold S2 to determine the optimal encoding method.

[0081] The statistics of M and N can be calculated after the scanning results are obtained, or the accumulator can be used to accumulate the number of keys to be counted during the detection process to obtain the values ​​of M and N more quickly.

[0082] Compared with the first embodiment, the method of the second embodiment does not need to use multiple encoding methods for encoding respectively, which saves the calculation process and makes the transmission more efficient.

[0083] Embodiment three:

[0084] The difference between the third embodiment and the second embodiment is that the method for determining the optimal encoding method is different. Figure 3 As shown, the method for determining the optimal encoding method in Embodiment 3 specifically includes:

[0085] Preset a first threshold value S1 and a second threshold value S2;

[0086] Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results;

[0087] First, compare the size of M and N to decide whether to encode according to the specified state or the specified change. If M < N, then compare the size of M and S1. If M ≤ S1, then use the first encoding method for encoding. If M > S1, then use the second encoding method for encoding. If M > N, then compare the size of N and S2. If N ≤ S2, then use the third encoding method for encoding. If N > S2, then use the fourth encoding method for encoding.

[0088] The following uses a commonly used keyboard with 104 keys as an example to further explain the dynamic encoding method used in this embodiment. Two concepts need to be explained here:

[0089] Key coordinates: Since there are 104 keys in total, 7-bit binary is used to represent the coordinates of each key. The 104 keys are sorted according to the method agreed upon by the sender and receiver, such as sorting them according to the size of the keyboard code table value. The key coordinates range from 0000000 to 1111011, corresponding to the 104 keys respectively. If more keys need to be added, just increase the number of bits.

[0090] State coding: 1 bit of binary is used to represent the state of a key. Since there are 104 keys in total, 104 bits of binary are used to represent the states from the first key to the last key, and they are arranged in the order agreed upon by the sender and receiver. The first threshold M=7 and the second threshold N=7 are preset. The threshold can be selected according to the actual situation. The values ​​of M and N can be the same or different.

[0091] (1) The scan results obtained from the first key scan are as follows:

[0092] 01 ...

[0093] Among them, 1 indicates the pressed state, and 0 indicates the unpressed state. The first encoding method is the optimal encoding method, and the coordinates of the three pressed keys are: 0000001, 0000011, and 0001010. In order to express that this encoded data is encoded by the first encoding method, the encoded data should also contain a field indicating the encoding method, such as using two binary digits to express the encoding method, and the first encoding method is represented by 00. In order to allow the receiving end to first identify the encoding method and prepare for decoding, the information indicating the encoding method can be placed in the low bit of the encoded data, and arranged in the order of low bit first to form 00010100000011000000100. During transmission, the encoded data can be further converted into a hexadecimal sequence for transmission, which is 0x04, 0x06, and 0x0A after conversion. Therefore, only 3 bytes of data need to be sent when encoding using the first encoding method.

[0094] Here we specify the state as the pressed state. If there are many keys pressed on the keyboard and few unpressed keys, the unpressed state can also be used as the specified state to encode the unpressed keys. It can also be used as an independent encoding method to further subdivide the encoding method by increasing the number of bits of information representing the encoding method.

[0095] (2) The scan results obtained from the second key scan are as follows:

[0096] 0101000000110 ...

[0097] The third encoding method is the optimal encoding method. The key whose state changes is the 12th key, and the coordinates of the key are: 0001011. In order to express that this coded data is encoded by the third encoding method, the coded data should also contain a field indicating the encoding method, such as the third encoding method is represented by 10. In order to allow the receiving end to first identify the encoding method and prepare for decoding, the information indicating the encoding method can be placed in the low bit of the coded data, and arranged in the order of low bit first to form 000101110. During transmission, the coded data can be further converted into a hexadecimal sequence for transmission, and the converted sequence is 0x2E, 0x00. Therefore, only 2 bytes of data need to be sent when encoding using the third encoding method.

[0098] Here, the change we specify is the key whose state has changed. If there are many keys on the keyboard that have changed and few keys that have not changed, you can also use the unchanged state as the specified change and encode the unchanged keys. It can also be used as an independent encoding method to further subdivide the encoding method by simply increasing the number of bits of information representing the encoding method.

[0099] (3) The scan results obtained from the third key scan are as follows:

[0100] 00101111110 ...

[0101] The second encoding method is the optimal encoding method. It encodes the local segment. If the local segment is from the first key to the last key pressed, the local segment to be encoded is: 0010111111001. In order to express that this encoded data is encoded by the second encoding method, the encoded data should also contain a field indicating the encoding method. For example, the second encoding method is represented by 01. In order to allow the receiving end to first identify the encoding method and prepare for decoding, the information indicating the encoding method can be placed in the low bit of the encoded data, and arranged in the order of low bit first to form 100111111010001. During transmission, the encoded data can be further converted into a hexadecimal sequence for transmission. After conversion, it is 0xD1, 0x4F. Therefore, only 2 bytes of data need to be sent when encoding using the second encoding method.

[0102] If the local segment to be encoded is located at the end of the entire sequence, in order to avoid the considerable number of 0s in the front occupying the number of bytes, only the first key pressed to the last key is encoded, so that the local segment becomes the section from the first key pressed to the last key, thereby reducing the number of bytes required to be transmitted. If the local segment to be encoded is located in the middle of the entire sequence, in order to avoid the considerable number of 0s in the front and back occupying the number of bytes, the coordinates of the first key pressed or the coordinates of the last key pressed can also be added to the encoded data to locate the specific position of the local segment, so that the local segment becomes the section from the first key pressed to the last key pressed, thereby reducing the number of bytes required to be transmitted. The selection of different local segments can be used as an independent encoding method, and the encoding method can be further subdivided by simply increasing the number of bits of information representing the encoding method.

[0103] (4) The scan results obtained from the fourth key scan are as follows:

[0104] 0111110011110 ...

[0105] The fourth encoding method is the optimal encoding method. It encodes the local segment. If the local segment is the key that changes from the first key to the last key, the local segment that needs to be encoded is: 01111100111101. In order to express that this encoded data is encoded by the fourth encoding method, the encoded data should also contain a field indicating the encoding method. For example, the fourth encoding method is represented by 11. In order to allow the receiving end to first identify the encoding method and prepare for decoding, the information indicating the encoding method can be placed in the low bit of the encoded data, and arranged in the order of low bit first to form 1011110011111011. During transmission, the encoded data can be further converted into a hexadecimal sequence for transmission, which is 0xFB, 0xBC after conversion. Therefore, only 2 bytes of data need to be sent when encoding using the second encoding method.

[0106] When encoding according to the state change, the selection of local segments can also be the other two methods in (3). The selection of different local segments can be used as independent encoding methods to further subdivide the encoding methods by simply increasing the number of bits of information representing the encoding methods.

[0107] In daily use of the keyboard, in most cases, only a few keys are pressed, and in most cases, the key states that change each time are relatively small. By generating valid data of indefinite length through dynamic encoding, the amount of data that needs to be transmitted can be greatly reduced, thereby improving the data transmission efficiency of the wireless keyboard.

Claims

1. A method for improving transmission efficiency of a wireless keyboard by dynamic coding, characterized in that: The following steps are involved: Scan the keyboard keys to obtain the scan results, in which the states of all keys are arranged in the order of the keys; The scanning result is encoded to obtain encoded data, wherein the encoded data includes information of the selected encoding method and information of the scanning result, and the encoded data obtained by selecting the optimal encoding method is transmitted wirelessly; the encoding method includes at least two of the following: The first encoding method: encoding is performed according to the state of the key, and the information of the scanning result includes the coordinates of the key in the specified state; The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state; The third encoding method: encoding according to the change of the key state, the change of the key state means that the state of the same key has changed compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change; The fourth encoding method: encoding is performed according to the change of the key state, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the key from the first specified change state to the last specified change state.

2. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to claim 1, characterized in that: The optimal encoding method is the encoding method with the shortest length of the obtained encoded data; the scanning results are first encoded using different encoding methods respectively, and then the lengths of the encoded data obtained by various encoding methods are compared to obtain the shortest encoded data.

3. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to claim 1, characterized in that: First, the optimal encoding method is obtained by judgment, and the scanning result is directly encoded using the optimal encoding method. The judgment includes: Preset a first threshold value S1 and a second threshold value S2; Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results; First compare the sizes of M and N. If M<N, then compare the sizes of M and S1. If M≤S1, use the first encoding method for encoding. If M>S1, use the second encoding method for encoding. If M>N, then compare the sizes of N and S2. If N≤S2, use the third encoding method for encoding. If N>S2, use the fourth encoding method for encoding.

4. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to claim 1, characterized in that: First, the optimal encoding method is obtained by judgment, and the scanning result is directly encoded using the optimal encoding method. The judgment includes: Preset a first threshold value S1 and a second threshold value S2; Count the number of keys in the specified state M and the number of keys in the specified change state N in the scanning results; First compare the sizes of M and S1. If M≤S1, use the first encoding method for encoding; if M>S1, compare the sizes of N and S2. If N≤S2, use the third encoding method for encoding; if N>S2, use the second encoding method or the fourth encoding method for encoding.

5. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to any one of claims 1 to 4, characterized in that: The specified state is a pressed state.

6. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to any one of claims 1 to 4, characterized in that: The specified change condition is that the key state has changed.

7. The method for improving transmission efficiency of a wireless keyboard by dynamic coding according to any one of claims 1 to 4, characterized in that: In the second encoding mode, the local segment is any of the following: From the first key to the last key in the specified state; From the first key in a specified state to the last key; From the key in the first specified state to the key in the last specified state, at this time, the encoded data also includes the coordinates of the key in the first specified state or the coordinates of the key in the last specified state.

8. The method for improving transmission efficiency of a wireless keyboard through dynamic coding according to any one of claims 1 to 4, characterized in that: In the fourth encoding mode, the local segment is any of the following: From the first key to the last key that specifies the change; From the first key that specifies the change to the last key; From the first key that specifies a change to the last key that specifies a change, at this time, the encoded data also includes the coordinates of the first key that specifies a change or the coordinates of the last key that specifies a change.

9. A wireless keyboard, characterized in that: include: The scanning detection module is used to scan the keyboard keys to obtain the scanning results. In the scanning results, the states of all keys are arranged according to the order of the keys; The dynamic encoding module is used to encode the scanning result to obtain the encoded data, wherein the encoded data includes information of the selected encoding method and information of the scanning result; the encoding method includes at least two of the following: The first encoding method: encoding is performed according to the state of the key, and the information of the scanning result includes the coordinates of the key in the specified state; The second encoding method: encoding according to the state of the key, the information of the scanning result includes the state codes of all keys in the local segment, and the local segment includes the keys from the first specified state to the last specified state; The third encoding method: encoding according to the change of the key state, the change of the key state means that the state of the same key has changed compared with the previous scanning result, and the information of the scanning result includes the key coordinates of the specified change; Fourth encoding method: encoding according to the change of key status, the information of the scanning result includes the status codes of all keys in the local segment, and the local segment includes the key from the first key of the specified change status to the last key of the specified change status; The wireless communication module is used to transmit the encoded data obtained by the optimal encoding method.

10. The wireless keyboard according to claim 9, characterized in that: It also includes a comparison module, which is used to select the encoding data with the shortest length as the encoding data obtained by the optimal encoding method; or to compare the number of keys M in the specified state and the number of keys N in the specified change situation in the scanning results with the preset first threshold S1 and second threshold S2, so as to determine the optimal encoding method.

Citation Information

Patent Citations

  • Key coding circuit and keyboard scanning circuit

    CN107332568A

  • Independent keyboard scanning and encoding method

    CN108809322A