A method for implementing gesture selection data based on embedded Linux

By implementing the method of selecting data with gesture clicks on the interactive interface of embedded Linux devices, the problem of difficulty in quickly selecting the text of the target entry is solved, and the device's control flexibility and user interface interaction experience are improved.

CN119556842BActive Publication Date: 2025-03-28BEIJING PINGZHI ORIENTAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510128619.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-03-28
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

When embedded Linux devices display data exceeding the maximum display amount of data on the display screen, it is difficult to quickly select the text of the target entry, and due to hardware resource limitations, it is not suitable for running a graphical user interface that takes up a large system resource.

Method used

The method of selecting data by implementing gesture clicks on the interactive interface of the embedded system includes creating a data storage structure, monitoring gesture click events, and finding the rectangular area corresponding to the click position on the data storage structure, and redrawing its background and data color to achieve the selection effect.

Benefits of technology

Without increasing hardware costs, the function of gesture selection data is realized, which improves the control flexibility of embedded devices and the speed of target content selection, avoids the problems of lag and slow buffering, and effectively improves the user interface interaction experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556842B_ABST
    Figure CN119556842B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for realizing gesture selection data based on embedded Linux, the method comprising storing target data into a created data storage structure; the first row and first column number of the click position on the display list according to the coordinates of the click position of the monitored gesture click event and the row height and column width of the display list; the second row and second column number of the click position in the data storage structure are calculated according to the current read position, the first row and the first column of the data storage structure; the corresponding rectangular area on the data storage structure is calculated according to the second row, the second column and the row height and the column width of the data storage structure, and the background and data of the rectangular area are redrawn with different colors; a frame of data at the current read position on the data storage structure is written into FrameBuffer and refreshed. The present invention realizes gesture click selection data on the embedded system interaction interface, and improves the flexibility and speed of embedded device control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded Linux, and in particular to a method, electronic device and storage medium for implementing gesture selection data based on embedded Linux. Background Art

[0002] Linux embedded systems are widely used in electronic products in the industrial and consumer fields because of their open source, streamlined and efficient, stable, customizable and low power consumption. At present, when embedded Linux devices display data that exceeds the maximum display amount of the display screen, they all use hard keys or soft keys on the interactive interface to turn pages, and the data search speed is slow. In particular, when it is necessary to select the text of an item in the current display list of the display window for operation, it is also necessary to use hard keys or soft keys on the interactive interface to move and search one by one on the display list, making it difficult to quickly select the text of the target item.

[0003] The graphical user interface can realize the operation interface of the installed equipment through gesture control, and the continuous movement and selection of data displayed on the display screen can be realized through gestures such as sliding and clicking. The graphical user interface can not only improve the user experience, but also is flexible to operate. In particular, any text displayed in the display window can be selected by clicking the screen with gestures. Compared with turning pages with buttons and searching one by one, the text of the target entry can be selected quickly.

[0004] However, due to the hardware resource limitations of the Linux embedded system itself, it is not suitable to run functional software that takes up a lot of system resources, such as complex graphical user interfaces, on these electronic products. When running large graphical user interface software, it will bring huge overhead to the low-power embedded system. Without increasing hardware costs (such as increasing memory, increasing CPU frequency, etc.), it will cause user interface operation jams and slow buffering, resulting in a very poor user experience.

[0005] Therefore, it is crucial to implement the use of gestures to select text on the interactive interface of embedded systems without introducing the overhead of large-scale graphics systems that consume huge resources. Summary of the invention

[0006] In order to realize the use of gestures to click and select text on the interactive interface of an embedded system without increasing huge overhead, the embodiments of the present invention provide a method, electronic device and storage medium for realizing gesture selection data based on embedded Linux.

[0007] The specific technical solutions are as follows:

[0008] In a first aspect, an embodiment of the present invention provides a method for implementing gesture selection data based on embedded Linux, comprising the following steps:

[0009] Creating a data storage structure according to the number of rows and columns of the target data and the style of the display list on the screen, and storing the target data in the data storage structure; wherein the style of the display list includes the number of rows, the number of columns, the row height pixels, and the column width pixels of the display list; the data storage structure can completely store the target data according to the row order and the column order of the target data, and can write data identical to the row height pixels and the column width pixels of the display list on the screen into the FrameBuffer;

[0010] Monitor gesture click events, and execute the selection procedure when the display list is in a non-selected state, and execute the restoration procedure when the display list is in a selected state;

[0011] The selection procedure is:

[0012] Calculate the first row and column of the click position on the display list based on the click position coordinates of the gesture click event and the row height and column width of the display list;

[0013] Calculate the second row number and the second column number of the click position in the data storage structure according to the current read position, the first row number and the first column number of the data storage structure; wherein the current read position is the row information and column information of a frame of data currently displayed in the display list stored in the data storage structure; the frame of data is the data that fills up all the FrameBuffer;

[0014] Calculate the rectangular area of ​​the data selected by the gesture click event on the data storage structure according to the second number of rows, the second number of columns, and the row height and column width of the data storage structure, and redraw the background and data of the rectangular area in the data storage structure with a color different from that of other areas;

[0015] Rewrite a frame of data corresponding to the current read position on the data storage structure into the FrameBuffer, refresh it, and change the state of the display list to the selection state;

[0016] The restoration procedure is:

[0017] According to the second column number and the second row number corresponding to the data selected in the last gesture click event, the background and data color of the rectangular area corresponding to the data storage structure are restored;

[0018] A frame of data corresponding to the current read position on the data storage structure is rewritten into the FrameBuffer, refreshed, and the display list state is changed to a non-selected state.

[0019] Preferably, the method further includes processing the data accordingly according to the received data processing request, specifically:

[0020] After receiving the data processing request, determine the status of the display list; wherein the data processing request includes a request to delete, modify, or allow other APPs to call the data;

[0021] If the state of the display list is the selection state, the data in the rectangular area of ​​the data storage structure is processed accordingly according to the data processing request, the second row number and the second column number, and the background and data color of the processed rectangular area are restored;

[0022] Rewrite a frame of data corresponding to the current read position on the data storage structure into the FrameBuffer, refresh it, and change the display list state to a non-selected state;

[0023] If the status of the displayed list is not selected, the data processing request will not be responded to.

[0024] Preferably, the data storage structure includes a linked list data structure created according to the number of rows and columns of the target data and a canvas requested from the memory according to the number of columns of the target data and the display list style of the screen; wherein:

[0025] The number of rows of the linked list data structure is equal to the number of rows of the target data, the number of cells in each row is equal to the number of columns of the target data, and each row is a row node, and two adjacent row nodes are bidirectionally linked; each row includes multiple cell nodes, and two adjacent cell nodes in each row are bidirectionally linked;

[0026] The row height of each row in the canvas is equal to the row height pixel of the display list, and the column width of each column in the canvas is equal to the column width pixel of the display list; the width of the canvas is equal to the number of columns of the target data multiplied by the column width pixel of the display list, and the height of the canvas is at least equal to the pixel height of the display list.

[0027] Preferably, storing the target data into the data storage structure comprises:

[0028] Obtain target data from the application layer, and store each row of target data into a row node corresponding to the linked list data structure in sequence starting from the start position of the linked list data structure in accordance with the row order of the target data, and store each column of data of each row of target data into a cell node corresponding to the row node in accordance with the column order of the target data;

[0029] According to the received target data opening request, the canvas target data is drawn to the canvas from the starting position of the linked list data structure to complete the initialization of the canvas target data, and the current linked list reading position is recorded;

[0030] Read a frame of data from the start position of the canvas and copy it to FrameBuffer, refresh the display list on the screen and record the current canvas reading position; wherein; the current canvas reading position includes the row information and column information read by the current canvas.

[0031] Preferably, upon receiving the request to open the target data, the canvas target data is initialized by drawing the data to the canvas from the starting position of the linked list data structure, and the current linked list reading position is recorded, specifically:

[0032] According to the received target data opening request, the data of each row node is read in sequence from the starting position of the linked list data structure, and the data in each cell node of the read row node is filled and drawn from the starting position of the canvas to the corresponding pixel coordinate position of the canvas, the initialization of the canvas target data is completed, and the current linked list reading position of the linked list data structure is recorded; wherein the data in each cell node of the read row node includes text information and picture information;

[0033] Filling and drawing the text information to the corresponding pixel coordinate position of the canvas is to read the font information from the corresponding font library according to the set font, calculate the pixel coordinate position in the canvas, and fill the corresponding pixel coordinate position one by one in the canvas memory in the form of pixel points;

[0034] Drawing the image information to the corresponding pixel coordinate position of the canvas is to read the image storage path information from the cell, open the image file, obtain the BMP bitmap data, and fill it in the corresponding pixel coordinate position of the canvas.

[0035] Preferably, the calculating the second row number and the second column number of the click position in the data storage structure according to the current read position, the first row number and the first column number of the data storage structure comprises:

[0036] Obtaining a current reading position according to the current canvas reading position and the number of rows and columns of a display list;

[0037] The row number and column number of the click position in the canvas are obtained according to the current read position, the first row number and the first column number, and are used as the second row number and the second column number respectively.

[0038] Preferably, the canvas includes multiple sub-canvases, and a starting sub-canvas and a preset sub-canvas order are set, and the multiple sub-canvases are used alternately in a cyclic manner according to the preset canvas order; each sub-canvas is provided with a sub-canvas sequence number, wherein the sub-canvas sequence number is used to mark the sub-canvas as the nth canvas for drawing target data onto the canvas starting from the starting position of the linked list data structure.

[0039] Preferably, the corresponding processing of the data in the rectangular area of ​​the data storage structure according to the data processing request, the second number of rows and the second number of columns includes:

[0040] According to the sequence number of the current sub-canvas and the number of rows of each sub-canvas, the total number of rows of the target data that has been drawn to the canvas from the starting position of the linked list data structure except the current sub-canvas is calculated;

[0041] According to the total number of drawn rows and the second row number of the rectangular area in the current sub-canvas, calculate the row node corresponding to the second row number in the linked list data structure;

[0042] According to the row node corresponding to the second row number and the second column number on the linked list data structure, determine the corresponding area of ​​the data selected by the click event in the linked list data structure, and respond to the data in the corresponding area of ​​the linked list data structure according to the data processing request;

[0043] In addition to being used by other APPs, after processing the data on the linked list data structure, the latest data is obtained from the corresponding area of ​​the linked list data structure according to the sequence number, the second row number, and the second column number of the current sub-canvas, and redrawn in the rectangular area corresponding to the current sub-canvas.

[0044] In a second aspect, an embodiment of the present invention further provides an electronic device, including 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;

[0045] Memory, used to store computer programs;

[0046] The processor is used to implement the steps of the method for implementing gesture selection data based on embedded Linux as described in the first aspect when executing the program stored in the memory.

[0047] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps for realizing gesture selection data based on embedded Linux as described in the first aspect above are implemented.

[0048] The embodiment of the present invention provides a method, electronic device and storage medium for implementing gesture selection data based on embedded Linux. In this embodiment, by establishing a correlation relationship between gesture click position coordinates, a screen display list and a data storage structure, a rectangular area corresponding to the click position is found on the data storage structure, and the data of the rectangular area is rewritten into the FrameBuffer after modifying the background and data color of the rectangular area on the data storage structure to be different from other areas. After refreshing, the data displayed in the display list has a selection effect, and gesture selection data is implemented. Without introducing the overhead brought by a large-scale graphics system with huge resource consumption and without increasing hardware costs (such as increasing memory, increasing CPU frequency, etc.), a graphical interface similar to gesture click selection data control in a mobile phone is implemented on the interactive interface of the embedded system, thereby improving the flexibility of embedded device control and the speed of target content selection, without problems such as freezes and slow buffering, and effectively improving the user interface interaction experience; in particular, gesture selection data is implemented based on gesture sliding, and the dual efficiency of rapid positioning of the target page and rapid selection of the target content in the page is achieved.

[0049] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0050] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0052] Figure 1 A flowchart of a method for implementing gesture selection data based on embedded Linux provided by an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of the structure of a linked list data structure in an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of a process for the first step in an embodiment of the present invention;

[0055] Figure 4 It is a schematic diagram of the structure relationship between the linked list data structure and the sub-canvases and FrameBuffer when there are three sub-canvases in an embodiment of the present invention;

[0056] Figure 5A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0058] like Figure 1 As shown, the embodiment of the present application provides a method for implementing gesture selection data based on embedded Linux, the method comprising the following steps:

[0059] Step S100, create a data storage structure according to the number of rows and columns of the target data (for example, M rows and N columns) and the style of the display list on the screen, and store the target data into the data storage structure; wherein the style of the display list includes at least the number of rows, the number of columns, the row height in pixels, and the column width in pixels of the display list; the data storage structure can completely store the target data obtained from the application layer according to the row order and the column order of the target data, and can write the target data with the same row height in pixels and column width in pixels as the display list on the screen to the Linux FrameBuffer.

[0060] Step S200, monitor gesture click events on the screen, and when a gesture click event is monitored, determine whether the state of the display list is a selected state. If so, execute the restore program step S600; otherwise, execute the selection program step S300; the state of the display list includes a selected state and a non-selected state.

[0061] S300. Calculate the first row number and the first column number of the click position on the display list according to the click position coordinates in the gesture click event and the row height and column width of the display list, that is, obtain the first row number according to the vertical coordinate of the click position and the row height of the display list, and obtain the first column number according to the horizontal coordinate of the click position and the row height of the display list; in this embodiment of the application, the click position coordinates of the gesture click event include the position coordinates of the hand falling on the screen and the position coordinates of the hand leaving the screen, so when the horizontal coordinates of the position where the hand falls on the screen and the horizontal coordinates of the position where the hand leaves the screen are the same, there is only one first row number. If the first row number is n, it means that the click position is in the nth row on the display list, otherwise, there are two first row numbers; when the vertical coordinates of the position where the hand falls on the screen and the vertical coordinates of the position where the hand leaves the screen are the same, there is only one first column number. If the first column number is m, it means that the click position is in the mth column on the display list, otherwise, there are two first column numbers.

