[go: up one dir, main page]

CN114265539A - Data display method, computing device and readable storage medium - Google Patents

Data display method, computing device and readable storage medium Download PDF

Info

Publication number
CN114265539A
CN114265539A CN202111582285.0A CN202111582285A CN114265539A CN 114265539 A CN114265539 A CN 114265539A CN 202111582285 A CN202111582285 A CN 202111582285A CN 114265539 A CN114265539 A CN 114265539A
Authority
CN
China
Prior art keywords
key
value
read element
value pair
abscissa
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111582285.0A
Other languages
Chinese (zh)
Other versions
CN114265539B (en
Inventor
卢桢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202111582285.0A priority Critical patent/CN114265539B/en
Publication of CN114265539A publication Critical patent/CN114265539A/en
Application granted granted Critical
Publication of CN114265539B publication Critical patent/CN114265539B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data display method, a computing device and a readable storage medium, wherein the method comprises the following steps: displaying elements in the structured data on a display interface; responding to the operation of adjusting the displayed elements on the display interface, and acquiring the coordinates, the original content and the adjusted content of the displayed elements; updating the corresponding original content in the structured data into the adjusted content; and updating the adjusted content corresponding to the displayed element coordinates in the display interface. According to the method and the device, the key value pair content can be directly adjusted in the display interface without being modified in the data file, so that the data modification efficiency is improved, the content of the display interface is updated in real time according to the adjusted data, and the flexibility and the convenience of data modification are improved.

Description

Data display method, computing device and readable storage medium
This application is a divisional application of the invention patent application 2021111792146 filed on 10/11/2021.
Technical Field
The present invention relates to the field of computers, and in particular, to a data display method, a computing device, and a readable storage medium.
Background
Currently, most applications require the display of some information, such as shortcut keys, configuration data, etc., which is typically in the form of key-value pairs. In the prior art, the key value pair display method is as follows: the method includes the steps that firstly, data files needing to be displayed are loaded and analyzed, different types of fields are obtained, fonts with preset sizes, preset color values or preset intervals among the fields are distributed according to the field types, and the content is displayed in a left-to-right sequence. However, the existing method can only modify the content of the key value pair in the data file, and the modification efficiency is low.
Therefore, a new data display method is needed to solve the above problems.
Disclosure of Invention
To this end, the present invention provides a data display method, a computing device and a readable storage medium in an attempt to solve or at least alleviate the problems presented above.
A data display method adapted to be executed in a computing device, the method comprising: displaying element structured data in the structured data on a display interface; responding to the operation of adjusting the displayed elements on the display interface, and acquiring the coordinates, the original content and the adjusted content of the displayed elements; updating the corresponding original content in the structured data into the adjusted content; and updating the adjusted content corresponding to the displayed element coordinates in the display interface.
Optionally, the elements in the structured data include key-value pair set names and key-value pair entries, and the structured data is obtained by: acquiring a key value pair set name in original display data; determining a height pixel value, a key, a character length of the key, a key value and a character length of the key value of each key value pair in each key value pair set as a key value pair item; and converting the key-value pair set name and the key-value pair item into an array in a preset format to obtain structured data.
Optionally, the method further comprises the steps of: reading elements from the structured data, wherein the read elements are key-value pair entries or key-value pair set names; determining the ordinate of the read element according to the information of the read element and preset layout parameters, and storing the read element and the ordinate into an ordinate container in an associated manner; and determining the abscissa of the read element according to the information of the read element and preset layout parameters, and storing the read element and the abscissa thereof into an abscissa container in an associated manner.
Optionally, the preset layout parameters include an initial ordinate, an interval pixel value between adjacent row elements, and an interval pixel value between an abscissa axis and an upper boundary of the canvas, and the step of determining the ordinate of the read element according to the information of the read element and the preset layout parameters includes: judging whether the read element is the first element of each column, if so, taking the ordinate of the read element as the initial ordinate; if not, when the read element is a key value pair array, the corresponding key and the ordinate of the key value are the same, and the ordinate of the read element is determined according to the following formula:
Y=startY+L[X]+S1-Z
where Y is the ordinate of the read element, startY is the initial ordinate, L [ X ] is the pixel height value of the read element, S1 is the interval pixel value between adjacent rows of elements, and Z is the interval pixel value between the abscissa axis and the upper boundary of the canvas.
Optionally, when the read element is a key-value pair set name, the method further includes the steps of:
judging whether the read element is the last element of each column, if so, taking the ordinate of the read element as the initial ordinate; if not, determining the vertical coordinate of the read element according to the following formula:
Y=startY+L[X]+S1-Z。
optionally, the spacing pixel value between adjacent row elements includes a spacing pixel value of a read element and an adjacent next row element, and a spacing pixel value of a read element and an adjacent previous row element.
Optionally, the preset layout parameters further include an initial abscissa and an interval pixel value between adjacent columns, and the step of determining the abscissa of the read element according to the preset layout parameters includes: judging whether the read elements are positioned at the initial abscissa, if so, taking the abscissa of the read elements as the initial abscissa;
if not, determining the abscissa of the read element according to the following formula:
Xt=X(t-1)+X(t-1).width+S2
where Xt is the abscissa of the read element, X (t-1) is the abscissa of the element in the column adjacent to said read element, X (t-1) width is the maximum pixel width value of the element in the column adjacent to the read element, and S2 is the spacing pixel value between adjacent columns.
Optionally, when the read element is an entry of a key-value pair, the space pixel values between adjacent columns include space pixel values between columns of adjacent keys and columns of key values, space pixel values between columns of adjacent key values and columns of keys.
Optionally, the step of displaying each element in the structured data on the display interface includes: acquiring a vertical coordinate associated with the read element from a vertical coordinate container; reading the abscissa corresponding to the read element from the abscissa container; and drawing the content of the read element at the same position of the abscissa and the ordinate of the read element in the canvas so as to display the read element on the display window.
Optionally, when the read element is a key-value pair entry, the displayed content of the read element includes a key and a key value, and the method further includes the steps of: allocating a grid area for a group of keys and key values in a display window; and drawing colors for each grid area according to a preset rule, wherein the preset rule is used for drawing different colors for adjacent grid areas.
Optionally, the step of drawing the color for each grid region according to the preset rule includes: determining a column number and a row number of each grid area; and judging whether the parity of the column number and the parity of the row number of each grid area are the same, if so, drawing a first color for the current grid area, and if not, drawing a second color for the current grid area.
Optionally, the step of acquiring the coordinates of the displayed element and the adjusted content in response to the operation of adjusting the displayed element on the display interface includes: and responding to the operation of adjusting the content of the grid area in the display window, and acquiring the coordinates of the displayed elements and the adjusted content.
Optionally, the operation of adjusting the content of the grid area comprises a revocation operation, and the method further comprises the steps of: responding to the operation of adjusting the grid area content and generating an operation event; storing the operation event into an event container; responding to the undo operation, acquiring the latest operation event from the event container, and obtaining the original content of the grid area corresponding to the operation event; updating the content corresponding to the latest operation event in the structured data into the original content; and updating the content of the grid area corresponding to the latest operation event into the original content.
Optionally, the operation of adjusting the contents of the grid area further includes an operation of exchanging the contents of the two grid areas, an operation of modifying the contents of the grid area, and an operation of deleting the contents of the grid area.
According to yet another aspect of the invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method as described above.
According to yet another aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described above.
The data display method comprises the following steps: displaying the elements in the structured data on the display interface, responding to the operation of adjusting the displayed elements on the display interface, acquiring the coordinates and the adjusted content of the displayed elements, updating the corresponding content in the structured data into the adjusted content, and updating the content corresponding to the coordinates of the displayed elements in the display interface into the adjusted content. According to the invention, the key value pair content can be directly adjusted in the display interface without modifying in the data file, so that the data modification efficiency is improved, the content of the display interface is updated in real time according to the adjusted data, and the flexibility and the convenience of data modification are improved.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a block diagram of a computing device 100, according to one embodiment of the invention;
FIG. 2 illustrates a flow diagram of a data display method 200 according to one embodiment of the invention;
FIG. 3 shows a schematic diagram of layout parameters according to one embodiment of the invention;
FIG. 4 illustrates a flow diagram of a method 400 of determining coordinates of elements in structured data according to one embodiment of the invention;
FIG. 5 shows a schematic diagram of a display interface according to one embodiment of the invention;
FIG. 6 illustrates a numbered schematic of a grid area according to one embodiment of the invention;
FIG. 7 shows a schematic diagram of a display interface according to another embodiment of the invention;
FIG. 8 shows a schematic diagram of a display interface according to yet another embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The key value pair storage is the simplest organization form of the database, and the key value pair comprises a key and a key value, the key is the identifier of the stored key value, and the key value is the stored data, for example, in a shortcut key, the key: exit, value: esc (Esc is a shortcut key for exit). Currently, most applications require the display of some information, such as shortcut keys, configuration data, etc., which is typically in the form of key-value pairs.
In the prior art, a display method of key value pairs is as follows: the method comprises the steps of loading and analyzing a data file to be displayed, obtaining fields of different types, distributing fonts of preset sizes, preset color values or preset intervals among the fields according to the field types, and displaying contents in a left-to-right sequence.
To this end, the invention proposes a data display method, which is executed in a computing device. FIG. 1 shows a block diagram of a computing device 100, according to one embodiment of the invention. A block diagram of a computing device 100 As shown in FIG. 1, in a basic configuration 102, the computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a Digital Signal Processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a level one cache 110 and a level two cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 may be arranged to operate with program data 124 on an operating system. Program data 124 includes instructions, and in computing device 100 according to the present invention, program data 124 includes instructions for performing data display method 200 and method 400 of determining coordinates of elements in structured data.
The computing device 100 also includes a storage device 132, the storage device 132 including removable storage 136 and non-removable storage 138, the removable storage 136 and the non-removable storage 138 each connected to the storage interface bus 134. In the present invention, the data related to each event occurring during the program execution process and the time information indicating the occurrence of each event may be stored in the storage device 132, and the operating system 120 is adapted to manage the storage device 132. The storage device 132 may be a magnetic disk.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus/interface controller 130. The example output device 142 includes an image processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communications with one or more other computing devices 162 over a network communication link via one or more communication ports 164.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a server, such as a file server, a database server, an application server, a WEB server, etc., or as part of a small-form factor portable (or mobile) electronic device, such as a cellular telephone, a Personal Digital Assistant (PDA), a personal media player device, a wireless WEB-watch device, a personal headset device, an application specific device, or a hybrid device that include any of the above functions. Computing device 100 may also be implemented as a personal computer including both desktop and notebook computer configurations. In some embodiments, the computing device 100 is configured to perform a data display method 200 and a method 400 of determining coordinates of elements in structured data in accordance with the present invention.
FIG. 2 illustrates a flow diagram of a data display method 200, according to one embodiment of the invention, the method 200 being suitable for execution in a computing device (e.g., the computing device 100 shown in FIG. 1). As shown in fig. 2, the method 200 includes steps S210 to S270, and the method 200 starts with step S210, and in step S210, original display data is obtained, where the original display data is data in the form of key value pairs, the original display data includes one or more key value pair sets, and each key value pair set includes one or more key value pairs.
The original display data may be any data stored in a key-value pair form, which is not limited in the present invention, for example, shortcut key data, configuration data, and the like. Here, the original display data will be described by taking shortcut key data as an example. Two key-value pair sets included in shortcut key data are listed below, the names of the two key-value pair sets are respectively start/capture and quit/save, and the start/capture key-value pair set includes five key-value pairs, which are respectively: quickly starting a screenshot-Ctrl + Alt + A, a screenshot-Alt + PrintScreen of a window where a cursor is located, delaying for 5 seconds to capture the screenshot-Ctrl + PrintScreen, acquiring a full screen-PrintScreen, and copying the full screen-PrintScreen to a pasting board-Ctrl + C. The exit/save key-value pair set comprises two key-value pairs, which are respectively: withdraw-Esc, save-Ctrl + S. Of course, the set of key-value pairs listed above is only a portion of the shortcut key data.
After the original display data is acquired, step S220 is executed to preprocess the original display data to obtain structured data in order to facilitate subsequent data reading operations. Specifically, the Name of a key-Value pair set in original display data is obtained, the character length (Name length) of the Name of the key-Value pair set, the Height pixel Value (Height1), the Height pixel Value (Height2) of each key-Value pair in the key-Value pair set, the character length (ItemName length) of the key, and the character length (Value length) of the key Value are determined, where it is to be noted that Height2 is determined, that is, the Height pixel values of the key-Value pair middle key and the key Value are determined. The method comprises the steps of taking keys (ItemName), ItemName length, key values (Value), Value length and Height2 of key Value pairs as key Value pair entries, hereinafter referred to as entries for short, converting names and entries of key Value pair sets into arrays in a preset format, obtaining the arrays as structured data, and storing the structured data into a database in communication connection with computing equipment.
In one embodiment, the array in the preset format is an array in a json format, that is, the structured data is an array in a json format, the array includes an object, the object includes a plurality of attributes, the name of each attribute is the name of a set of key-value pairs, the value of each attribute is an array, the array includes a plurality of entries, and each entry is an object including a key of a key-value pair, a character length of the key, a key value, a character length of the key value, and a height pixel value of the key-value pair. The length of the character is the number of the character, and Height2 is the pixel size occupied by the Height of the character in the key value pair.
Taking the original display data as the shortcut key data (assuming that the shortcut key data only includes two key Value pair sets of start/screenshot, exit/save) as an example, where Height2, ItemName length, and Value length of a key Value pair are not indicated, the obtained structured data, that is, the json format array is:
Figure BDA0003427401990000081
Figure BDA0003427401990000091
in addition, the pixel width Value (Mwidth) of each key-Value pair set Name, the pixel width Value (nWidth) occupied by the key of the key-Value pair, and the pixel width Value (vWidth) occupied by the key-Value pair are also calculated, assuming that the size of the pixel Value occupied by a single character is F, the Mwidth is the product of Name length and F, the nWidth of the key-Value pair is the product of ItemName length and F, and the vWidth is the product of Value length and F, and the key-Value pair set Name and the corresponding Mwidth are stored in association, the key and the corresponding nWidth are stored in association, the key Value and the corresponding vwidtgu are stored in association according to the actual application scene. F may be set according to an actual application scenario, which is not limited in the present invention. In an embodiment, Height2 is denoted as F, and Height1 is larger than F in order to better distinguish the key-value pair set name from the key and the key value, and the specific value may be set according to an actual application scenario, which is not limited in the present invention.
For example, the key-value pair set name starts/captures, and the keys of five key-value pairs included in the key-value pair set (respectively: quick start capture, capture of window where cursor is located, capture of screen delayed for 5 seconds, acquisition of full screen, and copying to paste board), the character lengths are respectively: 5. 6, 8, 6, 4, 6, mWidth and nWidth are respectively as follows: 5F, 6F, 8F, 6F, 4F, 6F. The key values of the five key-value pairs included in the start/screenshot key-value pair set (Ctrl + Alt + A, Alt + PrintScreen, Ctrl + PrintScreen, Ctrl + C, respectively) have the character lengths: 10. 15, 16, 11, 6, vWidth are respectively: 10F, 15F, 16F, 11F, 6F. The name of the key-value pair set is withdrawn/stored, and the character lengths of the keys (respectively: withdrawn and stored) of two key-value pairs in the key-value pair set are respectively: 5. 2, mWidth and nWidth are respectively as follows: 5F, 2F. The character lengths of the key values (Esc, Ctrl + S, respectively) of the two key-value pairs in the exit/save key-value pair set are respectively: 3. 6, vWidth is respectively as follows: 3F and 6F.
After preprocessing the original display data to obtain structured data, continuing to execute step S230, and determining coordinates of each element in the structured data, where the name of the key-value pair set in the structured data and any entry mentioned above can be understood as an element, and further, the key and the key value of the key-value pair in the entry can be understood as an element.
In one embodiment, the invention performs the layout according to the following rules: keys and key values of the key value pairs are arranged in different columns, keys of all the key value pairs in the key value pair set are arranged in the same column, key values of all the key value pairs in the key value pair set are arranged in the same column, the keys and the key values of the key value pairs are positioned in the same row, and the keys of the key value pairs and the key value columns are adjacent. The key-value pair set name and the keys of all the key-value pairs it contains are displayed in the same column and the keys are displayed after the key-value pair set name. If the remaining pixel height values of the current column are smaller than the sum of the key-value pair set name to be displayed and the pixel height values of the keys of all the key-value pairs included in the key-value pair set name, the key-value pair set name and the keys of all the key-value pairs included in the key-value pair set name are displayed in the next column, and the first element of each column is the key-value pair set name.
As can be seen from the above, the keys and the key values of the key value pairs are displayed in different columns, and the abscissa of the elements in the same column is the same, so that the abscissa of all the elements in the column can be obtained by calculating the abscissa of one element in the same column. In addition, the keys and the key values of the key value pairs are in the same row, that is, the vertical coordinates of the keys and the key values of the key value pairs are the same, so that when the vertical coordinates of the keys and the key values of the key value pairs are calculated, the vertical coordinates of the key values can be obtained only by calculating the vertical coordinates of the keys of the key value pairs, or the vertical coordinates of the keys can be obtained only by calculating the vertical coordinates of the key values of the key value pairs.
Some layout parameters are preset in the present invention, as shown in fig. 3, the preset layout parameters may include an initial ordinate start y, an initial abscissa start X, an interval pixel value S1 between adjacent row elements, an interval pixel value Z between an abscissa axis and an upper boundary of a canvas, an interval pixel value S2 between adjacent columns, an initial value of an abscissa X (t-1) of an element in a column adjacent to a read element, and an initial value of a maximum pixel width value X (t-1) of an element in a column adjacent to the read element.
Wherein, the initial ordinate startY and the initial abscissa startX are both 0, and S1 includes: the key-value pair set name and the interval pixel value M of the next adjacent row of keys, the key-value pair set name and the interval pixel value V of the previous adjacent row of keys, and the key and the interval pixel value B of the next adjacent row of keys. S2 includes a space pixel value W between a column of adjacent keys and a column of key values, and a space pixel value K between a column of adjacent key values and a column of keys. When the read element is the first column element, the initial value of X (t-1) width is 0, and the initial value of X (t-1) is 0. Each parameter value in the preset parameters may be set according to an actual application scenario, which is not limited in the present invention.
Step S230 is described in detail below according to the layout rule and the preset layout parameters.
Fig. 4 shows a flowchart of a method 400 of determining coordinates of elements in structured data according to an embodiment of the invention, and fig. 4 includes steps S2301-S2303, and in step S2301, an element is read from the structured data. It should be noted that the read element may be a key-Value pair set Name, and then the information of the element is the Name, Height1, and Name length of the key-Value pair set, and the read element may also be an entry, and then the information of the element is the content included in the entry, that is, the information of the element includes ItemName, ItemName length, Value length, and Height 2. When the read element is an entry, it is equivalent to the read element being a key and key value of a key-value pair.
Step S2302 is then executed to determine the ordinate of the read element, and store the read element and the ordinate association thereof in the ordinate container. Specifically, it is determined whether the read element is the first element of each column, and if so, the ordinate of the read element is startY, that is, the ordinate of the read element is 0. If not, when the read element is an entry, the ordinate of the key and the ordinate of the key value in the entry are the same, and the ordinate of the read element (key and key value) is determined according to the following formula:
Y=startY+L[X]+S1-Z (1)
wherein, Y is the ordinate of the read element, L [ X ] is the pixel Height value of the read element, L [ X ] ═ L [ X-1] + Height + S1, wherein L [ X-1] is the pixel Height value of the adjacent previous row element, Height includes Height1 and Height2, let L [0] ═ Z + Height, that is, the pixel Height value of the first element in each column is Z + Height, and store L [0] in the pixel Height value container.
And when the read element is the key-value pair set name, judging whether the read element is the last element of each column, if so, taking the ordinate of the read element as the initial ordinate, namely, if the last element in one column is the key-value pair set name, storing the key-value pair set name to the first row of the next column, namely, laying out the key-value pair set name and keys of all key-value pairs included in the key-value pair set name into the new column. If the read key-value pair set name is not the last element of each column, judging whether the height value of the remaining pixels of the canvas in the current column is larger than or equal to the height value of the pixels required for displaying the key-value pair set name and all the key-value pairs in the key-value pair set, if so, calculating the ordinate of each element according to the format (1), otherwise, laying out the read key-value pair set name, all the keys and the key-value pairs in the key-value pair set in the next column, wherein the read key-value pair set name is still the first element of the current column at the moment, namely, the ordinate of the read element is the initial ordinate 0.
An example of calculating the ordinate of a read element is given below using shortcut key data as an example:
for example, if the currently read element is a key-value pair set name launch/screenshot, then the information of the launch/screenshot key-value pair set includes a name launch/screenshot, Height1, and it is the first element in the first column, then its ordinate is 0, L [0] ═ Z + Height1, the launch/screenshot and its ordinate 0 are stored in an ordinate container in association, and L [0] ═ Z + Height1 of the launch/screenshot is stored in a pixel Height value container.
Then, reading an entry of a first key-value pair of the start/screenshot key-value pair set, determining that a key, a key value, and a Height pixel value of a currently read element are respectively a quick start screenshot, Ctrl + Alt + A, Height2 according to information of the entry, laying out the key-quick start screenshot and the key-value pair set name start/screenshot in a column, and after the key is started/screenshot in the key-value pair set name, then S1 at this time is M, Height, which is Height 2. The ordinate Y ═ startY + L [1] + M-Z, L [1] + Height2+ M, L [0] ═ Z + Height1 for the key-quick start screenshot, then L [1] ═ Z + Height1+ Height2+ M for the key-quick start screenshot, so Y ═ 0+ Z + Height1+ Height2+ M-Z, i.e. Y ═ Height1+ Height2+2M, stores the key-quick start screenshot and its ordinate Y ═ Height1+ Height2+2M association into the ordinate container, and stores L [1] ═ Z + Height1+ Height2+ Height for the key-quick start/screenshot into the pixel Height value.
Since the key value-Ctrl + Alt + a is located in the same row as the key-quick-start screenshot, that is, the key value-Ctrl + Alt + a is identical to Y and L [ X ] of the key-quick-start screenshot, Y, L [1] of the key value-Ctrl + Alt + a located in the same row as the key-quick-start screenshot is Y-Height 1+ Height2+2M, L [1] ═ Z + Height1+ Height2+ M, the key value-Ctrl + Alt + a and its ordinate Y-Height 1+ Height2+2M are stored in the ordinate container in association, and L [1] ═ Z + Height1+ Height2+ M of the key value-Ctrl + Alt + a are stored in the pixel Height value container.
Then, reading an entry of a second key-value pair of the startup/screenshot key-value pair set, determining that the key, the key value, and the Height pixel value of the current read element are respectively a window screenshot in which a cursor is located, Alt + PrintScreen, and Height2 according to information of the entry, laying out the window screenshot in which the key-cursor is located and the startup/screenshot of the key-value pair set name in a column, and locating in a next adjacent row of the key-quick startup screenshot, and then S1 at this time is B, Height which is Height 2. The ordinate Y ═ startY + L [2] + B-Z, L [2] + Height2+ B, where L [1] ═ Z + Height1+ Height2+ M, then L [2] ═ Z + Height1+2Height2+ M + B of the screenshot of the window where the key-cursor is located, so Y ═ Z + Height1+2Height2+ M + B-Z, i.e. Y ═ Height1+ Height2+ M +2B, associate the screenshot of the window where the key-cursor is located with its ordinate Y ═ Height1+ Height 4 + M +2B into the ordinate container, and store the screenshot of the window where the key-cursor is located with its ordinate Y ═ Height1+ Height 4 + M +2B + 1+ Height pixel in the screenshot of the window where the key-cursor is located.
Since the key value-Alt + PrintScreen is located in the same row as the screenshot of the window where the key-cursor is located, that is, the key value-Alt + PrintScreen is identical to Y and L [ X ] of the screenshot of the window where the key-cursor is located, Y, L [2] of the key value-Alt + PrintScreen is Y-Height 1+ Height2+ M +2B, L [2] ═ Z + Height1+2Height2+ M + B, the key value-Alt + PrintScreen and the ordinate Y thereof are Height1+ Height2+ M +2B are stored in the ordinate container in an associated manner, and L [2] ═ Z + Height1+2Height2+ M + B of the key value-Alt + PrintScreen is stored in the pixel Height value container.
And so on, until obtaining the key-of the last key-pair of the starting/screenshot key-pair set, copying the key-to the sticker board Y-Height 1+5Height2+ M +5B, L [5] ═ Z + Height1+5Height2+ M +4B, copying the key-to the sticker board and storing the ordinate Y-Height 1+5Height2+ M +5B in the ordinate container, and storing the key-to the sticker board L [5] - [ Z + Height1+5Height2+ M +4B in the pixel Height value container.
At this time, Y, L [5] of the key value Ctrl + C copied to the same row of the sticker sheet is Y-Height 1+5Height2+ M +5B, L [5] ═ Z + Height1+5Height2+ M +4B, the key value Ctrl + C and its ordinate Y-Height 1+5Height2+ M +5B are stored in association with each other in the ordinate container, and L [5] ═ Z + Height1+5Height2+ M +4B of the key value Ctrl + C is stored in the pixel Height value container.
After Y and L [ X ] of all key-value pairs of the starting/screenshot key-value pair set are obtained, the remaining pixel height value is obtained according to the difference between the pixel height value and L [5] of the canvas, and the name of the next key-value pair set is read to quit/store, wherein the key-value pair comprises two key-value pairs which are respectively: quitting-Esc, saving-Ctrl + S, according to Height2, Height1, S1, S2, determining the pixel Height value of the key-value pair set name quitting/saving, the keys of all the key-value pairs included in the key-value pair set name quitting/saving, if the pixel value is less than or equal to the remaining pixel Height value, calculating Y and L [ X ] of the keys and the key-value of all the key-value pairs included in the key-value pair quitting/saving by formula (1), wherein the calculation process is as described above and is not repeated here.
If the pixel value is greater than the remaining pixel height value, the exit/save key-value pair set is set in a new column, at this time, the name of the exit/save key-value pair set is the first element of the current column, that is, the ordinate of the exit/save key-value pair set name is 0, L [ X ] ═ L [0], and the calculation procedures of the key of the exit/save key-value pair set, Y and L [ X ] of the key value are as described above, and are not described herein again. The new column is a column adjacent to the key values of all the key values in the starting/screenshot key value pair set, namely the key value pair set name and the key are arranged in the third column, and the key value is arranged in the fourth column.
Finally, step S2303 is executed to determine the abscissa and ordinate of the read element, and store the read element and the abscissa association thereof in the abscissa container. Specifically, whether the read element is located at the initial abscissa is judged, if yes, the abscissa of the read element is the initial abscissa, and if not, the abscissa of the read element is determined according to the following formula:
Xt=X(t-1)+X(t-1).width+S2 (2)
where Xt is the abscissa of the element that has been read. Since the keys or key values of all key-value pairs included in the set of key-value pairs are laid out in the same column, the abscissa of the elements in the same column is the same. Therefore, the Xt of all the elements in the current column can be obtained only by calculating the Xt of any element in the current column.
An example of calculating the abscissa of the read element is given below by taking shortcut key data as an example:
first, the key-value pair set name, the abscissa of the key of all the key-value pairs it contains, is determined.
For example, if the currently read element is a key-value pair set name start/screenshot, the information of the start/screenshot key-value pair set includes the name start/screenshot, and it is the first row element of the first column, and its abscissa is StartX, that is, its abscissa is 0, store the start/screenshot and its abscissa 0 in an abscissa container in an associated manner, and find the mWidth corresponding to the start/screenshot. Since the abscissas of the elements in the same column are equal, and as can be seen from the layout rule described above, all keys of a set of key-value pairs and the names of the set of key-value pairs are laid out in the same column. Therefore, all the entries included in the startup/screenshot key value pair set are continuously read, the keys of five key value pairs included in the startup/screenshot key value pair set (respectively: quick startup screenshot, window screenshot where a cursor is located, screen capture delayed for 5 seconds, full screen capture, and copying to a sticky board) can be determined through the information of the entries, the abscissa of the five keys is 0, the name of the key value pair set and the abscissa X0 ═ 0 thereof are stored in an abscissa container in an associated manner, and the key of each key value pair in the key value pair set and the abscissa X0 ═ 0 thereof are stored in the abscissa container in an associated manner. And finding the mWidth of the starting/screenshot key-value pair set and the nWidth corresponding to the five keys which are included in the starting/screenshot key-value pair set as follows: 5F, 6F, 8F, 6F, 4F, 6F.
After mWidth, Xt of starting/screenshot, Xt of keys of all key-value pairs in a starting/screenshot key-value pair set and nWidth are obtained, calculating the height value of the remaining pixels of the canvas, wherein the calculation method is as described in the example of determining the vertical coordinate of each element, the description is omitted here, and the name of the next key-value pair set is read to exit/store, and the key-value pair set comprises two key-value pairs, which are respectively: quitting-Esc, saving-Ctrl + S, determining the sum of the pixel height values of the keys of all the key-value pairs included in the quitting/saving and quitting/saving key-value pair set, wherein the calculation method is as described in the example of determining the vertical coordinate of each element, and the description is omitted here.
And if the sum of the pixel height values of the keys of all the key-value pairs in the exit/storage and exit/storage key-value pair set is greater than the remaining pixel height value of the canvas, no other content is displayed in the first column at this time. Then, calculating X (0) width of the first column, wherein the mWidth of the determined starting/screenshot key value pair set and the nWidth corresponding to the five keys are respectively as follows: 5F, 6F, 8F, 6F, 4F, and 6F, it is found that the maximum value is 8F, and X (0) · width is 8F. And the keys of all the key value pairs included in the exit/storage and exit/storage key value pair sets are laid out in the third column, the key values of all the key value pairs included in the exit/storage key value pair sets are laid out in the fourth column, and the names of the key value pair sets and the abscissa of the keys are calculated according to the method, which is not repeated herein.
If the pixel height values of the keys of all the key-value pairs included in the exit/save and exit/save key-value pair set are less than or equal to the pixel height value of the rest of the canvas, then the keys of the two key-value pairs included in the exit/save and exit/save key-value pair set are both exited and saved in the first column, i.e. the abscissa of the exit/save and key-value pair is X0 ═ 0, the exit/save, key (exit, save) and the abscissa X0 ═ 0 are respectively stored in the abscissa container in an associated manner, and the mWidth and the nWidth of the exit/save and key (exit, save) are respectively: 5F, 2F.
And continuously calculating the residual pixel height value of the canvas, reading the name of the next key-value pair set, determining the pixel height values of the keys of all the key-value pairs included in the exit/storage and exit/storage key-value pair set, and if the pixel height value is greater than the residual pixel height value of the canvas, no other content is displayed in the first column at this time. Then, calculating X (0) width of the first column, and respectively calculating nWidth corresponding to start/screenshot, quit/save corresponding mWidth and 7 keys (respectively: quick start screenshot, screenshot of a window where a cursor is positioned, delayed 5 seconds screenshot, full screen acquisition, copying to a pasting board, quit and save): 5F, 6F, 8F, 6F, 4F, 6F, 2F, with the largest value being 8F, so X (0) width is 8F. At this time, the names of the currently read key-value pair sets, the keys of all the key-value pairs included in the currently read key-value pair sets are laid out in the third column, the key values of all the key-value pairs included in the currently read key-value pair sets are laid out in the fourth column, and the names of the key-value pair sets and the abscissa of the keys are calculated according to the above method, which is not described herein again.
Thereafter, the abscissa of the key values of all key-value pairs in the set of key-value pairs is determined.
And laying out the key values of the key value pairs in a second column, wherein the interval between the first column and the second column is the interval pixel value between the key column and the key value column, namely S2 is W, and determining the abscissa of the key values of all the key value pairs included in the starting/screenshot key value pair set. Reading all the entries included in the startup/screenshot key value pair set, determining the key values (Ctrl + Alt + A, Alt + PrintScreen, Ctrl + PrintScreen, PrintScreen + C, respectively) of the five key value pairs included in the startup/screenshot key value pair set according to the information of the entries, and determining the abscissa of one key value in the key value column similarly, i.e. determining the abscissa of all the elements in the column. The following is an example of determining the abscissa of the key value-Ctrl + Alt + a:
find nWidth corresponding to key value-Ctrl + Alt + A, where X0 is 0, the maximum pixel width value X (0) is 8F, X1 is X (0) + X (0) is width + W, i.e. X1 is 8F + W, then X1 of other key values Alt + PrintScreen, Ctrl + PrintScreen, Ctrl + C in the second column is 8F + W, and store the key values (Ctrl + Alt + A, Alt + PrintScreen, Ctrl + PrintScreen, Ctrl + C) and X1 is 8F + W into the abscissa container respectively. And finding out that the vWidth corresponding to the five key values is respectively as follows: 10F, 15F, 16F, 11F, 6F.
When the read second key-value pair set name is exited/saved, and the pixel height values of the keys of all the key-value pairs included in the key-value pair set are greater than the remaining pixel height value of the canvas, the second column does not store other key values, so that X (1) · width of the second column is the maximum value 16F of the vWidth corresponding to the five key values respectively, that is, X (1) · width · 16F.
When the read second key-value pair set name-exit/save, the pixel height values of the keys of all key-value pairs comprised by the key-value pair set are less than or equal to the remaining pixel height value of the canvas, then the key values (Esc, Ctrl + S) of the two key-value pairs comprised by the exit/save key-value pair set are also laid out in the second column, e.g., after the key value Ctrl + C. Since the abscissa of the same column of elements is the same, the abscissa of the key value (Esc, Ctrl + S) of two key value pairs included in the exit/save key value pair set is X1 — 8F + W, and the key value (Esc, Ctrl + S) and the abscissa thereof X1 — 8F + W are respectively stored in association with each other in the abscissa container. And finding out the vWidth respectively corresponding to the two key values as follows: 3F and 6F.
Then, when the currently read key-value pair set name and the pixel height values of the keys of all the key-value pairs included in the currently read key-value pair set name are determined to be larger than the remaining pixel height value of the canvas again, indicating that the second column does not display data any more, then X (1) width is calculated, and the vwidths corresponding to 7 key values (Ctrl + Alt + A, Alt + PrintScreen, Ctrl + PrintScreen, Ctrl + C, Esc, Ctrl + S, respectively) are respectively: 10F, 15F, 16F, 11F, 6F, 3F, 6F, the largest pixel width value among the 7 key values is 15F, i.e., X (1). width is 15F.
When the currently read key-value pair set name and the pixel height values of the keys of all the key-value pairs included in the currently read key-value pair set name are determined to be less than or equal to the remaining pixel height values of the canvas, the abscissa and the X (1) width of the key value are calculated continuously according to the above process, and the description is omitted here.
After determining the abscissa and the ordinate of the structured data, storing the solutions of the ordinate container, the abscissa container and the pixel height value container, wherein the storage modes can be set according to practical application scenarios.
After determining the abscissa and the ordinate of the structured data according to the steps S2301 to S2303, and storing the abscissa and the ordinate in the abscissa container, step S240 is executed to display the elements in the structured data on the display interface, where the elements included in the structured data are the key-value pair set name and the key-value pair entry respectively, and the entries include the key and the key value of the key-value pair, that is, the elements in the structured data are displayed to include the key-value pair set name and the key value of the key-value pair.
In one embodiment, step S240 includes: acquiring an ordinate associated with each element read in step S2301 from an ordinate container, acquiring an abscissa corresponding to each element read in step S2301 from an abscissa container, drawing the content of each read element in the canvas at the same position as the abscissa and the ordinate of each read element, and displaying the read elements on the display window, taking the shortcut key data (including all data of the shortcut key) described above as an example, the resulting display interface is shown in fig. 5.
In one embodiment, a grid area is allocated to a key value pair in a display window, a pixel height value of the grid area is a quotient of a remaining pixel height value of a canvas (after removing the pixel height value of the key value pair set name) and a column number of the key value pair, a pixel width value of the grid area is a quotient of a pixel width value of the canvas and a maximum pixel width value of each column of the key value pair, the pixel height value and the pixel width value of each grid area may be equal or unequal, and whether the pixel height value and the pixel width value of each grid area are equal or not is determined according to an actual application scene, where limitation is performed. After the size of the grid area is determined, the number (including column number-row number) of each grid area is determined according to the number of the row and column of the key value pair, whether the parity of the column number and the parity of the row number of each grid area are the same or not is judged, if the parity of the column number and the parity of the row number of each grid area are the same, a first color is drawn for the current grid area, and if the parity of the column number and the parity of the row number of each grid area are different, a second color is drawn for the current grid area, namely different colors are drawn for adjacent grid areas, wherein the drawing color for the grid areas can be drawing color on the frame of the grid areas, and the color can be filled in the grid areas.
For example, the key-value pair (5-1) in the first row and first column of FIG. 5 is numbered 0 (column number) -0 (row number), the key-value pair (5-2) in the second row and first column of FIG. 5 is numbered 0-1, and so on, the number of each key-value pair in the first column is determined, and continuing to determine the key-value pair (5-3) in the first row and second column of FIG. 5 is numbered 1-0, the key-value pair (5-4) in the second row and second column of FIG. 5 is numbered 1-1, and so on, the number of each grid region is determined. And judging whether the parity of the column number and the parity of the row number of each grid area are the same, if so, drawing blue color for the frame of the current grid area, and if not, drawing green color for the frame of the current grid area to obtain a schematic diagram of the number of the grid area shown in fig. 6. The grid area shown in fig. 6 is applied to the display interface shown in fig. 5, so that a schematic diagram of the display interface shown in fig. 7 is obtained.
According to the content, in the display interface, the grid region frames of the adjacent key value pairs display different colors, so that different key value pairs can be distinguished more visually, the visual effect is improved, and the user experience is improved.
Then, the user may adjust the content of each key value pair or the content of the key value pair set name on the display interface, respond to the operation of adjusting the displayed element on the display interface, execute step S250, obtain the coordinates, the original content, and the adjusted content of the displayed element, continue to execute step S260, update the original content corresponding to the structured data to the adjusted content, and finally execute step S270, update the content corresponding to the coordinates of the displayed element in the display interface to the adjusted content.
And if the user adjusts the content of the key on the display interface, the corresponding content in the structured data is the key of the key value pair. And if the user adjusts the content of the key value on the display interface, the corresponding content in the structured data is the key value of the key value pair. If the user adjusts the content of the key-value pair set name on the display interface, the corresponding content in the structured data is the key-value pair set name.
In one embodiment, when the adjusting operation is an operation of modifying the content of any grid region (i.e. an operation of modifying a key-value pair set name, a key of a key-value pair, or a key value), steps S250 to S270 include: the user only needs to perform double-click operation at the content to be modified, an input box is popped up in response to the double-click operation, the user can input and store the modified content in the input box, the coordinates, the original content and the adjusted content of the element corresponding to the current adjustment operation are obtained, an operation event is generated, the operation event comprises the coordinates, the original content and the adjusted content of the current operation element, the operation event is stored in an event container, the corresponding original content in the structured data is updated into the adjusted content, and the content corresponding to the displayed element coordinates in the display interface is updated into the adjusted content.
In one embodiment, when the adjustment operation is a revocation operation, steps S250 to S270 include: and responding to the undo operation, acquiring the latest operation event from the event container, acquiring the coordinates, the original content and the adjusted content of the current operation element from the operation event, updating the adjusted content in the structured data into the original content, and updating the content corresponding to the coordinates of the current operation element in the display interface into the original content.
In one embodiment, when the adjusting operation is an operation of deleting any content of the grid area (i.e. a key or key value operation of deleting any key-value pair set name or key-value pair), steps S250 to S270 include: the user can push and drag the selected key value pair to the hovering area by pressing the left mouse button to select the middle key value pair, and the selected key value pair can be displayed in the hovering area or not displayed, which is not limited by the invention. And acquiring the content of the selected key value pair as the original content. After the left mouse button is pressed for a preset time (for example, 2 seconds), a pre-deletion state is triggered, a deletable prompt box 8-1 pops up in the hovering area, the interface schematic diagram is shown in fig. 8, the interface in fig. 8 is a situation that the selected key value is not displayed in the hovering area, and at this time, the currently selected key value pair can be deleted by stopping pressing the left mouse button. Then, the corresponding original content in the structured data is deleted, and the coordinates of each element in the structured data are re-determined through the step S230, which is not described herein again, and the content of the display interface is updated.
In one embodiment, when the adjustment operation is an operation of exchanging any two mesh region contents (i.e., exchanging any two key-value pairs), steps S250 to S270 include: when exchanging the contents of the two key value pairs, the user firstly stops the mouse cursor in the target grid area, obtains the coordinates of the mouse cursor, obtains the row number of the target grid area according to the ratio of the abscissa of the mouse cursor to the pixel width value (the method for calculating the pixel width value of the grid area is as described above, and is not described here again), and obtains the column number of the target grid area according to the ratio of the ordinate of the mouse cursor to the pixel height value (the method for calculating the pixel height value of the grid area is as described above, and is not described here again), thereby obtaining the serial number of the target grid area. The user selects and drags the grid area of the key value pair to be exchanged through a mouse, when the dragging action is stopped, whether the grid area number where the grid area of the key value pair to be exchanged is located is the same as the target grid area number or not is judged, if yes, the key value pair to be exchanged is dragged to the target grid area, a third color is drawn in the target grid area, the third color is different from the first color and the second color, for example, the third color is red, the user is reminded of finishing the exchange, and the interactivity is improved. And drawing a third color in the target grid area, drawing a third color on a frame of the target grid area, and filling the third color in the grid area.
And acquiring coordinates and contents of the key value pairs to be exchanged and the key value pairs of the target grid area, updating the key value pairs corresponding to the coordinates of the key value pairs to be exchanged in the structured data to the key value pairs of the target grid area, updating the key value pairs corresponding to the coordinates of the key value pairs of the target grid area in the structured data to the key value pairs of the key value pairs to be exchanged, and updating the interface contents.
It should be noted that, each time the original display data needs to be displayed, steps S210 to S270 need to be executed. Then, when the content displayed on the interface is modified and exchanged, steps S250 to S270 are executed. When the content displayed on the interface is deleted, step S250 to step S260 are executed first, step S230 is executed, and step S270 is executed finally.
According to the data display method, the data content can be directly adjusted in the display interface without being modified in the data file, so that the data modification efficiency is improved, the content in the display interface is updated in real time according to the adjusted data, and the flexibility and the convenience of the data modification are improved. When the key value pair content is adjusted, interface prompt can also appear, and interactivity is improved, so that user experience is improved.
Secondly, the grid area where the adjacent key value pairs are located in the display interface displays different colors, so that each key value pair can be distinguished more visually, the visual effect is improved, and the user experience is improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the data display method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
It should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.

Claims (15)

1. A data display method, adapted to be executed in a computing device, the method comprising:
displaying elements in the structured data on a display interface, wherein the elements in the structured data comprise key-value pair set names and key-value pair entries;
responding to the operation of adjusting the displayed elements on the display interface, and acquiring the coordinates, the original content and the adjusted content of the displayed elements;
updating the corresponding original content in the structured data into the adjusted content;
updating the adjusted content of the content corresponding to the displayed element coordinate in the display interface;
reading elements from the structured data, wherein the read elements are the key-value pair entries or the key-value pair set names;
determining the ordinate of the read element according to the information of the read element and preset layout parameters, and storing the read element and the ordinate into an ordinate container in an associated manner;
and determining the abscissa of the read element according to the information of the read element and the preset layout parameters, and storing the read element and the abscissa thereof in an abscissa container in a correlation manner.
2. The method of claim 1, wherein the structured data is obtained by:
acquiring the key-value pair set name in the original display data;
determining a height pixel value, a key, a character length of the key, a key value and a character length of the key value of each key value pair in each key value pair set as a key value pair entry;
and converting the key-value pair set name and the key-value pair item into an array with a preset format to obtain the structured data.
3. The method of claim 1, wherein the preset layout parameters include an initial ordinate, an interval pixel value between adjacent row elements, an interval pixel value between an abscissa axis and an upper boundary of a canvas, and the step of determining the ordinate of the read element according to the information of the read element and the preset layout parameters includes:
judging whether the read element is the first element of each column, if so, taking the ordinate of the read element as the initial ordinate;
if not, when the read element is a key value pair array, the corresponding key and the ordinate of the key value are the same, and the ordinate of the read element is determined according to the following formula:
Y=startY+L[X]+S1-Z
wherein, Y is the ordinate of the read element, startY is the initial ordinate, L [ X ] is the pixel height value of the read element, S1 is the interval pixel value between adjacent rows of elements, and Z is the interval pixel value between the abscissa axis and the upper boundary of the canvas.
4. The method of claim 3, when the read element is a key-value pair set name, further comprising the steps of:
judging whether the read element is the last element of each column, if so, taking the ordinate of the read element as the initial ordinate;
if not, determining the vertical coordinate of the read element according to the following formula:
Y=startY+L[X]+S1-Z。
5. the method of claim 3 or 4, wherein the space pixel values between adjacent row elements comprise space pixel values of a read element and an adjacent next row element, and space pixel values of a read element and an adjacent previous row element.
6. The method of any one of claims 1 to 5, wherein the preset layout parameters further comprise an initial abscissa, an interval pixel value between adjacent columns, and the step of determining the abscissa of the read element according to the preset layout parameters comprises:
judging whether the read element is positioned at the initial abscissa or not, if so, taking the abscissa of the read element as the initial abscissa;
if not, determining the abscissa of the read element according to the following formula:
Xt=X(t-1)+X(t-1).width+S2
where Xt is the abscissa of the read element, X (t-1) is the abscissa of the element in the column adjacent to the read element, X (t-1) width is the maximum pixel width value of the element in the column adjacent to the read element, and S2 is the spacing pixel value between adjacent columns.
7. The method of claim 6, wherein when the read element is a key-value pair entry, the space pixel values between the adjacent columns include space pixel values between columns of adjacent keys and columns of key values, space pixel values between columns of adjacent key values and columns of keys.
8. The method of claim 1, wherein the step of displaying the elements in the structured data on the display interface comprises:
obtaining a vertical coordinate associated with the read element from the vertical coordinate container;
reading an abscissa corresponding to the read element from the abscissa container;
and drawing the content of the read element at the same position of the abscissa and the ordinate of the read element in the canvas so as to display the read element on a display window.
9. The method of claim 8, wherein when the read element is a key-value pair entry, the displayed contents of the read element include a key and a key value, the method further comprising the steps of:
allocating a grid area for a group of keys and key values in the display window;
and drawing colors for each grid area according to a preset rule, wherein the preset rule is used for drawing different colors for adjacent grid areas.
10. The method as claimed in claim 9, wherein the step of drawing the color for each mesh region according to the preset rule comprises:
determining a column number and a row number of each grid area;
and judging whether the parity of the column number and the parity of the row number of each grid area are the same, if so, drawing a first color for the current grid area, and if not, drawing a second color for the current grid area.
11. The method of claim 9 or 10, wherein the step of obtaining the coordinates and the adjusted content of the displayed element in response to the operation of adjusting the displayed element at the display interface comprises:
and responding to the operation of adjusting the grid area content in the display window, and acquiring the coordinates of the displayed elements and the adjusted content.
12. The method of claim 11, wherein the operation of adjusting the contents of the grid area comprises a undo operation, the method further comprising the steps of:
responding to the operation of adjusting the grid area content and generating an operation event;
storing the operational event into an event container;
responding to a revocation operation, and acquiring the latest operation event from the event container to obtain the original content of the grid area corresponding to the operation event;
updating the content corresponding to the latest operation event in the structured data into the original content;
and updating the content of the grid area corresponding to the latest operation event into the original content.
13. The method of claim 12, wherein the operation of adjusting the contents of a grid area further comprises the operations of exchanging the contents of two grid areas, modifying the contents of a grid area, deleting the contents of a grid area.
14. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-13.
15. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-13.
CN202111582285.0A 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium Active CN114265539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111582285.0A CN114265539B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111179214.6A CN113625930B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium
CN202111582285.0A CN114265539B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202111179214.6A Division CN113625930B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium

Publications (2)

Publication Number Publication Date
CN114265539A true CN114265539A (en) 2022-04-01
CN114265539B CN114265539B (en) 2023-07-07

Family

ID=78390819

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111582285.0A Active CN114265539B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium
CN202111179214.6A Active CN113625930B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202111179214.6A Active CN113625930B (en) 2021-10-11 2021-10-11 Data display method, computing device and readable storage medium

Country Status (1)

Country Link
CN (2) CN114265539B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923295B (en) * 2021-11-17 2023-04-07 Oppo广东移动通信有限公司 Voice control method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094608A1 (en) * 2005-10-26 2007-04-26 Microsoft Corporation Runtime modification of data presented in a graphical element
CN102929910A (en) * 2011-09-08 2013-02-13 微软公司 Visualization and editing of composite layouts
CN104978394A (en) * 2015-05-08 2015-10-14 安徽机电职业技术学院 Webpage tag data organization and update method for multi-language display
US20170235466A1 (en) * 2015-06-17 2017-08-17 NetSuite Inc. System and Method to Generate Interactive User Interface for Visualizing and Navigating Data or Information
CN109144656A (en) * 2018-09-17 2019-01-04 广州视源电子科技股份有限公司 Method, apparatus, computer device and storage medium for multi-element layout
CN109271075A (en) * 2018-09-06 2019-01-25 天津字节跳动科技有限公司 Page elements autoplacement method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1941860A (en) * 2005-09-30 2007-04-04 中兴通讯股份有限公司 Fast key system and realization for set-top box doamin
TW201011594A (en) * 2008-09-09 2010-03-16 gui-lin Zhong Method for defining hot keys of input apparatus
CN103870293B (en) * 2012-12-13 2019-05-31 联想(北京)有限公司 Information acquisition method, information display method and device and electronic equipment
CN103530343B (en) * 2013-10-08 2017-03-22 北京百度网讯科技有限公司 Structural data interactive system, data receiving terminal and structural data interactive method
CN108012174A (en) * 2017-12-20 2018-05-08 深圳创维-Rgb电子有限公司 Intelligent terminal shortcut customizing method, intelligent terminal and readable storage medium
CN110187874B (en) * 2019-05-13 2023-12-15 第四范式(北京)技术有限公司 Rule configuration method and device executed in computer equipment
CN112860157B (en) * 2019-11-12 2022-06-24 广州视源电子科技股份有限公司 Display element adjusting method, device, equipment and storage medium
CN111459298B (en) * 2020-03-30 2023-04-07 招商局金融科技有限公司 Shortcut key control method, electronic device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094608A1 (en) * 2005-10-26 2007-04-26 Microsoft Corporation Runtime modification of data presented in a graphical element
CN102929910A (en) * 2011-09-08 2013-02-13 微软公司 Visualization and editing of composite layouts
CN104978394A (en) * 2015-05-08 2015-10-14 安徽机电职业技术学院 Webpage tag data organization and update method for multi-language display
US20170235466A1 (en) * 2015-06-17 2017-08-17 NetSuite Inc. System and Method to Generate Interactive User Interface for Visualizing and Navigating Data or Information
CN109271075A (en) * 2018-09-06 2019-01-25 天津字节跳动科技有限公司 Page elements autoplacement method and device
CN109144656A (en) * 2018-09-17 2019-01-04 广州视源电子科技股份有限公司 Method, apparatus, computer device and storage medium for multi-element layout

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吕亮 等: "基于定制页面的二维态势数值可视化研究", 《系统仿真学报》, vol. 25, no. 8, pages 1886 - 1890 *

Also Published As

Publication number Publication date
CN113625930A (en) 2021-11-09
CN114265539B (en) 2023-07-07
CN113625930B (en) 2022-01-18

Similar Documents

Publication Publication Date Title
CN113849096B (en) Desktop display method and device and computing equipment
CN112015501A (en) Visual page generation method and device, computer equipment and storage medium
CN110232665B (en) Maximum pooling method, apparatus, computer equipment and storage medium
CN113010252B (en) Application page display method, electronic equipment and storage medium
WO2022242379A1 (en) Stroke-based rendering method and device, storage medium and terminal
CN111596911A (en) Method and device for generating control, computer equipment and storage medium
CN113625930B (en) Data display method, computing device and readable storage medium
CN108388463B (en) Icon processing method and device, computer equipment and storage medium
CN113504861A (en) Desktop management method and device and computing equipment
CN112099690A (en) Page scaling method, device, terminal and storage medium
CN110717891A (en) Picture detection method and device based on grouping batch and storage medium
US20020184261A1 (en) Process of inputting and outputting a display table derived from a worksheet and data storage media programmed to perform the same
CN111353111B (en) Image display method, computing device and readable storage medium
US11461874B2 (en) Graphics processing using matrices of transformations
WO2023241612A1 (en) File selection method and apparatus, electronic device, and readable storage medium
CN113721814B (en) Electronic book page display method, computing equipment and computer storage medium
US11922545B2 (en) Recording medium recording input program, input device, and input method
CN101996390A (en) Image copying method and device
CN112966484A (en) Chart typesetting method and device, electronic equipment and readable storage medium
CN113268189B (en) Atlas management method, device, storage medium and computer equipment
US20110074804A1 (en) Selection of a region
CN114924681B (en) A method for drawing a picture, a computing device and a readable storage medium
CN115686706B (en) Terminal view configuration method, device, computer equipment and storage medium
CN114237449A (en) Icon processing method, computing device and readable storage medium
CN119277142B (en) Barrage processing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant