CN109460496B - Method and device for realizing data display - Google Patents

Method and device for realizing data display Download PDF

Info

Publication number
CN109460496B
CN109460496B CN201811109063.5A CN201811109063A CN109460496B CN 109460496 B CN109460496 B CN 109460496B CN 201811109063 A CN201811109063 A CN 201811109063A CN 109460496 B CN109460496 B CN 109460496B
Authority
CN
China
Prior art keywords
value
data
display
difference
interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811109063.5A
Other languages
Chinese (zh)
Other versions
CN109460496A (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201811109063.5A priority Critical patent/CN109460496B/en
Publication of CN109460496A publication Critical patent/CN109460496A/en
Application granted granted Critical
Publication of CN109460496B publication Critical patent/CN109460496B/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/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses a method and a device for realizing data display, which specifically comprise the following steps: the method comprises the steps of firstly obtaining a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value of a display interval, determining an interval scaling ratio according to the data maximum value, the data minimum value, the display maximum value and the display minimum value, scaling a value of target data into a mapping value of the target data, wherein the mapping value of the target data can still reflect the size relationship among the data values on one hand, so that the display is visual, and on the other hand, the mapping value of the target data is in the set display interval, so that the problems that the mapping value of the target data is too small or too large and cannot be displayed are avoided, the data are displayed according to the mapping value of the target data, and the displayed data can be clearly displayed.

Description

Method and device for realizing data display
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for implementing data display.
Background
With the development of big data technology, data needs to be displayed on a terminal display device in many scenes, and data is usually displayed in a more intuitive manner, for example, contents such as data size and data distribution are displayed in a manner of a scatter diagram, a histogram, and the like. In the prior art, when a value of a certain data is large, the data is required to be reduced in order to adapt to the display size of the display device, and other data is required to be reduced in the same proportion.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for implementing data display, so as to solve the technical problem in the prior art that data cannot be clearly displayed due to scaling down of the data in the same scale.
In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
a method of enabling data display, the method comprising:
acquiring a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value of a display interval;
calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value as an interval scaling;
determining a mapping value of the target data according to the interval scaling, a value of the target data and an interval reference value, wherein the interval reference value is the display maximum value or the display minimum value, and the target data is data in the data set to be displayed;
and displaying the mapping value of the target data according to a predetermined display mode.
In a possible implementation manner, the determining a mapping value of the target data according to the interval scaling, a value of the target data, and an interval reference value includes:
calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value;
and calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
In a possible implementation manner, when the value of the target data is a non-negative number, the determining the mapping value of the target data according to the interval scaling, the value of the target data, and the interval reference value includes:
calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value;
and calculating the sum of the display minimum value and the second scaling difference value to obtain a mapping value of the target data.
In one possible implementation, if the data minimum is a non-positive number, before calculating the difference between the display maximum and the display minimum divided by the difference between the data maximum and the data minimum as the interval scaling, the method further comprises:
adding a translation value to all data in the data set to be displayed, updating all data in the data set to be displayed, re-acquiring a data maximum value and a data minimum value in the data set to be displayed, and calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value to serve as an interval scaling ratio and follow-up steps.
In one possible implementation, the display maximum value and the display minimum value are determined according to a display configuration of a display device.
In a possible implementation manner, after the mapping value of the target data is displayed according to a predetermined display manner, the method further includes:
and adding corresponding marks to the target data meeting the preset conditions for displaying.
An apparatus for enabling display of data, the apparatus comprising:
the acquisition unit is used for acquiring a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value of a display interval;
a calculation unit configured to calculate a difference between the display maximum value and the display minimum value divided by a difference between the data maximum value and the data minimum value as an interval scaling;
a determining unit, configured to determine a mapping value of the target data according to the interval scaling, a value of the target data, and an interval reference value, where the interval reference value is the display maximum value or the display minimum value, and the target data is data in the data set to be displayed;
and the display unit is used for displaying the mapping value of the target data according to a predetermined display mode.
In a possible implementation manner, the determining unit includes:
the first calculating subunit is used for calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value;
and the second calculating subunit is used for calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
In a possible implementation manner, when the value of the target data is a non-negative number, the determining unit includes:
the third calculation subunit is used for calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value;
and the fourth calculating subunit is configured to calculate a sum of the display minimum value and the second scaling difference value, so as to obtain a mapping value of the target data.
In one possible implementation manner, if the minimum value of the data is a non-positive number, the apparatus further includes:
and the updating unit is used for adding a translation value to all the data in the data set to be displayed before executing the calculating unit, updating all the data in the data set to be displayed, acquiring a maximum value and a minimum value of the data in the data set to be displayed again, and then executing the calculating unit and the subsequent units.
In one possible implementation, the display maximum value and the display minimum value are determined according to a display configuration of a display device.
In one possible implementation, the apparatus further includes:
and the adding unit is used for adding a corresponding mark to the target data meeting the preset condition for displaying after the display unit displays the target data.
A computer-readable storage medium, having stored therein instructions, which, when run on a terminal device, cause the terminal device to execute the above-mentioned method of implementing data display.
A computer program product, which, when running on a terminal device, causes the terminal device to execute the above-mentioned method of enabling data display.
Therefore, the embodiment of the application has the following beneficial effects:
according to the embodiment of the application, the data maximum value and the data minimum value in the data set to be displayed and the display maximum value and the display minimum value of the display interval are firstly obtained, the interval scaling proportion can be determined according to the data maximum value, the data minimum value, the display maximum value and the display minimum value, the value of the target data can be scaled into the mapping value of the target data, on one hand, the mapping value of the target data can still reflect the size relation between the data values, so that the display is visual, on the other hand, the mapping value of the target data is in the set display interval, the problem that the value of the mapping value of the target data is too small or too large and cannot be displayed is avoided, therefore, the data are displayed according to the mapping value of the target data, and the displayed data can be clearly displayed.
Drawings
Fig. 1 is a schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a method for implementing data display according to an embodiment of the present application;
fig. 3A is an exemplary diagram illustrating a display interval according to an embodiment of the present application;
fig. 3B is an exemplary diagram of another embodiment of a display interval provided in the present application;
FIG. 4 is a flowchart of a method for determining a target data mapping value according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of another method for determining a target data mapping value according to an embodiment of the present disclosure;
fig. 6 is a structural diagram of an apparatus for implementing data display according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
In order to facilitate understanding of the technical solutions of the present application, the background of the present application will be described below.
The inventor finds that in the traditional data display research, the traditional data display method is that the terminal displays the content such as the size and the distribution situation of the data on the display screen according to the acquired data characteristics, so that a user can intuitively observe the characteristics of the data. When the difference between the acquired data values is large, all the data needs to be reduced to be able to display the data on the display screen normally, which results in that the smaller data becomes smaller, so that the terminal cannot display or the display is blurred. In addition, in some scenarios, if there is a 0 value or a negative value in the data, the terminal cannot display the 0 value or the negative value.
Based on this, an embodiment of the present application provides a method and an apparatus for implementing data display, for a data set to be displayed, a data maximum value and a data minimum value in the data set and a display maximum value and a display minimum value that can be displayed by a terminal display device are obtained, an interval scaling is determined according to the data maximum value, the data minimum value, the display maximum value and the display minimum value, then each data in the data set is scaled to obtain a mapping value of the data, the mapping value of the data not only can embody a size relationship between the data values, so that a user can visually check the size of the data, but also the mapping value of the data is located in a display interval, thereby avoiding a problem that the terminal cannot display the data, displaying the data according to the mapping value of target data, and enabling the displayed data to be clearly displayed. In addition, the embodiment of the application can also translate all data in the data set, convert the data into positive numbers and display the positive numbers, so as to avoid the problem that 0 values or negative values cannot be displayed.
Referring to fig. 1, the figure is a schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application, where the method for implementing data display provided in the embodiment of the present application may be applied to a terminal 10.
In practical application, the terminal 10 may obtain a data set to be displayed from the server 20, obtain a data maximum value and a data minimum value in the data set, and a display maximum value and a display minimum value that can be displayed by the terminal 10, determine an interval scaling according to the data maximum value, the data minimum value, the display maximum value, and the display minimum value, then scale each data in the data set to obtain a mapping value of the data, and finally display the mapping value of each data on a display screen of the terminal 10, so that a user can visually view characteristics of the data in the data set through the display screen.
Those skilled in the art will appreciate that the block diagram shown in fig. 1 is only one example in which embodiments of the present application may be implemented. The scope of applicability of the embodiments of the present application is not limited in any way by this framework.
It should be noted that the terminal 10 in the embodiments of the present application may be any user equipment now known, developing or later developed that is capable of interacting with the server 20 via any form of wired and/or wireless connection (e.g., Wi-Fi, LAN, cellular, coaxial cable, etc.), including but not limited to: existing, developing, or future developing smartphones, non-smartphones, tablets, laptop personal computers, desktop personal computers, minicomputers, midrange computers, mainframe computers, and the like. It should also be noted that the server 20 in the embodiment of the present application may be an example of an existing, developing or future-developed device capable of providing an application service of information recommendation to a user, and the embodiment of the present application is not limited in this respect.
In order to facilitate understanding of the technical solutions of the present application, a method for implementing data display provided by the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, which is a flowchart of a method for implementing data display provided in an embodiment of the present application, as shown in fig. 2, the method may include:
s201: and acquiring a data maximum value and a data minimum value in the data set to be displayed and a display maximum value and a display minimum value in the display interval.
In this embodiment, the terminal display device first acquires a data set to be displayed, extracts a data maximum value and a data minimum value from the data set to be displayed, and acquires a display maximum value and a display minimum value of a display interval that the terminal display device can display.
The data set to be displayed can comprise a group of data to be displayed, the maximum value of the data refers to the maximum value of the data to be displayed in the data set to be displayed, and the minimum value of the data refers to the minimum value of the data to be displayed in the data set to be displayed; the display maximum value is a maximum value of data displayed in a display section for displaying, and may be, for example, a maximum value of data that can be displayed by the terminal display device itself, and the display minimum value is a minimum value of data displayed in a display section for displaying the minimum value.
In a specific implementation, the maximum and minimum display values of the display interval may be determined according to the display configuration of the terminal display device, that is, the maximum and minimum display values of the display interval may be configured according to the attribute of the terminal display device. For example, the maximum display value and the minimum display value of the display section may be determined according to the screen pixel size of the terminal display device, that is, there is a mapping relationship between the screen pixel size of the terminal display device and the display section, and the maximum display value and the minimum display value of the display section may be obtained through the mapping relationship according to the screen pixel size, and the mapping relationship may be preset according to an actual application situation.
In practical application, when the maximum value of the data to be displayed is larger than the maximum value of the display interval, the data may not be displayed on the terminal display device; or when the minimum value of the data to be displayed is smaller than the minimum value of the display interval, the data can be displayed unclear and the user experience is influenced, so that the data to be displayed needs to be processed to avoid the situation that the data to be displayed cannot be displayed normally, the processed data to be displayed is located in the display interval, the data can be displayed on the terminal display equipment, and the size of the data can be reflected visually.
For example, if the maximum size of the screen pixel of the terminal display device is 1366 × 768, the maximum display value of the display interval mapped according to the preset relationship is 1000, and in order to enable the data to be displayed clearly, the minimum display value of the display interval mapped according to the preset relationship is 100, that is, the data interval that can be displayed clearly by the terminal display device is [100,1000], and when the data that is not located in the interval is displayed, the data may not be displayed clearly.
In order to facilitate understanding of the maximum display value and the minimum display value of the display interval, referring to the bar graph shown in fig. 3A, the minimum display value that can be displayed on a certain terminal display device of the bar graph is 100, and the maximum display value is 1000, when the data to be displayed is greater than 1000, the top end of the bar graph exceeds the screen, and the display effect is affected; when the data to be displayed is less than 100, the drawn bar graph is very small, which affects the intuitiveness of the user in checking the size of the data, so that the data to be displayed can be normally displayed in the terminal display device, the data to be displayed needs to be processed, and the processed data to be displayed can be normally displayed.
For another example, referring to the scatter plot shown in fig. 3B, the size of the data may be represented by the size of the scatter itself, e.g., the maximum scatter represents a display maximum 1000 and the minimum scatter represents a display minimum 100 in the plot. The data maximum value of the data to be displayed can be converted into the display maximum value which can be displayed by the scatter diagram, the maximum scatter point of the scatter diagram is used for identifying the data maximum value, and the influence on the display of other data to be displayed due to the fact that the scatter point corresponding to the data value is large due to the fact that the data value of the data to be displayed is large is avoided. S202: and calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value to be used as interval scaling.
In this embodiment, the interval scaling is calculated according to the obtained display maximum value, display minimum value, data maximum value, and data minimum value, and the specific operation is that the display maximum value and the display minimum value are differentiated to obtain a first difference value, the data maximum value and the data minimum value are differentiated to obtain a second difference value, and the first difference value is divided by the second difference value to obtain the interval scaling.
For example, the maximum value of the data in the data set to be displayed is 10000, the minimum value is 0, the display maximum value of the display interval is 1000, and the display minimum value is 100, then the interval scaling is 0.09.
In practical applications, the interval scaling can be obtained by using equation (1):
Figure BDA0001808623840000091
wherein, XmaxFor the display maximum value of the display section, XminFor the display minimum of the display interval, xmaxIs the maximum value of data, x, in the data set to be displayedminAnd k is the interval scaling ratio, and is the minimum value of data in the data set to be displayed. The interval scaling ratio can be used to scale the data to be displayed within the display interval, for example, according to the above example, the data to be displayed with the data value in the range of 0-10000 can be scaled within the range of 100 and 1000 of the display interval.
After a certain data set to be displayed is acquired, the interval scaling for the data set to be displayed can be calculated according to the formula.
S203: and determining a mapping value of the target data according to the interval scaling, the value of the target data and the interval reference value.
In this embodiment, after the interval scaling is obtained, the mapping value of the target data to be displayed is determined according to the interval scaling, the value of the target data to be displayed, and the interval reference value, where the mapping value is located between the maximum display value and the minimum display value of the display interval. The interval reference value is a display maximum value or a display minimum value, and the target data is any data to be displayed in the data set to be displayed.
A specific implementation manner of determining the mapping value of the target data according to the interval scaling, the value of the target data, and the interval reference value will be described in the following embodiments.
S204: and displaying the mapping value of the target data according to a predetermined display mode.
In this embodiment, after the mapping value of the target data is determined, the mapping value of the target data may be displayed according to a display mode predetermined by the terminal display device.
The predetermined display manner may be various, for example, a bar chart display, a scatter chart display, a pie chart display, and the like, and the display manner is not limited in this embodiment. In specific implementation, the display mode can be predetermined according to the characteristics of the data to be displayed.
In addition, when the terminal display device displays the mapping value of the target data according to the predetermined display mode, the terminal display device can also add a corresponding mark to the target data meeting the preset condition for display.
In practical application, when the mapping value of the target data is displayed, whether the target data meets the preset condition can be judged, if yes, a corresponding mark can be added when the mapping value of the target data is displayed, and therefore a user can know the characteristics of the target data more intuitively.
When the value of the target data meets the preset condition, a corresponding mark can be added when the mapping value of the target data is displayed; for example, the preset condition is that the value of the target data is data not greater than zero, and when the value of the target data is zero or negative, a corresponding mark may be added when the mapping value of the target data is displayed. The preset condition may be set according to an actual application, and the present embodiment does not limit the preset condition.
The corresponding mark may be set according to an actual application situation, for example, a color mark, a red mark may be added to target data not greater than zero, and a green mark may be added to target data greater than zero, so that a visual auxiliary means may be used to distinguish attributes of the target data, and the corresponding mark may also be a shape mark, a label mark, or the like.
Through the above description, in the embodiment of the application, the data maximum value and the data minimum value in the data set to be displayed and the display maximum value and the display minimum value in the display interval are firstly obtained, the interval scaling ratio can be determined according to the data maximum value, the data minimum value, the display maximum value and the display minimum value, then the value of the target data can be scaled into the mapping value of the target data, on one hand, the mapping value of the target data can still reflect the size relationship between the data values, so that the display is intuitive, on the other hand, the mapping value of the target data is within the set display interval, and the problem that the mapping value of the target data is too small or too large and cannot be displayed is avoided, so that the data is displayed according to the mapping value of the target data, and the displayed data can be clearly displayed.
For determining the mapping value of the target data according to the interval scaling, the value of the target data and the interval reference value, the embodiments of the present application provide two determination methods, which will be described below with reference to the accompanying drawings.
Referring to fig. 4, which is a flowchart illustrating a method for determining a mapping value of target data according to an embodiment of the present application, as shown in fig. 4, the method may include:
s401: and calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value.
In this embodiment, a difference between a maximum value of data in a data set to be displayed and a value of target data to be displayed is first calculated, and then the difference is multiplied by an interval scaling ratio to obtain a first scaling difference.
The above calculation operation may be understood as scaling the difference between the value of the target data and the maximum value of the data, and then performing S402 calculation using the first scaled difference.
For example, if the interval scale is 0.09, the target data value is 5, and the difference between the maximum value of the data 1000 and the target data value of 5 is 9995, the resulting scaling difference is 899.55.
S402: and calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
In this embodiment, a value obtained by subtracting the scaling difference from the display maximum value is a mapping value of the target data. For example, the difference 100.45 between the maximum value 1000 and the first scaling difference 899.55 is displayed, and this value is the mapping value of the target data 5, and this mapping value is located in the display interval and can be normally displayed by the terminal display device.
When the target data is the maximum data value, the first scaling difference value is zero, and the mapping value of the target data is the maximum display value, that is, the maximum display value is used to represent the maximum data value in the data to be displayed.
And when the target data is the data minimum value, the mapping value obtained through calculation is the display minimum value, namely the data minimum value in the data to be displayed is represented by using the display minimum value.
In practical applications, the mapping value of each target data can be obtained by calculating according to formula (2):
Figure BDA0001808623840000121
wherein, XmaxFor the display maximum value of the display section, XminFor the display minimum of the display interval, xmaxIs the maximum value of data, x, in the data set to be displayedminThe value is the minimum value of data in the data set to be displayed, x is the value of the target data, and y is the mapping value of the value x of the target data.
As can be seen from formula (2), when x is the maximum value of the data, y is the maximum value of the display, and therefore, when x is the maximum value of the data to be displayed, the scaling difference between x and the maximum value of the data is first calculated, and the maximum value of the display minus the first scaling difference between the two is the mapping value corresponding to x, that is, the value of the target data x displayed on the terminal display device.
The above embodiments describe a method for determining a mapping value of target data, and another method for determining a mapping value of target data is described below with reference to the drawings. In this method, the value of the target data is a non-negative number.
Referring to fig. 5, which is a flowchart of another method for determining a mapping value of target data according to an embodiment of the present application, as shown in fig. 5, the method may include:
s501: and calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value to be used as interval scaling.
In this embodiment, the specific implementation of calculating the interval scaling according to the obtained display maximum value, display minimum value, data maximum value, and data minimum value may refer to the implementation of the above embodiment, and this embodiment is not described herein again.
S502: and calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value.
In this embodiment, a difference between a value of target data to be displayed and a minimum value of data in a data set to be displayed is first calculated, and then the difference is multiplied by an interval scaling ratio to obtain a second scaling difference.
For example, the interval scaling is 0.09, the target data has a value of 5, and the difference between the value of 5 of the target data and the data minimum value of 0 is 5, i.e., the second scaling difference is 0.45.
S503: and calculating the sum of the display minimum value and the second scaling difference value to obtain a mapping value of the target data.
In this embodiment, the obtained second scaling difference is added to the display minimum value, and the sum of the two is the mapping value of the target data. That is, on the basis of displaying the minimum value, a scaling value of the difference between the target data value and the data minimum value is added, and since the target data value is a non-negative value and is scaled in the present embodiment, the calculated mapping value of the target data is located in the display interval.
When the value of the target data is the maximum value of the data, the mapping value obtained through calculation is the maximum value of the display; when the value of the target data is the data minimum value, the map value obtained by the calculation is the display minimum value. For example, the difference between the maximum data value 10000 and the minimum data value 0 is 10000, which is multiplied by the interval scaling ratio 0.09 to obtain a second scaling difference 900, and then the second scaling difference is added to the minimum display value 100 to obtain a mapping value 1000, which is equal to the maximum display value; the difference between the data minimum value 0 and the data minimum value 0 is 0, the difference is multiplied by the interval scaling ratio 0.09 to obtain a second scaling difference value 0, and the second scaling difference value is added with the display minimum value 100 to obtain a mapping value 100, namely the display minimum value.
In specific implementation, the mapping value of the target data can be obtained by calculation using formula (3):
Figure BDA0001808623840000131
wherein, XmaxFor the display maximum value of the display section, XminFor the display minimum of the display interval, xmaxIs the maximum value of data, x, in the data set to be displayedminThe value is the minimum value of data in the data set to be displayed, x is the value of the target data, and y is the mapping value of the value x of the target data.
By the methods provided by the two embodiments, the mapping value of the target data to be displayed can be obtained by using the methods, the mapping value of the data can reflect the size relationship between the data values, so that a user can visually check the size of the data, and the mapping value of the data is located in the display interval, so that the problem that the terminal cannot display the data is avoided, the data is displayed according to the mapping value of the target data, and the displayed data can be clearly displayed.
In addition, when the acquired data set to be displayed includes 0 or a negative number, the 0 or the negative number cannot be displayed in some display modes, for example, the 0 or the negative number cannot be displayed in a scatter diagram, so that for subsequent calculation processing, all data in the data set to be displayed may be translated first to eliminate the 0 or the negative number, and then scaling processing may be performed on the translated target data to obtain a mapping value.
Based on this, in one possible implementation manner of the embodiment of the present application, if the data minimum is a non-positive number, before calculating a difference between the display maximum and the display minimum divided by a difference between the data maximum and the data minimum as an interval scaling, the method further includes:
adding a translation value to all data in the data set to be displayed, updating all data in the data set to be displayed, re-acquiring a data maximum value and a data minimum value in the data set to be displayed, and calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value to serve as an interval scaling ratio and follow-up steps.
In this embodiment, when the data set to be displayed includes 0 or a negative number, all the data sets are translated, and if a value 0 can be displayed in practical application, the translation value may be an absolute value of a minimum value of the data, that is, the translation value is added to all the data to obtain the translated data set to be displayed, then a maximum value and a minimum value of the data in the translated data set to be displayed are obtained, and an interval scaling and subsequent calculation are calculated by using the maximum value, the minimum value, the maximum value and the minimum value of the data. Of course, the translation value may also be a numerical value larger than the absolute value of the minimum value of the data, and in a specific implementation, the translation value may be determined according to an actual situation, and the specific setting of the translation value is not limited in this embodiment.
For example, if the minimum value of the data in the data set to be displayed is-5, the maximum value of the data is 2000, and the shift value can be 5, then the minimum value of the data is shifted to 0, and the maximum value of the data is shifted to 2005.
It should be noted that, after all the data of the data set to be displayed are translated, there is no negative number in the data set to be displayed, and therefore, the method described in fig. 5 may be used to determine the mapping value of the target data. If the set of data to be displayed including the negative number is not to be panned, the mapping value of the target data may be determined using the method described in FIG. 4.
In this embodiment of the application, if 0 or a negative value cannot be displayed according to a predetermined display manner, the data in the data set to be displayed may be translated first, so that the data in the data set to be displayed can be zoomed into the display interval for display.
Based on the above method embodiment, the present application further provides a device for implementing data display, and the device will be described below with reference to the accompanying drawings.
Referring to fig. 6, the drawing is a view of an apparatus for implementing data display provided in an embodiment of the present application, and as shown in fig. 6, the apparatus may include:
an obtaining unit 601, configured to obtain a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value in a display interval;
a calculating unit 602, configured to calculate a difference between the display maximum value and the display minimum value divided by a difference between the data maximum value and the data minimum value as an interval scaling;
a determining unit 603, configured to determine a mapping value of the target data according to the interval scaling, a value of the target data, and an interval reference value, where the interval reference value is the display maximum value or the display minimum value, and the target data is data in the data set to be displayed;
a display unit 604, configured to display the mapping value of the target data according to a predetermined display manner.
In a possible implementation manner, the determining unit includes:
the first calculating subunit is used for calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value;
and the second calculating subunit is used for calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
In a possible implementation manner, when the value of the target data is a non-negative number, the determining unit includes:
the third calculation subunit is used for calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value;
and the fourth calculating subunit is configured to calculate a sum of the display minimum value and the second scaling difference value, so as to obtain a mapping value of the target data.
In one possible implementation manner, if the minimum value of the data is a non-positive number, the apparatus further includes:
and the updating unit is used for adding a translation value to all the data in the data set to be displayed before executing the calculating unit, updating all the data in the data set to be displayed, acquiring a maximum value and a minimum value of the data in the data set to be displayed again, and then executing the calculating unit and the subsequent units.
In one possible implementation, the display maximum value and the display minimum value are determined according to a display configuration of a display device.
In one possible implementation, the apparatus further includes:
and the adding unit is used for adding a corresponding mark to the target data meeting the preset condition for displaying after the display unit displays the target data.
It should be noted that, the implementation of each unit or module in this embodiment may refer to the implementation of fig. 1 to fig. 5, and details of this embodiment are not described herein again.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute the above method for implementing data display.
The embodiment of the present application further provides a computer program product, and when the computer program product runs on a terminal device, the terminal device is enabled to execute the method for implementing data display.
It can be known from the foregoing embodiment that, in the embodiment of the present application, first, a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value in a display interval are obtained, and an interval scaling ratio can be determined according to the data maximum value, the data minimum value, the display maximum value, and the display minimum value, so that a value of target data can be scaled to a mapping value of the target data, and the mapping value of the target data can still reflect a size relationship between data values on one hand, so that display is intuitive, and on the other hand, the mapping value of the target data is within the set display interval, so that a problem that the mapping value of the target data is too small or too large and cannot be displayed does not exist, and thus data is displayed according to the mapping value of the target data, and displayed data can.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for implementing data display, the method comprising:
acquiring a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value of a display interval; the display maximum value and the display minimum value are determined according to a display configuration of a display device;
calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value as an interval scaling;
determining a mapping value of the target data according to the interval scaling, a value of the target data and an interval reference value, wherein the interval reference value is the display maximum value or the display minimum value, and the target data is data in the data set to be displayed;
and displaying the mapping value of the target data according to a predetermined display mode.
2. The method of claim 1, wherein determining the mapped value of the target data based on the interval scaling, the value of the target data, and an interval reference value comprises:
calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value;
and calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
3. The method of claim 1, wherein determining the mapped value of the target data according to the interval scaling, the value of the target data, and an interval reference value when the value of the target data is non-negative comprises:
calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value;
and calculating the sum of the display minimum value and the second scaling difference value to obtain a mapping value of the target data.
4. The method of any of claims 1-3, wherein if the data minimum is a non-positive number, prior to calculating the difference between the display maximum and the display minimum divided by the difference between the data maximum and the data minimum as an interval scaling, the method further comprises:
adding a translation value to all data in the data set to be displayed, updating all data in the data set to be displayed, re-acquiring a data maximum value and a data minimum value in the data set to be displayed, and calculating the difference between the display maximum value and the display minimum value divided by the difference between the data maximum value and the data minimum value to serve as an interval scaling ratio and follow-up steps.
5. An apparatus for enabling data display, the apparatus comprising:
the acquisition unit is used for acquiring a data maximum value and a data minimum value in a data set to be displayed and a display maximum value and a display minimum value of a display interval; the display maximum value and the display minimum value are determined according to a display configuration of a display device;
a calculation unit configured to calculate a difference between the display maximum value and the display minimum value divided by a difference between the data maximum value and the data minimum value as an interval scaling;
a determining unit, configured to determine a mapping value of the target data according to the interval scaling, a value of the target data, and an interval reference value, where the interval reference value is the display maximum value or the display minimum value, and the target data is data in the data set to be displayed;
and the display unit is used for displaying the mapping value of the target data according to a predetermined display mode.
6. The apparatus of claim 5, wherein the determining unit comprises:
the first calculating subunit is used for calculating the difference between the maximum value of the data and the value of the target data, and multiplying the difference by the interval scaling ratio to obtain a first scaling difference value;
and the second calculating subunit is used for calculating the difference between the display maximum value and the first scaling difference value to obtain a mapping value of the target data.
7. The apparatus according to claim 5, wherein when the value of the target data is a non-negative number, the determining unit includes:
the third calculation subunit is used for calculating the difference between the value of the target data and the minimum value of the data, and multiplying the difference by the interval scaling ratio to obtain a second scaling difference value;
and the fourth calculating subunit is configured to calculate a sum of the display minimum value and the second scaling difference value, so as to obtain a mapping value of the target data.
8. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute the method for realizing data display according to any one of claims 1 to 4.
CN201811109063.5A 2018-09-21 2018-09-21 Method and device for realizing data display Active CN109460496B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811109063.5A CN109460496B (en) 2018-09-21 2018-09-21 Method and device for realizing data display

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811109063.5A CN109460496B (en) 2018-09-21 2018-09-21 Method and device for realizing data display

Publications (2)

Publication Number Publication Date
CN109460496A CN109460496A (en) 2019-03-12
CN109460496B true CN109460496B (en) 2020-12-01

Family

ID=65606853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811109063.5A Active CN109460496B (en) 2018-09-21 2018-09-21 Method and device for realizing data display

Country Status (1)

Country Link
CN (1) CN109460496B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159502A (en) * 2019-12-27 2020-05-15 中国银行股份有限公司 Data processing method and device for visual display
CN112686001B (en) * 2021-01-05 2021-12-03 中科三清科技有限公司 Transformation method and transmission method of meteorological data, server and data transmission system
CN115543518B (en) * 2022-10-21 2023-05-12 北京世冠金洋科技发展有限公司 Image coordinate display method, device, equipment and readable storage medium
CN115978712A (en) * 2022-12-14 2023-04-18 珠海格力电器股份有限公司 Air conditioner pipeline detection method and device and air conditioner

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0981114A (en) * 1995-09-13 1997-03-28 Hitachi Commun Syst Inc Table graphic display method and processing method therefor
US5734382A (en) * 1991-12-25 1998-03-31 Sharp Kabushiki Kaisha Portable electronic equipment having function of drawing box chart
CN103412871A (en) * 2013-07-08 2013-11-27 北京百度网讯科技有限公司 Method and device for generating visualized view
CN102999307B (en) * 2011-09-14 2017-04-12 新奥特(北京)视频技术有限公司 Zoom pulse data display method
CN106598404A (en) * 2015-10-16 2017-04-26 青岛海信移动通信技术股份有限公司 Window display method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5734382A (en) * 1991-12-25 1998-03-31 Sharp Kabushiki Kaisha Portable electronic equipment having function of drawing box chart
JPH0981114A (en) * 1995-09-13 1997-03-28 Hitachi Commun Syst Inc Table graphic display method and processing method therefor
CN102999307B (en) * 2011-09-14 2017-04-12 新奥特(北京)视频技术有限公司 Zoom pulse data display method
CN103412871A (en) * 2013-07-08 2013-11-27 北京百度网讯科技有限公司 Method and device for generating visualized view
CN106598404A (en) * 2015-10-16 2017-04-26 青岛海信移动通信技术股份有限公司 Window display method and mobile terminal

Also Published As

Publication number Publication date
CN109460496A (en) 2019-03-12

Similar Documents

Publication Publication Date Title
CN109460496B (en) Method and device for realizing data display
CN107402757B (en) Page rendering method and device
CN112861885B (en) Image recognition method, device, electronic equipment and storage medium
EP3905672B1 (en) Color space mapping method and device, computer readable storage medium and apparatus
CN116844177A (en) Table identification method, apparatus, device and storage medium
CN116665615B (en) Medical display control method, system, equipment and storage medium thereof
CN109559707B (en) Gamma value processing method and device of display panel and display equipment
CN115205163B (en) Method, device and equipment for processing identification image and storage medium
CN109656647B (en) Chart picture generation method, device and equipment and computer readable storage medium
JP2005267158A (en) Character size control method, device, and program
CN115760653A (en) Image correction method, device, equipment and readable storage medium
CN106055229B (en) Display interface adjusting method and display interface adjusting module based on screen reading
CN109410296B (en) Method and device for realizing data display
CN114817664A (en) Big data based data display method and related equipment
CN112785567B (en) Map detection method, map detection device, electronic equipment and storage medium
US20180012383A1 (en) Display information generation system, method, and computer program product
CN111579211B (en) Display screen detection method, detection device and computer storage medium
CN117990344A (en) State detection method and device of electronic equipment, electronic equipment and storage medium
CN112612847B (en) Method and device for processing data based on drill-down analysis scene
CN113409294B (en) Core-pulling detection method of roll core, electronic equipment and storage medium
EP4343690A1 (en) Information processing method, program, and information processing device
CN113221999B (en) Picture annotation accuracy obtaining method and device and electronic equipment
CN107025645A (en) A kind of image processing method and terminal
CN116222980A (en) Test method, device, equipment and storage medium
US10489945B2 (en) Graphical user interface component to transpose a histogram

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