[0062] Step S400, obtaining the current read position of the data storage structure, and calculating the second row number and the second column number of the click position in the data storage structure according to the current read position, the first row number and the first column number; wherein the current read position is the row information and column information of a frame of data currently displayed in the display list (i.e., a frame of data currently filling up the FrameBuffer) in the data storage structure; a frame of data is data that fills up all the used FrameBuffer, that is, data of the pixel space occupied by all rows and columns of the display list; here the second row number and the second column number are similar to the first row number and the first column number, and no further explanation is given here.

[0063] Step S500, according to the second row number, the second column number and the row height and column width of the data storage structure, calculate the rectangular area of ​​the data selected by this gesture click event on the data storage structure, and redraw the background and data of the rectangular area in the data storage structure with a color different from the original, so that after rewriting the FrameBuffer and refreshing, the data with the selected effect is displayed in the display list, and the effect of gesture selection data is achieved. In some embodiments of the present application, if there is only one second row number and one second column number, it means that the horizontal and vertical coordinates of the position where the hand falls on the screen are the same as the horizontal and vertical coordinates of the position where the hand leaves the screen, which is the same point. At this time, the default rectangular area is the row corresponding to the second row number or the column corresponding to the second column number; if there are two second rows and two columns, it means that the horizontal and vertical coordinates of the position where the hand falls on the screen are two points that are different from the horizontal and vertical coordinates of the position where the hand leaves the screen. At this time, the default rectangular area is the rectangular area surrounded by two second row numbers and two second column numbers (including the row corresponding to the second row number and the column corresponding to the second column).

[0064] Step S600: rewrite a frame of data corresponding to the current read position on the data storage structure into the FrameBuffer, refresh it, and change the state of the display list to a selection state.

[0065] Step S700, according to the second column number and the second row number corresponding to the data selected in the last gesture click event, the background and data color of the rectangular area corresponding to the data storage structure are restored (the same as the color of other areas), and then a frame of data corresponding to the current reading position on the data storage structure is rewritten into the FrameBuffer, and refreshed and the display list state is changed to a non-selected state.

[0066] This embodiment establishes a correlation between the coordinates of the gesture click position, the screen display list and the data storage structure, finds the rectangular area corresponding to the click position on the data storage structure, and rewrites the data of the rectangular area into the FrameBuffer after modifying the background and data color of the rectangular area on the data storage structure to distinguish them from other areas. After refreshing, the data displayed in the display list has a selected effect, thereby realizing gesture selection of data. Without introducing the overhead brought by a large-scale graphics system with huge resource consumption and without increasing hardware costs (such as increasing memory, improving CPU frequency, etc.), a graphical interface similar to the gesture click screen selection data control in a mobile phone is realized on the interactive interface of the embedded system, thereby improving the flexibility of embedded device control and the speed of target content selection, without problems such as freezes and slow buffering, and effectively improving the user interface interaction experience.

[0067] In the embodiment of the present application, the data is further processed according to the received data processing request, including the following steps:

[0068] After receiving the data processing request, determine the status of the display list; in the embodiment of the present application, the data processing request includes but is not limited to a request to delete, modify, and allow other APPs to call the data;

[0069] If the state of the display list is the selection state, the data in the rectangular area of ​​the data storage structure is processed accordingly according to the data processing request, the second row number and the second column number, and the background and data color of the processed rectangular area are restored; then, a frame of data corresponding to the current read position on the data storage structure is rewritten into the FrameBuffer, and refreshed, and the display list state is changed to a non-selection state;

[0070] If the status of the displayed list is not selected, the data processing request will not be responded to.

[0071] In an embodiment of the present application, in order to achieve the effect of controlling screen sliding according to gestures, the data storage structure includes a linked list data structure created according to the number of rows and columns of the target data, and a canvas requested from the memory according to the number of columns of the target data and the user's display list style requirements for the device screen display window (the function of the canvas is to preload the text and image content to be displayed in the memory in the form of pixels). Among them, the number of rows of the linked list data structure is equal to the number of rows of the target data, the number of cells in each row is equal to the number of columns of the target data, and each row is a row node, and two adjacent row nodes are bidirectionally linked; the cell node of each row is used to store the text or image information to be displayed, and two adjacent cell nodes in each row are bidirectionally linked, such as Figure 2As shown; the style of the display list at least includes the number of rows, columns, row height pixels and column width pixels of the display list; the row height of each row in the canvas is equal to the row height pixels of the display list, and the column width of each column in the canvas is equal to the column width pixels of the display list; the width of the canvas is equal to the number of columns of the target data multiplied by the column width pixels of the display list, and the height of the canvas is at least equal to the pixel height of the display list, that is, at least equal to the number of rows in the display list multiplied by the row height pixels of the display list; the canvas is provided with a boundary mark for identifying the boundary of the canvas; the boundary mark includes the top and / or bottom boundary mark of the canvas and the left and / or right boundary mark of the canvas. Based on this, in step S100, storing the target data in the data storage structure includes:

[0072] Step S101, obtain target data from the application layer, and store each row of target data into the corresponding row node in sequence starting from the starting position of the linked list data structure according to the row order of the target data, and each column of data of each row of target data is stored in the cell node of the corresponding row node according to the column order of the target data, that is, the target data and the linked list data structure have a one-to-one correspondence between rows and columns.

[0073] Step S102: upon receiving a request to open the target data, the canvas target data is initially drawn to the canvas from the start position of the linked list data structure, and the current linked list reading position is recorded.

[0074] Step S103, starting from the starting position of the canvas, read a frame of data and copy it to the FrameBuffer driver for refresh display, and record the current canvas reading position (that is, the current reading position of the storage structure), and complete the content initialization of the display list of the display window; wherein the current canvas reading position includes the row information read by the current canvas and the column information read by the current canvas.

[0075] In this embodiment, upon receiving a request to open the target data, the canvas target data is initialized starting from the starting position of the linked list data structure and the current linked list reading position is recorded, specifically:

[0076] According to the received request to open the target data, the data of each row node is read in sequence from the starting position of the linked list data structure, and the data in each cell node of the read row node is filled and drawn from the starting position of the canvas to the corresponding pixel coordinate position of the canvas, completing the initialization of the canvas target data, and recording the current linked list reading position of the linked list data structure. Among them, the data in each cell node of the read row node includes text information and image information; filling and drawing the text information to the corresponding pixel coordinate position of the canvas is to read the font information from the corresponding font library according to the set font, calculate the pixel coordinate position in the canvas, and fill it one by one in the canvas memory in the form of pixel points to the corresponding pixel coordinate position; drawing the image information to the corresponding pixel coordinate position of the canvas is to read the image storage path information from the cell, open the image file, obtain the BMP bitmap data, and fill it in the corresponding pixel coordinate position of the canvas.

[0077] In the embodiment of the present application, step S400 includes the following steps:

[0078] Get the current canvas read position, and get the current read position based on the current canvas read position and the number of rows and columns in the display list;

[0079] According to the current read position, the first row number and the first column number, the row number of the click position in the canvas is calculated as the second row number and the column number of the click position in the canvas is calculated as the second column number.

[0080] In the embodiment of the present application, step S500 includes the following steps:

[0081] The row height and column width of the canvas are used as the row height and column width of the data storage structure, and the rectangular area where the data selected by this gesture click event is located is calculated according to the second row number, the second column number, and the row height and column width of the data storage structure;

[0082] Redraw the background and data (text and / or image) of the rectangular area in the canvas with a different color than the original one.

[0083] At this time, in the embodiment of the present application, step S700 rewrites a frame of data corresponding to the current read position of the canvas into the FrameBuffer and refreshes it, and displays the data with the selected effect in the display list.

[0084] Based on the linked list data structure and the canvas included in the data storage structure, the embodiment of the present application also includes implementing a gesture screen based on embedded Linux, specifically including the following steps:

[0085] The first step is to monitor the screen sliding gesture event, and calculate the sliding direction and sliding speed of the screen sliding gesture according to the continuously changing touch point coordinates in the screen sliding gesture event. Figure 3 As shown, the first step includes the following steps:

[0086] Step S801: Take three continuously changing touch sampling point coordinates from the gesture sliding event, and record the clock tick (millisecond level) of each sampling point;

[0087] Step S802, calculating the displacements of the three sampling points in the x and y directions according to the x and y coordinates (x1, y1), (x2, y2), and (x3, y3) of the three sampling points;

[0088] Step S803, determine the sliding direction according to the displacement size and coordinates; for example, if the displacement in the y direction is greater than the x direction, then determine that the sliding direction of the gesture screen sliding is up and down sliding. If y3 is greater than y1, determine that the direction is downward, otherwise determine that the direction is upward. If the displacement in the x direction is greater than the y direction, then determine that the sliding direction of the gesture screen sliding is left and right sliding. If x3 is greater than x1, determine that the direction is right, otherwise determine that the direction is left. It should be noted that the origin of the screen coordinates is the upper left corner;

[0089] Step S804: Calculate the sliding speed of the gesture sliding screen according to the calculated displacement, sliding direction, and time information recorded by the clock tick of each sampling point.

[0090] Step 2: Select a display strategy corresponding to the calculated sliding speed from a plurality of preset display strategies according to the sliding speed; wherein the display strategy includes a step distance; the step distance is the pixel points (newly added row pixels or column pixels) of the newly added data in a frame of data written to the graphics card FrameBuffer for display each time compared with the previous one; in the embodiment of the present application, in order to be closer to the sliding screen effect, the preset plurality of display strategies meet the following requirements:

[0091] The faster the gesture slides, the larger the step distance; conversely, the slower the gesture slides, the smaller the step distance.

[0092] Step 3: After each overflow of the frame fetching timer started when the gesture slides, a frame of data is obtained from the canvas and written into the FrameBuffer according to the gesture sliding direction, the current canvas reading position and the display strategy, and the current canvas reading position is recorded and refreshed on the display list displayed in the display window until the frame fetching stop condition is reached and the frame fetching stops. In an embodiment of the present application, the frame fetching stop condition includes but is not limited to the number of frames written to the FrameBuffer by the gesture sliding reaching the preset total number of frames to be displayed, and the end mark of the target data and the boundary mark of the left or right end are detected. In this way, when different data frames with overlapping data contents are continuously refreshed in the FrameBuffer, according to the principle of visual persistence, the visual effect of the list sliding under the control of the gesture sliding screen is achieved. In this embodiment, the frame timer settings of all strategies are the same as the total number of frames that need to be displayed, which are pre-set fixed values. The frame timer is set to 30 milliseconds, so the frame rate is also 30 milliseconds. One frame of data will be displayed in the display window every 30 milliseconds. The frame rate is controlled at about 30 frames per second through the timer. In this way, when different data frames with overlapping display contents are continuously refreshed in the FrameBuffer, according to the principle of visual persistence, the visual effect of the list sliding under gesture control is achieved.

[0093] This embodiment constructs a linked list data structure and a canvas according to the display list style and the target data style, and constructs a linked list data structure, a canvas, and data reading and writing of the FrameBuffer on the Linux system. Without introducing the overhead brought by a large-scale graphics system with huge resource consumption and without increasing hardware costs (such as increasing memory, increasing CPU frequency, etc.), a graphical interface similar to the gesture sliding control in a mobile phone is implemented on the interactive interface of the embedded system, thereby improving the flexibility of embedded device control and the speed of target content positioning without problems such as lag and slow buffering, and effectively improving the user interface interaction experience.

[0094] To ensure the real-time and smoothness of sliding, in an embodiment of the present application, the canvas includes multiple sub-canvases; to ensure the real-time and smoothness of sliding in real-time on an embedded device, in some embodiments, the canvas includes three sub-canvases, namely, a first sub-canvas, a second sub-canvas and a third sub-canvas, each of which includes a boundary identifier for identifying the boundary of the sub-canvas; the boundary identifiers include the top and / or bottom boundary identifiers of the canvas and the left and / or right boundary identifiers of the canvas, and the boundary identifiers of the canvas include the boundary identifiers of all sub-canvases; the starting sub-canvas and the preset sub-canvas sequence are set (the starting position of the starting sub-canvas is the starting position of the canvas), and the three sub-canvases are used alternately in a cyclic manner according to the preset canvas sequence, for example, the preset canvas sequence is the first sub-canvas, the second sub-canvas, the third sub-canvas, and the first sub-canvas; considering that the memory usage of the sub-canvas cannot be too large, the width of each sub-canvas is equal to the pixel width of the canvas, and the height of the sub-canvas is set to 3 times the pixel height of the display list; when the canvas includes three sub-canvases, the initialization of the canvas target data is completed when the starting sub-canvas is filled; such as Figure 4 The diagram of the structure relationship between the linked list data structure, the sub-canvas and the FrameBuffer is shown. At this time, according to the gesture sliding direction, the current canvas reading position and the display strategy, a frame of data is obtained from the canvas and written into the FrameBuffer, including:

[0095] When sliding up and down, determine whether the remaining data height of the current sub-canvas is enough for one frame of data pixels according to the stepping distance of the display strategy and the current canvas reading position. If so, directly obtain one frame of data and write it to FrameBuffer; otherwise, read the remaining data from the current sub-canvas, and then read new data from the linked list data structure according to the sliding direction and the current linked list reading position and draw it to the next sub-canvas. At the same time, record the previous linked list reading position, and then read data from the starting position of the next sub-canvas to make up one frame of data and write it to FrameBuffer; the three sub-canvases are used in a cycle until the end mark of the target data is detected. If the end mark is detected but the remaining data of the canvas is not enough for one frame, the last frame of data is obtained by reducing the stepping distance and written to FrameBuffer, and then stop taking frames.

[0096] When sliding left or right, you only need to determine whether you have reached the left or right boundary based on the boundary marker. If you have not reached the boundary, take a frame of data from the canvas and write it into the FrameBuffer based on the current canvas reading position and display strategy; if you reach the left or right boundary and the remaining data on the canvas is not enough for one frame, get the last frame of data and write it into the FrameBuffer by reducing the step distance this time, and then stop taking frames.

[0097] In the implementation of the present application, the display window display list will perform several frame fetching operations through the frame fetching timer from the start of sliding to the stop. Some embodiments of the present application achieve smooth processing by successively reducing the stepping distance for the subsequent frame fetching operations to avoid the sudden braking effect of the sliding screen. That is, when the number of frames written to the FrameBuffer is still short of the preset number of frames to reach the preset total number of frames that need to be displayed, the stepping distance of each frame of data is reduced by the preset distance.

