CN113741718B - Control data conversion method and device and main control equipment - Google Patents

Control data conversion method and device and main control equipment Download PDF

Info

Publication number
CN113741718B
CN113741718B CN202010479592.5A CN202010479592A CN113741718B CN 113741718 B CN113741718 B CN 113741718B CN 202010479592 A CN202010479592 A CN 202010479592A CN 113741718 B CN113741718 B CN 113741718B
Authority
CN
China
Prior art keywords
operation information
data
effective operation
control data
data 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.)
Active
Application number
CN202010479592.5A
Other languages
Chinese (zh)
Other versions
CN113741718A (en
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010479592.5A priority Critical patent/CN113741718B/en
Publication of CN113741718A publication Critical patent/CN113741718A/en
Application granted granted Critical
Publication of CN113741718B publication Critical patent/CN113741718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

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)
  • Input From Keyboards Or The Like (AREA)

Abstract

The embodiment of the invention provides a control data conversion method, a control data conversion device and a main control device. Wherein the method comprises the following steps: intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet; after at least one data packet is completely cached, for each completely cached data packet, event driving of an input subsystem is utilized to convert control data included in the data packet into standard events meeting preset standards. The control data transmitted by the serial port can be intercepted, the control data capable of completely representing the control instruction is obtained in a buffer mode, and the control data are converted into standard events by utilizing event driving, so that the control instruction input from the serial port is accurately converted into the standard events.

Description

Control data conversion method and device and main control equipment
Technical Field
The present invention relates to the field of touch technologies, and in particular, to a method and apparatus for converting control data, and a master control device.
Background
The input device may input manipulation instructions to the master device, which the application in the master device recognizes and responds to. Because the input devices are various, such as a mouse, a keyboard, a touch screen and the like, the input modes are different, if a corresponding driver is configured for each different input device in the main control device, so that an application program in the main control device can identify the control instruction input by the different input device, the development and operation cost is too high.
In the related art, to simplify the driving in the host device, an input subsystem (input subsystem) is often provided in an operating system (such as linxu operating system and Android operating system) of the host device. An event driven and a device driven are provided in the input subsystem, and the input subsystem interfaces with the application through the event driven and interfaces with the input device through the device driven. The input subsystem can convert the control instructions input by the input devices into standard events meeting preset standards, and input the standard events to the application program so that the application program executes corresponding business operations, and therefore the application program can identify the control instructions input by different input devices only by being in butt joint with event drivers.
However, the device driver of the input subsystem in the related art can only interface with the USB (Universal Serial Bus ) driver, so that only the input device accessing the master device through the USB interface in the related art can access the input subsystem. For the input devices accessing the main control device through the serial port, the input subsystem cannot be accessed, so that the control instructions input by the input devices cannot be converted into standard events through the input subsystem, and corresponding drivers need to be configured for the application programs aiming at the input devices, so that the development and operation and maintenance costs of the application programs are increased.
Disclosure of Invention
The embodiment of the invention aims to provide a control data conversion method, a control data conversion device and a main control device, so as to accurately convert control data input from a serial port into standard events. The specific technical scheme is as follows:
In a first aspect of an embodiment of the present invention, there is provided a manipulation data conversion method applied to a master device, where the master device includes a serial port, and the master device is connected to an input device through the serial port, the method including:
Intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet;
After at least one data packet is completely cached, for each completely cached data packet, event driving of an input subsystem is utilized to convert control data included in the data packet into standard events meeting preset standards.
In a possible embodiment, the caching the manipulation data includes:
The control data are cached in a unit indicated by a writing identifier in a preset annular cache area, and the unit indicated by the writing identifier is updated every time a data packet is completely cached;
the step of converting the control data included in each data packet into a standard event meeting a preset standard by using event driving of an input subsystem according to each data packet which is completely cached in sequence comprises the following steps:
And sequentially aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event conforming to a preset standard by using event driving of an input subsystem, and updating the unit indicated by the read identifier every time after constructing the standard event.
In a possible embodiment, before intercepting the manipulation data and caching the manipulation data each time the manipulation data sent by the input device is received through the serial port, the method further includes:
Each time data is received, determining whether the header information of a data packet to which the data belongs is matched with the identification information of the serial port;
and if the packet header information is matched with the identification information, determining that the received data is control data input by the input equipment through the serial port.
In a possible embodiment, the converting, by using the event driver of the input subsystem, the manipulation data included in the data packet into a standard event meeting a preset standard includes:
Analyzing the control data included in the data packet to obtain at least one piece of effective operation information, wherein each piece of effective operation information is used for representing one sub-operation in the operation of generating the data packet;
and converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem.
In a possible embodiment, the input device is a touch screen;
before the event driven by the input subsystem uses all the effective operation information to be standard events meeting preset standards, the method further comprises:
And if the at least one piece of effective operation information comprises the line drawing effective operation information and does not comprise the pressing effective operation information aiming at the line drawing point, adding the pressing effective operation information aiming at the line drawing point into the at least one piece of effective operation information, wherein the line drawing effective operation information is effective operation information for representing a line drawing sub-operation, the pressing effective operation information is effective operation information for representing a pressing sub-operation, and the line drawing point is a touch point aiming at the line drawing sub-operation on the input device.
In a possible embodiment, the input device is a touch screen;
after the event driven by the input subsystem converts all the effective operation information into standard events meeting preset standards, the method further comprises:
if there is press valid operation information that has not been converted, the control application responds to the press valid operation information.
In a second aspect of the embodiment of the present invention, there is provided a manipulation data conversion apparatus applied to a master device, where the master device includes a serial port, and the master device is connected to an input device through the serial port, the apparatus including:
the hook module is used for intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet;
and the event processing module is used for sequentially converting the control data included in the data packet into standard events meeting the preset standard by using event driving of the input subsystem for each completely cached data packet after completely caching at least one data packet.
In one possible embodiment, the hook module caches the manipulation data, including:
The control data are cached in a unit indicated by a writing identifier in a preset annular cache area, and the unit indicated by the writing identifier is updated every time a data packet is completely cached;
The event processing module converts the control data included in each complete cached data packet into standard events meeting preset standards by using event driving of an input subsystem, and the event processing module comprises:
And sequentially aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event conforming to a preset standard by using event driving of an input subsystem, and updating the unit indicated by the read identifier every time after constructing the standard event.
In a possible embodiment, the hook module is further configured to determine, each time when data is received, whether header information of a data packet to which the data belongs matches identification information of the serial port, before intercepting the manipulation data and buffering the manipulation data each time the manipulation data sent by the input device is received through the serial port;
and if the packet header information is matched with the identification information, determining that the received data is control data input by the input equipment through the serial port.
In one possible embodiment, the event processing module converts the manipulation data included in the data packet into a standard event according to a preset standard by using event driving of the input subsystem, including:
Analyzing the control data included in the data packet to obtain at least one piece of effective operation information, wherein each piece of effective operation information is used for representing one sub-operation in the operation of generating the data packet;
and converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem.
In a possible embodiment, the input device is a touch screen;
The device further comprises a first information loss protection module, wherein the first information loss protection module is used for adding the effective operation information for pressing the line drawing point into the at least one effective operation information if the at least one effective operation information comprises the effective operation information for drawing lines and does not comprise the effective operation information for pressing the line drawing point before the event driven by the input subsystem is used for enabling all the effective operation information to be standard events meeting preset standards, wherein the effective operation information for drawing lines is the effective operation information for representing sub operation of drawing lines, the effective operation information for pressing the sub operation of drawing lines is the effective operation information for representing sub operation of pressing the sub operation of drawing lines, and the line drawing point is the touch point for the sub operation of drawing lines on the input device.
In a possible embodiment, the input device is a touch screen;
The device also comprises a second information loss protection module, which is used for controlling the application program to respond to the pressing effective operation information if the pressing effective operation information which is not converted exists after the event driven by the input subsystem is used for converting all the effective operation information into standard events which meet the preset standard.
In a third aspect of the embodiment of the present invention, there is provided a master control apparatus, including:
the serial port is used for connecting input equipment:
A memory for storing a computer program;
a processor for implementing the method steps of any of the above first aspects when executing a program stored on a memory.
In a fourth aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the method steps of any of the first aspects described above.
The embodiment of the invention has the beneficial effects that:
According to the control data conversion method, the control data conversion device and the main control equipment, control data transmitted by a serial port can be intercepted, the control data capable of completely representing a control instruction can be obtained in a cache mode, and the control data are converted into standard events by utilizing event driving, so that the control instruction input from the serial port is accurately converted into the standard events. The method and the device have the advantages that corresponding drivers are not required to be configured for the application program aiming at the input equipment accessed from the serial port, and development and operation cost of the application program is effectively reduced.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, 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 diagram of an input subsystem according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for converting manipulation data according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a cache management method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a ring buffer according to an embodiment of the present invention;
FIG. 5a is a flowchart illustrating a method for handling data to standard events according to an embodiment of the present invention;
FIG. 5b is a flowchart illustrating a method for handling data to standard events according to an embodiment of the present invention;
FIG. 5c is a flowchart illustrating a method for handling data to standard events according to an embodiment of the present invention;
Fig. 6a is a schematic structural diagram of a manipulation data conversion device according to an embodiment of the present invention;
fig. 6b is a schematic structural diagram of another manipulation data conversion device according to an embodiment of the present invention;
fig. 6c is a schematic structural diagram of another manipulation data conversion device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a master control device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to more clearly describe the standard event construction method provided by the embodiment of the present invention, an application scenario of the standard event construction method provided by the embodiment of the present invention will be described in the following by way of example, and it will be understood that the application scenario illustrated below is only one possible application scenario of the standard event construction method provided by the embodiment of the present invention, and in other embodiments, the standard event construction method provided by the embodiment of the present invention may be applied to other possible application scenarios, which are not limited by the following examples.
The conference flat board has the functions of a plurality of devices such as a curtain, an electronic whiteboard, a sound, a computer, a remote conference terminal and the like, and is often applied to scenes such as conference office, education training and the like. The conference panel comprises a touch screen and a main control device, wherein the main control device can refer to a sub-device comprising a CPU in the conference panel, a user can touch the touch screen through fingers or other objects, and the touch screen generates corresponding control instructions according to the sensed touch operation and inputs the corresponding control instructions to the main control device in the conference panel so as to control the main control device to execute corresponding operations, such as opening a designated application program, playing videos and the like.
Fig. 1 is a schematic diagram of an input subsystem according to an embodiment of the present invention, where the schematic diagram includes a device driver layer 110, a core layer 120, an event driver layer 130, and an application processing layer 140.
The core layer 120 is used for interfacing the device driving layer 110 and the event driving layer 130, the device driving layer 110 is used for interfacing the touch screen and the input subsystem, and the event driving layer 130 is used for interfacing the application processing layer 140 and the input subsystem. In the figure, the arrow with a thick solid line indicates the transmission direction of the control instruction, the conference panel can convert the control instruction input by the touch panel into a standard event meeting a preset standard by using the input subsystem, and the standard event is uniformly input to the application program through the event driving layer so as to control the application program to respond to the input control instruction.
The input subsystem can unify the input of the application program, so that no matter what input device is used for inputting the control instruction, the input of the application program is a standard event. The development cost and the operation cost of the application program can be effectively reduced.
The device driver layer 110 of the input subsystem can only interface with the USB driver and therefore only input devices that access the master device through the USB interface can access the input subsystem. However, due to design requirements, such as cost, the USB interface of the master device is limited, so the touch screen may not be able to access the master device through the USB interface, but only through the serial port. Resulting in the inability of the touch screen to interface with the device driver layer 110 of the input subsystem, i.e., the inability of the touch screen to interface with the input subsystem. Therefore, it is difficult to convert the manipulation instruction input by the touch screen into a standard event, and thus an application program in the conference panel may need to configure a corresponding driver for the touch screen, otherwise, a user cannot control the conference panel to perform a partial operation through the touch screen.
Based on this, the embodiment of the invention provides a control data conversion method, which can be applied to any main control equipment supporting access to input equipment, such as a processing module in a mobile phone, a main control equipment in a conference flat board, a computer and the like, wherein the main control equipment comprises a serial port and is connected with the input equipment through the serial port. The method may, as shown in fig. 2, comprise:
s201, intercepting the manipulation data and caching the manipulation data whenever the manipulation data sent by the input device is received through the serial port.
S202, after at least one data packet is completely cached, aiming at each completely cached data packet in sequence, using event driving of an input subsystem to convert control data included in the data packet into standard events meeting preset standards.
By adopting the embodiment, the control data transmitted by the serial port can be intercepted, the control data capable of completely representing the control instruction is obtained in a buffer mode, and the control data are converted into standard events by utilizing event driving, so that the control instruction input from the serial port is accurately converted into the standard events. The method and the device have the advantages that corresponding drivers are not required to be configured for the application program aiming at the input equipment accessed from the serial port, and development and operation cost of the application program is effectively reduced.
In S201, the manipulation data is generated by the input device after sensing the operation, and the manipulation data generated by the same operation belong to the same data packet. The input device may be different types of input devices according to application scenes, for example, a mouse, a keyboard, a touch screen, a remote control lever, and the like. And the input device should be one that is capable of interfacing with a serial port. Since serial data is transferred byte by byte, and a single byte of manipulation data cannot represent the operation of generating the manipulation data, the manipulation data needs to be cached to obtain the manipulation data which can completely represent the operation of generating the manipulation data.
In a possible embodiment, each time data is received, it may be determined whether header information of a data packet to which the data belongs matches with identification information of a serial port, if the header information matches with the identification information, it is determined that the received data is control data input by an input device through the serial port, and the control data is intercepted and cached. The hook function is used for detecting whether the packet header information of a data packet to which the received data belongs is matched with the identification information of the serial port or not, if the packet header information is matched with the identification information, the received data is determined to be control data input by the input device through the serial port, and the control data is intercepted.
It will be understood that the header information of a data packet often includes information indicating an interface that receives the data packet, so if the header information matches with the identification information of the serial port, the data packet may be considered to be received through the serial port, and the data belonging to the data packet may be considered to be control data input by the input device through the serial port.
Intercepting the control data may mean refusing to transmit the control data to a downstream in the preset business logic, and the preset business logic is different according to different application scenarios, so that the object referred to by the downstream may be different. It may also mean copying the manipulation data and continuing to transmit the manipulation data downstream in the preset business logic.
In a possible embodiment, when the packet header of the data packet is received, analyzing the packet header information carried in the data packet, judging whether the packet header information is matched with the serial port identification information, and if the packet header information is matched with the serial port identification information, considering all data in the data packet as control data sent by the input device received through the serial port.
In S202, it may be determined that all manipulation data in a data packet has been completely buffered when the end of the data packet is received. Because the operation data generated by the same operation belong to the same data packet, after one data packet is completely cached, the operation data included in the data packet in the cache can completely represent the operation of generating the operation data, so that the operation data included in the data packet can be converted into standard events meeting the preset standard by using event driving of the input subsystem.
After the standard event is obtained, the standard event can be triggered continuously through event driving so as to control the application program to respond to the control data input by the input device through the serial port. In some application scenarios, S201 and S202 may be performed synchronously, i.e. the manipulation data in the buffer is converted into standard events while the manipulation data is buffered.
As the process of caching the manipulation data, more and more manipulation data need to be cached may be performed, but the space of the cache is often limited, and if all manipulation data needing to be cached cannot be cached, the loss of the manipulation data will be caused.
Based on this, the embodiment of the present invention provides a cache management method, which may be shown in fig. 3, and fig. 3 is a schematic flow diagram of the cache management method provided by the embodiment of the present invention, and may include:
s301, intercepting control data and caching the control data in a unit indicated by a writing identifier in a preset annular cache area when the control data sent by the input device are received through a serial port.
The unit from the writing identification to the reading identification in the preset ring buffer area is an idle unit, the idle unit refers to a unit capable of writing new control data, the idle unit may or may not store data, and if the idle unit stores data, the new control data can be rewritten into the idle unit when the new control data is written into the idle unit.
The ring buffer may be as shown in fig. 4, and the units from the start of writing to the start of reading of the identifier refer to the units from the start of writing to the start of reading of the identifier along the positive direction of the ring buffer, and for convenience of description, if the positive direction of the ring buffer is clockwise in fig. 4, the units 4, 5, 6, and 1 in the ring buffer shown in fig. 4 are idle units.
The write identifier initially indicates a preset initial unit in the ring buffer, and updates the unit indicated by the write identifier every time one packet is completely buffered, the updated unit indicated by the write identifier changes to the next unit that can store a packet starting from the unit indicated before the update. The preset initial unit may be different according to application scenarios, and may be, for example, unit 1 shown in fig. 4. The next cell is the next cell in the forward direction of the ring buffer, as shown in fig. 4 for example, the next cell of cell 4 that can store a packet is cell 5.
S302, aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event meeting a preset standard by using event driving of the input subsystem.
The read identifier initially indicates a preset initial unit, and each time the unit indicated by the read identifier is updated after a standard event is constructed, the unit indicated by the read identifier after updating is the next unit which stores unconverted control data from the unit indicated before updating. By adopting the embodiment, the unit storing unconverted operation data can be accurately represented in real time by setting the read identifier and the write identifier, so that the unit not storing the unconverted operation data is released in time, the limited cache space is fully utilized, the operation data is stored as much as possible, and the possibility of losing the operation data is reduced.
The following will describe the process of converting the manipulation data in the same data packet into the standard event, and fig. 5a may be referred to, where fig. 5a is a schematic flow diagram of a method for converting manipulation data into the standard event according to an embodiment of the present invention, and may include:
s501, analyzing the control data included in the data packet to obtain at least one piece of effective operation information.
Wherein each valid operation information is used to represent a sub-operation in the operation that generated the data packet. Taking the input device as a touch screen for example, the effective operation information may be used to represent sub-operations such as a pressing sub-operation, a drawing sub-operation, a lifting sub-operation, and the like. The pressing sub-operation is used for indicating that a user presses one or more touch points on the touch screen by using a finger or other objects, the drawing sub-operation is used for indicating that the user slides on the touch screen by using the finger or other objects according to a certain track, and the lifting sub-operation is used for indicating that the user removes the finger or other objects pressed on the touch screen. Taking the input device as a mouse for example, the effective operation information may be used to represent a left click sub-operation, a move sub-operation, a right click sub-operation, a scroll wheel sub-operation, and the like.
S502, converting all effective operation information into standard events meeting preset standards by using event driving of an input subsystem.
Take the example of an input device as a touch screen. It will be appreciated that a complete gesture operation typically begins with a press sub-operation and ends with a lift sub-operation. Therefore, it is possible to convert all the effective operation information from the effective operation information (hereinafter referred to as pressing effective operation information) for representing the pressing sub-operation to the effective operation information (hereinafter referred to as lifting effective operation information) for representing the next lifting sub-operation into the same standard event. The conversion rule may be different according to the application scenario, and for example, assuming that three pieces of continuous effective operation information are effective operation information for representing a pressing sub-operation, effective operation information for representing a drawing sub-operation (hereinafter referred to as drawing effective operation information), and effective operation information for representing a lifting sub-operation in this order, the three pieces of effective operation information may be converted into the same standard event. In another possible embodiment, each valid operation information may be converted into a standard event.
It can be appreciated that due to loss of control data or other reasons, the effective operation information obtained by parsing may be incomplete, so that the standard event obtained by conversion may not be well matched with the operation sensed by the input device, so that a certain difference exists between the business operation executed by the main control device and the user expectation.
Based on this, in an application scenario where the input device is a touch screen, in a possible embodiment, the method for handling data to standard event may also be as shown in fig. 5b, and between S501 and S502, further include:
S503, if the at least one piece of effective operation information includes the line drawing effective operation information and does not include the pressing effective operation information for the line drawing point, adding the pressing effective operation information for the line drawing point to the at least one piece of effective operation information.
The line drawing point is a touch point for line drawing sub operation on the input device. As with the previous analysis, a complete gesture operation is typically initiated with a press sub-operation and terminated with a lift sub-operation. Thus, if at least one valid operation information includes valid operation information for drawing a line, it means that the touch screen senses a sub-operation of drawing a line and a trajectory along which the sub-operation of drawing a line is started from a point of drawing a line, and thus there should be one valid operation information for pressing the point of drawing a line, and if there is no valid operation information for pressing the point of drawing a line, it may be considered that one valid operation information for pressing the point of drawing a line is lost. Thus, lost valid operation information can be complemented.
By adopting the embodiment, the possibility of incomplete effective operation information can be effectively reduced.
As described above, a complete gesture operation is usually initiated by a pressing sub-operation and ends with a lifting sub-operation, so if the effective operation information for representing the lifting sub-operation is lost, the effective operation information for representing the pressing sub-operation corresponding to the effective operation information cannot be combined with other effective operation information to represent the complete gesture operation, and thus is not correctly converted into a standard event, so that the effective operation information for representing the pressing sub-operation is not normally responded.
Based on this, in one possible embodiment, as shown in fig. 5c, after S502, the method may further include:
S504, if there is press valid operation information that has not been converted yet, the control application responds to the press valid operation information.
In the application scenario, since the pressing effective operation information cannot be normally converted into a standard event, the effective operation information may be converted into an up event to control the application program to forcibly respond to the pressing effective operation information.
The execution timing of S504 may be executed immediately after S502 or after a preset period of time after S502. For example, a background process for timing execution may be set, and S504 is executed by the background process every time a preset time node is reached.
By adopting the embodiment, the possibility that the effective operation information is not responded by the application program can be reduced, so that a user can better control the main control device through the input device.
Referring to fig. 6a, fig. 6a is a schematic structural diagram of a manipulation data conversion device according to an embodiment of the present invention, which may include:
The hook module 601 is configured to intercept control data sent by the input device and cache the control data whenever the control data is received through the serial port, where the control data is generated by the input device after an operation is sensed, and the control data generated by the same operation belongs to the same data packet;
The event processing module 602 is configured to, after buffering at least one data packet completely, convert, for each data packet buffered completely, the control data included in the data packet into a standard event that meets a preset standard by using event driving of the input subsystem.
In a possible embodiment, the hook module 601 caches the manipulation data, including:
The control data are cached in a unit indicated by a writing identifier in a preset annular cache area, and the unit indicated by the writing identifier is updated every time a data packet is completely cached;
The event processing module 602 converts, for each completely cached data packet, the manipulation data included in the data packet into a standard event according to a preset standard by using event driving of the input subsystem, where the event processing module includes:
And sequentially aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event conforming to a preset standard by using event driving of an input subsystem, and updating the unit indicated by the read identifier every time after constructing the standard event.
In a possible embodiment, the hook module 601 is further configured to determine, each time when data is received, whether header information of a data packet to which the data belongs matches identification information of the serial port, before intercepting the manipulation data and buffering the manipulation data whenever the manipulation data sent by the input device is received through the serial port;
and if the packet header information is matched with the identification information, determining that the received data is control data input by the input equipment through the serial port.
In one possible embodiment, the event processing module 602 uses event driving of the input subsystem to convert the manipulation data included in the data packet into a standard event that meets a preset standard, including:
Analyzing the control data included in the data packet to obtain at least one piece of effective operation information, wherein each piece of effective operation information is used for representing one sub-operation in the operation of generating the data packet;
and converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem.
In a possible embodiment, the input device is a touch screen, and as shown in fig. 6b, the apparatus further includes a first information loss protection module 603, configured to, before the event driven by the input subsystem uses all the valid operation information to meet the standard event of the preset standard, if the at least one valid operation information includes the line drawing valid operation information and does not include the pressing valid operation information for the line drawing point, add the pressing valid operation information for the line drawing point to the at least one valid operation information, where the line drawing valid operation information is valid operation information for representing a line drawing sub-operation, and the pressing valid operation information is valid operation information for representing a pressing sub-operation, and the line drawing point is a touch point for which the line drawing sub-operation is performed on the input device.
In a possible embodiment, the input device is a touch screen, and as shown in fig. 6c, the apparatus further includes a second information loss protection module 604, configured to, after the event driven by the input subsystem converts all the valid operation information into a standard event that meets a preset standard, if there is press valid operation information that has not been converted yet, control an application program to respond to the press valid operation information.
The embodiment of the invention also provides a master control device, as shown in fig. 7, including:
A serial port 701 for connecting an input device;
A memory 702 for storing a computer program;
the processor 703 is configured to execute the program stored in the memory 702, thereby implementing the following steps:
Intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet;
After at least one data packet is completely cached, for each completely cached data packet, event driving of an input subsystem is utilized to convert control data included in the data packet into standard events meeting preset standards.
In a possible embodiment, the caching the manipulation data includes:
The control data are cached in a unit indicated by a writing identifier in a preset annular cache area, and the unit indicated by the writing identifier is updated every time a data packet is completely cached;
the step of converting the control data included in each data packet into a standard event meeting a preset standard by using event driving of an input subsystem according to each data packet which is completely cached in sequence comprises the following steps:
And sequentially aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event conforming to a preset standard by using event driving of an input subsystem, and updating the unit indicated by the read identifier every time after constructing the standard event.
In a possible embodiment, before terminating the transmission of the manipulation data and buffering the manipulation data each time the manipulation data sent by the input device is received through the serial port, the method further comprises:
Each time data is received, determining whether the header information of a data packet to which the data belongs is matched with the identification information of the serial port;
and if the packet header information is matched with the identification information, determining that the received data is control data input by the input equipment through the serial port.
In a possible embodiment, the converting, by using the event driver of the input subsystem, the manipulation data included in the data packet into a standard event meeting a preset standard includes:
Analyzing the control data included in the data packet to obtain at least one piece of effective operation information, wherein each piece of effective operation information is used for representing one sub-operation in the operation of generating the data packet;
and converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem.
In a possible embodiment, the input device is a touch screen;
before the event driven by the input subsystem uses all the effective operation information to be standard events meeting preset standards, the method further comprises:
And if the at least one piece of effective operation information comprises the line drawing effective operation information and does not comprise the pressing effective operation information aiming at the line drawing point, adding the pressing effective operation information aiming at the line drawing point into the at least one piece of effective operation information, wherein the line drawing effective operation information is effective operation information for representing a line drawing sub-operation, the pressing effective operation information is effective operation information for representing a pressing sub-operation, and the line drawing point is a touch point aiming at the line drawing sub-operation on the input device.
In a possible embodiment, the input device is a touch screen;
after the event driven by the input subsystem converts all the effective operation information into standard events meeting preset standards, the method further comprises:
if there is press valid operation information that has not been converted, the control application responds to the press valid operation information.
The Memory mentioned by the master device may include a random access Memory (Random Access Memory, RAM) or may include a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which a computer program is stored, which when executed by a processor implements the steps of any of the manipulation data conversion methods described above.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform the manipulation data conversion method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus, the master device, the computer-readable storage medium, the computer program product, the description is relatively simple, as it is substantially similar to the method embodiments, as relevant see the partial description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (7)

