CN113741718A - Control data conversion method and device and master control equipment - Google Patents

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

Info

Publication number
CN113741718A
CN113741718A CN202010479592.5A CN202010479592A CN113741718A CN 113741718 A CN113741718 A CN 113741718A CN 202010479592 A CN202010479592 A CN 202010479592A CN 113741718 A CN113741718 A CN 113741718A
Authority
CN
China
Prior art keywords
data
control data
event
input
standard
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.)
Pending
Application number
CN202010479592.5A
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.)
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/CN113741718A/en
Publication of CN113741718A publication Critical patent/CN113741718A/en
Pending 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
    • 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

Abstract

The embodiment of the invention provides a method and a device for converting control data and a main control device. Wherein the method comprises the following steps: when control data sent by the input equipment is received through the serial port, the control data is intercepted and cached, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet; after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem. The method can intercept and capture the control data transmitted by the serial port, obtain the control data capable of completely representing the control instruction in a cache mode, and convert the control data into the standard event by utilizing event driving, thereby accurately converting the control instruction input from the serial port into the standard event.

Description

Control data conversion method and device and master control equipment
Technical Field
The present invention relates to the field of touch technologies, and in particular, to a method and an apparatus for converting control data, and a master control device.
Background
The input device can input control instructions to the main control device, and an application program in the main control device recognizes the control instructions and responds. Because the input devices are various, such as a mouse, a keyboard, a touch screen, etc., and the input modes are different, if a corresponding driver is configured for each different input device in the main control device, so that the application program in the main control device can recognize the control instructions input by the different input devices, the development, operation and maintenance costs are too high.
In order to simplify the driving in the main control device in the related art, an input subsystem (input subsystem) is often provided in an operating system (such as a linxu operating system and an Android operating system) of the main control device. An event driver and a device driver are provided in the input subsystem, and the input subsystem interfaces with the application program through the event driver and interfaces with the input device through the device driver. The input subsystem can convert the control instruction input by the input equipment into a standard event meeting a preset standard, and inputs the standard event into the application program, so that the application program executes corresponding business operation, and therefore the application program can recognize the control instruction input by different input equipment only by being in butt joint with the event driver.
However, in the related art, the device driver of the input subsystem can only interface with a USB (Universal Serial Bus) driver, and therefore, in the related art, only the input device accessing the master device through the USB interface can access the input subsystem. For the input devices that access the main control device through the serial port, since the input subsystem cannot be accessed, the control instructions input by the input devices cannot be converted into standard events through the input subsystem, and therefore, corresponding drivers need to be configured for the application programs for the input devices, which increases the development and operation and maintenance costs of the application programs.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for converting control data and a main control device, so as to accurately convert the control data input from a serial port into a standard event. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a method for converting control data is provided, which is applied to a main control device, where the main control device includes a serial port, and the main control device is connected to an input device through the serial port, and the method includes:
when control data sent by the input equipment is received through the serial port, the control data is intercepted and cached, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet;
after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem.
In a possible embodiment, the caching the manipulation data includes:
caching the control data in a unit indicated by a writing identifier in a preset annular cache region, and updating the unit indicated by the writing identifier when a data packet is completely cached;
the method sequentially converts the control data included in each data packet into a standard event meeting a preset standard by using the event driver of the input subsystem for each completely cached data packet, and comprises the following steps:
and sequentially aiming at the data packets cached in the unit indicated by the reading identifier, converting the control data included in the data packets into standard events meeting a preset standard by using the event drive of the input subsystem, and updating the unit indicated by the reading identifier after the standard events are constructed.
In a possible embodiment, 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, the method further includes:
when 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 the received data as the control data input by the input equipment through the serial port.
In a possible embodiment, the converting the manipulation data included in the data packet into the standard event meeting the preset standard by using the event driver of the input subsystem 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 the event drive of the input subsystem.
In one possible embodiment, the input device is a touch screen;
before the event-driven using the input subsystem makes all the valid operation information a standard event meeting a preset standard, the method further includes:
if include the effective operating information of setting-out in at least one effective operating information to do not include the effective operating information of pressing to the setting-out point add in at least one effective operating information to the effective operating information of pressing of setting-out point, wherein, the effective operating information of setting-out effective operating information for being used for showing the setting-out sub-operation, press the effective operating information for being used for showing the effective operating information who presses the sub-operation, the setting-out point does on the input device the touch-control point that the setting-out sub-operation was aimed at.
In one possible embodiment, the input device is a touch screen;
after the event-driven conversion of all the valid operation information into standard events meeting preset standards by using the input subsystem, the method further comprises:
if there is the 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 embodiments of the present invention, there is provided a device for converting control data, which is applied to a main control device, where the main control device includes a serial port, and the main control device is connected to an input device through the serial port, and the device includes:
the hook module is used for intercepting the control data and caching the control data when the control data sent by the input equipment is received through the serial port, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet;
and the event processing module is used for converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem for each completely cached data packet in sequence after at least one data packet is completely cached.
In a possible embodiment, the hooking module caches the manipulation data, including:
caching the control data in a unit indicated by a writing identifier in a preset annular cache region, and updating the unit indicated by the writing identifier when a data packet is completely cached;
the event processing module converts the control data included in each data packet into a standard event meeting a preset standard by using the event driver of the input subsystem for each completely cached data packet in sequence, and the method comprises the following steps:
and sequentially aiming at the data packets cached in the unit indicated by the reading identifier, converting the control data included in the data packets into standard events meeting a preset standard by using the event drive of the input subsystem, and updating the unit indicated by the reading identifier after the standard events are constructed.
In a possible embodiment, the hook module is further configured to, when receiving the manipulation data sent by the input device through the serial port, intercept the manipulation data and cache the manipulation data, and when receiving the data, determine whether header information of a data packet to which the data belongs matches identification information of the serial port;
and if the packet header information is matched with the identification information, determining the received data as the control data input by the input equipment through the serial port.
In a possible embodiment, the event processing module converts the manipulation data included in the data packet into a standard event meeting a preset standard by using an event driver of the input subsystem, and 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 the event drive of the input subsystem.
In one possible embodiment, the input device is a touch screen;
the device still includes that protection module is lost to first information, is used for utilize the event drive of input subsystem will all effective operation information is before the standard event that accords with preset standard, if including the effective operation information of setting-out in at least one effective operation information to do not include the effective operation information of pressing to the setting-out point add in at least one effective operation information to the effective operation information of pressing of setting-out point, wherein, the effective operation information of setting-out is for being used for showing the effective operation information of setting-out sub-operation, press the effective operation information of effective operation information for being used for showing the effective operation information of pressing sub-operation, the setting-out point does on the input device the touch-control point that setting-out sub-operation aimed at.
In one 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 press effective operation information if the press effective operation information which is not converted exists after the event drive of the input subsystem converts all the effective operation information into the standard event which meets the preset standard.
In a third aspect of the embodiments of the present invention, a master device is provided, including:
the serial port is used for connecting the input equipment:
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect of embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, carries out the method steps of any one of the above-mentioned first aspects.
The embodiment of the invention has the following beneficial effects:
the method, the device and the main control equipment for converting the control data provided by the embodiment of the invention can intercept and capture the control data transmitted by the serial port, obtain the control data capable of completely expressing the control instruction in a cache mode, and convert the control data into the standard event by utilizing event driving, thereby accurately converting the control instruction input from the serial port into the standard event. The corresponding driver does not need to be configured for the application program aiming at the input equipment accessed from the serial port, and the development, operation and maintenance costs of the application program are effectively reduced.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of an input subsystem provided by an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for transforming operation data according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a cache management method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a ring cache according to an embodiment of the present invention;
fig. 5a is a schematic flowchart of a method for converting control data into standard events according to an embodiment of the present invention;
FIG. 5b is a schematic flow chart illustrating a method for converting control data into a standard event according to an embodiment of the present invention;
FIG. 5c is a schematic flow chart illustrating a method for converting the operation data into the standard event according to an embodiment of the present invention;
fig. 6a is a schematic structural diagram of a manipulated data transformation apparatus according to an embodiment of the present invention;
fig. 6b is a schematic structural diagram of an apparatus for converting operation data according to an embodiment of the present invention;
fig. 6c is a schematic structural diagram of an apparatus for converting operation data according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a master device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present 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 exemplarily described below, it should 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 the standard event construction method provided by the embodiment of the present invention may also be applied to other possible application scenarios in other embodiments, which are not limited by the following examples.
The conference tablet has the functions of various 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 tablet comprises a touch screen and a main control device, wherein the main control device can be a sub-device including a CPU in the conference tablet, a user can touch the touch screen through a finger or other objects, and the touch screen generates a corresponding control instruction according to the sensed touch operation and inputs the control instruction to the main control device in the conference tablet so as to control the main control device to execute corresponding operation, such as opening a designated application program, playing a video and the like.
Fig. 1 shows a schematic diagram of an input subsystem provided by an embodiment of the 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.
Wherein the core layer 120 is used to interface the device driver layer 110 and the event driver layer 130, the device driver layer 110 is used to interface the touch screen and the input subsystem, and the event driver layer 130 is used to interface the application processing layer 140 and the input subsystem. The arrow of the thick solid line in the figure represents the transmission direction of the control command, and the conference tablet can convert the control command input by the touch pad into a standard event meeting the preset standard by using the input subsystem, and uniformly input the standard event into the application program through the event driving layer so as to control the application program to respond to the input control command.
The input of the application program can be unified through the input subsystem, so that the input of the application program is a standard event no matter what input device is used for inputting the control command. The development cost and the operation and maintenance cost of the application program can be effectively reduced.
However, the device driver layer 110 of the input subsystem can only interface with the USB driver, and thus only the input device accessing the master device through the USB interface can access the input subsystem. Due to design requirements, for example, due to cost considerations, the USB interface of the master device is limited, and therefore, the touch screen may not be able to access the master device through the USB interface, but only can access the master device through a serial port. Resulting in the touchscreen not being able to interface with the device driver layer 110 of the input subsystem, i.e., the touchscreen not being able 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 therefore, an application program in the conference tablet may need to configure a corresponding driver program for the touch screen, otherwise, a user cannot control the conference tablet to perform a part of operations through the touch screen.
Based on this, the embodiment of the present invention provides a method for converting control data, which can be applied to any master control device supporting access to an input device, such as a processing module in a mobile phone, a master control device in a conference tablet, a computer, and the like, where the master control device includes a serial port and is connected to the input device through the serial port. The method may be as shown in fig. 2, comprising:
s201, when the control data sent by the input device is received through the serial port, the control data is intercepted and cached.
And S202, after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem.
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 can be obtained in a cache mode, and the control data is converted into the standard event by utilizing event driving, so that the control instruction input from the serial port is accurately converted into the standard event. The corresponding driver does not need to be configured for the application program aiming at the input equipment accessed from the serial port, and the development, operation and maintenance costs of the application program are 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 belongs to the same data packet. The input device may be different types of input devices according to application scenarios, and may be, for example, a mouse, a keyboard, a touch screen, a remote control stick, and the like. And the input device should be one that can interface with a serial port. Since the serial port transmits data byte by byte, and the single byte of the manipulation data cannot represent the operation for generating the manipulation data, the manipulation data needs to be buffered to obtain the manipulation data capable of completely representing the operation for generating the manipulation data.
In a possible embodiment, when data is received, it is determined whether header information of a data packet to which the data belongs matches identification information of a serial port, and if the header information matches the identification information, it is determined that the received data is control data input by an input device through the serial port, the control data is intercepted, and the control data is cached. The method may include setting a hook function in the serial port driver, where the hook function is used to detect whether header information of a data packet to which the received data belongs matches identification information of the serial port, and if the header information matches the identification information, determining that the received data is control data input by the input device through the serial port, and intercepting the control data.
It can be understood that the header information of a data packet often includes information indicating an interface that receives the data packet, so that if the header information matches the identification information of the serial port, the data packet may be considered to be received through the serial port, and data belonging to the data packet may be considered to be manipulation data input by the input device through the serial port.
Intercepting the manipulation data may mean rejecting transmission of the manipulation data to a downstream in a preset service logic, and the preset service logic is different according to different application scenarios, so that objects referred to by the downstream may be different. Or copying the control data and continuing to transmit the control data to the downstream in the preset business logic.
In a possible embodiment, when the header of the data packet is received, the header information carried in the data packet is analyzed, whether the header information is matched with the identification information of the serial port or not is judged, and if the header information is matched with the identification information of the serial port, all data in the data packet are considered to be control data received through the serial port and sent by the input device.
In S202, it may be determined that all the handling data in a data packet has been completely buffered when the packet end of the data packet is received. Because the operation data generated by the same operation belongs to the same data packet, after a data packet is completely cached, the operation data included in the data packet in the cache can completely represent the operation for generating the operation data, and therefore the operation data included in the data packet can be converted into the standard event which meets the preset standard by utilizing the event drive of the input subsystem.
After the standard event is obtained, the standard event can be continuously triggered through event driving so as to control the application program to respond to the control data input by the input equipment through the serial port. In some application scenarios, S201 and S202 may be performed synchronously, that is, the manipulation data in the cache is converted into a standard event while the manipulation data is cached.
The handling data needing to be cached may be more and more as the caching of the handling data proceeds, but the space of the cache is often limited, and if all the handling data needing to be cached cannot be cached, the handling data will be lost.
Based on this, an embodiment of the present invention provides a cache management method, which may be as shown in fig. 3, where fig. 3 is a schematic flow chart of the cache management method provided in the embodiment of the present invention, and the method may include:
s301, when the control data sent by the input device is received through the serial port, the control data is intercepted and cached in a unit indicated by the writing identifier in the preset annular cache region.
The unit from the writing identifier to the reading identifier in the preset ring buffer is an idle unit, the idle unit refers to a unit into which new control data can be written, the idle unit may store data or may not store data, and if the idle unit stores data, the idle unit may overwrite new control data to the idle unit when writing the new control data into the idle unit.
The circular buffer area may be as shown in fig. 4, where the unit from the beginning of the write identifier to the end of the read identifier refers to a unit from the beginning of the write identifier to the end of the read identifier along the positive direction of the circular buffer area, and for convenience of description, it is assumed that the positive direction of the circular buffer area is the clockwise direction in fig. 4, and then the unit 4, the unit 5, the unit 6, and the unit 1 in the circular buffer area shown in fig. 4 are idle units.
The write identifier indicates a preset initial unit in the ring buffer area when the write identifier is initial, and updates the unit indicated by the write identifier when one data packet is completely buffered, wherein the unit indicated by the write identifier after updating is changed into a unit which can store the data packet next to the unit indicated before updating. The preset initial unit may be different according to different application scenarios, and may be, for example, the unit 1 shown in fig. 4. The next unit is the next unit in the forward direction of the ring buffer, and taking the example shown in fig. 4 as an example, the next unit of the unit 4 that can store the data packet is the unit 5.
And S302, sequentially aiming at the data packets cached in the units indicated by the read identifications, converting the control data included in the data packets into standard events meeting the preset standard by using the event drive of the input subsystem.
The reading identifier indicates a preset initial unit at the initial time, and the unit indicated by the reading identifier is updated after the standard event is constructed, wherein the unit indicated by the reading identifier after the updating is the next unit which stores the unconverted control data from the unit indicated before the updating. By adopting the embodiment, the unit which stores the unconverted control data can be accurately represented in real time by setting the read identifier and the write identifier, so that the unit which does not store the unconverted control data is released in time, the limited cache space is fully utilized, the control data is stored as much as possible, and the possibility of losing the control data is reduced.
A description will be given below of a process for converting the control data in the same data packet into the standard event, and referring to fig. 5a, fig. 5a is a schematic flow diagram of a method for converting the control data into the standard event according to an embodiment of the present invention, where the method may include:
s501, analyzing the operation data included in the data packet to obtain at least one valid operation information.
Wherein each valid operation information is used to indicate a sub-operation in the operation of generating the data packet. Taking the input device as a touch screen as an example, the valid operation information may be used to indicate sub-operations such as a pressing sub-operation, a drawing sub-operation, and a lifting sub-operation. 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 according to a certain track by using the finger or other objects, 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 as an example, the valid operation information may be used to indicate a left click sub-operation, a move sub-operation, a right click sub-operation, a scroll wheel sub-operation, and the like.
And S502, converting all effective operation information into standard events meeting preset standards by using the event drive of the input subsystem.
Take the input device as a touch screen as an example. It will be appreciated that a full gesture operation typically begins with a press sub-operation to end with a lift sub-operation. Therefore, all the valid operation information from the valid operation information (hereinafter, referred to as the press valid operation information) indicating the press sub-operation to the next valid operation information (hereinafter, referred to as the lift valid operation information) indicating the lift sub-operation can be converted into the same standard event. The rule of the conversion may be different according to different application scenarios, and for example, assuming that three continuous effective operation information are effective operation information for representing a pressing sub-operation, effective operation information for representing a drawing sub-operation (hereinafter, drawing effective operation information), and effective operation information for representing a lifting sub-operation, the three continuous 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 understood that, due to loss of the manipulation data or other reasons, the effective operation information obtained by the parsing may not be complete, so that the converted standard event may not be well matched with the operation sensed by the input device, so that the business operation performed by the main control device is different from the operation expected by the user.
Based on this, in an application scenario where the input device is a touch screen, in a possible embodiment, the method for converting the manipulated data into the standard event may also be as shown in fig. 5b, and between S501 and S502, the method may further include:
and S503, if the at least one piece of effective operation information comprises the drawn line effective operation information and does not comprise the pressing effective operation information aiming at the drawn line point, adding the pressing effective operation information aiming at the drawn line point in the at least one piece of effective operation information.
The drawing point is a touch point aimed at by the drawing sub operation on the input equipment. As discussed above, a full gesture operation is typically initiated by a press sub-operation to complete a lift sub-operation. Therefore, if the effective operation information for drawing the line is included in the at least one piece of effective operation information, the touch screen is indicated to sense a line drawing sub-operation, and the track along which the line drawing sub-operation is performed starts from the line drawing point, so that there should be pressing effective operation information for the line drawing point, and if there is no pressing effective operation information for the line drawing point, it can be considered that one piece of pressing effective operation information for the line drawing point is lost. Therefore, the 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 usually starts with a pressing sub-operation and ends with a lifting sub-operation, so if the valid operation information for indicating the lifting sub-operation is lost, the corresponding valid operation information for indicating the pressing sub-operation cannot indicate the complete gesture operation together with other valid operation information, and therefore is not correctly converted into a standard event, so that the valid operation information for indicating the pressing sub-operation is not normally responded.
Based on this, in a possible embodiment, as also shown in fig. 5c, after S502, the method may further include:
s504, if the press effective operation information which is not converted yet exists, the control application program responds to the press effective operation information.
In the application scenario, since the press valid operation information cannot be normally converted into the standard event, the application program may be controlled to forcibly respond to the press valid operation information by converting the valid operation information into an up event.
The execution timing of S504 may be immediately after S502, or may be after a preset time period after S502 is executed. For example, a regularly executed background process may be set, and each time the preset time node is reached, the background process executes S504.
By adopting the embodiment, the possibility that the effective operation information is not responded by the application program can be reduced, so that the user can better control the main control equipment through the input equipment.
Referring to fig. 6a, fig. 6a is a schematic structural diagram of a manipulation data conversion apparatus according to an embodiment of the present invention, which may include:
the hook module 601 is configured to intercept and capture the manipulation data and cache the manipulation data when the manipulation data sent by the input device is received through the serial port, where the manipulation data is generated after an operation is sensed by the input device, and the manipulation data generated by the same operation belongs to the same data packet;
the event processing module 602 is configured to, after at least one data packet is completely cached, sequentially convert, for each completely cached data packet, control data included in the data packet into a standard event meeting a preset standard by using an event driver of the input subsystem.
In a possible embodiment, the hooking module 601 caches the manipulation data, including:
caching the control data in a unit indicated by a writing identifier in a preset annular cache region, and updating the unit indicated by the writing identifier when a data packet is completely cached;
the event processing module 602 sequentially converts, for each completely cached data packet, the control data included in the data packet into a standard event meeting a preset standard by using the event driver of the input subsystem, including:
and sequentially aiming at the data packets cached in the unit indicated by the reading identifier, converting the control data included in the data packets into standard events meeting a preset standard by using the event drive of the input subsystem, and updating the unit indicated by the reading identifier after the standard events are constructed.
In a possible embodiment, the hook module 601 is further configured to determine whether header information of a data packet to which the data belongs is matched with identification information of the serial port when receiving the data, before intercepting the control data and caching the control data when receiving the control data sent by the input device through the serial port;
and if the packet header information is matched with the identification information, determining the received data as the control data input by the input equipment through the serial port.
In a possible embodiment, the event processing module 602 converts the manipulation data included in the data packet into a standard event meeting a preset standard by using an event driver 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 the event drive of the input subsystem.
In a possible embodiment, the input device is a touch screen, as shown in fig. 6b, the apparatus further comprises a first information loss protection module 603, before the event driving of the utilization input subsystem drives all the effective operation information to be standard events meeting preset standards, if the drawn line effective operation information is included in the at least one effective operation information, and the pressing effective operation information for the drawn line point is not included, adding pressing effective operation information for the drawn line point to the at least one effective operation information, wherein the drawing line effective operation information is effective operation information for showing the operation of drawing a line, the effective pressing operation information is effective operation information used for representing pressing sub-operations, and the line drawing points are touch control points on the input equipment, and the line drawing sub-operations are aimed at.
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 driver of the input subsystem converts all the valid operation information into a standard event meeting a preset standard, control the application program to respond to the pressed valid operation information if there is a pressed valid operation information that has not been converted yet.
An embodiment of the present invention further 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 implement the following steps when executing the program stored in the memory 702:
when control data sent by the input equipment is received through the serial port, the control data is intercepted and cached, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet;
after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem.
In a possible embodiment, the caching the manipulation data includes:
caching the control data in a unit indicated by a writing identifier in a preset annular cache region, and updating the unit indicated by the writing identifier when a data packet is completely cached;
the method sequentially converts the control data included in each data packet into a standard event meeting a preset standard by using the event driver of the input subsystem for each completely cached data packet, and comprises the following steps:
and sequentially aiming at the data packets cached in the unit indicated by the reading identifier, converting the control data included in the data packets into standard events meeting a preset standard by using the event drive of the input subsystem, and updating the unit indicated by the reading identifier after the standard events are constructed.
In a possible embodiment, before terminating 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 includes:
when 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 the received data as the control data input by the input equipment through the serial port.
In a possible embodiment, the converting the manipulation data included in the data packet into the standard event meeting the preset standard by using the event driver of the input subsystem 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 the event drive of the input subsystem.
In one possible embodiment, the input device is a touch screen;
before the event-driven using the input subsystem makes all the valid operation information a standard event meeting a preset standard, the method further includes:
if include the effective operating information of setting-out in at least one effective operating information to do not include the effective operating information of pressing to the setting-out point add in at least one effective operating information to the effective operating information of pressing of setting-out point, wherein, the effective operating information of setting-out effective operating information for being used for showing the setting-out sub-operation, press the effective operating information for being used for showing the effective operating information who presses the sub-operation, the setting-out point does on the input device the touch-control point that the setting-out sub-operation was aimed at.
In one possible embodiment, the input device is a touch screen;
after the event-driven conversion of all the valid operation information into standard events meeting preset standards by using the input subsystem, the method further comprises:
if there is the press valid operation information that has not been converted, the control application responds to the press valid operation information.
The Memory mentioned in the above-mentioned host device may include a Random Access Memory (RAM) and may also 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 processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the steps of the above-mentioned manipulation data conversion method.
In another embodiment of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the above-mentioned manipulation data conversion methods.
In the above embodiments, the implementation may be wholly or partially realized 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, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the main control device, the computer-readable storage medium, and the computer program product, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A control data conversion method is applied to a main control device, the main control device comprises a serial port, and the main control device is connected with an input device through the serial port, and the method comprises the following steps:
when control data sent by the input equipment is received through the serial port, the control data is intercepted and cached, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet;
after at least one data packet is completely cached, sequentially aiming at each completely cached data packet, converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem.
2. The method of claim 1, wherein caching the steering data comprises:
caching the control data in a unit indicated by a writing identifier in a preset annular cache region, and updating the unit indicated by the writing identifier when a data packet is completely cached;
the method sequentially converts the control data included in each data packet into a standard event meeting a preset standard by using the event driver of the input subsystem for each completely cached data packet, and comprises the following steps:
and sequentially aiming at the data packets cached in the unit indicated by the reading identifier, converting the control data included in the data packets into standard events meeting a preset standard by using the event drive of the input subsystem, and updating the unit indicated by the reading identifier after the standard events are constructed.
3. The method according to claim 1, wherein 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, the method further comprises:
when 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 the received data as the control data input by the input equipment through the serial port.
4. The method of claim 1, wherein the converting the manipulation data included in the data packet into a standard event meeting a predetermined standard by using an event driver of the input subsystem comprises:
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 the event drive of the input subsystem.
5. The method of claim 4, wherein the input device is a touch screen;
before the event-driven using the input subsystem makes all the valid operation information a standard event meeting a preset standard, the method further includes:
if include the effective operating information of setting-out in at least one effective operating information to do not include the effective operating information of pressing to the setting-out point add in at least one effective operating information to the effective operating information of pressing of setting-out point, wherein, the effective operating information of setting-out effective operating information for being used for showing the setting-out sub-operation, press the effective operating information for being used for showing the effective operating information who presses the sub-operation, the setting-out point does on the input device the touch-control point that the setting-out sub-operation was aimed at.
6. The method of claim 4, wherein the input device is a touch screen;
after the event-driven conversion of all the valid operation information into standard events meeting preset standards by using the input subsystem, the method further comprises:
if there is the press valid operation information that has not been converted, the control application responds to the press valid operation information.
7. The utility model provides a control data conversion equipment which characterized in that is applied to master control equipment, master control equipment includes the serial ports, and master control equipment passes through the serial ports is connected with input device, the device includes:
the hook module is used for intercepting the control data and caching the control data when the control data sent by the input equipment is received through the serial port, the control data is generated after the input equipment senses operation, and the control data generated by the same operation belongs to the same data packet;
and the event processing module is used for converting the control data included in the data packet into a standard event meeting a preset standard by utilizing the event drive of the input subsystem for each completely cached data packet in sequence after at least one data packet is completely cached.
8. A master device, comprising:
the serial port is used for connecting the input equipment:
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored in the memory.
9. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN202010479592.5A 2020-05-29 2020-05-29 Control data conversion method and device and master control equipment Pending CN113741718A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN113741718A true CN113741718A (en) 2021-12-03

Family

ID=78725143

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113741718A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060219792A1 (en) * 2003-11-13 2006-10-05 Metrologic Instruments, Inc. Hand-supportable digital imaging-based bar code symbol reader employing an event-driven system control subsystem, automatic IR-based object detection, and trigger-switch activated image capture and processing subsystem
CN101873305A (en) * 2009-12-31 2010-10-27 杭州海康威视数字技术股份有限公司 Data transmission control method, monitoring system and decoder thereof
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
US20160071005A1 (en) * 2014-09-05 2016-03-10 Qualcomm Incorporated Event-driven temporal convolution for asynchronous pulse-modulated sampled signals
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
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

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060219792A1 (en) * 2003-11-13 2006-10-05 Metrologic Instruments, Inc. Hand-supportable digital imaging-based bar code symbol reader employing an event-driven system control subsystem, automatic IR-based object detection, and trigger-switch activated image capture and processing subsystem
CN101873305A (en) * 2009-12-31 2010-10-27 杭州海康威视数字技术股份有限公司 Data transmission control method, monitoring system and decoder thereof
US20160071005A1 (en) * 2014-09-05 2016-03-10 Qualcomm Incorporated Event-driven temporal convolution for asynchronous pulse-modulated sampled signals
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
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

Non-Patent Citations (1)

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