[0098] In the embodiment of the present application, when the canvas includes multiple sub-canvases and the display list is in a selection state, the data in the rectangular area of ​​the data storage structure is processed accordingly according to the data processing request, the second row number and the second column number, including:

[0099] Calculate the total number of lines of the target data that have been drawn to the canvas from the starting position of the linked list data structure except the current sub-canvas according to the sequence number of the current sub-canvas (used to mark the sub-canvas as the number of canvases that start drawing the target data to the canvas from the starting position of the linked list data structure) and the number of lines of each sub-canvas;

[0100] According to the total number of drawn rows and the second row number of the rectangular area in the current sub-canvas, calculate the row node corresponding to the second row number in the linked list data structure, that is, the row node corresponding to the click position in the linked list data structure;

[0101] According to the row node corresponding to the second row number and the second column number on the linked list data structure, determine the corresponding area of ​​the data selected by the click event in the linked list data structure, and respond to the data in the corresponding area of ​​the linked list data structure according to the data processing request;

[0102] In addition to being used by other APPs, after processing the data on the linked list data structure, the latest data is obtained from the corresponding area of ​​the linked list data structure according to the sequence number, the second row number, and the second column number of the current sub-canvas, and redrawn in the rectangular area corresponding to the current sub-canvas.

[0103] and Figure 1 Corresponding to the embodiment shown, the embodiment of the present invention further provides an electronic device, see Figure 5 , including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504;

[0104] Memory 503, used for storing computer programs;

[0105] The processor 501 is configured to implement any one of the steps of the method for selecting data by gesture based on embedded Linux in the above embodiments when executing the program stored in the memory.

[0106] It can be seen from this embodiment that the electronic device provided by the embodiment of the present invention can realize a graphical interface similar to the data selection control by gesture clicking in a mobile phone on the interactive interface of the embedded system without introducing the overhead brought by a large-scale graphics system with huge resource consumption and without increasing the hardware cost (such as increasing the memory, increasing the CPU frequency, etc.), thereby improving the flexibility of embedded device control and the speed of target content selection without problems such as lag and slow buffering, and effectively improving the user interface interaction experience.

[0107] and Figure 1 Corresponding to the embodiment shown, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method steps of gesture selection data based on embedded Linux in any one of the above embodiments are implemented.

[0108] It can be seen from this embodiment that by applying the storage medium provided in the embodiment of the present invention, a graphical interface similar to the data selection control by gesture clicking in a mobile phone can be implemented on the interactive interface of the embedded system without introducing the overhead brought by a large-scale graphics system with huge resource consumption and without increasing the hardware cost (such as increasing the memory, increasing the CPU frequency, etc.), thereby improving the flexibility of embedded device control and the speed of target content selection without problems such as lag and slow buffering, and effectively improving the user interface interaction experience.

[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for implementing gesture selection data based on embedded Linux, characterized in that: The following steps are involved: A data storage structure is created according to the number of rows and columns of the target data and the style of the display list on the screen, and the target data is stored in the data storage structure; wherein the style of the display list includes the number of rows, the number of columns, the row height pixels, and the column width pixels of the display list; the data storage structure can completely store the target data according to the row order and the column order of the target data, and can write data for the FrameBuffer that is the same as the row height pixels and the column width pixels of the display list on the screen; Monitor gesture click events, and execute the selection procedure when the display list is in a non-selected state, and execute the restoration procedure when the display list is in a selected state; The selection procedure is: Calculate the first row and column of the click position on the display list based on the click position coordinates of the gesture click event and the row height and column width of the display list; Calculate the second row number and the second column number of the click position in the data storage structure according to the current read position, the first row number and the first column number of the data storage structure; wherein the current read position is the row information and column information of a frame of data currently displayed in the display list stored in the data storage structure; the frame of data is the data that fills up all the FrameBuffer; Calculate the rectangular area of ​​the data selected by the gesture click event on the data storage structure according to the second number of rows, the second number of columns, and the row height and column width of the data storage structure, and redraw the background and data of the rectangular area in the data storage structure with a color different from that of other areas; Rewrite a frame of data corresponding to the current read position on the data storage structure into the FrameBuffer, refresh it, and change the state of the display list to the selection state; The restoration procedure is: According to the second column number and the second row number corresponding to the data selected in the last gesture click event, the background and data color of the rectangular area corresponding to the data storage structure are restored; A frame of data corresponding to the current read position on the data storage structure is rewritten into the FrameBuffer, refreshed, and the display list state is changed to a non-selected state.

2. The method according to claim 1, characterized in that: It also includes processing the data accordingly according to the received data processing request, specifically: After receiving the data processing request, determine the status of the display list; wherein the data processing request includes a request to delete, modify, or allow other APPs to call the data; If the state of the display list is the selection state, the data in the rectangular area of ​​the data storage structure is processed accordingly according to the data processing request, the second row number and the second column number, and the background and data color of the processed rectangular area are restored; Rewrite a frame of data corresponding to the current read position on the data storage structure into the FrameBuffer, refresh it, and change the display list state to a non-selected state; If the status of the displayed list is not selected, the data processing request will not be responded to.

3. The method according to claim 2, characterized in that The data storage structure includes a linked list data structure created according to the number of rows and columns of the target data and a canvas requested from the memory according to the number of columns of the target data and the display list style of the screen; wherein: The number of rows of the linked list data structure is equal to the number of rows of the target data, the number of cells in each row is equal to the number of columns of the target data, and each row is a row node, and two adjacent row nodes are bidirectionally linked; each row includes multiple cell nodes, and two adjacent cell nodes in each row are bidirectionally linked; The row height of each row in the canvas is equal to the row height pixel of the display list, and the column width of each column in the canvas is equal to the column width pixel of the display list; the width of the canvas is equal to the number of columns of the target data multiplied by the column width pixel of the display list, and the height of the canvas is at least equal to the pixel height of the display list.

4. The method according to claim 3, characterized in that Storing the target data in the data storage structure comprises: Obtain target data from the application layer, and store each row of target data into a row node corresponding to the linked list data structure in sequence starting from the start position of the linked list data structure in accordance with the row order of the target data, and store each column of data of each row of target data into a cell node corresponding to the row node in accordance with the column order of the target data; According to the received target data opening request, the canvas target data is drawn to the canvas from the starting position of the linked list data structure to complete the initialization of the canvas target data, and the current linked list reading position is recorded; Read a frame of data from the start position of the canvas and copy it to FrameBuffer, refresh the display list on the screen and record the current canvas reading position; wherein; the current canvas reading position includes the row information and column information read by the current canvas.

5. The method according to claim 4, characterized in that According to the received target data opening request, the canvas target data is initialized by drawing the data to the canvas from the starting position of the linked list data structure, and the current linked list reading position is recorded, specifically: According to the received target data opening request, the data of each row node is read in sequence from the starting position of the linked list data structure, and the data in each cell node of the read row node is filled and drawn from the starting position of the canvas to the corresponding pixel coordinate position of the canvas, the initialization of the canvas target data is completed, and the current linked list reading position of the linked list data structure is recorded; wherein the data in each cell node of the read row node includes text information and picture information; Filling and drawing the text information to the corresponding pixel coordinate position of the canvas is to read the font information from the corresponding font library according to the set font, calculate the pixel coordinate position in the canvas, and fill the corresponding pixel coordinate position one by one in the canvas memory in the form of pixel points; Drawing the image information to the corresponding pixel coordinate position of the canvas is to read the image storage path information from the cell, open the image file, obtain the BMP bitmap data, and fill it in the corresponding pixel coordinate position of the canvas.

6. The method according to claim 4, characterized in that The step of calculating the second row number and the second column number of the click position in the data storage structure according to the current read position, the first row number and the first column number of the data storage structure comprises: Get the current read position according to the current canvas read position and the number of rows and columns in the display list; The row number and column number of the click position in the canvas are obtained according to the current read position, the first row number and the first column number, and are used as the second row number and the second column number respectively.

7. The method according to claim 3, characterized in that The canvas includes multiple sub-canvases, and a starting sub-canvas and a preset sub-canvas sequence are set. The multiple sub-canvases are used cyclically and alternately according to the preset canvas sequence; each sub-canvas is provided with a sub-canvas sequence number, wherein the sub-canvas sequence number is used to mark the sub-canvas as the nth canvas for drawing target data onto the canvas starting from the starting position of the linked list data structure.

8. The method according to claim 7, characterized in that The corresponding processing of the data in the rectangular area of ​​the data storage structure according to the data processing request, the second number of rows and the second number of columns includes: According to the sequence number of the current sub-canvas and the number of rows of each sub-canvas, the total number of rows of the target data that has been drawn to the canvas from the starting position of the linked list data structure except the current sub-canvas is calculated; According to the total number of drawn rows and the second row number of the rectangular area in the current sub-canvas, calculate the row node corresponding to the second row number in the linked list data structure; According to the row node corresponding to the second row number and the second column number on the linked list data structure, determine the corresponding area of ​​the data selected by the click event in the linked list data structure, and respond to the data in the corresponding area of ​​the linked list data structure according to the data processing request; In addition to being used by other APPs, after processing the data on the linked list data structure, the latest data is obtained from the corresponding area of ​​the linked list data structure according to the sequence number, the second row number, and the second column number of the current sub-canvas, and redrawn in the rectangular area corresponding to the current sub-canvas.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-8 when executing the program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Report data output method, device, apparatus and storage medium

    CN109508352A

  • Interaction control method and device, equipment and storage medium

    CN119271102A