1. A method for converting manipulation data, which is applied to a master control device, wherein the master control device comprises a serial port, and the master control device is connected with an input device through the serial port, the method comprising:
Intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet;
after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting control data included in the data packet into a standard event meeting a preset standard by using event driving of an input subsystem;
The event-driven converting, by using the input subsystem, the manipulation data included in the data packet into a standard event meeting a preset standard, including:
Analyzing the control data included in the data packet to obtain at least one piece of effective operation information, wherein each piece of effective operation information is used for representing one sub-operation in the operation of generating the data packet;
converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem;
The input device is a touch screen;
before the event driven by the input subsystem uses all the effective operation information to be standard events meeting preset standards, the method further comprises:
And if the at least one piece of effective operation information comprises the line drawing effective operation information and does not comprise the pressing effective operation information aiming at the line drawing point, adding the pressing effective operation information aiming at the line drawing point into the at least one piece of effective operation information, wherein the line drawing effective operation information is effective operation information for representing a line drawing sub-operation, the pressing effective operation information is effective operation information for representing a pressing sub-operation, and the line drawing point is a touch point aiming at the line drawing sub-operation on the input device.
2. The method of claim 1, wherein the caching the manipulation data comprises:
The control data are cached in a unit indicated by a writing identifier in a preset annular cache area, and the unit indicated by the writing identifier is updated every time a data packet is completely cached;
the step of converting the control data included in each data packet into a standard event meeting a preset standard by using event driving of an input subsystem according to each data packet which is completely cached in sequence comprises the following steps:
And sequentially aiming at the data packet cached in the unit indicated by the read identifier, converting the control data included in the data packet into a standard event meeting a preset standard by using event driving of the input subsystem, and updating the unit indicated by the read identifier every time after constructing the standard event.
3. The method of claim 1, wherein each time manipulation data sent by the input device is received through the serial port, before intercepting the manipulation data and caching the manipulation data, the method further comprises:
Each time data is received, determining whether the header information of a data packet to which the data belongs is matched with the identification information of the serial port;
and if the packet header information is matched with the identification information, determining that the received data is control data input by the input equipment through the serial port.
4. The method of claim 1, wherein the input device is a touch screen;
after the event driven by the input subsystem converts all the effective operation information into standard events meeting preset standards, the method further comprises:
if there is press valid operation information that has not been converted, the control application responds to the press valid operation information.
5. A manipulation data conversion device, characterized in that it is applied to a master control device, the master control device includes a serial port, and the master control device is connected with an input device through the serial port, the device includes:
the hook module is used for intercepting control data and caching the control data when the control data sent by the input device are received through the serial port, wherein the control data are generated after the input device senses operation, and the control data generated by the same operation belong to the same data packet;
The event processing module is used for sequentially converting the control data included in the data packet into standard events meeting preset standards by using event driving of the input subsystem for each completely cached data packet after completely caching at least one data packet;
The event processing module is specifically configured to parse the manipulation data included in the data packet to obtain at least one piece of effective operation information, where each piece of effective operation information is used to represent one sub-operation in the operation of generating the data packet; converting all the effective operation information into standard events meeting preset standards by using event driving of an input subsystem;
The input device is a touch screen;
The device further comprises a first information loss protection module, wherein the first information loss protection module is used for adding the effective operation information for pressing the line drawing point into the at least one effective operation information if the at least one effective operation information comprises the effective operation information for drawing lines and does not comprise the effective operation information for pressing the line drawing point before the event driven by the input subsystem is used for enabling all the effective operation information to be standard events meeting preset standards, wherein the effective operation information for drawing lines is the effective operation information for representing sub operation of drawing lines, the effective operation information for pressing the sub operation of drawing lines is the effective operation information for representing sub operation of pressing the sub operation of drawing lines, and the line drawing point is the touch point for the sub operation of drawing lines on the input device.
6. A master control apparatus, comprising:
the serial port is used for connecting input equipment:
A memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-4 when executing a program stored on a memory.
7. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-4.
CN202010479592.5A 2020-05-29 2020-05-29 Control data conversion method and device and main control equipment Active CN113741718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010479592.5A CN113741718B (en) 2020-05-29 2020-05-29 Control data conversion method and device and main control equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010479592.5A CN113741718B (en) 2020-05-29 2020-05-29 Control data conversion method and device and main control equipment

Publications (2)

Publication Number Publication Date
CN113741718A CN113741718A (en) 2021-12-03
CN113741718B true CN113741718B (en) 2024-06-04

Family

ID=78725143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010479592.5A Active CN113741718B (en) 2020-05-29 2020-05-29 Control data conversion method and device and main control equipment

Country Status (1)

Country Link
CN (1) CN113741718B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04191920A (en) * 1990-11-27 1992-07-10 Oki Electric Ind Co Ltd Touch position correcting method in touch panel device
JPH0695804A (en) * 1991-06-17 1994-04-08 Oki Electric Ind Co Ltd Display input device and automatic transaction device having said display input device
CN101873305A (en) * 2009-12-31 2010-10-27 杭州海康威视数字技术股份有限公司 Data transmission control method, monitoring system and decoder thereof
CN103049187A (en) * 2012-11-08 2013-04-17 南京芒冠光电科技股份有限公司 Signal processing method for spliced type multi-screen interactive electronic whiteboard system
CN104486247A (en) * 2014-12-16 2015-04-01 北京东土科技股份有限公司 Data transmission method and device based on serial server
CN104571011A (en) * 2014-11-27 2015-04-29 魏晓慧 Embedded multi-media control system
CN105138490A (en) * 2015-07-09 2015-12-09 中标软件有限公司 Serial data filtration system and method
CN105183280A (en) * 2015-08-27 2015-12-23 广东欧珀移动通信有限公司 Operation method for list interface and electronic terminal
CN105718108A (en) * 2016-01-14 2016-06-29 广东欧珀移动通信有限公司 Interface operation method and mobile terminal
CN107038024A (en) * 2016-02-04 2017-08-11 腾讯科技(深圳)有限公司 One kind manipulation collocation method and its equipment
CN107168710A (en) * 2017-05-16 2017-09-15 太原鹏跃电子科技有限公司 A kind of built-in Linux Development of Serial Driver method based on barrage reception mechanism
CN107239223A (en) * 2017-06-29 2017-10-10 深圳天珑无线科技有限公司 A kind of terminal control method and terminal
CN107278294A (en) * 2017-05-12 2017-10-20 深圳前海达闼云端智能科技有限公司 Input equipment implementation method and its realize device
CN107342785A (en) * 2017-06-06 2017-11-10 北京东土军悦科技有限公司 A kind of chromacoder
CN108563493A (en) * 2018-04-12 2018-09-21 郑州云海信息技术有限公司 A kind of event-driven method, device, equipment and readable storage medium storing program for executing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7490774B2 (en) * 2003-11-13 2009-02-17 Metrologic Instruments, Inc. Hand-supportable imaging based bar code symbol reader employing automatic light exposure measurement and illumination control subsystem integrated therein
US20090240707A1 (en) * 2008-03-18 2009-09-24 International Business Machines Corporation Event driven input data validation
US9705833B2 (en) * 2014-04-02 2017-07-11 International Business Machines Corporation Event driven dynamic multi-purpose internet mail extensions (MIME) parser
US11551076B2 (en) * 2014-09-05 2023-01-10 Qualcomm Incorporated Event-driven temporal convolution for asynchronous pulse-modulated sampled signals

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04191920A (en) * 1990-11-27 1992-07-10 Oki Electric Ind Co Ltd Touch position correcting method in touch panel device
JPH0695804A (en) * 1991-06-17 1994-04-08 Oki Electric Ind Co Ltd Display input device and automatic transaction device having said display input device
CN101873305A (en) * 2009-12-31 2010-10-27 杭州海康威视数字技术股份有限公司 Data transmission control method, monitoring system and decoder thereof
CN103049187A (en) * 2012-11-08 2013-04-17 南京芒冠光电科技股份有限公司 Signal processing method for spliced type multi-screen interactive electronic whiteboard system
CN104571011A (en) * 2014-11-27 2015-04-29 魏晓慧 Embedded multi-media control system
CN104486247A (en) * 2014-12-16 2015-04-01 北京东土科技股份有限公司 Data transmission method and device based on serial server
CN105138490A (en) * 2015-07-09 2015-12-09 中标软件有限公司 Serial data filtration system and method
CN105183280A (en) * 2015-08-27 2015-12-23 广东欧珀移动通信有限公司 Operation method for list interface and electronic terminal
CN105718108A (en) * 2016-01-14 2016-06-29 广东欧珀移动通信有限公司 Interface operation method and mobile terminal
CN107038024A (en) * 2016-02-04 2017-08-11 腾讯科技(深圳)有限公司 One kind manipulation collocation method and its equipment
CN107278294A (en) * 2017-05-12 2017-10-20 深圳前海达闼云端智能科技有限公司 Input equipment implementation method and its realize device
CN107168710A (en) * 2017-05-16 2017-09-15 太原鹏跃电子科技有限公司 A kind of built-in Linux Development of Serial Driver method based on barrage reception mechanism
CN107342785A (en) * 2017-06-06 2017-11-10 北京东土军悦科技有限公司 A kind of chromacoder
CN107239223A (en) * 2017-06-29 2017-10-10 深圳天珑无线科技有限公司 A kind of terminal control method and terminal
CN108563493A (en) * 2018-04-12 2018-09-21 郑州云海信息技术有限公司 A kind of event-driven method, device, equipment and readable storage medium storing program for executing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"linux输入子系统(设备驱动与事件驱动)";haomcu;《CSDN》;第1-5页 *

