CN116483760B - Interaction method, device, chip, keyboard, electronic equipment and medium - Google Patents
Interaction method, device, chip, keyboard, electronic equipment and medium Download PDFInfo
- Publication number
- CN116483760B CN116483760B CN202310712654.6A CN202310712654A CN116483760B CN 116483760 B CN116483760 B CN 116483760B CN 202310712654 A CN202310712654 A CN 202310712654A CN 116483760 B CN116483760 B CN 116483760B
- Authority
- CN
- China
- Prior art keywords
- keyboard
- tablet
- handshake
- mode
- operating system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 92
- 230000003993 interaction Effects 0.000 title claims abstract description 61
- 238000004891 communication Methods 0.000 claims abstract description 395
- 238000004590 computer program Methods 0.000 claims description 29
- 230000004044 response Effects 0.000 claims description 13
- 230000002452 interceptive effect Effects 0.000 claims description 3
- 230000008569 process Effects 0.000 description 28
- 230000002093 peripheral effect Effects 0.000 description 23
- 230000006870 function Effects 0.000 description 12
- 238000012545 processing Methods 0.000 description 12
- 230000005540 biological transmission Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 11
- 230000006978 adaptation Effects 0.000 description 9
- 230000003044 adaptive effect Effects 0.000 description 7
- 238000013461 design Methods 0.000 description 4
- 238000001179 sorption measurement Methods 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 239000010985 leather Substances 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 230000013011 mating Effects 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/16—Constructional details or arrangements
- G06F1/1613—Constructional details or arrangements for portable computers
- G06F1/1633—Constructional details or arrangements of portable computers not specific to the type of enclosures covered by groups G06F1/1615 - G06F1/1626
- G06F1/1662—Details related to the integrated keyboard
- G06F1/1669—Detachable keyboards
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
- G06F13/4286—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0016—Inter-integrated circuit (I2C)
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Human Computer Interaction (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
The embodiment of the application provides an interaction method, an interaction device, an interaction chip, an interaction keyboard, electronic equipment and an interaction medium. Initializing a communication mode of the keyboard to a first communication mode under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; after initializing the communication mode of the keyboard into a first communication mode, acquiring a handshake result of the keyboard and the tablet; and executing a first operation according to the handshake result, wherein the first operation is an operation of setting a communication mode of the keyboard so that the keyboard and the tablet have the same communication mode, or an operation of setting an operation mode of the keyboard so that the operation mode of the keyboard corresponds to an operation of an operation system of the tablet. The embodiment of the application can support the universality of the pogo pin keyboard among different types of flat plates, and is convenient for users to use.
Description
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to an interaction method, device, chip, keyboard, electronic device, and medium.
Background
When a tablet (or tablet personal computer) product is used as a productivity tool, tablet users generally have a requirement of typing input, so that tablet products of various manufacturers can push out keyboard (such as leather sheath keyboard) accessories corresponding to the tablet to support functions of keys, touch pads, NFC (near field communication) touch connection and the like.
The keyboard corresponding to the tablet is generally divided into two data transmission modes, namely Bluetooth and pogo pin (thimble). The standard keyboard of each flat manufacturer is generally a pogo pin keyboard, and the three-party ecological keyboard can be a Bluetooth keyboard.
At present, the flat plate and the pogo pin keyboard are usually used in a one-to-one matching way, and the pogo pin keyboard is not universal among different flat plates, so that inconvenience is brought to users.
Disclosure of Invention
The embodiment of the application provides an interaction method, an interaction device, an interaction chip, an interaction keyboard, an interaction electronic device and an interaction medium, which can support the universality of a pogo pin keyboard among different flat plates and are convenient for a user to use.
In a first aspect, an embodiment of the present application provides an interaction method, applied to a keyboard, where the method includes: initializing a communication mode of the keyboard to a first communication mode under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; after initializing the communication mode of the keyboard into a first communication mode, acquiring a handshake result of the keyboard and the tablet; and executing a first operation according to the handshake result, wherein the first operation is an operation of setting a communication mode of the keyboard so that the keyboard and the tablet have the same communication mode, or an operation of setting an operation mode of the keyboard so that the operation mode of the keyboard corresponds to an operation of an operation system of the tablet.
After the pogo pin keyboard is connected with the flat plates, the self-adaptive identification of the flat plates of different operating systems and the self-adaptive identification of different communication modes of the flat plates can be realized, so that the pogo pin keyboard is universal among different flat plates and is convenient for users to use.
In one embodiment, the first communication mode is a universal serial bus communication mode; the handshake result includes: the result is used for indicating whether the keyboard receives handshake information sent by the tablet in the set waiting time limit; performing a first operation according to the handshake result, comprising: if the handshake result indicates that the keyboard does not receive handshake information sent by the tablet within the set waiting time limit, setting the communication mode of the keyboard as a second communication mode.
The USB keyboard can handshake with the USB flat panel by waiting for handshake information sent by the USB flat panel, and the implementation mode accords with the USB communication standard, so that the handshake with the USB flat panel can be realized without modifying the flat panel end program.
In one embodiment, after setting the communication mode of the keyboard to the second communication mode, the interaction method further includes: sending a handshake request to the tablet; receiving reply information of the flat panel to the handshake request; and setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet.
Therefore, the self-adaption of the operation system and the communication mode of the tablet can be realized, so that the keyboard can be commonly used among different operation systems and different communication modes of the tablet.
In one embodiment, performing a first operation according to a handshake result includes: if the handshake result indicates that the keyboard receives handshake information sent by the tablet within the set waiting time limit, setting a communication mode of the keyboard as a first communication mode; the interaction method further comprises the following steps: if the handshake result indicates that the keyboard receives handshake information sent by the panel within the set waiting time limit, sending handshake reply to the panel; and setting the working mode of the keyboard according to the response result of the tablet to the handshake reply so that the working mode of the keyboard corresponds to the operating system of the tablet.
After the USB keyboard receives the handshake information of the USB panel, the handshake reply can be fed back, and then the working mode of the keyboard is set according to the response result of the panel to the handshake reply, so that the self-adaption of the panel operating system is realized.
In one embodiment, setting the operation mode of the keyboard according to the response result of the tablet to the handshake reply includes: if the identification information of the first operating system sent by the tablet is received, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the identification information of the first operating system sent by the tablet is not received, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
The keyboard can realize the self-adaption of the USB tablet operating system according to whether the unique identification of the Windows operating system is received or not.
In one embodiment, the first communication mode is not a universal serial bus communication mode; the interaction method further comprises the following steps: sending a handshake request to the flat panel, wherein the handshake result is reply information of the flat panel to the handshake request; performing a first operation according to the handshake result, comprising: and setting the working mode of the keyboard according to the reply information.
When the communication mode of the keyboard is not USB communication, the handshake request can be sent after the keyboard is powered on and started. If the keyboard can receive the reply information of the tablet to the handshake request, the keyboard working mode can be formally set accordingly, so that the self-adaption of the tablet operating system is realized.
In one embodiment, the handshake request includes a first request conforming to a data format of the first operating system and a second request conforming to a data format of the second operating system; setting the working mode of the keyboard according to the reply information, including: if the reply information comprises the information for replying the first request and does not comprise the information for replying the second request, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the reply message includes the information for replying to the second request and does not include the information for replying to the first request, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
When the keyboard is used for handshake to the tablet, two pieces of information for handshake can be sent, so that the self-adaption to an operating system can be realized.
In one embodiment, setting the operation mode of the keyboard according to the reply information includes: if the identification information in the reply information is the information corresponding to the first operating system, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the identification information in the reply information is the information corresponding to the second operating system, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
When the keyboard is used for holding hands on the tablet, a handshake request can be sent, so that the self-adaption to the operating system can be realized.
In one embodiment, initializing a communication mode of a keyboard to a first communication mode includes: initializing the communication mode of the keyboard to be the communication mode of the last use of the keyboard under the condition that the communication mode of the last use of the keyboard exists; and initializing the communication mode of the keyboard to the communication mode of a matched panel of the keyboard under the condition that the communication mode of the keyboard used last time does not exist.
The initialization of the keyboard communication mode can be realized according to the use condition of the keyboard and the standard communication mode, so that the keyboard can be initialized to be consistent with the flat plate, the communication mode does not need to be switched, and the keyboard end flow is simplified.
In one embodiment, the interaction method further comprises: initializing a working mode of the keyboard under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; under the condition that the working mode of the keyboard used for the first time exists, initializing the working mode of the keyboard to the working mode of the keyboard used for the first time; and initializing the working mode of the keyboard to the working mode corresponding to the operating system of the matched panel of the keyboard under the condition that the working mode of the keyboard used last time does not exist.
The initialization of the keyboard working mode can be realized according to the use condition of the keyboard and the standard operating system, so that the keyboard can be initialized to the working mode corresponding to the operating system of the connected flat panel, the working mode is not required to be switched, and the flow of the keyboard end is simplified.
In one embodiment, the interaction method further comprises: responding to the using operation of the keyboard, and encapsulating the data corresponding to the using operation according to the data format of the operating system corresponding to the working mode of the keyboard to obtain encapsulated data; and sending the packaged data to the flat panel.
After the keyboard formally sets the working mode, the working mode of the keyboard corresponds to the operating system of the tablet, and when a user uses the keyboard, the data format of the tablet operating system can be used for packaging data operated by the user and reporting the data to the tablet so as to support the tablet to process the data reported by the keyboard, thereby realizing interaction between the keyboard and the tablet.
In a second aspect, an embodiment of the present application provides an interaction device, applied to a keyboard, including: the initialization module is used for initializing the communication mode of the keyboard into a first communication mode under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; the acquisition module is used for acquiring a handshake result of the keyboard and the tablet after initializing the communication mode of the keyboard into a first communication mode; and the setting module is used for executing a first operation according to the handshake result, wherein the first operation is an operation of setting the communication mode of the keyboard so that the keyboard and the tablet have the same communication mode, or an operation of setting the working mode of the keyboard so that the working mode of the keyboard corresponds to the operation of an operating system of the tablet.
In a third aspect, an embodiment of the present application provides an electronic chip, including: a processor for executing computer program instructions stored on a memory, wherein the computer program instructions, when executed by the processor, trigger the electronic chip to perform the method according to any of the first aspects.
In a fourth aspect, embodiments of the present application provide a keyboard, including: an interaction means as in the second aspect, or an electronic chip as in the third aspect.
In a fifth aspect, embodiments of the present application provide an electronic device comprising a memory for storing computer program instructions, a processor for executing the computer program instructions, and communication means, wherein the computer program instructions, when executed by the processor, trigger the electronic device to perform a method as in any of the first aspects.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored therein, which when run on a computer, causes the computer to perform the method as in any of the first aspects.
In a seventh aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method as in any of the first aspects.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a keyboard according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another keyboard according to one embodiment of the present application;
FIG. 3 is a schematic view of a thimble assembly according to one embodiment of the present disclosure;
FIG. 4 is a schematic view of another thimble assembly according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a connection method between a keyboard and a tablet according to an embodiment of the present application;
FIG. 6 is a timing diagram illustrating a keyboard and tablet interaction process according to one embodiment of the present application;
FIG. 7 is a timing diagram illustrating another keyboard and tablet interaction process according to one embodiment of the present application;
FIG. 8 is a schematic diagram of another connection mode between a keyboard and a tablet according to an embodiment of the present application;
FIG. 9 is a timing diagram illustrating another keyboard and tablet interaction process according to one embodiment of the present application;
FIG. 10 is a schematic diagram of a connection between a keyboard and a tablet according to another embodiment of the present disclosure;
FIG. 11 is a timing diagram illustrating yet another keyboard and tablet interaction process according to one embodiment of the present application;
FIG. 12 is a schematic diagram of a connection between a keyboard and a tablet according to an embodiment of the present disclosure;
FIG. 13 is a timing diagram illustrating yet another keyboard and tablet interaction process according to one embodiment of the present application;
fig. 14 is a flow chart of an interaction method according to an embodiment of the present application.
Detailed Description
For a better understanding of the technical solutions of the present application, embodiments of the present application are described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "at least one" as used herein means one or more, and "a plurality" means two or more. The term "and/or" as used herein is merely one association relationship describing the associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. Wherein A, B may be singular or plural. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
It should be understood that although the terms first, second, etc. may be used in embodiments of the present application to describe the set threshold values, these set threshold values should not be limited to these terms. These terms are only used to distinguish the set thresholds from each other. For example, a first set threshold may also be referred to as a second set threshold, and similarly, a second set threshold may also be referred to as a first set threshold, without departing from the scope of embodiments of the present application.
When the tablet (or tablet) is large in size, its operating state may resemble a personal computer (Personal Computer, PC). When the tablet product is used as a productivity tool, tablet users generally have a requirement of typing input, so that tablet products of various manufacturers can push out keyboard (such as leather sheath keyboard) accessories corresponding to the tablet to support functions of keys, touch pad, NFC (Near Field Communication ) bump connection and the like.
The keyboard (keyboard) corresponding to the tablet is generally divided into two data transmission modes, namely bluetooth and pogo pin (thimble or spring pin). The standard keyboard of each flat manufacturer is generally a pogo pin keyboard, and the three-party ecological keyboard can be a Bluetooth keyboard.
The pogo pin is a precise connector applied to electronic products such as mobile phones and the like, and can avoid gap disconnection at a connecting part through compression and extension force of a spring. pogo pin is scalable. When the flat plate is connected with the matched keyboard, all contacts of the flat plate are in one-to-one correspondence and are in contact with all pogo pins of the keyboard, the pogo pins can be in a compressed state, and a passage is formed between the contacts and the pogo pins connected with the contacts so as to realize the functions of communication, power supply and the like.
The communications and connections between the tablet and pogo pin keyboard may be various, such as UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter) communications, USB (Universal Serial Bus ) communications, I2C (inter-integrated circuit, integrated circuit) communications, SPI (Serial Peripheral Interface ) communications, etc. The number of pogo pins needed for different communication modes is different. In one possible implementation, 3 pogo pins are required for UART communication. In a possible implementation, 4 or 5 pogo pins are required for USB communication.
Currently, keyboards with different numbers of pogo pins cannot be used universally.
Besides the communication modes, there may be more than one type of tablet operating system, for example, the tablet operating system generally has two types of Windows operating systems and Android (Android) operating systems, and the Android operating systems and the Windows operating systems have different data structure definitions on keys, touch pads and the like, so that a keyboard cannot be directly connected to the tablet of the two operating systems.
Because the keyboard can not be used commonly due to the difference of pin quantity and operating system, a manufacturer can match a corresponding pogo pin keyboard for each flat product, and the software and hardware of the keyboard can be customized according to the size of the flat product, pin quantity and operating system, so that the keyboard can only be used on one flat plate to which the keyboard is adapted. The pin number of the keyboard can be the number of pogo pins in the keyboard, and the pin number of the flat plate can be the number of contacts matched with the pogo pins in the flat plate.
In one possible implementation, the tablet connection scheme may be selected based on product requirements. For example, a certain type of Windows two-in-one tablet (i.e. the operating system of the tablet is a Windows operating system) adopts a keyboard with 4 pogo pins (i.e. the keyboard has 4 pogo pins), and the tablet and the keyboard perform communication interaction in a USB communication mode. For example, a keyboard with 3 pogo pins is adopted by a certain Android tablet (namely, the operating system of the tablet is an Android operating system), and communication interaction is carried out between the tablet and the keyboard in a UART communication mode.
However, because the tablet and the pogo pin keyboard are used in a one-to-one matching way, the pogo pin keyboard is not universal among different types of tablet (such as different operating systems and pin quantity), and inconvenience is brought to users.
In order to improve universality of the pogo pin keyboard and facilitate use of the keyboard by users, the embodiment of the application provides an interaction method of the keyboard and the tablet, so that the keyboard can be supported to be universal among more than one tablet. The keyboard may be used universally across different (different modes of communication and/or different operating systems) boards by performing the method steps performed by the keyboard in the interactive method.
The connection between the flat plate and the keyboard is required to meet the requirement of hardware compatibility, namely, a plurality of contacts of the flat plate can be in one-to-one correspondence with a plurality of ejector pins of the keyboard. If the keyboard is also provided with other thimble, the other thimble can be in a pull-up suspension state.
The interaction method provided in any embodiment of the present application may be applied to the keyboard 100 shown in fig. 1, where the keyboard 100 may be used in combination with a tablet. The keyboard 100 may be a leather boot keyboard for a tablet, a keyboard for use with a two-in-one tablet (i.e., tablet and personal computer two-in-one), or the like.
Fig. 1 shows a schematic structure of a keyboard 100. The keyboard 100 may include a processor 110, an internal memory 120, keys 130, a touch pad 140, an NFC chip 150, a pin 160, etc.
The processor 110 may include one or more processing units, such as: the processor 110 may include a controller, a digital signal processor (digital signal processor, DSP), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
In some embodiments, the processor 110 may be a System On Chip (SOC), and the processor 110 may include a central processing unit (Central Processing Unit, CPU) and may further include other types of processors.
The processor 110 may also include the necessary hardware accelerators or logic processing hardware circuitry, or one or more integrated circuits for controlling the execution of technical program, etc. Further, the processor 110 may have a function of operating one or more software programs, which may be stored in a storage medium.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the memory of keyboard 100 may be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM) or other types of dynamic storage devices that can store information and instructions, electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), or any computer-readable medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In some embodiments, the processor 110 and the memory may be combined into a single processing device, or may be separate components, and the processor 110 may be configured to execute program code stored in the memory. In particular implementations, the memory may also be integrated into the processor 110 or may be separate from the processor 110.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others. The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the keyboard 100. In other embodiments of the present application, the keyboard 100 may also employ different interfacing manners, or a combination of interfacing manners, as in the above embodiments.
The internal memory 120 may be used to store computer executable program code including instructions. The internal memory 120 may include a storage program area and a storage data area. The storage program area may store an operating system, an application program required for at least one function, and the like. The storage data area may store data created during use of the keyboard 100, etc. In addition, the internal memory 120 may include a high-speed random access memory, and may also include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the keypad 100 and data processing by executing instructions stored in the internal memory 120 and/or instructions stored in a memory provided in the processor.
Keys 130 may include alphabetic keys, numeric keys, shortcut keys for performing set functions (e.g., screen shots, recordings, silence, etc.), and the like.
The touch pad 140 is used to detect a touch operation acting thereon, and the detected touch operation may be communicated to the processor 110 to determine a touch event type.
The NFC chip 150 may support the keyboard 100 to have an NFC-over-bump function to enable quick connection of the keyboard 100 with other NFC devices.
The keyboard 100 may include a plurality (e.g., 3, 4, 5, etc.) of pins 160. The keyboard 100 may be connected to contacts of the tablet through pins 160 to enable connection of the keyboard 100 to the tablet. The pins 160 may include pins for enabling communications, pins for powering the keyboard 100, and the like.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the keyboard 100. In other embodiments of the present application, keyboard 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components may be provided. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Referring to fig. 2, one embodiment of the present application provides a keyboard, which includes a touch pad 201, keys 202 and 3 pins 203. In a possible implementation manner, the 3 pins 203 may be GND (ground) pins, UART pins, VCC (Volt Current Condenser, power supply voltage) pins in sequence, and the communication manner of the keyboard may be UART communication.
In one possible implementation manner, when the keyboard is connected with the flat panel, the GND ejector pin of the keyboard can be connected with the GND contact of the flat panel, the UART ejector pin of the keyboard can be connected with the UART contact of the flat panel, and the VCC ejector pin of the keyboard can be connected with the VCC contact of the flat panel. Thus, the tablet can supply power (for example, the power supply voltage can be 3.3V) to the keyboard through the GND path and the VCC path for the keyboard to start up and run, and the keyboard and the tablet can communicate through the UART path to transfer data in a UART communication mode. After the keyboard is connected with the tablet, when the user presses any key 202 or touches any position of the touch pad 201, the keyboard can report relevant data operated by the user to the tablet through the UART communication channel.
Referring to FIG. 3, one embodiment of the present application provides a keyboard that may include 3 pins 301 arranged in sequence and an assembly 302 for supporting and securing pins 301.
In one possible implementation (denoted as mode 1), the keyboard may configure 3 pins 301 as GND pins, UART pins, and VCC pins in this order.
In one embodiment of mode 1, when the keyboard is connected to a tablet having 3 contacts, the GND pin of the keyboard may be connected to the GND contact of the tablet, the UART pin of the keyboard may be connected to the UART contact of the tablet, and the VCC pin of the keyboard may be connected to the VCC contact of the tablet. In this way, the tablet can supply power to the keyboard through the GND path and the VCC path, and the keyboard and the tablet can communicate through the UART path to transfer data in a UART communication mode.
Referring to fig. 4, one embodiment of the present application provides a keyboard that may include 4 pins 401 arranged in sequence and an assembly 402 for supporting and securing the pins 401.
In one possible implementation (denoted as mode 2), the keyboard may configure the 4 pins 401 as GND pins, d+ pins, VCC pins, and D-pins in this order. The USB can use a differential transmission mode, and has two Data lines, namely a USB Data positive signal line (USB Data Positive, namely a USB-DP line, abbreviated as D+) and a USB Data negative signal line (USB Data Minus, namely a USB-DM line, abbreviated as D-). Compared with single-wire UART communication, the data transmission rate of the double-wire USB communication can be higher, and the USB communication can be applied to a tablet with high performance (such as high touch point reporting rate) requirements, so that the use experience of a user on the tablet is improved.
In another possible implementation (denoted as mode 3), the keyboard may sequentially configure the 4 pins 401 as GND pins, UART pins, VCC pins, and empty pins (or not configure the pins).
In one embodiment of mode 2, when the keyboard is connected to a panel having 4 contacts, the GND pin of the keyboard may be connected to the GND contact of the panel, the D+ pin of the keyboard may be connected to the D+ contact of the panel, the VCC pin of the keyboard may be connected to the VCC contact of the panel, and the D-pin of the keyboard may be connected to the D-contact of the panel. In this way, the tablet may power the keyboard via the GND path and the VCC path, and data may be transferred between the keyboard and the tablet via the D+ path and the D-path in a USB communication manner.
In another embodiment of mode 2, when the keyboard is connected to a panel having 3 contacts, the GND pins of the keyboard may be connected to the GND contacts of the panel, the d+ pins of the keyboard may be connected to the UART contacts of the panel, the VCC pins of the keyboard may be connected to the VCC contacts of the panel, and the D-pins of the keyboard may be in a pull-up suspended state and not connected to the contacts of the panel. Thus, the flat panel can supply power to the keyboard through the GND path and the VCC path, a communication path exists between the D+ thimble of the keyboard and the UART contact of the flat panel, and no communication path corresponding to the D-thimble exists. Because the keyboard adopts USB communication and the tablet adopts UART communication, when the keyboard outputs data, the communication channel can detect that signals (such as high-low level digital signals) are transmitted, but the tablet cannot normally analyze the signals, for example, when the bottom hardware of the tablet performs verification (such as CRC verification, integrity verification and the like) on the received signals, the signals cannot pass through the verification, so that the data cannot be reported to the upper-layer keyboard driver, and thus the keyboard driver of the tablet cannot receive the data output by the keyboard. Wherein the Chinese definition of CRC (Cyclic Redundancy Check) is cyclic redundancy check code.
In one embodiment of mode 3, when the keyboard is connected to a panel having 3 contacts, the GND pin of the keyboard may be connected to the GND contact of the panel, the UART pin of the keyboard may be connected to the UART contact of the panel, the VCC pin of the keyboard may be connected to the VCC contact of the panel, and the other pin of the keyboard may be in a suspended state in which it is pulled up, and is not connected to the contact of the panel. In this way, the tablet can supply power to the keyboard through the GND path and the VCC path, and the keyboard and the tablet can communicate through the UART path to transfer data in a UART communication mode.
Based on similar implementation principles, the keyboard may include 3 pins and 4 pins, and in other embodiments of the present application, the keyboard may further include 5 pins, 6 pins, etc., and the related art implementation will be described with reference to the embodiments shown in fig. 3 and fig. 4, which are not described herein.
In one possible implementation, the keyboard includes 5 pins, the keyboard interacts with the tablet through an I2C communication mode, and the 5 pins of the keyboard may include clock pins and data pins for constructing a communication path, and include pins for transmitting interrupt signals.
In one possible implementation, the keyboard includes 5 pins, the keyboard interacts with the tablet through SPI communications, and 6 pins of the keyboard may include pins for constructing a communications path, pins for transmitting interrupt signals, and so on.
Example 1
Embodiment 1 provides an example of a keyboard adaptation of 3 pogo pins to different operating system (Windows and Android) tablets in case of the same number of pin pins (3).
In embodiment 1.1, the operating system of the tablet is an Android operating system, and in embodiment 1.2, the operating system of the tablet is a Windows operating system.
Example 1.1
Referring to fig. 5, 3 contacts of the tablet 501 are connected to 3 pins of the keyboard 500 in a one-to-one correspondence manner, so as to realize the adsorption connection between the tablet 501 and the keyboard 500. Wherein, the GND contact of the flat plate 501 is connected with the GND pin of the keyboard 500 to form a GND power supply path, the UART contact of the flat plate 501 is connected with the UART pin of the keyboard 500 to form a UART communication path, and the VCC contact of the flat plate 501 is connected with the VCC pin of the keyboard 500 to form a VCC power supply path. The tablet 501 and keypad 500 may implement UART communication via a UART communication path.
In embodiment 1.1, the operating system of the tablet 501 is an Android operating system, and the communication mode is UART communication.
Referring to fig. 6, an interaction process of the tablet 501 and the keyboard 500 may include the following steps:
in step 601, a keyboard driver (keyboard driver) of the tablet 501 supplies power to the keyboard 500 when it is recognized that the keyboard 500 is connected, where an operating system of the tablet 501 is an Android operating system, and a communication mode is UART communication.
Wherein the tablet 501 may power the keypad 500 through a GND power path and a VCC power path.
In step 602, the keyboard 500 is powered on and then initialized to a default operating mode and a default communication mode, wherein the default communication mode is UART communication.
Wherein, the keyboard 500 is a 3 pogo pin keyboard, and the default communication mode is UART communication, i.e. the keyboard 500 works in a single-wire UART transmission mode.
In one embodiment, when the keyboard is powered on and booted for the first time, the default working mode of the keyboard may be the working mode corresponding to the operating system of the mating tablet of the keyboard.
In one embodiment, when the keyboard is not powered on for the first time, the default working mode may be the working mode corresponding to the operating system of the mating tablet of the keyboard. In another embodiment, when the keyboard is not powered on for the first time, the default operating mode may be the last operating mode of the keyboard.
In one embodiment, when the keyboard is powered on and started for the first time, the default communication mode of the keyboard may be a communication mode of a matched panel of the keyboard.
In one embodiment, when the keyboard is not powered on for the first time, the default communication mode may be a communication mode of a matched panel of the keyboard. In another embodiment, when the keyboard is not powered on for the first time, the default communication mode may be the last communication mode used by the keyboard.
In one embodiment, the last-time operation mode and communication mode of the keyboard can be recorded in a nonvolatile memory of the keyboard, such as FLASH memory.
In step 603, the keyboard 500 sends a handshake request to the tablet 501, the handshake request including a first request conforming to the data format of the Windows operating system and a second request conforming to the data format of the Android operating system.
In embodiment 1.1, the first request and the second request may be sent simultaneously.
In other embodiments of the present application, the first request and the second request may be sequentially sent as needed, for example, if the keyboard does not receive the corresponding handshake reply after sending the first request, the second request is sent, and if the keyboard receives the corresponding handshake reply after sending the first request, the second request is not sent any more.
In step 604, the keypad driver of the tablet 501 feeds back a handshake reply to the keypad 500 according to the handshake request, the handshake reply comprising information to reply to the second request.
Since the tablet 501 and the keyboard 500 communicate in UART communication, the tablet 501 may receive a handshake request. The operating system of the tablet 501 is an Android operating system, the tablet 501 may feed back a handshake reply to the second request, but not to the first request.
In step 605, the keyboard 500 sets the operation mode and the communication mode of the keyboard 500 according to the handshake reply, wherein the set communication mode is UART communication, and the set operation mode is the operation mode corresponding to the Android operating system.
By setting the working mode of the keyboard, the keyboard can package the data reported to the tablet according to the data format of the operating system corresponding to the working mode and analyze the data sent by the tablet.
When the keyboard 500 receives the handshake reply, the handshake is considered to be successful, that is, the UART communication is successful, so that the normal connection of the keyboard 500 and the tablet 501 can be confirmed. Furthermore, the keyboard 500 can determine that the operating system of the tablet 501 is an Android operating system according to the second request returned by the tablet in the handshake reply, so that the operating mode and communication mode of the keyboard can be formally set.
In one embodiment, the keyboard may formally set its operating mode and communication mode without requiring a reboot.
In one embodiment, the setting of the keyboard operation mode and the communication mode may be achieved by setting corresponding flag bits in the keyboard.
In one embodiment, the keyboard may formally set the keyboard's operating mode and communication mode through global variables. When the keyboard needs to encapsulate data operated by a user, the setting content in the global variable can be read to acquire the working mode of the keyboard, and the data is encapsulated accordingly.
In one embodiment, the data in the global variable may be recorded in the FLASH of the keyboard, so that after the keyboard is powered on and turned on next time, the last used working mode and communication mode of the keyboard (i.e., the current working mode and communication mode of the keyboard in the embodiment of fig. 6) may be read from the FLASH as the default working mode and default communication mode initialized after the keyboard is turned on next time.
In one embodiment, the default operation mode and the default communication mode of the keyboard can be initialized by setting the global variable, and the operation mode and the communication mode of the keyboard can be formally set by setting the global variable again.
Taking the working mode as an example, in a feasible implementation manner, when the working mode of the keyboard is formally set, whether the working mode recorded in the global variable is the same as the working mode to be set or not is directly set, so as to perform assignment coverage on corresponding data in the global variable. Similarly, the communication mode of the keyboard can be set as such.
Taking the working mode as an example, in another possible implementation manner, when the working mode of the keyboard is formally set, whether the working mode recorded in the global variable is the same as the working mode to be set or not can be judged first, if so, the global variable is reset to perform assignment switching on corresponding data in the global variable, otherwise, the corresponding data in the global variable can not be required to be reset. Similarly, the communication mode of the keyboard can be set as such.
If the default operation mode of the keyboard 500 during initialization is the operation mode corresponding to the Android operating system, in step 605, the operation mode may be assigned again to be the operation mode corresponding to the Android operating system, so as to be formally set to be the operation mode corresponding to the Android operating system.
If the default operation mode of the keyboard 500 during initialization is the operation mode corresponding to the Windows operation system, in step 605, the operation mode may be reassigned to the operation mode corresponding to the Android operation system, so as to formally switch to the operation mode corresponding to the Android operation system.
In step 606, when the user performs a pressing operation on a key of the keyboard or performs a touching operation on the keyboard touch pad, the keyboard 500 encapsulates relevant data of the operation performed by the user according to the data format of the Android operating system according to the set working mode, and sends the encapsulated data to the tablet 501.
Wherein the keypad 500 may transmit the encapsulated data to the tablet 501 through the UART communication path.
In one embodiment, the keyboard may read the content of the flag bit, and determine the working mode of the keyboard, so that the user operation data may be encapsulated according to the data format of the operating system corresponding to the working mode.
In one embodiment, the content in the global variable may be obtained each time the user operates the keyboard (e.g., taps the keyboard, touches the touch pad, etc.), so as to obtain a working mode of the keyboard, and then the user operation data is encapsulated according to a data format of an operating system corresponding to the working mode. For example, when the user operates the keyboard as the user clicks the keyboard, the user operation data may be the key value of the key clicked by the user.
In another embodiment, after the keyboard is powered on and started and the working mode is set through the global variable, the working mode of the keyboard recorded in the global variable can be obtained only when the user operates the keyboard for the first time, and the user does not need to repeatedly obtain the working mode of the keyboard recorded in the global variable when operating the keyboard for each time. And encapsulating the user operation data according to the obtained working modes for the data of the user operation keyboard each time.
In step 607, the keyboard driver of the tablet 501 processes the encapsulated data sent from the keyboard 500. In this way, a response to the user operation can be achieved.
After the working mode of the keyboard is formally set, the data of the keyboard operated by the user can be uploaded to the flat plate, and the flat plate can send information (such as an upgrade package, configuration information, screen-on and screen-off information and the like) downwards to the keyboard under some conditions (such as screen-on and screen-off, cover opening and closing and the like) so as to trigger the keyboard to execute corresponding processing, so that bidirectional interaction between the keyboard and the flat plate can be realized.
In one embodiment, each time data sent from the tablet is received, the working mode of the keyboard recorded in the global variable is obtained, then the received data is analyzed according to the data format of the operating system corresponding to the working mode, and then the analyzed data is subjected to data processing.
In another embodiment, after the keyboard is powered on and the working mode is set through the global variable, if the time when the tablet first sends data is earlier than the time when the user first operates the keyboard, the working mode of the keyboard recorded in the global variable can be obtained when the tablet first sends data. Otherwise, when the user operates the keyboard for the first time, the working mode of the keyboard recorded in the global variable can be obtained. When the user operates the keyboard every time later and when the data is sent every time later, the working mode of the keyboard recorded in the global variable does not need to be repeatedly acquired. For the data of each operation keyboard of the user, the user operation data are packaged according to the obtained working mode, and for the data sent by the flat plate each time, the received data are analyzed according to the obtained working mode.
In one related technology of interaction between a keyboard and a tablet, the keyboard does not perform handshake operation with the tablet, so that the keyboard does not perform formally setting its own working mode to be an operation corresponding to the tablet operating system, and thus when there is a user operation, the keyboard can use a fixed data format to package user operation data and report the user operation data to the tablet. Because the data package format of the keyboard may not correspond to the operating system of the tablet, when the data package format does not correspond to the operating system of the tablet, the data reported by the keyboard may be processed by performing data format conversion on the received data in the keyboard driver of the tablet. Thus, the requirements for the flat panel drive are high.
Unlike the related art, in the embodiment of fig. 6, the keyboard performs the operation of handshaking with the tablet, and after the handshaking with the tablet is successful, the keyboard formally sets its own working mode to the working mode corresponding to the tablet operating system, so that when there is a user operation, the keyboard can package the user operation data using the data format of the tablet operating system and report the data to the tablet, so that the tablet can process the data reported by the keyboard without performing format conversion of the user operation data. Thus, the embodiment of fig. 6 has a low requirement on the panel driver, so that the interaction flow of the panel terminal can be simplified, and the design and modification of the panel terminal program can be reduced.
In the interaction process shown in fig. 6, the handshake request sent by the keyboard to the tablet includes two requests, the tablet replies the request corresponding to its operating system, but does not reply the request not corresponding to its operating system, and the keyboard can determine the operating system of the tablet according to the specific content of the handshake reply of the tablet. Thus, the design and modification of the tablet end program can be reduced.
Referring to fig. 7, another interaction process of the tablet 501 and the keyboard 500 may include the following steps:
step 701, step 601.
Step 702, step 602.
In step 703, the keypad 500 sends a handshake request to the tablet 501. In one embodiment, the handshake request may conform to the data format of the operating system corresponding to the default operating mode of keyboard 500.
In step 704, the keyboard driver of the tablet 501 feeds back a handshake reply to the keyboard 500 according to the handshake request, where the handshake reply includes identification information corresponding to the Android operating system.
Because the operating system of the tablet 501 is an Android operating system, the identification information in the handshake reply fed back by the tablet 501 is the identification information corresponding to the Android operating system, but not the identification information corresponding to the Windows operating system.
In one embodiment, specific content of the identification information may be customized, for example, the identification information corresponding to the Android operating system is "1", and the identification information corresponding to the Windows operating system is "2".
Step 705, the keyboard 500 sets the working mode and the communication mode of the keyboard 500 according to the identification information in the handshake reply, wherein the set communication mode is UART communication, and the set working mode is the working mode corresponding to the Android operating system.
When the keyboard 500 receives the handshake reply, the handshake is considered successful, that is, the UART communication is successful, so that the normal connection of the keyboard 500 and the tablet 501 can be confirmed. Furthermore, the keyboard 500 can determine that the operating system of the tablet 501 is an Android operating system according to the identification information, so that the operating mode and communication mode of the keyboard can be formally set.
Step 706, step 606 is synchronized.
Step 707, step 607.
In the interaction process shown in fig. 7, the handshake request sent by the keyboard to the tablet is a request, the identification information carried in the handshake reply fed back by the tablet is the identification information corresponding to the operating system of the tablet, but not the identification information corresponding to other operating systems, and the keyboard can determine the operating system of the tablet according to the identification information in the handshake reply of the tablet. Thus, the processing flow of the flat panel end can be simplified.
Different from the universal communication mode of USB, the UART of 3 pogo pin is a non-standard communication mode, and UART driver can be self-research driver on Android operating system and Windows operating system, so that the communication format and content of UART can be custom designed. Such as may be based on different custom designs to implement the handshake-related flows in fig. 6 and 7, respectively.
Example 1.2
Referring to fig. 8, 3 contacts of the flat plate 801 are connected to 3 pins of the keyboard 800 in a one-to-one correspondence manner, so as to realize the adsorption connection between the flat plate 801 and the keyboard 800. Wherein, the GND contact of the flat plate 801 is connected with the GND thimble of the keyboard 800 to form a GND power supply path, the UART contact of the flat plate 801 is connected with the UART thimble of the keyboard 800 to form a UART communication path, and the VCC contact of the flat plate 801 is connected with the VCC thimble of the keyboard 800 to form a VCC power supply path. The tablet 801 and keypad 800 may implement UART communication via a UART communication path.
In embodiment 1.2, the operating system of the tablet 801 is a Windows operating system, and the communication mode may be UART communication.
Referring to fig. 9, an interaction process between the tablet 801 and the keyboard 800 may include the following steps:
in step 901, the keyboard driver of the tablet 801 supplies power to the keyboard 800 when it recognizes that the keyboard 800 is connected, where the operating system of the tablet 801 is a Windows operating system, and the communication mode is UART communication.
Wherein the flat panel 801 may supply power to the keyboard 800 through the GND supply path and the VCC supply path.
In step 902, the keyboard 800 is powered on and then initialized to a default operating mode and a default communication mode, where the default communication mode is UART communication.
Wherein, the keyboard 800 is a 3 pogo pin keyboard, and the default communication mode is UART communication, that is, the keyboard 800 works in a single-wire UART transmission mode.
For the implementation of initializing the default operation mode and the default communication mode, please refer to the related description in step 602, which is not described in detail here.
In step 903, the keyboard 800 sends a handshake request to the tablet 801, where the handshake request includes a first request conforming to the data format of the Windows operating system and a second request conforming to the data format of the Android operating system.
Regarding the transmission timing request of the first request and the second request, reference is made to the description of step 603, which is not repeated here.
In step 904, the keypad driver of the tablet 801 feeds back a handshake reply to the keypad 800 according to the handshake request, the handshake reply comprising information to reply to the first request.
Since the tablet 801 and the keyboard 800 communicate in UART communication, the tablet 801 may receive a handshake request. The operating system of the tablet 801 is a Windows operating system, the tablet 801 may feed back a handshake reply to the first request, but not to the second request.
In step 905, the keyboard 800 sets an operation mode and a communication mode of the keyboard 800 according to the handshake reply, wherein the set communication mode is UART communication, and the set operation mode is an operation mode corresponding to the Windows operating system.
When the keyboard 800 receives the handshake reply, it can consider that the handshake is successful, that is, the UART communication is successful, and according to the request returned by the tablet in the handshake reply as the first request, it can be determined that the operating system of the tablet 801 is a Windows operating system, so that the working mode and the communication mode of the keyboard can be formally set.
For the implementation manner of formally setting the keyboard operation mode and the communication mode, please refer to the related description in the step 605, and the description of this embodiment is omitted here.
In step 906, when the user performs a pressing operation on a key of the keyboard or performs a touching operation on a touch pad of the keyboard, the keyboard 800 encapsulates relevant data of the operation performed by the user according to the data format of the Windows operating system according to the set operation mode, and sends the encapsulated data to the tablet 801.
The keyboard 800 may send the packaged data to the tablet 801 through a UART communication path.
In step 907, the keyboard driver of tablet 801 processes the encapsulated data sent from keyboard 800. In this way, a response to the user operation can be achieved.
In the interaction process shown in fig. 9, the handshake request sent by the keyboard to the tablet includes two requests, and the keyboard can determine the operating system of the tablet according to the specific content of the handshake reply of the tablet.
In the same manner as the handshake request transmission shown in fig. 7, in another interaction process between the tablet 801 and the keyboard 800, the handshake request transmitted from the keyboard to the tablet is a request, and the keyboard can determine the operating system of the tablet according to the identification information in the handshake reply of the tablet.
In embodiment 1, when the number of pin pins is the same (3), the keyboard can realize the adaptive communication to the connected tablet no matter what operating system the operating system corresponding to the default operation mode of the keyboard and the tablet is and whether the operating system is the same or not.
Example 2
Embodiment 2 provides an example of a keyboard adaptation of 4 pogo pins to different operating system (Windows and Android) tablets in case of the same number of pin pins (4) in actual use.
In the above-mentioned modes 2 and 3, when the keyboard has 4 pogo pins, the number of pogo pins actually used may be 4 for USB communication or 3 for UART communication. In embodiment 2, after the handshake between the keyboard and the tablet is successful, the number of pogo pins actually used by the keyboard is 4, and the communication mode is USB communication.
Embodiment 2 will be described taking a tablet operating system as an example of a Windows operating system. Based on the same implementation principle, in other embodiments, the operating system of the tablet may also be an Android operating system.
Referring to fig. 10, 4 contacts of the flat plate 1001 are connected to 4 pins of the keyboard 1000 in a one-to-one correspondence manner, so as to realize the adsorption connection between the flat plate 1001 and the keyboard 1000. Wherein, the GND contact of the flat plate 1001 is connected with the GND thimble of the keyboard 1000 to form a GND power supply path, the d+ contact of the flat plate 1001 is connected with the d+ thimble of the keyboard 1000 to form a d+ communication path, the VCC contact of the flat plate 1001 is connected with the VCC thimble of the keyboard 1000 to form a VCC power supply path, and the D-contact of the flat plate 1001 is connected with the D-thimble of the keyboard 1000 to form a D-communication path. The tablet 1001 and the keyboard 1000 can realize USB communication via a d+ communication path and a D-communication path.
In embodiment 2, the operating system of the tablet 1001 is a Windows operating system, and the communication mode is USB communication.
Referring to fig. 11, an interaction process between the tablet 1001 and the keyboard 1000 may include the following steps:
in step 1101, the keyboard driver of the tablet 1001 supplies power to the keyboard 1000 when it recognizes that the keyboard 1000 is connected, where the operating system of the tablet 1001 is a Windows operating system, and the communication mode is USB communication.
Wherein the tablet 1001 may power the keyboard 1000 through the GND power path and the VCC power path.
In step 1102, the keyboard 1000 is powered on and then initialized to a default operating mode and a default communication mode, wherein the default communication mode is USB communication.
In embodiment 2, the keyboard 1000 is a 4 pogo pin keyboard, and the default communication mode is USB communication, i.e. the keyboard 1000 operates as a two-wire USB transmission mode.
For the implementation of initializing the default operation mode and the default communication mode, please refer to the related description in step 602, which is not described in detail here.
In step 1103, the keyboard driver of the tablet 1001 sends handshake information to the keyboard 1000 after connecting the keyboard 1000.
The USB is a general communication mode, the USB driver is a general driver on the Windows operating system, and when a USB tablet using the Windows operating system (i.e. the communication mode is a tablet for USB communication) is connected with a USB peripheral (such as an external device such as a USB keyboard and a USB mouse), an instruction for device enumeration is sent to the USB peripheral, and after the device enumeration is completed, the USB peripheral may receive a string descriptor unique to the Windows operating system sent by the USB tablet, where the string descriptor may be used to distinguish a device using the Windows operating system from a device not using the Windows operating system.
In one embodiment, by sending an instruction for device enumeration, the tablet may learn what devices are connected to the peripheral device so that the tablet may load the corresponding driver accordingly.
After the USB flat is connected with the peripheral, the USB flat can output an instruction of device enumeration so that the USB peripheral feeds back the device identification information of the USB flat. Correspondingly, the USB peripheral may wait after connecting the tablet to receive an instruction from the USB tablet to enumerate the device. If the peripheral connected with the USB flat is a USB peripheral, the peripheral can receive the instruction of equipment enumeration, and if the peripheral connected with the USB flat is not the USB peripheral, the peripheral cannot receive the instruction of equipment enumeration.
In one embodiment, the handshake information sent by the tablet 1001 may be an instruction for enumeration of the device.
In another embodiment of the present application, step 1102 may be performed, and step 1103 may be performed simultaneously, which is not limited in this embodiment.
In step 1104, the keyboard 1000 receives the handshake information sent from the tablet 1001 within the set waiting time period, and feeds back a handshake reply to the tablet 1001 according to the handshake information.
In one embodiment, the set wait time period may be 5s, i.e., a timeout time period of 5s may be set.
In one embodiment, the handshake reply of the keyboard feedback may include device identification information of the keyboard.
Since the tablet 1001 and the keyboard 1000 communicate in USB communication, the keyboard 1000 may receive handshake information. When the keyboard 1000 receives the handshake information, it can be considered that the handshake is successful, that is, the USB communication is successful, so that it can be confirmed that the keyboard 1000 and the tablet 1001 are connected normally.
In step 1105, the keyboard driver of tablet 1001 sends the keyboard 1000 identification information corresponding to the Windows operating system according to the handshake reply.
In one embodiment, the identification information of the corresponding Windows operating system fed back by the tablet according to the handshake reply may be information unique to the Windows operating system, for example, may be a character string descriptor of "Get string descriptor". If the keyboard receives the unique identification information, the operating system of the tablet is determined to be a Windows operating system.
In other embodiments of the present application, if the operating system of the tablet 1001 is an Android operating system, the tablet 1001 may not process the handshake reply, and the keyboard 1000 may not receive any response result of the tablet to the handshake reply, so the keyboard 1000 may determine that the operating system of the tablet is an Android operating system.
In step 1106, the keyboard 1000 sets the working mode and the communication mode of the keyboard 1000 according to the identification information of the corresponding Windows operating system fed back by the tablet 1001, where the set communication mode is USB communication, and the set working mode is the working mode of the corresponding Windows operating system.
In another embodiment of the present application, the keyboard 1000 may also set the communication mode to USB communication after receiving the handshake reply.
For the implementation manner of formally setting the keyboard operation mode and the communication mode, please refer to the related description in the step 605, and the description of this embodiment is omitted here.
In step 1107, when the user performs a pressing operation on a key of the keyboard or performs a touching operation on the keyboard touch pad, the keyboard 1000 encapsulates relevant data of the operation performed by the user according to the data format of the Windows operating system according to the set operation mode, and sends the encapsulated data to the tablet 1001.
The keyboard 1000 may send the packaged data to the tablet 1001 through a USB communication path.
At step 1108, the keyboard driver of tablet 1001 processes the encapsulated data sent from keyboard 1000. In this way, a response to the user operation can be achieved.
In embodiment 2, when the number of pin pins actually used is the same (4), the keyboard can realize the adaptive communication to the connected tablet no matter which operating system the operating system corresponding to the default operation mode of the keyboard and the tablet is and whether the operating system is the same or not.
In embodiment 2, the number of pogo pins actually used after the keyboard 1000 of 4 pogo pins is powered on is 4. In another embodiment of the present application, the number of pogo pins actually used after the keyboard 1000 of 4 pogo pins is powered on may be 3, unlike in embodiment 2. For example, if the keyboard 1000 is connected to a tablet with 3 contacts for UART communication last time, the last communication mode of the keyboard 1000 is UART communication, so that after the keyboard 1000 is connected to power on and turned on, the default communication mode of UART communication can be initialized.
The keypad 1000 may send a handshake request to the tablet 1001 after initializing to UART communication. Because the tablet 1001 has 4 contacts, the communication mode of the tablet 1001 is USB communication, and the communication mode of the keyboard 1000 is UART communication, the keyboard 1000 cannot receive the handshake information output by the tablet 1001, and because the tablet 1001 cannot receive the handshake request, the keyboard 1000 cannot receive the handshake reply returned by the tablet 1001. As such, keyboard 1000 may be considered a handshake failure, with keyboard 1000 and tablet 1001 being abnormally connected.
In the event of a handshake failure, the keyboard 1000 may switch from UART communication to USB communication. Based on the implementation logic same as that of steps 1103 to 1108 in embodiment 2, after the keyboard 1000 is switched to USB communication, since the communication modes of the tablet 1001 and the keyboard 1000 are all USB communication, the keyboard 1000 may receive the handshake information sent by the tablet 1001, and the handshake between the keyboard 1000 and the tablet 1001 is successful, and at this time, the connection between the keyboard 1000 and the tablet 1001 is normal. After the handshake is successful, the keyboard 1000 may set its operation mode to an operation mode corresponding to the Windows operating system of the tablet 1001, and then interact with the tablet 1001 in the set operation mode.
It can be seen that this embodiment provides an example of a tablet board of 4 pogo pins adapting to different communication modes and different operating systems (Windows and Android) in the case that the number of pin pins actually used after the keyboard is powered on is different from the number of pin pins of the tablet board.
Example 3
Embodiment 3 provides an example of the keyboard adaptation of 4 pogo pins to different communication modes and different operating system (Windows and Android) tablets in case of different numbers of pin pins actually used.
In the above-mentioned modes 2 and 3, when the keyboard has 4 pogo pins, the number of pogo pins actually used may be 4 for USB communication or 3 for UART communication. In embodiment 3, after the handshake between the keyboard and the tablet is successful, the number of pogo pins actually used by the keyboard is 3, and the communication mode is UART communication.
Embodiment 3 will be described taking an Android operating system as an example of a tablet operating system. Based on the same implementation principles, in other embodiments, the tablet's operating system may also be the Windows operating system.
Referring to fig. 12, 3 contacts of the tablet 1201 are connected to 3 pins of the keyboard 1200 in a one-to-one correspondence to realize the adsorption connection between the tablet 1201 and the keyboard 1200, and the other pin of the keyboard 1200 is in a suspended state in which it is pulled up, and is not connected to the contacts of the tablet 1201. Wherein, the GND contact of the tablet 1201 is connected with the GND pin of the keypad 1200 to form a GND power supply path, the UART contact of the tablet 1201 is connected with the UART pin of the keypad 1200 to form a UART communication path, and the VCC contact of the tablet 1201 is connected with the VCC pin of the keypad 1200 to form a VCC power supply path. The tablet 1201 and the keypad 1200 may implement UART communication via a UART communication path.
In embodiment 3, the operating system of the tablet 1201 is an Android operating system, and the communication mode is UART communication.
Referring to fig. 13, an interaction between the tablet 1201 and the keypad 1200 may include the steps of:
in step 1301, the keyboard driver of the tablet 1201 supplies power to the keyboard 1200 when recognizing that the keyboard 1200 is connected, where the operating system of the tablet 1201 is an Android operating system, and the communication mode is UART communication.
In step 1302, the keyboard 1200 is powered on and then initialized to a default operating mode and a default communication mode, where the default communication mode is USB communication.
In embodiment 3, the keyboard 1200 is a 4 pogo pin keyboard, and the default communication mode is USB communication, i.e. the keyboard 1200 operates in a two-wire USB transmission mode.
For the implementation of initializing the default operation mode and the default communication mode, please refer to the related description in step 602, which is not described in detail here.
In step 1303, when the handshake information from the tablet 1201 is not received within the set waiting time period, the communication mode of the keyboard 1200 is switched to the UART communication mode.
After the USB flat is connected with the peripheral, the USB flat can output an instruction of device enumeration so that the USB peripheral feeds back the device identification information of the USB flat. Correspondingly, the USB peripheral may wait after connecting the tablet to receive an instruction from the USB tablet to enumerate the device. If the peripheral connected with the USB flat is a USB peripheral, the peripheral can receive the instruction of equipment enumeration, and if the peripheral connected with the USB flat is not the USB peripheral, the peripheral cannot receive the instruction of equipment enumeration.
In one embodiment, the handshake information may be an instruction for enumeration of the device.
Since the tablet 1201 employs UART communication, the keypad driver of the tablet 1201 does not send handshake information to the keypad 1200 after connecting the keypad 1200, and the keypad 1200 does not receive handshake information.
In one embodiment, the keyboard may implement the switching of the communication mode by reconfiguration of the MCU GPIO. Wherein, the Chinese paraphrasing of MCU (Microcontroller Unit) is a micro control unit, and the Chinese paraphrasing of GPIO (General Purpose Input/Output) is a general purpose input/Output interface.
For example, in one possible implementation, if the keyboard of 4 pogo pin needs to be switched from USB communication to UART communication, the MCU platform configuration interface may be used to configure the d+ and D-GPIOs of the USB communication as UART and disable (unavailable), respectively.
In one embodiment, the switching of communication modes may be accomplished by invoking GpioConfig (mode) functions. For example, when USB is switched to UART, mode can be configured as UART by calling the function.
In step 1304, the keyboard 1200 sends a handshake request to the tablet 1201 in UART communication, where the handshake request includes a first request conforming to a data format of a Windows operating system and a second request conforming to a data format of an Android operating system.
Regarding the transmission timing request of the first request and the second request, reference is made to the description of step 603, which is not repeated here.
In step 1305, the keypad driver of the tablet 1201 feeds back a handshake reply to the keypad 1200 according to the handshake request, the handshake reply including information to reply to the second request.
Since the tablet 1201 and the keypad 1200 communicate in a UART communication, the tablet 1201 may receive a handshake request. The operating system of the tablet 1201 is an Android operating system, the tablet 1201 may feed back a handshake reply to the second request, but not the first request.
In step 1306, the keyboard 1200 sets an operation mode and a communication mode of the keyboard 1200 according to the handshake reply, where the set communication mode is UART communication, and the set operation mode is an operation mode corresponding to the Android operating system.
When the keypad 1200 receives the handshake reply, the handshake is considered successful, that is, the UART communication is successful, so that the normal connection of the keypad 1200 and the tablet 1201 can be confirmed. Furthermore, the keyboard 1200 can determine that the operating system of the tablet 1201 is the Android operating system according to the request returned by the tablet in the handshake reply as the second request, so that the operating mode and the communication mode of the keyboard can be formally set.
For the implementation manner of formally setting the keyboard operation mode and the communication mode, please refer to the related description in the step 605, and the description of this embodiment is omitted here.
In step 1307, when the user performs a pressing operation on a key of the keyboard or performs a touching operation on the keyboard touch pad, the keyboard 1200 encapsulates relevant data of the operation performed by the user according to the data format of the Android operating system according to the set working mode, and sends the encapsulated data to the tablet 1201.
Wherein the keypad 1200 may transmit the encapsulated data to the tablet 1201 through a UART communication path.
The keypad actuation of the tablet 1201 processes the encapsulated data sent from the keypad 1200, step 1308. In this way, a response to the user operation can be achieved.
In the interaction process shown in fig. 13, the handshake request sent by the keyboard to the tablet includes two requests, and the keyboard can determine the operating system of the tablet according to the specific content of the handshake reply of the tablet.
In another interaction process between the tablet 1201 and the keyboard 1200, the keyboard sends a handshake request to the tablet as shown in fig. 7, and the keyboard determines the operating system of the tablet according to the identification information in the handshake reply of the tablet.
In embodiment 3, even if the number of pin pins actually used by the keyboard and the tablet are different, and no matter what operating system the operating system corresponding to the default operating mode of the keyboard and the operating system of the tablet are and whether they are the same, the adaptive communication of the keyboard to the connected tablet can be realized.
In embodiment 3, the number of pogo pins actually used after the keyboard 1200 of 4 pogo pins is powered on is 4. In another embodiment of the present application, the number of pogo pins actually used after the keyboard 1200 of 4 pogo pins is powered on may be 3, unlike in embodiment 3. If the keypad 1200 is connected with the tablet with 3 contacts for UART communication, the last communication mode of the keypad 1200 is UART communication, so that the default communication mode of UART communication can be initialized after the keypad 1200 is connected with power-on and started.
The keypad 1200 may send a handshake request to the tablet 1201 after initializing to UART communication. Since the tablet 1201 has 3 contacts, the communication mode of the tablet 1201 is UART communication, and the communication mode of the keypad 1200 is UART communication as well, the tablet 1201 can receive the handshake request and feedback the handshake reply, and the keypad 1200 can receive the handshake reply returned by the tablet 1201. As such, the keypad 1200 may be considered successful in handshaking and the keypad 1200 and tablet 1201 are connected properly. After the keyboard 1200 is successfully held, the operation mode may be set to an operation mode corresponding to the Android operating system of the tablet 1201, and then interact with the tablet 1201 in the operation mode.
It can be seen that this embodiment provides an example of a tablet of a 4 pogo pin keyboard adaptive to different operating systems (Windows and Android) in the case where the number of pin pins of the keyboard and the tablet are different, but the number of pin pins actually used after the keyboard is powered on is the same as the number of pin pins of the tablet.
Example 4
Embodiment 4 provides an example of the keyboard adaptation of 4 pogo pins to different communication modes under the condition that the operating system corresponding to the working mode of the tablet is the same as the operating system of the keyboard, but the pin numbers actually used by the two are different.
In the application scenario of embodiment 4, the keyboard is only connected to the tablet of the same operating system, so that only different communication modes can be adapted, and no adaptation of the operating system is required.
In one possible implementation of embodiment 4, the tablet is a USB communication, and if the keyboard of the 4 pogo pin is initialized to the USB communication, the handshake between the keyboard and the tablet is successful. After the handshake is successful, the keyboard is formally switched to USB communication, and the keyboard and the tablet interact through a USB communication channel.
In another possible implementation of embodiment 4, the tablet is a USB communication, and if the keyboard of the 4 pogo pin is initialized to UART communication, the keyboard and the tablet will fail to hold. After the handshake failure, the keyboard can be switched to USB communication, and the handshake between the keyboard and the tablet is successful. After the handshake is successful, the keyboard is formally switched to USB communication, and the keyboard and the tablet interact through a USB communication channel.
In yet another possible implementation of embodiment 4, the tablet is UART communication, and if the keyboard of the 4 pogo pin is initialized to USB communication, the keyboard and the tablet will fail to handshake. After the handshake failure, the keyboard can be switched to UART communication, and the handshake between the keyboard and the tablet is successful. After the handshake is successful, the keyboard is formally switched to UART communication, and the keyboard and the tablet interact through a UART communication channel.
In yet another possible implementation of embodiment 4, the tablet is UART communication, and if the keyboard of the 4 pogo pin is initialized to UART communication, the keyboard and the tablet will handshake successfully. After the handshake is successful, the keyboard is formally switched to UART communication, and the keyboard and the tablet interact through a UART communication channel.
Details of implementation in embodiment 4 (e.g. how to handshake in different communication modes, how to initialize the communication modes, etc.) may refer to the relevant content in embodiments 1-3, and are not described herein.
As shown in fig. 14, one embodiment of the present application provides an interaction method applied to a keyboard, the method includes steps 1401-1403:
in step 1401, when a communication path exists between the contact of the keyboard and the thimble of the tablet, the communication mode of the keyboard is initialized to the first communication mode.
In one embodiment, the first communication mode may be one of a USB communication mode and a UART communication mode.
Step 1402, after initializing the communication mode of the keyboard to the first communication mode, obtaining a handshake result between the keyboard and the tablet. After initializing to the first communication mode, the keyboard may attempt to communicate with the tablet through the first communication mode.
Step 1403, according to the handshake result, performs a first operation, where the first operation is to set a communication mode of the keyboard (such as a busmode) so that the keyboard and the tablet have the same communication mode, or to set an operation mode of the keyboard (such as a workmode) so that the operation mode of the keyboard corresponds to an operation of an operating system of the tablet.
In one embodiment, the first operation may be used to set an operational mode of the keyboard to enable adaptation of the tablet operating system.
In one embodiment, the first operation may be used to set the communication mode of the keyboard to achieve adaptation to the tablet communication mode.
In one embodiment, the first operation may be used to set a communication mode of the keyboard to implement self-adaptation to a tablet communication mode, and after the communication mode of the keyboard is set by the first operation, the tablet may be handshake again, and the working mode of the keyboard is set according to handshake reply, so as to implement self-adaptation to the tablet operating system.
In the embodiment of fig. 14, after the pogo pin keyboard is connected to the tablet, the adaptive recognition of the tablet of different operating systems and the adaptive recognition of different communication modes of the tablet can be realized, so that the pogo pin keyboard can be used commonly among different tablet types and is convenient for users to use.
In one embodiment, the pin data of the keyboard is greater than or equal to the number of contacts of the tablet, so that when the communication modes of the keyboard and the tablet are different, the communication mode of the keyboard can be switched to adapt to the communication mode of the tablet (i.e. the tablet is not adapted by the keyboard, but the tablet is not adapted to the tablet), and the communication interaction between the keyboard and the tablet can be realized without changing the communication mode of the tablet.
In one embodiment of the present application, the first communication mode is a Universal Serial Bus (USB) communication mode; the handshake result includes: the result is used for indicating whether the keyboard receives handshake information sent by the tablet in the set waiting time limit; performing a first operation according to the handshake result, comprising: if the handshake result indicates that the keyboard does not receive handshake information sent by the tablet within the set waiting time limit, setting the communication mode of the keyboard as a second communication mode.
The USB keyboard can handshake with the USB flat panel by waiting for handshake information sent by the USB flat panel, and the implementation mode accords with the USB communication standard, so that the handshake with the USB flat panel can be realized without modifying the flat panel end program.
In one embodiment, the handshake information may be an instruction for device enumeration as described above.
If the communication mode initialized by the keyboard is consistent with the communication mode of the tablet (namely, USB communication is adopted), the keyboard can receive handshake information, otherwise, the keyboard cannot receive handshake information. If handshake information is received, adaptive setup of communication mode (i.e. maintaining original USB communication) can be performed. If the handshake information is not received, the communication mode of the keyboard (for example, UART communication) can be switched so as to keep consistent with the communication mode of the tablet, and the self-adaption of the tablet communication mode is realized.
In one embodiment, the second communication mode after switching may be a UART communication mode, and when the tablet connected to the keyboard is a tablet of the UART communication mode, the UART keyboard is switched by the communication mode, so that the UART keyboard is connected to the UART tablet, and the UART keyboard and the tablet can communicate through the UART channel.
In one embodiment of the present application, after setting the communication mode of the keyboard to the second communication mode, the interaction method further includes: sending a handshake request to the tablet; receiving reply information of the flat panel to the handshake request; and setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet.
In this embodiment, after the adaptation to the tablet communication system is completed, the tablet communication system may also handshake again, and according to the reply information of the handshake with the tablet, the adaptation to the tablet operating system is performed. Therefore, the self-adaption of the operation system and the communication mode of the tablet can be realized, so that the keyboard can be commonly used among different operation systems and different communication modes of the tablet.
In one embodiment of the present application, the handshake request includes a first request conforming to a data format of the first operating system and a second request conforming to a data format of the second operating system; setting the working mode of the keyboard according to the reply information, including: if the reply information comprises the information for replying the first request and does not comprise the information for replying the second request, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the reply message includes the information for replying to the second request and does not include the information for replying to the first request, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
When the keyboard is used for handshake to the panel, two pieces of information can be sent, the two pieces of information correspond to different operating systems respectively, the panel replies which piece of information, namely the operating system of the panel can be indicated as the operating system corresponding to the piece of information, and further the working mode of the keyboard can be formally set according to the operating system corresponding to the piece of information, so that the self-adaption of the operating system can be realized.
In one embodiment of the present application, setting an operation mode of the keyboard according to the reply message includes: if the identification information in the reply information is the information corresponding to the first operating system, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the identification information in the reply information is the information corresponding to the second operating system, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
When the keyboard is used for holding hands on the flat plate, a handshake request can be sent, the flat plate can carry the identification of the operating system according to the handshake reply fed back by the handshake request, and the keyboard can formally set the working mode of the keyboard according to the identification, so that the self-adaption of the operating system can be realized.
In one embodiment of the present application, performing a first operation according to a handshake result includes: if the handshake result indicates that the keyboard receives handshake information sent by the tablet within the set waiting time limit, setting a communication mode of the keyboard as a first communication mode; the interaction method further comprises the following steps: if the handshake result indicates that the keyboard receives handshake information sent by the panel within the set waiting time limit, sending handshake reply to the panel; and setting the working mode of the keyboard according to the response result of the tablet to the handshake reply so that the working mode of the keyboard corresponds to the operating system of the tablet.
If the USB keyboard receives the handshake information, the communication mode can be adaptively set (namely, the original USB communication is maintained). After the USB keyboard receives the handshake information of the USB panel, the handshake reply can be fed back, and then the working mode of the keyboard is set according to the response result of the panel to the handshake reply, so that the self-adaption of the panel operating system is realized.
In one embodiment of the present application, setting an operation mode of the keyboard according to a response result of the tablet to the handshake reply includes: if the identification information of the first operating system sent by the tablet is received, setting the working mode of the keyboard to be the working mode corresponding to the first operating system; if the identification information of the first operating system sent by the tablet is not received, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
The USB tablet of the Windows operating system can feed back the unique identifier of the Windows operating system, while the USB tablet of other operating systems does not feed back the unique identifier, and the keyboard can realize the self-adaption of the USB tablet operating system according to whether the unique identifier is received or not.
In one embodiment of the present application, the first communication mode is not a universal serial bus communication mode (for example, may be a UART communication mode); the interaction method further comprises the following steps: sending a handshake request to the flat panel, wherein the handshake result is reply information of the flat panel to the handshake request; performing a first operation according to the handshake result, comprising: and setting the working mode of the keyboard according to the reply information.
When the communication mode of the keyboard is not USB communication, the handshake request can be sent after the keyboard is powered on and started. When the keyboard communication mode and the tablet communication mode are the same, such as UART communication, the keyboard can receive the reply information of the tablet to the handshake request, and further formally set the working mode of the keyboard according to the reply information, so as to realize self-adaption to the tablet operating system.
As described above, when the keyboard handles a hand to the tablet, two pieces of information for handshake may be sent, or a handshake request may be sent, and the related art implementation may refer to the related content and will not be described herein.
In one embodiment of the present application, initializing a communication mode of a keyboard to a first communication mode includes: initializing the communication mode of the keyboard to be the communication mode of the last use of the keyboard under the condition that the communication mode of the last use of the keyboard exists; and initializing the communication mode of the keyboard to the communication mode of a matched panel of the keyboard under the condition that the communication mode of the keyboard used last time does not exist.
The initialization of the keyboard communication mode can be realized according to the use condition of the keyboard and the standard communication mode, so that the keyboard can be initialized to be consistent with the flat plate, the communication mode does not need to be switched, and the keyboard end flow is simplified.
In one embodiment of the present application, the interaction method further includes: initializing a working mode of the keyboard under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; under the condition that the working mode of the keyboard used for the first time exists, initializing the working mode of the keyboard to the working mode of the keyboard used for the first time; and initializing the working mode of the keyboard to the working mode corresponding to the operating system of the matched panel of the keyboard under the condition that the working mode of the keyboard used last time does not exist.
The initialization of the keyboard working mode can be realized according to the use condition of the keyboard and the standard operating system, so that the keyboard can be initialized to the working mode corresponding to the operating system of the connected flat panel, the working mode is not required to be switched, and the flow of the keyboard end is simplified.
In one embodiment of the present application, the interaction method further includes: responding to the using operation of the keyboard, and encapsulating the data corresponding to the using operation according to the data format of the operating system corresponding to the working mode of the keyboard to obtain encapsulated data; and sending the packaged data to the flat panel.
After the keyboard formally sets the working mode, the working mode of the keyboard corresponds to the operating system of the tablet, and when a user uses the keyboard, the data format of the tablet operating system can be used for packaging data operated by the user and reporting the data to the tablet so as to support the tablet to process the data reported by the keyboard, thereby realizing interaction between the keyboard and the tablet.
An embodiment of the present application further provides an interaction device, applied to a keyboard, including: the initialization module is used for initializing the communication mode of the keyboard into a first communication mode under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel; the acquisition module is used for acquiring a handshake result of the keyboard and the tablet after initializing the communication mode of the keyboard into a first communication mode; and the setting module is used for executing a first operation according to the handshake result, wherein the first operation is an operation of setting the communication mode of the keyboard so as to enable the keyboard and the tablet to have the same communication mode or an operation of setting the operating system of the keyboard so as to enable the keyboard and the tablet to have the same operating system.
An embodiment of the present application further provides a keyboard, which includes the above-mentioned interaction device.
One embodiment of the present application also provides an electronic chip, which is mounted in an electronic device (UE), the electronic chip including: a processor for executing computer program instructions stored on a memory, wherein the computer program instructions, when executed by the processor, trigger an electronic chip to perform the method steps provided by any of the method embodiments of the present application.
An embodiment of the present application further provides a keyboard including a device for executing the above electronic chip.
An embodiment of the present application further proposes a terminal device, which includes a communication module, a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the terminal device to execute the method steps provided by any of the method embodiments of the present application.
An embodiment of the present application also provides an electronic device comprising a memory for storing computer program instructions, a processor for executing the computer program instructions and communication means (such as a communication module that may enable 5G communication based on an NR protocol), wherein the computer program instructions, when executed by the processor, trigger the electronic device to perform the method steps provided by any of the method embodiments of the present application.
In particular, in an embodiment of the present application, one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method steps described in the embodiments of the present application.
Further, the devices, apparatuses, modules illustrated in the embodiments of the present application may be implemented by a computer chip or entity, or by a product having a certain function.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein.
In several embodiments provided herein, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.
Specifically, in an embodiment of the present application, there is further provided a computer readable storage medium, where a computer program is stored, when the computer program is executed on a computer, to cause the computer to perform the method steps provided in the embodiments of the present application.
An embodiment of the present application also provides a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method steps provided by the embodiments of the present application.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or units, which may be in electrical, mechanical, or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units, implemented in the form of software functional units, may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a Processor (Processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
In the present embodiments, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be apparent to those skilled in the art that the same and similar parts of the various embodiments in the present application are referred to each other for convenience and brevity of description. For example, specific working processes of the system, the device and the unit described in the embodiments of the present application may refer to corresponding processes in the embodiments of the method of the present application, which are not described herein again.
The foregoing description of the embodiments is provided for the purpose of illustration only and is not intended to limit the invention to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, alternatives, and alternatives falling within the spirit and scope of the invention.
Claims (14)
1. An interaction method, characterized in that it is applied to a keyboard, the method comprising:
Initializing a communication mode of the keyboard to be a first communication mode under the condition that a communication channel exists between a contact of the keyboard and a thimble of the panel;
after initializing the communication mode of the keyboard into the first communication mode, acquiring a handshake result of the keyboard and the tablet;
executing a first operation according to the handshake result;
if the first communication mode is a usb communication mode and the handshake result indicates that the keyboard does not receive handshake information sent by the tablet within a set waiting time limit, executing a first operation according to the handshake result includes:
setting the communication mode of the keyboard as a second communication mode;
wherein, the working mode of the keyboard corresponds to the operating system of the tablet, or after the setting the communication mode of the keyboard as the second communication mode, the method further includes: sending a handshake request to the tablet; receiving reply information of the flat panel to the handshake request; setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet;
If the first communication mode is not a universal serial bus communication mode, the method further comprises: sending a handshake request to the flat panel, wherein the handshake result is reply information of the flat panel to the handshake request;
the executing a first operation according to the handshake result includes: and setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet.
2. The method of claim 1, wherein the first communication mode is a universal serial bus communication mode;
the handshake result includes: and the result is used for indicating whether the keyboard receives the handshake information sent by the tablet in the set waiting time limit.
3. The method of claim 2, wherein the performing a first operation according to the handshake result comprises:
if the handshake result indicates that the keyboard receives handshake information sent by the tablet within the set waiting time limit, setting a communication mode of the keyboard as the first communication mode;
the method further comprises the steps of:
if the handshake result indicates that the keyboard receives handshake information sent by the panel within the set waiting time limit, sending handshake reply to the panel;
And setting the working mode of the keyboard according to the response result of the tablet to the handshake reply so that the working mode of the keyboard corresponds to the operating system of the tablet.
4. A method according to claim 3, wherein said setting the operation mode of the keyboard according to the response result of the tablet to the handshake reply comprises:
if the identification information of the first operating system sent by the tablet is received, setting the working mode of the keyboard to be the working mode corresponding to the first operating system;
and if the identification information of the first operating system sent by the tablet is not received, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
5. The method of claim 1, wherein the handshake request comprises a first request conforming to a data format of a first operating system and a second request conforming to a data format of a second operating system;
setting the working mode of the keyboard according to the reply information, including:
if the reply message includes the information for replying to the first request and does not include the information for replying to the second request, setting the working mode of the keyboard to be a working mode corresponding to the first operating system;
And if the reply information comprises the information for replying the second request and does not comprise the information for replying the first request, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
6. The method of claim 1, wherein setting the operation mode of the keyboard according to the reply message comprises:
if the identification information in the reply information is information corresponding to a first operating system, setting the working mode of the keyboard to be the working mode corresponding to the first operating system;
and if the identification information in the reply information is information corresponding to a second operating system, setting the working mode of the keyboard to be the working mode corresponding to the second operating system.
7. The method of claim 1, wherein initializing the communication mode of the keyboard to a first communication mode comprises:
initializing the communication mode of the keyboard to be the communication mode of the last use of the keyboard under the condition that the communication mode of the last use of the keyboard exists;
and initializing the communication mode of the keyboard to be the communication mode of a matched panel of the keyboard under the condition that the communication mode of the keyboard used once does not exist.
8. The method according to claim 1, wherein the method further comprises:
initializing a working mode of the keyboard under the condition that a communication channel exists between a contact of the keyboard and a thimble of the flat plate;
under the condition that the working mode of the keyboard used once exists, initializing the working mode of the keyboard to the working mode of the keyboard used once;
and initializing the working mode of the keyboard to be the working mode corresponding to the operating system of the matched panel of the keyboard under the condition that the working mode of the keyboard used at one time does not exist.
9. The method according to claim 1, wherein the method further comprises:
responding to the using operation of the keyboard, and encapsulating data corresponding to the using operation according to a data format of an operating system corresponding to the working mode of the keyboard to obtain encapsulated data;
and sending the packaged data to the flat panel.
10. An interactive apparatus, for application to a keyboard, the interactive apparatus comprising:
the initialization module is used for initializing the communication mode of the keyboard into a first communication mode under the condition that a communication channel exists between the contact of the keyboard and the thimble of the panel;
The acquisition module is used for acquiring a handshake result of the keyboard and the tablet after initializing the communication mode of the keyboard into the first communication mode;
the setting module is used for executing a first operation according to the handshake result;
if the first communication mode is a usb communication mode and the handshake result indicates that the keyboard does not receive handshake information sent by the tablet within a set waiting time limit, executing a first operation according to the handshake result includes:
setting the communication mode of the keyboard as a second communication mode;
the keyboard is provided with a first communication mode, wherein the working mode of the keyboard corresponds to the operating system of the tablet, or after the communication mode of the keyboard is set to be a second communication mode, the interaction device is used for: sending a handshake request to the tablet; receiving reply information of the flat panel to the handshake request; setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet;
if the first communication mode is not a universal serial bus communication mode, the interaction device is configured to: sending a handshake request to the flat panel, wherein the handshake result is reply information of the flat panel to the handshake request;
The executing a first operation according to the handshake result includes: and setting the working mode of the keyboard according to the reply information so that the working mode of the keyboard corresponds to the operating system of the tablet.
11. An electronic chip, comprising:
a processor for executing computer program instructions stored on a memory, wherein the computer program instructions, when executed by the processor, trigger the electronic chip to perform the method of any of claims 1-9.
12. A keyboard, comprising: the interaction device of claim 10, or the electronic chip of claim 11.
13. An electronic device comprising a memory for storing computer program instructions, a processor for executing the computer program instructions, and communication means, wherein the computer program instructions, when executed by the processor, trigger the electronic device to perform the method of any of claims 1-9.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310712654.6A CN116483760B (en) | 2023-06-16 | 2023-06-16 | Interaction method, device, chip, keyboard, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310712654.6A CN116483760B (en) | 2023-06-16 | 2023-06-16 | Interaction method, device, chip, keyboard, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116483760A CN116483760A (en) | 2023-07-25 |
CN116483760B true CN116483760B (en) | 2024-03-22 |
Family
ID=87219818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310712654.6A Active CN116483760B (en) | 2023-06-16 | 2023-06-16 | Interaction method, device, chip, keyboard, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116483760B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049088A (en) * | 2011-10-14 | 2013-04-17 | 信锦企业股份有限公司 | External operation system and external operation method of touch control device |
CN103605427A (en) * | 2013-06-20 | 2014-02-26 | 徐杨 | Drive-free quick response input device based on intelligent tablet computer |
CN104915602A (en) * | 2015-04-22 | 2015-09-16 | 飞天诚信科技股份有限公司 | PIN code protection method under Android platform |
CN107589856A (en) * | 2017-09-27 | 2018-01-16 | 上海斐讯数据通信技术有限公司 | Intelligent keyboard and intelligent input system |
CN216719067U (en) * | 2021-12-22 | 2022-06-10 | 深圳市大开实业发展有限公司 | IOT intelligent keyboard |
CN217333211U (en) * | 2022-04-13 | 2022-08-30 | 惠州Tcl移动通信有限公司 | Flat keyboard and flat computer component |
CN115525099A (en) * | 2022-01-11 | 2022-12-27 | 荣耀终端有限公司 | Terminal equipment and method for detecting keyboard access |
CN116048195A (en) * | 2022-07-14 | 2023-05-02 | 荣耀终端有限公司 | Method and device for supplying power to keyboard through tablet personal computer and tablet personal computer |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3053025A4 (en) * | 2013-09-30 | 2017-05-17 | Hewlett-Packard Development Company, L.P. | Selecting operating systems based on a computing device mode |
-
2023
- 2023-06-16 CN CN202310712654.6A patent/CN116483760B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049088A (en) * | 2011-10-14 | 2013-04-17 | 信锦企业股份有限公司 | External operation system and external operation method of touch control device |
CN103605427A (en) * | 2013-06-20 | 2014-02-26 | 徐杨 | Drive-free quick response input device based on intelligent tablet computer |
CN104915602A (en) * | 2015-04-22 | 2015-09-16 | 飞天诚信科技股份有限公司 | PIN code protection method under Android platform |
CN107589856A (en) * | 2017-09-27 | 2018-01-16 | 上海斐讯数据通信技术有限公司 | Intelligent keyboard and intelligent input system |
CN216719067U (en) * | 2021-12-22 | 2022-06-10 | 深圳市大开实业发展有限公司 | IOT intelligent keyboard |
CN115525099A (en) * | 2022-01-11 | 2022-12-27 | 荣耀终端有限公司 | Terminal equipment and method for detecting keyboard access |
CN217333211U (en) * | 2022-04-13 | 2022-08-30 | 惠州Tcl移动通信有限公司 | Flat keyboard and flat computer component |
CN116048195A (en) * | 2022-07-14 | 2023-05-02 | 荣耀终端有限公司 | Method and device for supplying power to keyboard through tablet personal computer and tablet personal computer |
Non-Patent Citations (1)
Title |
---|
打造2合1电脑――平板键盘导购;ALONG;;电脑知识与技术(经验技巧)(第02期);第65-67页 * |
Also Published As
Publication number | Publication date |
---|---|
CN116483760A (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100755971B1 (en) | Usb device having single port capable of operating in the manner of dual interface | |
US9256563B2 (en) | Dual-operating-system architecture for sharing USB devices, and method thereof | |
CN105700732B (en) | It is used for transmission the devices, systems, and methods of touch sensor information | |
WO2019184444A1 (en) | Master-slave configuration communication protocol, method for improving compatibility, and electronic device | |
CN106445858B (en) | Information processing method, information processing module and electronic equipment | |
CN104572564A (en) | Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer | |
CN101661304B (en) | Computer and input equipment sharing method thereof | |
US10136223B1 (en) | Control method and control system for audio device | |
CN101763324B (en) | Method for realizing equipment simulating and device thereof | |
CN116483760B (en) | Interaction method, device, chip, keyboard, electronic equipment and medium | |
WO2024099182A1 (en) | Master/slave node determination method and apparatus, and electronic device and storage medium | |
US7996697B2 (en) | Matching system of electronic device and peripheral device and matching method thereof | |
US20070257892A1 (en) | Data processing system and method for touch pad | |
KR20200086480A (en) | Firmware upgrading method of wireless charger and device using thereof | |
US20040015615A1 (en) | Method for performing data transfer of KVM switch | |
CN101998691B (en) | Method, system and device for data transmission | |
CN112835821B (en) | Method for simulating PS2 interface through GPIO port of singlechip, singlechip and system | |
CN114064545A (en) | Serial port function identification method and device, main control chip, household appliance and medium | |
CN106354683B (en) | Micro-control device and input/output system applied to micro-control device | |
CN101989194A (en) | Secondary development method for wireless communication module | |
CN101788964B (en) | Automatic correspondence updating computer switching device | |
CN111782574A (en) | Serial peripheral interface control method and serial peripheral interface controller | |
CN213426432U (en) | Bluetooth headset and bluetooth headset charging bin combined system | |
US11442518B2 (en) | Extended system, server host and operation method thereof | |
WO2015035609A1 (en) | Method and device for simultaneously uploading keyboard key codes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |