CN110658948A - Method, apparatus and medium for touch operation - Google Patents

Method, apparatus and medium for touch operation Download PDF

Info

Publication number
CN110658948A
CN110658948A CN201910795438.6A CN201910795438A CN110658948A CN 110658948 A CN110658948 A CN 110658948A CN 201910795438 A CN201910795438 A CN 201910795438A CN 110658948 A CN110658948 A CN 110658948A
Authority
CN
China
Prior art keywords
touch
touch points
data packet
information
packet
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.)
Withdrawn
Application number
CN201910795438.6A
Other languages
Chinese (zh)
Inventor
陶长安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Chengda Intelligent Technology Co Ltd
Original Assignee
Guangzhou Chengda Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Chengda Intelligent Technology Co Ltd filed Critical Guangzhou Chengda Intelligent Technology Co Ltd
Priority to CN201910795438.6A priority Critical patent/CN110658948A/en
Publication of CN110658948A publication Critical patent/CN110658948A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses a method, a device and a storage medium for touch operation, aiming at solving the technical problem of unsmooth touch feeling in the process of touch interaction of a user in the prior art, wherein the method for touch operation comprises the steps of self-adaptively adjusting the length of a data packet according to the number of touch points, wherein the length of the data packet is positively correlated with the number of the touch points; according to the embodiment of the application, the communication bandwidth required by data packet transmission is saved, the time delay of the data packet transmission is reduced, and the clicking feeling of a user in the touch interaction process is relieved.

Description

Method, apparatus and medium for touch operation
Technical Field
The present disclosure relates to the field of control, and in particular, to a method, an apparatus, and a medium for touch operation.
Background
Due to the convenience of interaction, the application scenes are more and more abundant. The touch interaction process of the current scheme is as follows: when the terminal device detects a touch event on a touch device (such as a touch screen, a touch frame or a touch pad), the touch event generates a data packet, the length of the data packet is usually large, the data packet is sent to a processor, the processor identifies the type of the touch gesture according to the data packet, and then the operation corresponding to the type of the touch gesture is executed.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art: the data volume of the data packet is larger, and the transmission process that the terminal equipment sends the data packet to the processor consumes longer time, so that a user feels stuck when using touch interaction control.
Disclosure of Invention
According to the method, the device and the medium for touch operation, the length of the data packet is adjusted according to the number of touch points corresponding to the touch event, the data volume sent to a host by the touch equipment is reduced, and therefore the transmission delay of the data packet is reduced.
In a first aspect, the present application provides a method for sending a data packet, including: the terminal equipment acquires touch data of a touch event, the touch event comprises N touch points, the terminal equipment generates a data packet according to attribute information of the N touch points, the length of the data packet is related to the numerical value of N, the larger the value of N is, the larger the length of the corresponding data packet is, and otherwise, the smaller the numerical value of N is, the smaller the length of the corresponding data packet is. The terminal device sends a data packet, for example: the touch device in the terminal equipment can send the data packet to the processor of the terminal equipment, or the touch device of the terminal equipment sends the data packet to the processors of other terminal equipment through the communication interface.
In one possible design, generating the data packet according to the attribute information of the N touch points includes: generating a bag body with a corresponding size according to the number N of the touch points; determining the storage position of the attribute information of the N touch points in the bag body according to the identification information of the N touch points, storing the attribute information of the N touch points in the bag body according to the storage position, generating a bag head according to the length of the bag body, and combining the bag head and the bag body into data.
In one possible design, the bag body further includes check information, and the check information includes check bits and the number N of touch points.
In a possible design, the identification information of the N touch points is increased by taking 1 as a step length according to the generated sequence, and the identification information of the first touch point in the N touch points is 0.
In one possible design, the attribute information of the N touch points includes one or more of identification information, state information, position information, and size information.
In one possible design, the data packet includes a header that includes length information and/or header identification bits.
In a second aspect, the present application provides an apparatus for touch operation, comprising:
the acquiring unit is used for acquiring attribute information of N touch points corresponding to the touch event; wherein N is an integer greater than 0;
the generating unit is used for generating data according to the attribute information of the N touch points; wherein the length of the data packet is positively correlated with the value of N;
and the sending unit is used for sending the data packet.
In one possible design, the generating unit is specifically configured to:
generating a bag body with a corresponding size according to the number N of the touch points;
determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the N touch points;
and storing the attribute information of the N touch points into the bag body according to the storage position.
In one possible design, the bag body further includes check information, and the check information includes check bits and/or the number N of touch points.
In a possible design, the identification information of the N touch points is increased by taking 1 as a step length according to the generated sequence, and the identification information of the first touch point in the N touch points is 0, that is, the identification information of the N touch points is 0, 1, 2, …, and N in sequence.
In one possible design, the attribute information of the N touch points includes one or more of identification information, state information, position information, and size information.
In one possible design, the data packet further includes a header, and the header includes length information and/or a header identification bit.
In another aspect, the present application provides a device for touch operation (referred to as a device for short), which may implement the method for touch operation of the first aspect. The apparatus may be a chip (such as a baseband chip, or a communication chip, etc.) or a processing server. The above-described method may be implemented by software, hardware, or by executing corresponding software by hardware.
In one possible implementation manner, the structure of the apparatus includes a processor, a memory; the processor is configured to support the apparatus to perform corresponding functions in the above-described communication method. The memory is used for coupling with the processor, which holds the necessary programs (instructions) and/or data for the device. Optionally, the communication apparatus may further include a communication interface for supporting communication between the apparatus and other network elements.
In another possible implementation manner, the apparatus may include a unit module for performing corresponding actions in the above method.
In yet another possible implementation, the wireless communication device includes a processor and a transceiver, the processor is coupled to the transceiver, and the processor is configured to execute a computer program or instructions to control the transceiver to receive and transmit information; the processor is further configured to implement the above-described method when the processor executes the computer program or instructions. The transceiver may be a transceiver, a transceiver circuit, or an input/output interface. When the communication device is a chip, the transceiver is a transceiver or an input/output interface.
When the device is a chip, the sending unit may be an output unit, such as an output circuit or a communication interface; the receiving unit may be an input unit, such as an input circuit or a communication interface. When the device is a network device, the sending unit may be a transmitter or a transmitter; the receiving unit may be a receiver or a receiver.
Yet another aspect of the present application provides an apparatus, comprising: a memory and a processor; wherein the memory stores a set of program codes, and the processor is configured to call the program codes stored in the memory and execute the method of the aspects.
Yet another aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
Yet another aspect of the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the embodiment of the application, the data packets with the corresponding lengths are generated according to the number of the touch points, the length of the data packets is positively correlated with the number of the touch points, the problem of large transmission delay caused by the fact that a large data packet is used for transmission is solved, the communication bandwidth required by data packet transmission is saved, the delay of the data packet transmission is reduced, and therefore the blocking feeling of a user in the process of touch interaction is relieved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1A is a diagram of a network architecture provided by an embodiment of the present application;
FIG. 1B is another diagram of a network architecture provided by an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for touch operation according to an embodiment of the present disclosure;
fig. 3 is another schematic flow chart of a method for touch operation according to an embodiment of the present disclosure;
fig. 4A is an interaction diagram of a method for touch operation according to an embodiment of the present disclosure;
FIG. 4B is a schematic diagram of a touch gesture provided in an embodiment of the present application;
FIG. 4C is a schematic diagram of a touch gesture provided by an embodiment of the present application;
fig. 5 is another interaction diagram of a method for touch operation according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an apparatus provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance. It will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1A and fig. 1B are network structure diagrams of an embodiment of the present application, and referring to fig. 1A, a terminal device 1 includes a touch device 10 and a processor 11, where the touch device 10 and the processor 11 are located in the same terminal device, the touch device 10 has a touch surface and a touch controller, the touch surface may be a touch screen, a touch pad, or a touch frame, when a user performs a touch operation on the touch surface, the touch device 10 detects a touch event on the touch surface, the touch event may be a single-point touch event or a multi-point touch event, the touch controller generates a data packet according to attribute information of one or more touch points corresponding to the touch event, the touch device 10 sends the data packet to the processor 11 through a bus, the processor 11 receives the data packet from the touch device 10, identifies attribute information of one or more touch points carried in the data packet, and obtains a touch gesture type, the processor 11 then performs a corresponding operation according to the touch gesture type. The touch device 10 and the processor 11 may be connected via a bus, which includes but is not limited to a Peripheral Component Interconnect (PCI) bus, a Controller Area Network (CAN), an Industry Standard Architecture (ISA) bus, or other types of buses, and the embodiments of the present invention are not limited thereto.
Referring to fig. 1B, the touch device 10 is located in the terminal device 1, the processor 20 is located in the terminal device 2, the touch device 10 and the processor 20 are respectively located in two different terminal devices, and the terminal device 1 and the terminal device 2 communicate with each other through a communication interface, which includes but is not limited to a Universal Serial Bus (USB) interface, a High Definition Multimedia Interface (HDMI) or other interfaces. When a user detects a touch event on a touch device of the touch device 10 of the terminal device 1, the touch event may be a single-point touch event or a multi-point touch event, the touch device 10 generates a data packet according to attribute information of one or more touch points corresponding to the touch event, the touch device 10 sends the data packet to the processor 20 through a bus, the processor 20 receives the data packet from the touch device 10, identifies the attribute information of the one or more touch points carried in the data packet to obtain a touch gesture type, and then the processor 20 executes a corresponding operation according to the touch gesture type.
The terminal device of the embodiment of the application includes but is not limited to a mobile terminal, a vehicle-mounted terminal, an intelligent wearable device, a tablet computer, a personal computer and other terminal devices with a touch function.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for touch operation according to an embodiment of the present disclosure, where the schematic flowchart is based on the network architecture of fig. 1A, and in an embodiment of the present disclosure, the method includes:
s201, acquiring attribute information of N touch points corresponding to the touch event.
Specifically, when a user performs a touch operation on a touch device of the terminal device, the terminal device detects a touch event, when a finger of the user contacts the touch device, an area where the finger contacts the touch device is called a touch point, and the size of the touch point is related to the thickness of the finger and the pressing force. The terminal device detects a plurality of touch points formed by a plurality of fingers on the touch surface under the condition that the terminal device supports multi-point touch. The terminal equipment can continuously record the attribute information of the touch point, and when the finger is separated from the touch device, the terminal equipment determines that the user completes the current touch operation.
Wherein the attribute information represents position information, identification information and size information of the touch point on the touch device, such as: the attribute information includes one or more of state information, identification Information (ID), position information, and size information of the touch point. The state information of the touch point indicates a down state (down), a slide state (move), and a up state (up), the down state indicates state information when the finger is in contact with the touch device, the slide state indicates a state where the finger of the user slides on the touch device, and the up state indicates a state where the finger is out of contact with the touch device. Different states of the touch point can be represented using different numerical values, for example: 0x04 indicates that the state of the touch point is the down state, 0x05 indicates that the state of the touch point is the slide state, and 0x07 indicates that the state of the touch point is the up state. The position information indicates a position of the touch point on the touch device, and usually indicates the position of the touch point using X and Y coordinates with reference to an origin in the touch device. The size information of the touch point indicates the size of the touch point, and the size of the touch point may be indicated using a width and a height.
And S202, generating a data packet according to the attribute information of the N touch points.
Specifically, the length of the data packet and the number N of touch points corresponding to the touch event are in positive correlation, the greater the number of touch points, the greater the length of the data packet, and conversely, the smaller the number of touch points, the shorter the length of the data packet. If a plurality of touch points exist, the lengths of the attribute information of the plurality of touch points are the same or the lengths of the attribute information of the plurality of touch points are different. The data packet comprises a packet header and a packet body, the attribute information of the N touch points is located in the packet body of the data packet, the packet header of the data packet is used for describing relevant information of the data packet, the length of the packet header of the data packet is fixed, the packet header comprises a packet header identification bit, length information and a reserved bit, the packet header identification bit is used for identifying the packet header, the length information represents the length of the data packet, the reserved bit is a reserved extension field, and a user can define the data packet.
For example: the lengths of the attribute information of the touch points are all the same, the length of the attribute information of each touch point is 9 bytes, and the packet header of the data packet is 5 bytes. When the number of touch points corresponding to the touch event is 1, the length of a data packet generated by the terminal equipment is 14 bytes; when the number of touch points corresponding to the touch event is 2, the length of a data packet generated by the terminal equipment is 23 bytes; when the number of touch points corresponding to the touch event is 3, the length of the data packet generated by the terminal device is 32 bytes.
By way of further example: the number of the touch points is 2, 2 touch points are respectively a touch point 1 and a touch point 2, the length of the touch point 1 is 8 bytes, the length of the touch point 2 is 9 bytes, and the length of the packet header of the data packet is 5 bytes, so that the length of the data packet generated according to the current two touch points is: 8+9+ 5-22 bytes.
And S203, the terminal equipment sends the data packet.
Specifically, the terminal device may send the data packet to the processor of the terminal device, or to processors of other terminal devices. According to an embodiment of the present application, the terminal device first sends the header of the data packet, and then sends the body of the data packet, so that the processor first receives the header of the data packet, and receives and parses the following body according to information carried in the header.
For example, when a touch event corresponds to 1 touch point, the length of a generated data packet is 17 bytes, and when a touch device (e.g., a touch frame) of the terminal device sends the data packet to the processor using 115200 baud rate, the required transmission time is 1.4 ms. If a data packet of 67 bytes length of the prior art is used for transmission, the required transmission time is 5.8 ms. Compared with the transmission scheme in the prior art, the transmission delay is greatly reduced.
According to the embodiment of the application, the data packets with the corresponding lengths are generated according to the number of the touch points, the length of the data packets is positively correlated with the number of the touch points, the problem of large transmission delay caused by the fact that the data packets with large lengths are used for transmission is solved, the communication bandwidth required by data packet transmission is saved, the delay of the data packet transmission is reduced, and therefore the clicking feeling of touch interaction of a user is relieved.
Referring to fig. 3, another flow diagram of a method for touch operation provided in an embodiment of the present application is based on the network architecture of fig. 1A, and in the embodiment of the present application, the method includes:
s301, acquiring attribute information of N touch points corresponding to the touch event.
Specifically, the touch event represents a touch action occurring on a touch device of the terminal device, when a finger of a user contacts the touch indication, the finger and the touch device form a touch point, the terminal device may continuously record attribute information of the touch point, for example, the terminal device may record the attribute information of the touch point according to a preset period, and when the finger is separated from the touch indication, the terminal device determines a complete current touch operation of the user. When the terminal equipment supports multi-point touch control, a plurality of fingers respectively correspond to a touch point.
And S302, generating a bag body according to the attribute information of the N touch points.
Specifically, the bag user stores the attribute information of the touch points, the length of the attribute information of the touch points is fixed, the terminal device allocates the bag body according to the number N of the touch points, the length of the bag body is in positive correlation with the number N of the touch points, the larger the number N of the touch points is, the larger the length of the bag body is, the smaller the number N of the touch points is, and the shorter the length of the bag body is. At this time, the assigned packet body does not store the attribute information of the touch point, and can be filled with a specific character.
For example, the attribute information of the touch point needs to occupy a storage space of 9 bytes, and if N is equal to 1, the length of the terminal device is 9 bytes; assuming that the touch event corresponds to 2 touch points, and N is 2, the terminal device allocates a packet with a length of 18 bytes; the touch event corresponds to 3 touch points, N is 3, and the terminal device allocates a bag body with the length of 27 bytes.
In a possible embodiment, the body further includes check information, the check information is used to ensure the reliability of data packet transmission, and the length of the check information is also fixed, for example: the length of the verification information is 2 bytes, the verification information comprises the number N of the touch points and a checksum, and the length of the verification information needs to be considered when the terminal equipment distributes the bag body according to the number of the touch points.
For example, the attribute information of the touch points needs to occupy a storage space of 9 bytes, and when the number of the touch points is 1, the terminal device allocates a packet with a length of 11 bytes; when the number of the touch points is 2, the terminal equipment allocates a bag body with the length of 20 bytes.
S303, determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the touch points.
Specifically, the identification information of the touch point represents the identity of the touch point, the identification information of the touch point is obtained by the sequence of the generation of the touch points, different touch points have different identification information, and the assignment rule of the identification information of the touch point may be to increase progressively from 0 in a manner that the step length is 1, or to increase progressively from 1 in a manner that the step length is 1. The terminal device prestores or preconfigures a mapping relation between the identification information and the storage positions of the touch points, and the terminal device determines the storage positions of the attribute information of the N touch points in the bag body according to the mapping relation. For example: the user uses the finger 1 and the finger 2 to perform touch operation on the terminal device, the terminal device detects that the finger 1 contacts the touch screen before the finger 2, the terminal device assigns 0 identification information for a touch point (recorded as the touch point 1) corresponding to the finger 1, and assigns 1 identification information for a touch point (recorded as the touch point 2) corresponding to the finger 1, the terminal device can prestore or preconfigure a mapping relationship between the identification information and a storage position, and the terminal device determines the storage position of the touch point in the packet header according to the mapping relationship.
For example, the terminal device pre-stores mapping relationships between identification information and storage locations of touch events of 6 touch points supported by the terminal device as shown in the table:
Figure BDA0002180798630000081
TABLE 1
Assuming that the terminal device detects that the current touch event includes 2 touch points, the identification information of the first touch point is 0, the identification information of the 2 nd touch point is 1, and the storage location of the touch point with the identification information of 0 is from the 5 th byte to the 14 th byte; the storage locations of the attribute information of the touch point whose identification information is 1 are 15 th byte to 24 th byte.
As another example, the number of touch points and the length of the data packet are shown in Table 2:
for example: the identification information of the touch points and the storage position in the bag body are shown in table 1, the identification information of the first touch point in the N touch points is 0, and the number is increased by taking 1 as a step length.
Figure BDA0002180798630000091
TABLE 2
In table 2, N represents identification information of touch points, and the identification information of touch points is incremented by 1 from 0, that is, the identification information of N touch points is: 0. 1, 2, …, N represents the number of touch points corresponding to touch events occurring on the touch means of the terminal device. The header occupies the fixed 5 bytes in the front in the data packet: byte 0 to byte 4, the packet header includes packet header identification bit 1, packet header identification bit 2, length information low byte, length information high byte and reserved bit.
In table 2, when the number of touch points corresponding to a touch event is 1, N is 1, the identification information of the touch point is 0, and N is 0, then the attribute information of the touch point in the packet occupies bytes 5 to 14, the verification information in the packet includes the number of touch points and a checksum, the verification information occupies bytes 15 and 16, and the total length of the packet is 17 bytes.
When the number of touch points corresponding to the touch event is 2, N is 2, the identification information of the two touch points is N is 0 and N is 1, the attribute information of the touch point with N being 0 occupies the 5 th byte to the 14 th byte, the attribute information of the touch point with N being 1 occupies the 15 th byte to the 24 th byte, the verification information in the packet occupies the 25 th byte and the 26 th byte, and the middle length of the data packet is 27 bytes.
And S304, storing the attribute information of the N touch points in the bag body according to the storage positions.
Specifically, the packet header includes one or more of a packet header identification bit, length information, and a reserved bit. The length of the packet header is fixed, the packet header is located in front of the packet body, the number of the packet header identification bits may be one or more, the packet header identification bits are used for identifying that the type of the data packet is the packet header, and the packet header identification bits may be a character string, a bit or other forms.
And S305, generating a packet header according to the length of the packet body.
Specifically, the packet header carries length information and/or a packet header identification bit, the length information indicates the length of the data packet corresponding to the packet header, and the length information may be indicated by a bitmap. The header identification bits are used to identify the header, and the number of the header identification bits may be one or more to ensure the accuracy of the identification. The length of the header may be fixed, for example: the length of the packet header is fixed to 5 bytes; or the length of the packet header may not be fixed, for example: the length of the packet head is related to the length of the bag body, the longer the length of the bag body is, the longer the length of the packet head is, and the shorter the length of the bag body is, the shorter the length of the corresponding packet head is.
S306, combining the packet body and the packet head into a data packet.
The data packet comprises a packet head and a packet body, and the packet head is positioned in front of the packet body.
And S307, transmitting the data packet.
Specifically, since the packet header is in front of the packet body, when the data packet is sent, the packet header is sent to the processor before the packet body.
For example, when the touch event corresponds to 1 touch point, the length of the generated data packet is 17 bytes, and when the touch device (e.g., the touch frame) of the terminal device sends the data packet to the processor using a 9600 baud rate, the required transmission time is 16.7 ms. If a data packet of 67 bytes length of the prior art is used for transmission, the required transmission time is 69.8 ms. Compared with the transmission scheme in the prior art, the transmission delay is greatly reduced.
By implementing the embodiment of the application, the length of the data packet is adjusted in a self-adaptive manner through the number of the touch points corresponding to the touch event, the length of the data packet and the number of the touch points are in positive correlation, the problem of large transmission delay caused by transmission by using a large data packet is avoided, and the data volume in the transmission process of the data packet is reduced, so that the transmission delay of the data packet is reduced, and the response speed of a user in touch operation through terminal equipment is improved.
Referring to fig. 4, an interaction schematic diagram of a method for touch operation provided in an embodiment of the present application is shown, where the interaction process is based on the network architecture of fig. 1B, and in the embodiment of the present application, the method includes:
s401, the terminal device 1 obtains attribute information of N touch points corresponding to the touch event.
The specific process of S401 may refer to the description of S201 in fig. 2, and is not described herein again.
S402, the terminal device 1 generates a data packet according to the attribute information of the N touch points.
The specific process of S402 may refer to the description of S202 in fig. 2, and is not described herein again.
S403, the terminal device 1 sends the data packet to the terminal device 2, and the terminal device 2 receives the data packet from the terminal device 1.
Specifically, the specific process of S403 may refer to the description of S203 in fig. 2, and is not described herein again.
S404, the terminal device 2 analyzes the length information in the packet header.
Specifically, the terminal device 2 identifies the packet header according to the packet header identification bit, and then determines the length of the subsequent packet body according to the length information carried in the packet header.
And S405, the terminal equipment 2 determines that the receiving of the bag body is finished according to the length information.
Specifically, the terminal device 2 determines the length of the subsequent bag body according to the length information, judges whether the bag body is completely received according to the length of the bag body, and if the bag body is completely received, the terminal device 2 executes the next operation.
S406, the terminal device 2 identifies the touch gesture type according to the attribute information of the N touch points carried in the bag body.
Specifically, the terminal device 2 identifies a touch gesture type according to attribute information of N touch points carried in the bag body, where the touch gesture type represents a track formed by the N touch points on the touch device of the terminal device 1, for example: the touch gesture types comprise single-point upward sliding, single-point downward sliding, three-point upward sliding, two-point opposite direction approaching, two-point opposite direction far away and the like.
And S407, the terminal device 2 executes corresponding operation according to the type of the touch event.
Specifically, the terminal device 2 prestores or preconfigures a mapping relationship between the type of the touch event and the operation type, and the terminal device 2 determines the operation corresponding to the type of the current touch event according to the mapping relationship and then executes the operation.
For example, referring to fig. 4B, the touch device is a touch screen, the terminal device 1 and the terminal device 2 are located in the same terminal device, the terminal device 1 detects a touch event formed by two touch points on the touch screen, the terminal device 1 generates a data packet with a length of 25 bytes according to attribute information of the two touch points, the terminal device 1 sends the data packet to the terminal device 2, the terminal device 2 analyzes the data packet to recognize that the touch gesture type on the touch screen is a two-point opposite direction away, the terminal device 2 determines that an operation corresponding to the touch gesture type is an amplification operation according to a mapping relationship, and the terminal device 2 performs an amplification operation on a current interface.
For another example, as shown in fig. 4C, the touch device is a touch screen, the terminal device 1 and the terminal device 2 are located in the same terminal device, the terminal device 1 detects that a touch event formed by one touch point occurs on the touch screen, the terminal device 1 generates a 16-byte data packet according to attribute information of the one touch point, the terminal device 1 analyzes the data packet to recognize that the touch gesture type on the touch screen is a right sliding, the terminal device 2 determines that the touch gesture type corresponds to a page turning operation according to a mapping relationship, and the terminal device 2 switches the current interface to the next interface.
By implementing the embodiment of the application, the length of the data packet is adjusted in a self-adaptive manner through the number of the touch points corresponding to the touch event, the length of the data packet is in positive correlation with the number of the touch points, the problem of large transmission delay caused by using a data packet with a large length is avoided, and the data volume in the transmission process of the data packet is reduced, so that the transmission delay of the data packet is reduced, and the response speed of a user for performing related operations through terminal equipment is improved.
Referring to fig. 5, another interaction diagram of a method for touch operation provided in an embodiment of the present application is shown, where the interaction process is based on the network architecture of fig. 1B, and in an embodiment of the present application, the method includes:
s501, the terminal device 1 obtains attribute information of N touch points corresponding to the touch event.
And S502, the terminal equipment 1 determines to generate the bag body with the corresponding size according to the number N of the touch points.
S503, the terminal device 1 determines the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the touch points.
And S504, the terminal device 1 stores the attribute information of the N touch points in the bag body according to the storage position.
S505, the terminal device 1 generates a packet header according to the length of the packet.
S506, the terminal device 1 generates a packet.
S507, the terminal device 1 sends the data packet to the terminal device 2, and the terminal device 2 receives the data packet from the terminal device 1.
S508, the terminal device 2 parses the length information in the packet header.
And S509, the terminal device 2 determines that the receiving of the packet body is finished according to the length information.
And S510, the terminal device 2 identifies the touch gesture type according to the attribute information of the N touch points carried in the bag body.
And S511, the terminal device 2 executes corresponding operation according to the touch gesture type.
The specific implementation process of S501 to S511 can refer to descriptions of S301 to S307 in fig. 3 and S404 to S407 in fig. 4A, and is not described herein again.
By implementing the embodiment of the application, the length of the data packet is adjusted in a self-adaptive manner through the number of the touch points corresponding to the touch event, the length of the data packet is in positive correlation with the number of the touch points, the problem of large transmission delay caused by using a data packet with a large length is avoided, and the data volume in the transmission process of the data packet is reduced, so that the transmission delay of the data packet is reduced, and the response speed of a user in touch operation through terminal equipment is improved.
Fig. 2 to 5 illustrate a method for touch operation according to an embodiment of the present disclosure in detail.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an apparatus for touch operation according to an embodiment of the present application, which is referred to as an apparatus 6 for short, where the apparatus 6 may include an obtaining unit 601, a generating unit 602, and a sending unit 603.
An obtaining unit 601, configured to obtain attribute information of N touch points corresponding to a touch event; wherein N is an integer greater than 0.
A generating unit 602, configured to generate data packets according to the attribute information of the N touch points; wherein the length of the data packet has a positive correlation with the value of N.
A sending unit 603, configured to send the data packet.
In a possible implementation, the generating unit 602 is specifically configured to:
generating a bag body with a corresponding size according to the number N of the touch points;
determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the N touch points;
storing the attribute information of the N touch points into the bag body according to a storage position;
generating a packet header according to the length of the packet body, and combining the packet header and the packet header into the data.
In a possible embodiment, the enclosure further comprises check information, wherein the check information comprises a number N of check bits and/or touch points.
In a possible implementation manner, the identification information of the N touch points is incremented by taking 1 as a step length according to the sequence of the generation of the touch points, and the identification information of the first touch point in the N touch points is 0.
In one possible implementation, the attribute information of the N touch points includes one or more of identification information, state information, position information, and size information.
In a possible embodiment, the data packet further includes a header, and the header includes length information and/or a header identification bit.
The device 6 may be a terminal device, and the device 6 may also be a field-programmable gate array (FPGA), an application-specific integrated chip (asic), a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips, which implement related functions.
The embodiment of the present application and the method embodiments of fig. 2 to 5 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the method embodiments of fig. 2 to 5, and will not be described again here.
Referring to fig. 7, a schematic structural diagram of a terminal device with a touch device according to an embodiment of the present application is shown, where the terminal device may be used to implement the method for touch operation provided in the foregoing embodiment.
Specifically, the method comprises the following steps:
the memory 720 may be used to store software programs and modules, and the processor 780 performs various functional applications and data processing by operating the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 720 may also include a memory controller to provide access to memory 720 by processor 780 and input unit 730.
The input unit 730 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Specifically, the input unit 730 may include a touch device 731 (e.g., a touch screen, a touch pad, or a touch frame). The touch device 731, also referred to as a touch display or a touch pad, can collect touch operations of a user (e.g., operations of a user on or near the touch device 731 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. Alternatively, the touch device 731 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 780, and can receive and execute commands from the processor 780. In addition, the touch device 731 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave.
The display unit 740 may be used to display information input by a user or information provided to a user and various graphic user interfaces of the terminal device, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 740 may include a Display panel 741, and optionally, the Display panel 741 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch device 731 can cover the display panel 741, and when the touch device 731 detects a touch operation on or near the touch device 731, the touch operation is transmitted to the processor 780 to determine the type of the touch event, and then the processor 780 provides a corresponding visual output on the display panel 741 according to the type of the touch event. Although in fig. 7, the touch device 731 and the display panel 741 are implemented as two separate components to implement input and output functions, in some embodiments, the touch device 731 and the display panel 741 may be integrated to implement input and output functions.
The processor 780 is a control center of the terminal device, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by operating or executing software programs and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby integrally monitoring the terminal device. Optionally, processor 780 may include one or more processing cores; processor 780 may integrate an application processor that handles operating system, user interfaces, applications, etc. and a modem processor that handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
Specifically, in this embodiment, the display unit of the terminal device is a touch screen display, the terminal device further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring attribute information of N touch points corresponding to the touch event; wherein N is an integer greater than 0;
generating a data packet according to the attribute information of the N touch points; wherein the length of the data packet is positively correlated with the value of N;
and sending the data packet.
In one possible design, processor 780 performs generating a data packet based on the attribute information of the N touch points including:
generating a bag body with a corresponding size according to the number N of the touch points;
determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the N touch points;
storing the attribute information of the N touch points into the bag body according to a storage position;
generating a packet header according to the length of the packet body, and combining the packet header and the packet header into the data.
In a possible embodiment, the enclosure further comprises check information, wherein the check information comprises a number N of check bits and/or touch points.
In a possible implementation manner, the identification information of the N touch points is incremented by 1 as a step length according to the generated sequence, and the identification information of the first touch point in the N touch points is 0.
In one possible implementation, the attribute information of the N touch points includes one or more of identification information, state information, position information, and size information.
In a possible embodiment, the data packet further includes a header, and the header includes length information and/or a header identification bit.
The embodiment of the present application and the method embodiments of fig. 2 to 5 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the method embodiments of fig. 2 to 5, which are not described herein again.
Alternatively, the terminal device may include RF (Radio Frequency) circuit 710, memory 720 including one or more computer-readable storage media, input unit 730, display unit 740, sensor 750, audio circuit 760, WiFi (wireless fidelity) module 760, processor 780 including one or more processing cores, and power supply 790. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 7 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Wherein:
RF circuit 710 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink information from a base station and processing the received downlink information by one or more processors 780; in addition, data relating to uplink is transmitted to the base station. In general, RF circuit 710 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 710 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to 3GPP (3rd Generation Partnership Project, 3GPP for short), 3GPP2 (3rd Generation Partnership Project 2, 3GPP2 for short), UMTS (Universal Mobile Telecommunications System, UMTS for short), LTE (Long Time Evolution, LTE for short), LTE-a (LTE-Advanced, Long Term Evolution upgrade, LTE-a for short), WIMAX (Worldwide Access for Microwave Access, WIMAX for short), HSDPA (High Speed Downlink Packet Access, HSDPA for short), HSUPA (High Speed Uplink Packet Access, TDMA for short), and Multiple Access Time Division Multiple Access (HSUPA for short), which may be implemented by using any communication standard or protocol, including but not limited to 3GPP (3rd Generation Partnership Project, UMTS for short), UMTS (Universal Mobile Telecommunications System, UMTS for short), LTE (Long Time Evolution, LTE for short), LTE-a (LTE-Advanced Long Term Evolution upgrade, LTE-a for short), WIMAX (Worldwide Interoperability for Microwave Access, TDMA for short), HSDPA (High Speed Downlink Packet Access, TDMA for short), and TDMA for short WCDMA (Wideband Code Division Multiple Access, WCDMA for Short), GSM (Global system for Mobile Communication, GSM for Short, email, SMS (Short Messaging Service), etc.
Optionally, the terminal device may further include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 741 and/or a backlight when the terminal device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the terminal device is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of the terminal device, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device, detailed description is omitted here.
Audio circuitry 760, speaker 761, and microphone 762 may provide an audio interface between a user and a terminal device. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, processes the audio data by the audio data output processor 780, and transmits the processed audio data to, for example, another terminal device via the RF circuit 710, or outputs the audio data to the memory 720 for further processing. The audio circuitry 760 may also include an earbud jack to provide communication of peripheral headphones with the terminal device.
WiFi belongs to short-distance wireless transmission technology, and the terminal equipment can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 770, and provides wireless broadband Internet access for the user. Although fig. 7 shows the WiFi module 770, it is understood that it does not belong to the essential constitution of the terminal device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
Optionally, the terminal device further includes a power supply 790 (e.g., a battery) for supplying power to each component, wherein the power supply may be logically connected to the processor 780 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The power supply 790 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Optionally, the terminal device may further include a camera 791, a bluetooth module, and the like, where the camera 791 is configured to expose the surrounding environment to obtain a frame image, and in one mode, the camera 791 transmits parameters of the frame image obtained by exposure to the processor 780, so that the processor 780 performs processing such as denoising and enhancing on the frame image to generate a picture that can be displayed to the user; in yet another alternative, the camera 791 may have an image processor chip, and the image processor chip may perform a preliminary processing on the frame of image, and after performing the preliminary processing on the frame of image, the processed data may be transferred to the processor 780 so that the processor 780 may ultimately produce an image that can be displayed to a user. Further, the number of the cameras 791 may be one or more.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for touch operation, comprising:
acquiring attribute information of N touch points corresponding to the touch event; wherein N is an integer greater than 0;
generating a data packet according to the attribute information of the N touch points; wherein the length of the data packet is positively correlated with the value of N;
and sending the data packet.
2. The method of claim 1, wherein the generating the data packet according to the attribute information of the N touch points comprises:
generating a bag body with a corresponding size according to the number N of the touch points;
determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the N touch points;
storing the attribute information of the N touch points into the bag body according to a storage position;
generating a packet header according to the length of the packet body, and generating the data packet; wherein the data packet comprises the packet body.
3. The method of claim 2, wherein the enclosure further comprises verification information comprising a number of verification bits and/or touch points N.
4. The method according to claim 2 or 3, wherein the identification information of the N touch points is increased in steps of 1 according to the generated sequence, and the identification information of the first touch point in the N touch points is 0.
5. The method of claim 4, wherein the attribute information of the N touch points comprises one or more of identification information, status information, location information, and size information.
6. The method according to claim 5, wherein the packet header comprises length information and/or a header identification bit.
7. An apparatus for touch operation, comprising:
the acquiring unit is used for acquiring attribute information of N touch points corresponding to the touch event; wherein N is an integer greater than 0;
the generating unit is used for generating data according to the attribute information of the N touch points; wherein the length of the data packet is positively correlated with the value of N;
and the sending unit is used for sending the data packet.
8. The apparatus according to claim 7, wherein the generating unit is specifically configured to:
generating a bag body with a corresponding size according to the number N of the touch points;
determining the storage positions of the attribute information of the N touch points in the bag body according to the identification information of the N touch points;
storing the attribute information of the N touch points into the bag body according to a storage position;
generating a packet header according to the length of the packet body, and generating the data packet; wherein the data packet comprises the packet body.
9. An apparatus for touch operation, comprising a processor, an input device, an output device, and a memory, wherein the memory is configured to store a computer program comprising program instructions, and wherein the processor is configured to invoke the program instructions to perform the method of any of claims 1-6.
10. A computer-readable storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method according to any of claims 1-6.
CN201910795438.6A 2019-08-27 2019-08-27 Method, apparatus and medium for touch operation Withdrawn CN110658948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910795438.6A CN110658948A (en) 2019-08-27 2019-08-27 Method, apparatus and medium for touch operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910795438.6A CN110658948A (en) 2019-08-27 2019-08-27 Method, apparatus and medium for touch operation

Publications (1)

Publication Number Publication Date
CN110658948A true CN110658948A (en) 2020-01-07

Family

ID=69036684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910795438.6A Withdrawn CN110658948A (en) 2019-08-27 2019-08-27 Method, apparatus and medium for touch operation

Country Status (1)

Country Link
CN (1) CN110658948A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4390638A1 (en) * 2022-12-23 2024-06-26 Himax Technologies Limited Touch detection device and touch data transmission method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145089A (en) * 2007-10-31 2008-03-19 广东威创日新电子有限公司 Touch panel device and method for communicating with computer and the device
CN102184047A (en) * 2011-05-03 2011-09-14 广东威创视讯科技股份有限公司 Communication method and device of touch information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145089A (en) * 2007-10-31 2008-03-19 广东威创日新电子有限公司 Touch panel device and method for communicating with computer and the device
CN102184047A (en) * 2011-05-03 2011-09-14 广东威创视讯科技股份有限公司 Communication method and device of touch information

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4390638A1 (en) * 2022-12-23 2024-06-26 Himax Technologies Limited Touch detection device and touch data transmission method thereof

Similar Documents

Publication Publication Date Title
US11604726B2 (en) Memory management method, electronic device and storage medium
CN104852885B (en) Method, device and system for verifying verification code
US10657347B2 (en) Method for capturing fingerprint and associated products
WO2015070769A1 (en) Data transfer method and apparatus
US10687207B2 (en) Method for data migration and terminal
CN111314517B (en) Display panel and mobile terminal
CN105653112B (en) Method and device for displaying floating layer
CN113115101B (en) LED display screen, distributed information display system and control method
CN112787769A (en) Method, device, equipment and storage medium for determining NFI
CN107622234B (en) Method and device for displaying budding face gift
CN107748680B (en) Kernel configuration method, terminal and computer readable storage medium
CN105095161B (en) Method and device for displaying rich text information
CN103399745A (en) Method, device and terminal device for sending instant messages
CN111931155A (en) Verification code input method, verification code input equipment and storage medium
CN108920086B (en) Split screen quitting method and device, storage medium and electronic equipment
CN110658948A (en) Method, apparatus and medium for touch operation
CN107798008B (en) Content pushing system, method and device
US11327845B2 (en) Image synchronization method and device, and server
CN109799994B (en) Terminal component generation method and device
CN111435907B (en) Transmission processing method, device, terminal and medium
CN108430005B (en) Audio circuit, audio judgment method and mobile terminal
CN113329347A (en) Processing method of Bluetooth device, mobile terminal and storage medium
CN108088436B (en) Navigation information prompting method, terminal and computer readable storage medium
CN107315623B (en) Method and device for reporting statistical data
CN111966271B (en) Screen panorama screenshot method and device, terminal equipment and storage medium

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200107

WW01 Invention patent application withdrawn after publication