Also Published As

Publication number Publication date
CN113741718A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
EP2950203B1 (en) Application scenario identification method, power consumption management method and apparatus and terminal device
US9536261B2 (en) Resolving conflicts within saved state data
CN110825456B (en) Loading time calculation method, loading time calculation device, computer equipment and storage medium
CN110442366B (en) Screen transmission processing method, device, equipment and storage medium
CN103927198A (en) Software clearing method and software clearing device
CN106844182B (en) Method, system and mobile terminal for recording user behavior
WO2020020202A1 (en) Account management method and apparatus of application program, and device and medium
CN107817962B (en) Remote control method, device, control server and storage medium
US10168898B2 (en) Supporting different event models using a single input source
CN107577775B (en) Data reading method and device, electronic equipment and readable storage medium
CN103514004A (en) Method and device for managing system environment under Windows system
CN114461223A (en) Code generation method and device and terminal equipment
CN113741718B (en) Control data conversion method and device and main control equipment
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
CN112000321A (en) Method and device for realizing undo and/or redo of three-dimensional detection software
KR20180038522A (en) Forward activity-related information from the source electronic device to the companion electronic device
CN112395437A (en) 3D model loading method and device, electronic equipment and storage medium
CN113821458B (en) Data operation method, device, computer equipment and storage medium
US11650832B1 (en) System and method for drawing optimization with pointer input in a remote session
CN115469937A (en) Plug-in operation method and device, electronic equipment and storage medium
WO2019056614A1 (en) Touch data separation method and apparatus, device, and storage medium
US9753741B2 (en) Remote inking
CN111190637A (en) Version file release management method, device and system
CN110442819B (en) Data processing method, device, storage medium and terminal
CN114816032B (en) Data processing method and device, electronic 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
GR01 Patent grant