Similar Documents

Publication Publication Date Title
US10922102B2 (en) Method of controlling applications in a terminal and terminal
US10187770B2 (en) Forwarding activity-related information from source electronic devices to companion electronic devices
US20210256077A1 (en) Methods, devices and computer-readable storage media for processing a hosted application
CN106844181B (en) Method, system and mobile terminal for recording user behavior
CN104246659A (en) Instantiable gesture objects
CN103294336A (en) Automatic magnification and selection confirmation
WO2021027205A1 (en) Screen sharing processing method, apparatus and device, and storage medium
US20230281029A1 (en) Graphical user interface for macro generation, modification, and verification
US20210326151A1 (en) Methods, devices and computer-readable storage media for processing a hosted application
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
CN111880675B (en) Interface display method and device and electronic equipment
US10168898B2 (en) Supporting different event models using a single input source
CN106844182B (en) Method, system and mobile terminal for recording user behavior
US9894318B1 (en) Method for output control of videos from multiple available sources and user terminal using the same
JP2006277771A (en) Terminal device and operation history recording method for computer network
CN110908552B (en) Multi-window operation control method, device, equipment and storage medium
TWI627541B (en) Forwarding activity-related information from source electronic devices to companion electronic devices
CN113282239A (en) Data migration method, memory and controller
CN110248023B (en) Intelligent terminal control method, device, equipment and medium
CN113741718A (en) Control data conversion method and device and master control equipment
CN112000321A (en) Method and device for realizing undo and/or redo of three-dimensional detection software
WO2019056614A1 (en) Touch data separation method and apparatus, device, and storage medium
CN112106044A (en) Method, apparatus and computer readable medium for transferring files over a web socket connection in a network collaborative workspace
US8803808B1 (en) Keyboard event detection and network event generation

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