Multi-touch-screen dynamic mapping method and device based on Linux system and storage medium
By identifying and binding the identifiers of the touch component and display component under the Linux system, the problem of touch mapping errors after the system restart or connection under the extended display state of the multi-touch screen is solved, and automated mapping and efficient user experience are achieved.
Patent Information
- Application Number
- CN202510121308.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-06
AI Technical Summary
Under Linux system, when the multi-touch screen is extended, the system restarts or the touch screen is connected, the touch mapping is incorrect.
By identifying all touch components and display components in the system, the device id of the touch component is mapped to the display output port connected to the display component according to the identifier binding relationship of the touch component and the display component, and the mapping is automatically re-established when the system is started or the touch screen is connected.
It solves the problem of touch mapping errors after system restart or touch screen connection, realizes automatic touch component and display component mapping, and improves user experience and work efficiency.
Smart Images

Figure CN119937835A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of multi-touch screen display technology, and more specifically, to a multi-touch screen dynamic mapping method, device and storage medium based on a Linux system. Background Art
[0002] With the continuous innovation of electronic devices, touch screen technology has been widely used, and relying on its direct, intuitive, easy to use and simple operation characteristics, it has gradually become one of the mainstream input methods. A touch screen is a device that combines a touch component and a display component by mechanical means. The touch component is responsible for detecting the user's touch operation, while the display component is responsible for presenting image information. The collaborative work of these two components enables the touch screen to achieve the dual functions of touch sensing and image display. Among them, the touch component is usually connected to the host device through a USB interface. Through the USB connection, the touch component can quickly transmit the user's touch information to the host device to achieve touch operation. The display component is usually connected to the host device through an interface such as HDMI, DVI or VGA, and the image signal output by the host device is presented on the display screen with high quality. Usually, a host is only connected to one touch screen, but in some application scenarios, a host device needs to be connected to multiple touch screens. By configuring the display output to the extended mode, multiple touch screens can be used to perform multi-interface operation and display.
[0003] Connect multiple touch screens to a host device running Linux and set them as extended displays. Each time the system starts or the touch screen is connected, the device identification and configuration may change, making the previously set touch mapping relationship no longer valid, that is, the mapping relationship between the touch component and its corresponding display component no longer matches, resulting in touch mapping errors or touch offset problems. Manual touch mapping matching is very tedious and repetitive, reducing the user experience and work efficiency. Summary of the invention
[0004] In view of the defects of the prior art, the present application provides a multi-touch screen dynamic mapping method, device and storage medium based on the Linux system, which aims to solve the touch mapping error problem after the system is restarted or the touch screen is connected in the multi-touch screen extended display state of the current Linux system.
[0005] To achieve the above objectives, in a first aspect, the present application provides a multi-touch screen dynamic mapping method based on a Linux system, and the multi-touch screen dynamic mapping method specifically comprises the following steps: Connect all touch screens to the host and identify all touch components and display components in the system; Binding identifiers of a touch component and a display component that match the touch display; Each time the system is started, all touch components and display components in the system are identified, and the device ID of the touch component is mapped to the display output port connected to the display component according to the identifier binding relationship between the touch component and the display component; at the same time, the background real-time monitoring is started to determine whether there is a touch screen connected to the host. If a touch screen is found to be connected to the host, all touch components and display components in the system are identified, and the device ID of the touch component is mapped to the display output port connected to the display component according to the identifier binding relationship between the touch component and the display component.
[0006] Preferably, the identifiers of the touch component and the display component that match the touch display are bound, specifically: Mapping the device IDs of all touch components to the first display output port, and finding the first touch screen whose touch function is normal at this time; mapping the device IDs of all touch components to the first display output port in turn, and judging whether the touch function of the first touch screen is normal, if normal, binding the identifier of the touch component participating in the mapping at this time and the identifier of the display component connected to the first display output port; Repeat the above steps for all display output ports in turn. Preferably, the device ID of the touch component is mapped to the display output port to which the display component is connected according to the identifier binding relationship between the touch component and the display component, specifically: Get the identifiers of all touch components and display components in the system; Find out the bound touch components and bound display components having the identifier binding relationship; Map the device ID of the bound touch component to the display output port to which the bound display component is connected.
[0007] Preferably, the device ID and identifier of the touch control component are obtained by the following method: Read the touch screen's VID:PID information through the Linux system command line tool; Get the name information of the touch component based on the VID:PID information of the touch screen; Obtain device IDs of all touch components based on the name information; Acquire device node information of the touch control component based on the device ID; An identifier of a touch control component is obtained based on the device node information.
[0008] Preferably, the identifier of the display component and the display output terminal to which the display component is connected are obtained through a Linux system command line tool.
[0009] Preferably, the device ID of the touch control component is mapped to the display output port through a Linux system command line tool.
[0010] Preferably, the input device events in the system kernel are monitored through a Linux system command line tool, and if the event includes the characters "add", "VID:PID" and "event", it is determined that a touch screen is monitored to be connected to the host.
[0011] In a second aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0012] In a third aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0013] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0014] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art: (1) The technical solution of the present application uniquely matches the binding relationship between the touch component identifier and the display component identifier in the touch screen, and re-establishes the mapping of the touch component and the display component according to the binding relationship when the system is started or the touch screen is reconnected to the system, thereby solving the problem of touch mapping errors after the system is restarted or the touch screen is connected in the multi-touch screen extended display state of the current Linux system.
[0015] (2) This application method is implemented through the Linux system command line tool and is applicable to any Linux-based system, including a variety of domestic systems including the Kylin system.
[0016] (3) The present application method distinguishes different touch components and display components by identifying hardware identifiers. Therefore, the present application method has no restrictions on the model and manufacturer of the touch screen and is applicable to touch screens of all models and manufacturers.
[0017] (4) The method of this application is simple to implement. It only needs to perform matching and binding once after the hardware is determined and connected. It will be automatically mapped after the computer is turned on or the touch screen is reconnected, and it takes up little CPU and memory resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flowchart of a multi-touch screen dynamic mapping method based on a Linux system provided in an embodiment of the present application.
[0019] Figure 2 This is a hardware connection diagram of a multi-touch screen dynamic mapping method based on a Linux system provided in an embodiment of the present application.
[0020] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0022] The terms "first" and "second" in the specification and claims of this application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of response messages.
[0023] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0024] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0025] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0026] Embodiment 1: Embodiment 1 provides a multi-touch screen dynamic mapping method based on Linux system, such as Figure 1 As shown, the specific steps include: (1) First, connect all touch screens to the host and identify all touch components and display components in the system; then bind the identifiers of the touch components and display components that match the touch displays.
[0027] (2) System startup; execute steps (3) and (4) simultaneously.
[0028] (3) The system identifies all touch components and display components in the system, and maps the device ID of the touch component to the display output port to which the display component is connected according to the identifier binding relationship between the touch component and the display component.
[0029] (4) Real-time monitoring is started in the background to monitor whether there is a touch screen connected to the host. If so, all touch components and display components in the system are identified, and the device ID of the touch component is mapped to the display output port to which the display component is connected according to the identifier binding relationship between the touch component and the display component.
[0030] It should be noted that The identifier of the touch component refers to an attribute generated by the udev device manager in the Linux system, which is used to uniquely identify the physical connection path of the device in the system, and can be used to determine the physical connection method of the device to help distinguish similar devices.
[0031] The identifier of the display component refers to a specific identifier of the display device connected to the system in the X server, which is used to identify and manage the device. The identifier is usually in hexadecimal and is unique for each device.
[0032] When the physical path connecting the touch screen and the host device is determined, the touch component identifier and the display component identifier are uniquely determined and no longer change.
[0033] Embodiment 2: Embodiment 2 also provides a multi-touch screen dynamic mapping method based on the Linux system, and Embodiment 2 specifically includes the following steps: (1) First, connect all touch screens to the host and identify all touch components and display components in the system; then bind the identifiers of the touch components and display components that match the touch displays.
[0034] (1.1) Physically connect the host device and the touch screen; This embodiment 2 is preferably described by taking a USB interface touch control component and an HDMI interface display component as examples. Figure 2 As shown. Touch screen 1, touch screen 2 to touch screen N are connected to the host device respectively. Touch screen 1 includes touch component 1 and display component 1. The input interface connection between touch component 1 and the host is defined as USB1, and the output interface connection between display component 1 and the host is defined as HDMI1. Touch screen 2 includes touch component 2 and display component 2. The input interface connection between touch component 2 and the host is defined as USB2, and the output interface connection between display component 2 and the host is defined as HDMI2. Touch screen N includes touch component N and display component N. The input interface connection between touch component N and the host is defined as USBN, and the output interface connection between display component N and the host is defined as HDMIN.
[0035] The touch component is recognized by the host device operating system as a USB device and has a specific identification representation, including VID (Vendor ID) and PID (Product ID). Exemplarily, the VID:PID information of all touch components can be obtained through the "lsusb" command, and after de-duplication, it is saved in the VID:PID information array. It should be noted that: The VID is the unique identifier of the device manufacturer. Each legitimate USB device manufacturer will apply for a unique 16-digit VID from the USB Implementers Forum (USB-IF), which ensures that devices from different manufacturers will not conflict in the USB ecosystem; The PID is the unique identifier of the specific device under the manufacturer, which defines the specific type and function of the device. When a manufacturer designs a new device, it will assign a specific PID to ensure that the operating system can recognize the device and load the corresponding driver. Therefore, when the manufacturer or product model of the touch component is different, its VID:PID information is also different, and the VID:PID information can be used to uniquely identify a specific model of touch component produced by a specific manufacturer.
[0036] (1.2) Identify all touch components within the system.
[0037] (1.2.1) Make a preliminary grouped save of the VID:PID information of the touch components Obtain the total number N of touch components recognized by the host device operating system. Exemplarily, the VID:PID information array can be traversed, and the number of touch components with a specific VID:PID can be obtained through the "lsusb |grep VID:PID |wc -l" command, and the total number N of touch components recognized by the host device operating system is obtained by cumulative counting.
[0038] Obtain the total number M of all types of touch components recognized by the host device operating system. Exemplarily, it can be obtained through " " command. After de-duplicating all the names of the touch components recognized by the host device operating system, they are saved in the touch component name information array, and the touch component quantities corresponding to each element of the touch component name information array of the host device operating system are saved in the touch component quantity information array. Exemplarily, a for loop can be used with i as the loop increment variable, i = 0 as the starting condition, i < M as the judgment condition, and then the VID:PID information array is traversed using: " " command to obtain the de-duplicated touch component name information; using: " ” The command is used to obtain the information on the number of corresponding touch components.
[0039] It should be noted that the names of touch components with different VID:PID are recognized differently by the host device operating system, and the names of touch components with the same VID:PID may also be different due to different production batches. Therefore, the VID:PID information is initially grouped and saved to group and save the touch component name information and the corresponding quantity in the subsequent steps.
[0040] (1.2.2)Obtain the device ID, device node information, and identifier of the touch component.
[0041] Obtain the device ID of the touch component recognized by the host device under the X11 system. Further, obtain the device node information " / dev / input / eventX" of the touch component. Still further, obtain the touch component identifier and save it in the touch component identifier array.
[0042] Exemplarily, the for loop can be used with i as the loop increment variable, i = 0 as the starting condition, and i < M as the judgment condition (the i-th type). Then, use the for loop with j as the loop increment variable, j = 0 as the starting condition, and j < the value of the i-th element in the touch component quantity information array (the quantity of the i-th type). Use: “xinput --list | grep "the value of the i-th element in the touch component name information array“ ” The command is used to obtain the device ID of the touch component recognized by the host device under the X11 system and save it in the touch component device ID array in sequence. In the same-level loop, use: “
[0043] ” The command is used to obtain the device node information " / dev / input / eventX" of the touch component.
[0044] In the same-level loop, use: “ ” The command is used to obtain the touch component identifier and save it in the touch component identifier array in sequence. It should be noted that " / dev / input / eventX" represents a device node, where "X" represents the corresponding device number, replacing a Roman numeral. A device node is a special file in the Unix / Linux system used to represent and access hardware devices. Each device has a corresponding device node in the system. When a device is connected or disconnected or the system is restarted, the device node may change. Hypothetically, when connecting a touch device, it may generate a device node " / dev / input / event9" in the system. When the device is re-plugged or the system is restarted, this device node may change to " / dev / input / event11".
[0045] (1.3)Identify all display components within the system.
[0046] Obtain the display output port "HDMIX" of the connected display component recognized by the host device under the X11 system, where "X" represents the corresponding port number, replacing a Roman numeral, used to distinguish multiple ports of the same type. Further, obtain the display component identifier. Exemplarily, a for loop can be used with i as the loop increment variable, i = 0 as the starting condition, and i < N as the judgment condition, using: “ ” command to obtain the display output port of the connected display component recognized by the host device under the X11 system and save it in the display output port array in sequence. Within the same loop, use: “ ” command to obtain the display component identifier and save it in the display component identifier array in sequence.
[0047] (1.4)Match and bind the identifiers of the touch components and display components that match the touch display.
[0048] Map all touch component device IDs to a certain display output port. At this time, there is and only one touch screen with normal touch display function, and the touch display functions of the remaining touch screens are disordered. At this time, the touch screen with normal touch display function can be used as the target to perform the matching and binding of the touch component identifier and the display component identifier. Enable the touch component device ID in sequence and map it to this display output port, and then judge whether the touch screen can be normally touched and displayed. If the touch display is disordered, use the next touch component device ID for mapping. If the touch display function is normal, bind the touch component identifier corresponding to the touch component device ID to the display component identifier corresponding to the display output port. After completing the binding, use the next touch screen as the target and repeat the above steps.
[0049] Exemplarily, a matching flag array FlagArr can be set to record whether the touch component has completed matching. Initialize all elements of the FlagArr array to 0, and set the corresponding position element to 1 when the matching is completed. Use a for loop with i as the loop increment variable, i = 0 as the starting condition, and i < N as the judgment condition to construct the outer loop. Then use a for loop with j as the loop increment variable, j = 0 as the starting condition, and j < N as the judgment condition to construct the inner loop. First, perform an inner loop. Use the command "xinput enable the j-th element of the touch component device ID array" to enable the touch component device corresponding to the j-th element of the touch component device ID array, so that the touch component device returns to the available state. Use the command "xinput map-to-output the j-th element of the touch component device ID array the i-th element of the display output port array" to map the touch component corresponding to the j-th element of the touch component device ID array to the display component corresponding to the i-th element of the display output port array. In this inner loop, map all touch component device IDs to the display output port corresponding to the j-th element of the display output port array. Ask the user to find the only touch screen with normal touch display function and set it as the target touch screen. Disable all touch components to make all touch component devices unavailable while keeping the mapping relationship unchanged. Perform another outer loop. Judge whether the j-th element of the FlagArr array is 0. If it is 0, use the command "xinput enable the j-th element of the touch component device ID array" to enable the touch component device corresponding to the j-th element of the touch component device ID array, so that the touch control device returns to the available state. Ask the user to judge whether the touch display function of the target touch screen is normal. If it is normal, then the j-th element of the touch component identifier array and the i-th element of the display component identifier array are successfully matched and bound at this time.
[0050] (2) When the system starts, turn on the touch screen mapping, and at the same time start monitoring in the background. If the monitoring finds that a touch screen is connected to the system, then turn on the touch screen mapping.
[0051] (2.1) Touch screen mapping.
[0052] The touch screen mapping method aims to obtain the mapping relationship between the touch component device ID corresponding to the touch component identifier and the display output port corresponding to the display component identifier by using the binding relationship between the touch screen touch component identifier and the display component identifier obtained by the matching method.
[0053] It should be noted that whenever the system starts or the touch component is re-connected to the system and recognized by the system, the touch component identifier and the display component identifier are uniquely determined and no longer change. However, the touch component device ID and the display output port may change. But when using the "xinput map-to-output" command to perform mapping, the touch component device ID and the display output port are required. Therefore, the touch component device ID and the display output port that may change can be found and determined through the unchanged touch component identifier and display component identifier.
[0054] Inherit the total number N of touch components, the touch component name information array, and the touch component quantity information array obtained in the matching method, and according to the touch component identifiers and display group identifiers that have been successfully matched and bound, store them in the touch component identifier array A and the display component identifier array A respectively.
[0055] It should be noted that the touch component identifier and the display component identifier corresponding to the elements at the same position in the touch component identifier array A and the display component identifier array A are matched and bound to each other.
[0056] Inherit the method of obtaining the touch component device ID recognized by the host device under the X11 system in the matching method and save it in the touch component device ID array in sequence to obtain a new touch component device ID array B. Inherit the method of obtaining the touch component identifier in the matching method and save it in the touch component identifier array in sequence to obtain a new touch component identifier array B.
[0057] It should be noted that the method of obtaining the touch component device ID array B is the same as that described in the matching method. Since the mapping method needs to be executed when the system starts or the touch component is re-connected to the system and recognized by the system, the touch component device ID may change. Therefore, the current touch component device ID needs to be re-obtained when the mapping method is executed.
[0058] Obtain the elements of the corresponding display output port array A according to the elements of the display component identifier array A, and set them as the target. Traverse the touch component identifier array B to find the elements with the same element values as the elements of the touch component identifier array A. Find the corresponding element in the touch component device ID array B of the touch component identifier array B and set it as the target. Map the element of the target touch component device ID array B to the element of the display output port array A.
[0059] Exemplarily, use a for loop to take i as the loop increment variable, i = 0 as the starting condition, and i < N as the judgment condition to construct the outer loop. Then use a for loop to take j as the loop increment variable, j = 0 as the starting condition, and j < N as the judgment condition to construct the inner loop. In the outer loop, it can be passed through: “ ” The command obtains the display output port corresponding to the i-th element of the display component identifier array A.
[0060] In the inner loop, determine whether the j-th element of touch component identifier array B is the same as the i-th element of touch component identifier array A. If they are the same, use "xinput map-to-output touch component device id array B j-th element display component identifier array A corresponding to the display output port" to map the touch component to the corresponding display component, complete the mapping of the corresponding touch screen, and jump out of this inner loop. If they are not the same, continue the inner loop until all touch screen touch mappings are completed.
[0061] (2.2) Start background monitoring.
[0062] Start the kernel input subsystem event real-time monitor. Exemplarily, the kernel input subsystem event real-time monitor can be started by the "udevadm monitor -kernel --subsystem=input" command.
[0063] It should be noted that this command will start a process that will continue to run and monitor kernel events related to input devices, and is responsible for receiving and displaying events from the kernel. When input devices (such as keyboards, mice, touch components) are inserted or removed, or other events related to input devices occur, the process will capture and display information about these events.
[0064] The event information output by the monitoring process is stored in the variable line. Whenever the event information output is detected, the keywords "add", "VID:PID" and "event" are queried. When the above keywords are present at the same time, the mapping method is executed to restore the correct mapping between the touch component and the display component.
[0065] It should be noted that the output information containing "add" indicates that a device is detected to be added to the system. For example, when a new hardware device (USB device, keyboard, mouse, touch component, etc.) is inserted or connected, the Linux kernel will generate an event and notify the user space through the udev system, indicating that the device has been successfully identified and added. The output information containing "VID:PID" indicates that the device added to the system has the VID:PID. The output information containing "event" indicates some operation or change related to the device status.
[0066] Based on the method in the above embodiment, the embodiment of the present application further provides an electronic device, such as Figure 3As shown, the electronic device may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute the method in the above embodiment.
[0067] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0068] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0069] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0070] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0071] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0072] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can 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 the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0073] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0074] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A multi-touch screen dynamic mapping method based on Linux system, characterized in that: The multi-touch screen dynamic mapping method specifically comprises the following steps: Connect all touch screens to the host and identify all touch components and display components in the system; Binding identifiers of a touch component and a display component that match the touch display; Each time the system is started, all touch components and display components in the system are identified, and the device ID of the touch component is mapped to the display output port connected to the display component according to the identifier binding relationship between the touch component and the display component; at the same time, the background real-time monitoring is started to determine whether there is a touch screen connected to the host. If a touch screen is found to be connected to the host, all touch components and display components in the system are identified, and the device ID of the touch component is mapped to the display output port connected to the display component according to the identifier binding relationship between the touch component and the display component.
2. The multi-touch screen dynamic mapping method according to claim 1, characterized in that: Bind the identifiers of the touch component and display component that match the touch display, specifically: Mapping the device IDs of all touch components to the first display output port, and finding the first touch screen whose touch function is normal at this time; mapping the device IDs of all touch components to the first display output port in turn, and judging whether the touch function of the first touch screen is normal, if normal, binding the identifier of the touch component participating in the mapping at this time and the identifier of the display component connected to the first display output port; Repeat the above steps for all display output ports in sequence.
3. The multi-touch screen dynamic mapping method according to claim 1, characterized in that: According to the identifier binding relationship between the touch component and the display component, the device ID of the touch component is mapped to the display output port to which the display component is connected, specifically: Get the identifiers of all touch components and display components in the system; Find out the bound touch components and bound display components having the identifier binding relationship; Map the device ID of the bound touch component to the display output port to which the bound display component is connected.
4. The multi-touch screen dynamic mapping method according to claim 1, 2 or 3, characterized in that: Get the device ID and identifier of the touch component through the following method: Read the VID:PID information of the touch screen through the Linux system command line tool; Get the name information of the touch component based on the VID:PID information of the touch screen; Obtain device IDs of all touch components based on the name information; Acquire device node information of the touch control component based on the device ID; An identifier of a touch control component is obtained based on the device node information.
5. The multi-touch screen dynamic mapping method according to claim 1, 2 or 3, characterized in that: Use the Linux system command line tool to obtain the identifier of the display component and the display output terminal to which the display component is connected.
6. The multi-touch screen dynamic mapping method according to claim 1, 2 or 3, characterized in that: Use the Linux system command line tool to map the device ID of the touch component to the display output port.
7. The multi-touch screen dynamic mapping method according to claim 1, characterized in that: The input device events in the system kernel are monitored through the Linux system command line tool. If the event includes the characters "add", "VID:PID" and "event", it is determined that a touch screen is connected to the host.
8. An electronic device, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Mapping method of multi-display touch component system, terminal and readable storage medium
CN111552402A
Multi-touch screen mapping method and device, equipment and storage medium
CN116821013A
Multi-screen touch display automatic calibration method
CN117891421A