WO2024032564A1 - Instrument digital display method, apparatus and device, and computer-readable storage medium - Google Patents

Instrument digital display method, apparatus and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2024032564A1
WO2024032564A1 PCT/CN2023/111532 CN2023111532W WO2024032564A1 WO 2024032564 A1 WO2024032564 A1 WO 2024032564A1 CN 2023111532 W CN2023111532 W CN 2023111532W WO 2024032564 A1 WO2024032564 A1 WO 2024032564A1
Authority
WO
WIPO (PCT)
Prior art keywords
digit
text element
digital display
offset
pixel
Prior art date
Application number
PCT/CN2023/111532
Other languages
French (fr)
Chinese (zh)
Inventor
胡华智
何昌威
Original Assignee
亿航智能设备(广州)有限公司
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 亿航智能设备(广州)有限公司 filed Critical 亿航智能设备(广州)有限公司
Publication of WO2024032564A1 publication Critical patent/WO2024032564A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present invention relates to the technical field of instrument digital display, and in particular to an instrument digital display method, device, equipment and computer-readable storage medium.
  • the purpose of the present invention is to provide an instrument digital display method, device, equipment and computer-readable storage medium to solve the problem that existing instrument data display requires frequent instances of multiple UI objects, resulting in reduced UI drawing performance and garbage collection.
  • the burden on the computer increases, and the operating performance of the system software decreases, which affects the timely display of data information on the dashboard, causing problems that affect users' predictions and adverse consequences when using the equipment.
  • an instrument digital display method is provided, which is applied to an interface that presents digital change trends.
  • the method includes the following steps:
  • Each digit is fixedly configured with five text elements in descending order from large to small and from top to bottom;
  • the transparency displayed by the text element on the current digit is controlled according to the distance of the overall offset pixel on the current digit.
  • an instrument digital display device uses the steps in the above-mentioned instrument digital display method.
  • the device includes an interconnected digital setting unit and a text element configuration unit. , calculation unit, offset pixel calculation unit and text element transparency control unit;
  • the digit setting unit is configured to set the digits required for the digital display of the instrument
  • the text element configuration unit is configured to fixedly configure five text elements in each digit in descending order from large to small and from top to bottom;
  • the calculation unit is configured to calculate the pixel height of each text element and determine the offset coefficient on each digit;
  • the offset pixel calculation unit is configured to calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element;
  • the text element transparency control unit is configured to control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit. The greater the distance, the smaller the transparency displayed by the text element. .
  • an instrument digital display device includes a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the computer program is When the processor is executed, the steps of the instrument digital display method described above are implemented.
  • the present invention also provides a computer-readable storage medium, which includes a processor, a computer-readable storage medium, and a computer program stored on the computer-readable storage medium.
  • a computer program stored on the computer-readable storage medium.
  • the instrument digital display method, device, equipment and computer-readable storage medium provided by the embodiment of the present invention.
  • the instrument digital display method sets the digits required for the instrument digital display; and arranges each digit according to the numerical order from large to Small, fixedly configure five text elements in descending order from top to bottom; calculate the pixel height of each text element and the offset coefficient on each digit; calculate the current value based on the offset coefficient and the pixel height of each text element
  • the overall offset pixels of the five text elements on the current digit; the transparency displayed by the text elements on the current digit is controlled according to the distance of the overall offset pixels on the current digit.
  • the instrument digital display speed is faster and can Effectively avoid the need to frequently instantiate multiple UI objects to display existing instrument data, resulting in reduced UI drawing performance, increased burden on the garbage collector, and reduced operating performance of system software, which affects the timely display of data information on the dashboard, which is detrimental to users when using the device. Problems that affect predictions and adverse consequences will occur, seriously affecting the user experience.
  • Figure 1 is a method flow chart of an embodiment of an instrument digital display method related to the present invention.
  • Figure 2 is a schematic diagram of the digital display process of an instrument digital display method according to an embodiment of the present invention.
  • Figure 3 is a method flow chart of another embodiment of the instrument digital display method according to the embodiment of the present invention.
  • Figure 4 is a schematic diagram of changes in digital display transparency of an instrument digital display method according to an embodiment of the present invention.
  • Figure 5 is a schematic display diagram of an instrument digital display method applied to a car according to an embodiment of the present invention.
  • Figure 6 is a schematic structural diagram of an instrument digital display device according to an embodiment of the present invention.
  • Embodiments of the present invention provide a method for displaying instrument digits.
  • the method is applied to an interface that presents a trend of digital changes.
  • it can be used on display devices with instrument panels such as automobiles, airplanes, and digital electricity meters. Please refer to Figures 1 to 1.
  • Figure 3 the method includes the following steps:
  • the digits required for the digital display of the instrument are set on the device on the interface that shows the trend of digital changes, such as the instrument panel.
  • the digits include the units, tens, hundreds, thousands, and ten thousand digits set before the decimal point.
  • the first digit after the decimal point is tenths, the second digit is hundredths, and the third digit is thousands.
  • the specific number of digits that need to be set can be determined according to actual needs.
  • five text elements are fixedly configured for each digit in descending order from large to small and from top to bottom, as shown in Table 1 below. For example, for each digit (one, ten, hundred%) respectively Allocate five fixed text elements.
  • T3 displays the number X on the current digit
  • T1 displays X+2.
  • T2 displays X+1
  • T4 displays X-1
  • T5 displays X-2. In this way, the numbers displayed on T1 ⁇ T5 gradually form a descending sequence.
  • the offset coefficient of the current digit is the number on one digit lower than it.
  • the first digit after the decimal point is used as the offset of the ones digit.
  • Shift coefficient when calculating the overall offset pixel on the tens digit, use the number on the ones digit as the offset coefficient on the tens digit, and so on.
  • the number on the digit that is one digit lower than the current digit is used as the offset coefficient P of the current digit;
  • the center line of the text element arranged in the middle position is set as the reference line, which corresponds to the reference number 0, and the size of the overall offset pixel and the reference number 0 is determined;
  • the overall offset pixel L is equal to the reference number 0, it means that the five text elements at the current digit are offset by a distance of H pixels, and 1 is added to the number of the originally displayed text element. Or subtract 1 to display and serve as the basis for the next iteration display.
  • controlling the transparency displayed by the text element at the current digit based on the distance of the overall offset pixel at the current digit further includes:
  • the five text elements T1, T2, T3, T4, and T5 are regarded as a large drawing area, and the horizontal center line of T3 is used as the original center line, and 3 samples are calibrated for each text element.
  • Points A, B, and C (corresponding to the top, middle, and bottom of the text element respectively), calculate the distance between each sampling point of each text element and the original center line. The smaller the distance, the greater the opacity of the sampling point.
  • the instrument digital display method described in the embodiment of the present invention is applied to an interface that presents digital changing trends, such as the kilometers traveled by a car, the flight altitude of an airplane, the reading of a digital electric meter, etc.
  • the number 5 in the tens digit follows the number 9 in the ones digit and gradually slides into the display from top to bottom; conversely, when returning from 150 to 149, the number 5 in the tens digit follows the number 0 in the ones digit. They gradually draw upward and disappear together, and the number 4 in the tens digit gradually slides into the display from bottom to top, following the number 9 in the ones digit.
  • it is to realize the associated display of individuals, tens, hundreds and thousands digits similar to that of a household electric meter.
  • the instrument digital display method sets the digits required for the instrument digital display; and fixes and configures five text elements on each digit in descending order from large to small and from top to bottom; calculates each digit.
  • the pixel height of the text element and the offset coefficient on each digit calculate the overall offset pixels of the five text elements on the current digit according to the offset coefficient and the pixel height of each text element; based on all the pixels on the current digit
  • the distance size of the overall offset pixel is used to control the transparency displayed by the text element on the digit.
  • the display speed of instrument numbers is faster, which can effectively avoid the need to frequently instantiate multiple UI objects for existing instrument data display, resulting in UI drawing performance Decreasing, the burden on the garbage collector increases, and the operating performance of the system software decreases, which affects the timely display of data information on the dashboard, causing prejudgments and adverse consequences for users when using the device, and seriously affecting the user experience.
  • An embodiment of the present invention also provides an instrument digital display device.
  • the instrument digital display device adopts the steps of the instrument digital display method described in the first embodiment. Please refer to Figure 6.
  • the instrument digital display device includes interconnected Digital setting unit 201, text element configuration unit 301, calculation unit 401, offset pixel calculation unit 501, and text element transparency control unit 601.
  • the digit setting unit 201 is configured to set the digits required for the digital display of the instrument
  • the digit setting unit 201 is used to set the digits required for the digital display of the instrument on a device on an interface that presents a digital change trend such as an instrument panel.
  • the digits include the ones, tens, and hundreds digits set before the decimal point. , thousands, ten thousand, and the first tenth digit after the decimal point, the second digit hundredth, and the third digit thousandth.
  • the specific number of digits that need to be set can be determined according to actual needs.
  • the text element configuration unit 301 is configured to fixedly configure five text elements in each digit in descending order from large to small and from top to bottom.
  • the text element configuration unit 301 five text elements are fixedly configured for each digit in descending order from large to small and from top to bottom, for example, for each digit (one, ten, hundred). ...) allocate fixed 5 text elements respectively, assuming that the five text elements are T1, T2, T3, T4, T5, arranged in order from top to bottom, where T3 displays the number X on the current digit, then T1 Then it displays X+2, T2 displays X+1, T4 displays X-1, and T5 displays X-2. In this way, the numbers displayed on T1 ⁇ T5 gradually form a descending sequence.
  • the calculation unit 401 is configured to calculate the pixel height of each text element and determine the offset coefficient on each digit.
  • the pixel height of each text element is H; calculate the offset coefficient P on each digit, where the offset coefficient of the current digit is the number on the digit one lower than it.
  • the offset coefficient of the current digit is the number on the digit one lower than it.
  • the offset pixel calculation unit 501 is configured to calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element.
  • the text element transparency control unit 601 is configured to control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit. The greater the distance, the greater the transparency displayed by the text element. Small.
  • the center line of the middle text element on the current digit is used as the original center line, and three sampling points are calibrated on each text element. These three sampling points correspond to the top, middle, and bottom of the text element respectively, and each text element is calculated.
  • the distance between each sampling point of the element and the original midline; the transparency of the sampling point is controlled according to the distance between each sampling point of each text element and the original midline; the smaller the distance, the greater the opacity of the sampling point.
  • the displayed position of the text element will also be moved up or down.
  • the specific steps of the up or down movement of the text element are:
  • the overall offset pixel L is equal to the reference number 0, it means that the five text elements at the current digit are offset by a distance of H pixels, and 1 is added to the number of the originally displayed text element. Or subtract 1 to display and serve as the basis for the next iteration display.
  • the instrument digital display device described in the embodiment of the present invention can generally be set on an interface that presents a digital change trend, such as the kilometers traveled by a car, the flight altitude of an airplane, the reading of a digital electric meter, etc.
  • a digital change trend such as the kilometers traveled by a car, the flight altitude of an airplane, the reading of a digital electric meter, etc.
  • the instrument digital display device uses the digit setting unit 201 to set the digits required for the instrument digital display; the text element configuration unit 301 sets each digit in descending order from large to small and from top to bottom. Five text elements are arranged in a fixed order; the calculation unit 401 calculates the pixel height of each text element and the offset coefficient on each digit; the offset pixel calculation unit 501 calculates the offset coefficient according to the offset coefficient and the pixel height of each text element. Calculate the overall offset pixels of the five text elements at the current digit; the text element transparency control unit 601 controls the transparency displayed by the text element at the current digit according to the distance of the overall offset pixels at the current digit.
  • An embodiment of the present invention also provides an instrument digital display device.
  • the device includes a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the computer program is processed by the When the device is executed, the steps of the instrument digital display method described in the first embodiment are implemented.
  • a computer-readable storage medium provided according to an embodiment of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, the steps in the instrument digital display method described in the first embodiment are implemented, The specific steps are as described in Embodiment 1 and will not be repeated here.
  • the memory in this embodiment can be used to store software programs and various data.
  • the memory may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, at least one application required for a function, etc.; the stored data area may store data created based on the use of the mobile phone, etc.
  • the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • all or part of the processes in the method of the above embodiment can be completed by instructing relevant hardware through a computer program.
  • the program can be stored in a computer-readable storage medium.
  • the program can be stored in a storage medium of a computer system and executed by at least one processor in the computer system to implement processes including the embodiments of the above methods.
  • the storage media includes but is not limited to magnetic disks, USB flash drives, optical disks, read-only memory (Read-Only Memory, ROM), etc.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present invention can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
  • the instrument digital display method, device, equipment and computer-readable storage medium provided by the embodiment of the present invention.
  • the instrument digital display method sets the digits required for the instrument digital display; and arranges each digit according to the numerical order from large to Small, fixedly configure five text elements in descending order from top to bottom; calculate the pixel height of each text element and the offset coefficient on each digit; calculate the current value based on the offset coefficient and the pixel height of each text element
  • the overall offset pixels of the five text elements on the current digit; the transparency displayed by the text elements on the current digit is controlled according to the distance of the overall offset pixels on the current digit.
  • the instrument digital display speed is fast and effective.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of Indicators Other Than Cathode Ray Tubes (AREA)

Abstract

The present invention belongs to the technical field of instrument digital display. Provided are an instrument digital display method, apparatus and device, and a computer-readable storage medium. The method comprises: setting digits required for instrument digital display (S101); fixedly configuring each digit with five text elements in which the numbers are ranked from large to small and in decreasing order from top to bottom (S102); calculating a pixel height of each text element (S103); calculating an offset coefficient on each digit, wherein the offset coefficient of the current digit is the number on the digit that is one place lower than the current digit (S104); calculating an overall offset pixel of the five text elements on the current digit according to the offset coefficient and the pixel height of each text element (S105); and according to the distance of the overall offset pixel on the current digit, controlling the degree of transparency at which the text elements on the digit are displayed (S106). In this way, the speed of instrument digital display is relatively fast.

Description

仪表数字显示方法、装置、设备及计算机可读存储介质Instrument digital display method, device, equipment and computer-readable storage medium 技术领域Technical field
本发明涉及仪表数字显示技术领域,尤其涉及一种仪表数字显示方法、装置、设备及计算机可读存储介质。The present invention relates to the technical field of instrument digital display, and in particular to an instrument digital display method, device, equipment and computer-readable storage medium.
背景技术Background technique
目前的汽车、飞机以及数字电表上均具有大量的仪表盘用于显示设备静态或动态的的数据参数信息,比如汽车上行程信息显示、油表信息显示、飞机上的高度信息显示、数字电表上的用电量信息显示等等。根据所述仪表盘上所述数据信息的显示,便于用户根据所述显示的数字显示对设备的当前状态以及使用情况进行判断。现有的设备上的仪表盘上的仪表数字的显示一般是将所述数据信息频繁实例多个UI对象,且采用透明掩码方式实现滚入/滚出所述UI对象以实现数字显示的渐变效果。由于不断的UI对象滚入/滚出,这将导致UI绘图性能下降、垃圾回收器负担加重,使得整个控制系统的软件运行性能下降而影响用户使用体感或者导致延迟数据信息的显示而使用户在使用设备时产生错误预判或不良后果。Currently, cars, airplanes, and digital electricity meters all have a large number of instrument panels used to display static or dynamic data parameter information of the equipment, such as travel information display on cars, fuel gauge information display, altitude information display on airplanes, and digital electricity meters. The power consumption information display and so on. According to the display of the data information on the dashboard, it is convenient for the user to judge the current status and usage of the device based on the displayed digital display. The display of instrument numbers on the instrument panel on the existing equipment generally involves frequently instantiating the data information into multiple UI objects, and using a transparent mask method to implement rolling in/out of the UI objects to achieve a gradual change in digital display. Effect. Due to the continuous rolling in/out of UI objects, this will lead to a decrease in UI drawing performance and an increase in the burden on the garbage collector, which will decrease the software running performance of the entire control system and affect the user's sense of use or cause delays in the display of data information, making the user inoperable. Mispredictions or adverse consequences may occur when using the equipment.
技术问题technical problem
有鉴于此,本发明的目的在于提供一种仪表数字显示方法、装置、设备及计算机可读存储介质,以解决现有仪表数据显示需要频繁实例多个UI对象,导致UI绘图性能下降、垃圾回收器负担加重,系统软件的运行性能下降而影响仪表盘上数据信息的及时显示,对用户在使用设备时产生影响预判及不良后果的问题。In view of this, the purpose of the present invention is to provide an instrument digital display method, device, equipment and computer-readable storage medium to solve the problem that existing instrument data display requires frequent instances of multiple UI objects, resulting in reduced UI drawing performance and garbage collection. The burden on the computer increases, and the operating performance of the system software decreases, which affects the timely display of data information on the dashboard, causing problems that affect users' predictions and adverse consequences when using the equipment.
技术解决方案Technical solutions
本发明解决上述技术问题所采用的技术方案如下:The technical solutions adopted by the present invention to solve the above technical problems are as follows:
根据本发明的第一方面,提供一种仪表数字显示方法,应用于呈现数字变化趋势的界面上,所述方法包括如下步骤:According to a first aspect of the present invention, an instrument digital display method is provided, which is applied to an interface that presents digital change trends. The method includes the following steps:
设置仪表数字显示所需要的数位;Set the required digits for the instrument’s digital display;
每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;Each digit is fixedly configured with five text elements in descending order from large to small and from top to bottom;
计算每个文本元素的像素高度;Calculate the pixel height of each text element;
计算每个数位上的偏移系数;其中,当前数位的偏移系数为比它低一位的数位上的数字;Calculate the offset coefficient on each digit; where the offset coefficient of the current digit is the number on the digit one lower than it;
根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;Calculate the overall offset pixels of the five text elements at the current position according to the offset coefficient and the pixel height of each text element;
根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度。The transparency displayed by the text element on the current digit is controlled according to the distance of the overall offset pixel on the current digit.
根据本发明的第二方面,还提供一种仪表数字显示装置,所述仪表数字显示装置使用上述所述仪表数字显示方法中的步骤,所述装置包括相互连接的数位设置单元、文本元素配置单元、计算单元、偏移像素计算单元以及文本元素透明度控制单元;According to a second aspect of the present invention, an instrument digital display device is also provided. The instrument digital display device uses the steps in the above-mentioned instrument digital display method. The device includes an interconnected digital setting unit and a text element configuration unit. , calculation unit, offset pixel calculation unit and text element transparency control unit;
所述数位设置单元,设置为设置仪表数字显示所需要的数位;The digit setting unit is configured to set the digits required for the digital display of the instrument;
所述文本元素配置单元,设置为将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;The text element configuration unit is configured to fixedly configure five text elements in each digit in descending order from large to small and from top to bottom;
所述计算单元,设置为计算每个文本元素的像素高度以及确定每个数位上的偏移系数;The calculation unit is configured to calculate the pixel height of each text element and determine the offset coefficient on each digit;
所述偏移像素计算单元,设置为根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;The offset pixel calculation unit is configured to calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element;
所述文本元素透明度控制单元,设置为根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,距离越大,文本元素显示的透明度越小。The text element transparency control unit is configured to control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit. The greater the distance, the smaller the transparency displayed by the text element. .
根据本发明的第三方面,还提供一种仪表数字显示设备,所述设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述所述的仪表数字显示方法的步骤。According to a third aspect of the present invention, an instrument digital display device is also provided. The device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is When the processor is executed, the steps of the instrument digital display method described above are implemented.
此外,本发明还提供一种计算机可读存储介质,包括处理器、计算机可读存储介质以及在所述计算机可读存储介质上存储的计算机程序,所述计算机程序被处理器执行时实现如上述所述方法中的步骤。In addition, the present invention also provides a computer-readable storage medium, which includes a processor, a computer-readable storage medium, and a computer program stored on the computer-readable storage medium. When the computer program is executed by the processor, the above-mentioned steps are implemented. steps in the method.
有益效果beneficial effects
本发明实施例提供的所述仪表数字显示方法、装置、设备及计算机可读存储介质,所述仪表数字显示方法通过设置仪表数字显示所需要的数位;并将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;计算每个文本元素的像素高度及每个数位上的偏移系数;根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,仪表数字显示速度较快,能有效避免现有仪表数据显示需要频繁实例多个UI对象,导致UI绘图性能下降、垃圾回收器负担加重,系统软件的运行性能下降而影响仪表盘上数据信息的及时显示,对用户在使用设备时产生影响预判及不良后果,严重影响用户使用体验感的问题。The instrument digital display method, device, equipment and computer-readable storage medium provided by the embodiment of the present invention. The instrument digital display method sets the digits required for the instrument digital display; and arranges each digit according to the numerical order from large to Small, fixedly configure five text elements in descending order from top to bottom; calculate the pixel height of each text element and the offset coefficient on each digit; calculate the current value based on the offset coefficient and the pixel height of each text element The overall offset pixels of the five text elements on the current digit; the transparency displayed by the text elements on the current digit is controlled according to the distance of the overall offset pixels on the current digit. The instrument digital display speed is faster and can Effectively avoid the need to frequently instantiate multiple UI objects to display existing instrument data, resulting in reduced UI drawing performance, increased burden on the garbage collector, and reduced operating performance of system software, which affects the timely display of data information on the dashboard, which is detrimental to users when using the device. Problems that affect predictions and adverse consequences will occur, seriously affecting the user experience.
附图说明Description of drawings
图1为本发明涉及的一种仪表数字显示方法一实施例的方法流程图。Figure 1 is a method flow chart of an embodiment of an instrument digital display method related to the present invention.
图2为本发明实施例一种仪表数字显示方法的数字显示过程示意图。Figure 2 is a schematic diagram of the digital display process of an instrument digital display method according to an embodiment of the present invention.
图3为本发明实施例的仪表数字显示方法另一实施例的方法流程图。Figure 3 is a method flow chart of another embodiment of the instrument digital display method according to the embodiment of the present invention.
图4为本发明实施例一种仪表数字显示方法的数字显示透明度的变化示意图。Figure 4 is a schematic diagram of changes in digital display transparency of an instrument digital display method according to an embodiment of the present invention.
图5为本发明实施例的一种仪表数字显示方法运用在汽车上的显示示意图。Figure 5 is a schematic display diagram of an instrument digital display method applied to a car according to an embodiment of the present invention.
图6为本发明实施例的一种仪表数字显示装置的结构示意图。Figure 6 is a schematic structural diagram of an instrument digital display device according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身没有特定的意义。因此,“模块”、“部件”或“单元”可以混合地使用。In the following description, suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention and have no specific meaning in themselves. Therefore, "module", "component" or "unit" may be used interchangeably.
实施例一Embodiment 1
本发明实施例提供一种仪表数字显示方法,所述方法应用于呈现数字变化趋势的界面上,比如可以用于汽车、飞机以及数字电表上等具有仪表盘的显示设备上,请参阅图1至图3,所述方法包括如下步骤:Embodiments of the present invention provide a method for displaying instrument digits. The method is applied to an interface that presents a trend of digital changes. For example, it can be used on display devices with instrument panels such as automobiles, airplanes, and digital electricity meters. Please refer to Figures 1 to 1. Figure 3, the method includes the following steps:
S101、设置仪表数字显示所需要的数位。S101. Set the digits required for the digital display of the instrument.
具体地,在仪表盘等呈现数字变化趋势的界面上的设备上设置仪表数字显示所需要的数位,所述数位包括设置在小数点前的个位、十位、百位、千位、万位以及小数点后第一数位十分位、第二数位百分位、第三数位千分位,具体需要设置的数位的多少可以根据实际需求情况来确定。Specifically, the digits required for the digital display of the instrument are set on the device on the interface that shows the trend of digital changes, such as the instrument panel. The digits include the units, tens, hundreds, thousands, and ten thousand digits set before the decimal point. The first digit after the decimal point is tenths, the second digit is hundredths, and the third digit is thousands. The specific number of digits that need to be set can be determined according to actual needs.
S102、每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素。S102. Five text elements are fixedly arranged on each digit in descending order from large to small and from top to bottom.
具体地,每个数位上按照数字的数值从大到小,从上往下依次递减排序固定配置五个文本元素,如下表1,比如为每个数位(个、十、百...)分别分配固定的5个文本元素,设该五个文本元素分别为T1、T2、T3、T4、T5,从上往下依次排列,其中T3显示当前数位上的数字X,那么T1则显示X+2,T2显示X+1,T4显示X-1,T5显示X-2,这样T1~T5上显示的数字逐渐形成递减序列排列。Specifically, five text elements are fixedly configured for each digit in descending order from large to small and from top to bottom, as shown in Table 1 below. For example, for each digit (one, ten, hundred...) respectively Allocate five fixed text elements. Let the five text elements be T1, T2, T3, T4, and T5, arranged in order from top to bottom. T3 displays the number X on the current digit, then T1 displays X+2. , T2 displays X+1, T4 displays X-1, and T5 displays X-2. In this way, the numbers displayed on T1~T5 gradually form a descending sequence.
表1:Table 1:
S103、计算每个文本元素的像素高度。S103. Calculate the pixel height of each text element.
具体地,可根据实际情况测量得到每个文本元素的像素高度均为H。Specifically, it can be measured based on the actual situation that the pixel height of each text element is H.
S104、计算每个数位上的偏移系数;其中,当前数位的偏移系数为比它低一位的数位上的数字。S104. Calculate the offset coefficient on each digit; where the offset coefficient of the current digit is the number on the digit one lower than it.
具体的,当前数位的偏移系数为比它低一位的数位上的数字,比如计算数位为个位上的整体偏移像素时,将小数点所在数位后的第一位数字作为个位的偏移系数;计算数位为十位上的整体偏移像素时,将个位上的数字作为十位的偏移系数,依次类推。Specifically, the offset coefficient of the current digit is the number on one digit lower than it. For example, when calculating the overall offset pixel on the ones digit, the first digit after the decimal point is used as the offset of the ones digit. Shift coefficient; when calculating the overall offset pixel on the tens digit, use the number on the ones digit as the offset coefficient on the tens digit, and so on.
S105、根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素。S105. Calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element.
具体地,将当前数位比它低一位的数位上的数字作为当前数位的偏移系数P;Specifically, the number on the digit that is one digit lower than the current digit is used as the offset coefficient P of the current digit;
计算当前数位上的每个文本元素的像素高度H;Calculate the pixel height H of each text element at the current position;
根据所述偏移系数P和每个文本元素的像素高度H计算当前数位的五个文本元素的整体偏移像素L,即L=P*H。Calculate the overall offset pixel L of the five text elements at the current digit according to the offset coefficient P and the pixel height H of each text element, that is, L=P*H.
比如计算数位为个位上的整体偏移像素时,将小数点所在数位后的第一位数字作为个位的偏移系数P,计算数位为个位上的每个文本元素的像素高度H;根据所述偏移系数和每个文本元素的像素高度计算当前数位为个位的五个文本元素的整体偏移像素L,即L=P*H。For example, when calculating the overall offset pixel at the units digit, the first digit after the decimal point is used as the offset coefficient P of the units digit, and the pixel height H of each text element at the units digit is calculated; according to The offset coefficient and the pixel height of each text element are used to calculate the overall offset pixel L of the five text elements whose current digit is the ones digit, that is, L=P*H.
同理,当计算数位为十位上的整体偏移像素时,将个位上的数字作为十位的偏移系数P’,计算数位为十位上的每个文本元素的像素高度H’;根据所述偏移系数和每个文本元素的像素高度计算当前数位为十位的五个文本元素的整体偏移像素L’,即L’=P’*H’。In the same way, when calculating the overall offset pixel in the tens digit, the number in the ones digit is used as the offset coefficient P' of the tens digit, and the pixel height H' of each text element in the tens digit is calculated; Calculate the overall offset pixel L' of the five text elements whose current digit is the tens digit according to the offset coefficient and the pixel height of each text element, that is, L'=P'*H'.
S106、根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度。S106. Control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit.
具体地,将排列在中间位置的文本元素的中心线设置为基准线,该基准线对应基准数0,判断所述整体偏移像素与基准数0的大小;Specifically, the center line of the text element arranged in the middle position is set as the reference line, which corresponds to the reference number 0, and the size of the overall offset pixel and the reference number 0 is determined;
当所述整体偏移像素L小于所述基准数0时,则控制当前数位上的所述文本元素整体向上偏移;When the overall offset pixel L is less than the reference number 0, control the entire text element at the current digit to shift upward;
当所述整体偏移像素L大于所述基准数0时,则控制当前数位上的所述文本元素整体向下偏移。When the overall offset pixel L is greater than the reference number 0, the entire text element at the current digit is controlled to be offset downward.
当所述整体偏移像素L等于所述基准数0时,则说明当前数位上的所述五个文本元素偏移了一个H像素距离,在所述原本显示的文本元素的数字上进行加1或减1显示,并作为下次迭代显示基础。When the overall offset pixel L is equal to the reference number 0, it means that the five text elements at the current digit are offset by a distance of H pixels, and 1 is added to the number of the originally displayed text element. Or subtract 1 to display and serve as the basis for the next iteration display.
在所述原本显示的文本元素的数字上进行加1或减1之后,这样T1~T5就形成新的数字序列X’+2、X’+1、X’、X’-1、X’-2(X’=X+1或X’=X-1)。下次迭代时以X’替代X并重复进行即可。从而达到T1~T5重复利用的目的。After adding or subtracting 1 to the number of the originally displayed text element, T1 to T5 form a new number sequence X'+2, X'+1, X', X'-1, X'- 2 (X'=X+1 or X'=X-1). Just replace X with X' in the next iteration and repeat. This achieves the purpose of reusing T1~T5.
在一实施例中,所述根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度还包括:In one embodiment, controlling the transparency displayed by the text element at the current digit based on the distance of the overall offset pixel at the current digit further includes:
S1061、将当前数位上的中间文本元素的中心线作为原始中线。S1061. Use the center line of the middle text element on the current digit as the original center line.
S1062、在每个文本元素上标定三个采样点,这三个采样点分别对应文本元素的顶部、中间和底部。S1062. Calibrate three sampling points on each text element. These three sampling points correspond to the top, middle and bottom of the text element respectively.
S1063、计算每个文本元素的每个采样点与原始中线的距离。S1063. Calculate the distance between each sampling point of each text element and the original center line.
S1064、根据所述每个文本元素的每个采样点与原始中线的距离的大小来控制采样点的透明度;距离越小,采样点的不透明度越大。S1064. Control the transparency of the sampling points according to the distance between each sampling point of each text element and the original center line; the smaller the distance, the greater the opacity of the sampling point.
具体地,如图图4所示,把T1、T2、T3、T4、T5五个文本元素看成一个大绘图区,以T3的横向的中线作为原始中线,为每个文本元素标定3个采样点A、B、C(分别对应文本元素的顶部、中间、底部),计算每个文本元素的每个采样点与原始中线的距离,距离越小,采样点的不透明度越大。Specifically, as shown in Figure 4, the five text elements T1, T2, T3, T4, and T5 are regarded as a large drawing area, and the horizontal center line of T3 is used as the original center line, and 3 samples are calibrated for each text element. Points A, B, and C (corresponding to the top, middle, and bottom of the text element respectively), calculate the distance between each sampling point of each text element and the original center line. The smaller the distance, the greater the opacity of the sampling point.
本发明实施例所述仪表数字显示方法应用在呈现数字变化趋势的界面上,比如汽车行驶公里数、飞机的飞行高度、数字电表的读数等。如图5中从149进入150时,十位的数字5是跟随个位的数字9从上向下逐渐滑入显示;反之若从150退回 149时十位的数字5是跟随个位的数字0一起向上逐渐画出消失,十位的数字4跟随个位的数字9从下往上逐渐滑入显示。概括起来就是实现类似家用电表的个、十、百、千位的关联显示。The instrument digital display method described in the embodiment of the present invention is applied to an interface that presents digital changing trends, such as the kilometers traveled by a car, the flight altitude of an airplane, the reading of a digital electric meter, etc. As shown in Figure 5, when entering from 149 to 150, the number 5 in the tens digit follows the number 9 in the ones digit and gradually slides into the display from top to bottom; conversely, when returning from 150 to 149, the number 5 in the tens digit follows the number 0 in the ones digit. They gradually draw upward and disappear together, and the number 4 in the tens digit gradually slides into the display from bottom to top, following the number 9 in the ones digit. To sum up, it is to realize the associated display of individuals, tens, hundreds and thousands digits similar to that of a household electric meter.
本发明实施例所述仪表数字显示方法通过设置仪表数字显示所需要的数位;并将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;计算每个文本元素的像素高度及每个数位上的偏移系数;根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,仪表数字显示速度较快,能有效避免现有仪表数据显示需要频繁实例多个UI对象,导致UI绘图性能下降、垃圾回收器负担加重,系统软件的运行性能下降而影响仪表盘上数据信息的及时显示,对用户在使用设备时产生影响预判及不良后果,严重影响用户使用体验感的问题。The instrument digital display method according to the embodiment of the present invention sets the digits required for the instrument digital display; and fixes and configures five text elements on each digit in descending order from large to small and from top to bottom; calculates each digit. The pixel height of the text element and the offset coefficient on each digit; calculate the overall offset pixels of the five text elements on the current digit according to the offset coefficient and the pixel height of each text element; based on all the pixels on the current digit The distance size of the overall offset pixel is used to control the transparency displayed by the text element on the digit. The display speed of instrument numbers is faster, which can effectively avoid the need to frequently instantiate multiple UI objects for existing instrument data display, resulting in UI drawing performance Decreasing, the burden on the garbage collector increases, and the operating performance of the system software decreases, which affects the timely display of data information on the dashboard, causing prejudgments and adverse consequences for users when using the device, and seriously affecting the user experience.
实施例二Embodiment 2
本发明实施例还提供一种仪表数字显示装置,所述仪表数字显示装置采用上述实施例一中所述的仪表数字显示方法中步骤,请参阅图6,所述仪表数字显示装置包括相互连接的数位设置单元201、文本元素配置单元301、计算单元401、偏移像素计算单元501以及文本元素透明度控制单元601。An embodiment of the present invention also provides an instrument digital display device. The instrument digital display device adopts the steps of the instrument digital display method described in the first embodiment. Please refer to Figure 6. The instrument digital display device includes interconnected Digital setting unit 201, text element configuration unit 301, calculation unit 401, offset pixel calculation unit 501, and text element transparency control unit 601.
所述数位设置单元201,设置为设置仪表数字显示所需要的数位;The digit setting unit 201 is configured to set the digits required for the digital display of the instrument;
具体地,通过所述数位设置单元201在仪表盘等呈现数字变化趋势的界面上的设备上设置仪表数字显示所需要的数位,所述数位包括设置在小数点前的个位、十位、百位、千位、万位以及小数点后第一数位十分位、第二数位百分位、第三数位千分位,具体需要设置的数位的多少可以根据实际需求情况来确定。Specifically, the digit setting unit 201 is used to set the digits required for the digital display of the instrument on a device on an interface that presents a digital change trend such as an instrument panel. The digits include the ones, tens, and hundreds digits set before the decimal point. , thousands, ten thousand, and the first tenth digit after the decimal point, the second digit hundredth, and the third digit thousandth. The specific number of digits that need to be set can be determined according to actual needs.
所述文本元素配置单元301,设置为将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素。The text element configuration unit 301 is configured to fixedly configure five text elements in each digit in descending order from large to small and from top to bottom.
具体地,通过所述文本元素配置单元301将每个数位上按照数字的数值从大到小,从上往下依次递减排序固定配置五个文本元素,比如为每个数位(个、十、百...)分别分配固定的5个文本元素,设该五个文本元素分别为T1、T2、T3、T4、T5,从上往下依次排列,其中T3显示当前数位上的数字X,那么T1则显示X+2,T2显示X+1,T4显示X-1,T5显示X-2,这样T1~T5上显示的数字逐渐形成递减序列排列。Specifically, through the text element configuration unit 301, five text elements are fixedly configured for each digit in descending order from large to small and from top to bottom, for example, for each digit (one, ten, hundred). ...) allocate fixed 5 text elements respectively, assuming that the five text elements are T1, T2, T3, T4, T5, arranged in order from top to bottom, where T3 displays the number X on the current digit, then T1 Then it displays X+2, T2 displays X+1, T4 displays X-1, and T5 displays X-2. In this way, the numbers displayed on T1~T5 gradually form a descending sequence.
所述计算单元401,设置为计算每个文本元素的像素高度以及确定每个数位上的偏移系数。The calculation unit 401 is configured to calculate the pixel height of each text element and determine the offset coefficient on each digit.
具体地,可根据实际情况测量得到每个文本元素的像素高度均为H;计算每个数位上的偏移系数P,其中,当前数位的偏移系数为比它低一位的数位上的数字,比如计算数位为个位上的整体偏移像素时,将小数点所在数位后的第一位数字作为个位的偏移系数;计算数位为十位上的整体偏移像素时,将个位上的数字作为十位的偏移系数,依次类推。Specifically, it can be measured according to the actual situation that the pixel height of each text element is H; calculate the offset coefficient P on each digit, where the offset coefficient of the current digit is the number on the digit one lower than it. , for example, when calculating the overall offset pixel in the ones digit, use the first digit after the decimal point as the offset coefficient of the ones digit; when calculating the overall offset pixel in the tens digit, use the units digit The number is used as the offset coefficient of the tens digit, and so on.
所述偏移像素计算单元501,设置为根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素。The offset pixel calculation unit 501 is configured to calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element.
具体地,根据所述偏移系数P和每个文本元素的像素高度H计算当前数位的五个文本元素的整体偏移像素L,即L=P*H。Specifically, the overall offset pixel L of the five text elements of the current digit is calculated according to the offset coefficient P and the pixel height H of each text element, that is, L=P*H.
所述文本元素透明度控制单元601,设置为根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,距离越大,文本元素显示的透明度越小。The text element transparency control unit 601 is configured to control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit. The greater the distance, the greater the transparency displayed by the text element. Small.
具体地,将当前数位上的中间文本元素的中心线作为原始中线,在每个文本元素上标定三个采样点,这三个采样点分别对应文本元素的顶部、中间和底部,计算每个文本元素的每个采样点与原始中线的距离;根据所述每个文本元素的每个采样点与原始中线的距离的大小来控制采样点的透明度;距离越小,采样点的不透明度越大。Specifically, the center line of the middle text element on the current digit is used as the original center line, and three sampling points are calibrated on each text element. These three sampling points correspond to the top, middle, and bottom of the text element respectively, and each text element is calculated. The distance between each sampling point of the element and the original midline; the transparency of the sampling point is controlled according to the distance between each sampling point of each text element and the original midline; the smaller the distance, the greater the opacity of the sampling point.
除了所述文本元素显示的透明度的显示之外,还会对文本元素所显示的位置进行上移或者下移,所述文本元素上移或者下移具体为:In addition to displaying the transparency of the text element, the displayed position of the text element will also be moved up or down. The specific steps of the up or down movement of the text element are:
将排列在中间位置的文本元素的中心线设置为基准线,该基准线对应基准数0,判断所述整体偏移像素与基准数0的大小。Set the center line of the text element arranged in the middle position as the baseline line, which corresponds to the reference number 0, and determine the size of the overall offset pixel and the reference number 0.
当所述整体偏移像素L小于所述基准数0时,则控制当前数位上的所述文本元素整体向上偏移。When the overall offset pixel L is less than the reference number 0, the entire text element at the current digit is controlled to be offset upward.
当所述整体偏移像素L大于所述基准数0时,则控制当前数位上的所述文本元素整体向下偏移。When the overall offset pixel L is greater than the reference number 0, the entire text element at the current digit is controlled to be offset downward.
当所述整体偏移像素L等于所述基准数0时,则说明当前数位上的所述五个文本元素偏移了一个H像素距离,在所述原本显示的文本元素的数字上进行加1或减1显示,并作为下次迭代显示基础。When the overall offset pixel L is equal to the reference number 0, it means that the five text elements at the current digit are offset by a distance of H pixels, and 1 is added to the number of the originally displayed text element. Or subtract 1 to display and serve as the basis for the next iteration display.
在所述原本显示的文本元素的数字上进行加1或减1之后,这样T1~T5就形成新的数字序列X’+2、X’+1、X’、X’-1、X’-2(X’=X+1或X’=X-1)。下次迭代时以X’替代X并重复进行即可。从而达到T1~T5重复利用的目的。After adding or subtracting 1 to the number of the originally displayed text element, T1 to T5 form a new number sequence X'+2, X'+1, X', X'-1, X'- 2 (X'=X+1 or X'=X-1). Just replace X with X' in the next iteration and repeat. This achieves the purpose of reusing T1~T5.
本发明实施例所述仪表数字显示装置一般可设置于呈现数字变化趋势的界面上,比如汽车行驶公里数、飞机的飞行高度、数字电表的读数等。如5图从149进入150时,十位的数字5是跟随个位的数字9从上向下逐渐滑入显示;反之若从150退回149时十位的数字5是跟随个位的数字0一起向上逐渐画出消失,十位的数字4跟随个位的数字9从下往上逐渐滑入显示。概括起来就是实现类似家用电表的个、十、百、千位的关联显示。The instrument digital display device described in the embodiment of the present invention can generally be set on an interface that presents a digital change trend, such as the kilometers traveled by a car, the flight altitude of an airplane, the reading of a digital electric meter, etc. As shown in Figure 5, when entering from 149 to 150, the number 5 in the tens digit will gradually slide into the display from top to bottom following the number 9 in the ones digit; conversely, if it returns from 150 to 149, the number 5 in the tens digit will follow the number 0 in the ones digit. It gradually disappears when drawn upwards, and the number 4 in the tens digit gradually slides into the display from bottom to top, following the number 9 in the ones digit. To sum up, it is to realize the associated display of individuals, tens, hundreds and thousands digits similar to that of a household electric meter.
本发明实施例所述仪表数字显示装置通过采用通过数位设置单元201设置仪表数字显示所需要的数位;由文本元素配置单元301将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;计算单元401计算每个文本元素的像素高度及每个数位上的偏移系数;由偏移像素计算单元501根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;由文本元素透明度控制单元601根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,从而实现仪表数字的快速显示,显示速度较快,能有效避免现有仪表数据显示需要频繁实例多个 UI对象,导致UI绘图性能下降、垃圾回收器负担加重,系统软件的运行性能下降而影响仪表盘上数据信息的及时显示,对用户在使用设备时产生影响预判及不良后果,严重影响用户使用体验感的问题。The instrument digital display device according to the embodiment of the present invention uses the digit setting unit 201 to set the digits required for the instrument digital display; the text element configuration unit 301 sets each digit in descending order from large to small and from top to bottom. Five text elements are arranged in a fixed order; the calculation unit 401 calculates the pixel height of each text element and the offset coefficient on each digit; the offset pixel calculation unit 501 calculates the offset coefficient according to the offset coefficient and the pixel height of each text element. Calculate the overall offset pixels of the five text elements at the current digit; the text element transparency control unit 601 controls the transparency displayed by the text element at the current digit according to the distance of the overall offset pixels at the current digit. , thereby realizing the rapid display of instrument numbers, and the display speed is fast, which can effectively avoid the need to frequently instantiate multiple UI objects for existing instrument data display, resulting in a decrease in UI drawing performance, an increase in the burden on the garbage collector, and a decrease in the operating performance of the system software. The timely display of data information on the dashboard will affect users' predictions and adverse consequences when using the device, seriously affecting the user's experience.
实施例三Embodiment 3
本发明实施例还提供的一种仪表数字显示设备,所述设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上述实施例一所述的仪表数字显示方法的步骤。An embodiment of the present invention also provides an instrument digital display device. The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is processed by the When the device is executed, the steps of the instrument digital display method described in the first embodiment are implemented.
实施例四Embodiment 4
根据本发明的一个实施例提供的一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述实施例一所述的仪表数字显示方法中的步骤,具体步骤如实施例一中描述所述,在此不再赘述。A computer-readable storage medium provided according to an embodiment of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, the steps in the instrument digital display method described in the first embodiment are implemented, The specific steps are as described in Embodiment 1 and will not be repeated here.
本实施例中的存储器可用于存储软件程序以及各种数据。存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据手机的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory in this embodiment can be used to store software programs and various data. The memory may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, at least one application required for a function, etc.; the stored data area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
根据本实施例的一个示例,上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述程序可存储于一计算机可读取存储介质中,如本发明实施例中,该程序可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各方法的实施例的流程。该存储介质包括但不限于磁碟、优盘、光盘、只读存储记忆体(Read-Only Memory,ROM)等。According to an example of this embodiment, all or part of the processes in the method of the above embodiment can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. As implemented in the present invention For example, the program can be stored in a storage medium of a computer system and executed by at least one processor in the computer system to implement processes including the embodiments of the above methods. The storage media includes but is not limited to magnetic disks, USB flash drives, optical disks, read-only memory (Read-Only Memory, ROM), etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or that contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,这些均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of the present invention, many forms can be made without departing from the spirit of the present invention and the scope protected by the claims, and these all fall within the protection of the present invention.
工业实用性Industrial applicability
本发明实施例提供的所述仪表数字显示方法、装置、设备及计算机可读存储介质,所述仪表数字显示方法通过设置仪表数字显示所需要的数位;并将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;计算每个文本元素的像素高度及每个数位上的偏移系数;根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,仪表数字显示速度较快,有效避免现有仪表数据显示需要频繁实例多个UI对象,导致UI绘图性能下降、垃圾回收器负担加重,系统软件的运行性能下降而影响仪表盘上数据信息的及时显示,对用户在使用设备时产生影响预判及不良后果,严重影响用户使用体验感的问题。因此,具有工业实用性。The instrument digital display method, device, equipment and computer-readable storage medium provided by the embodiment of the present invention. The instrument digital display method sets the digits required for the instrument digital display; and arranges each digit according to the numerical order from large to Small, fixedly configure five text elements in descending order from top to bottom; calculate the pixel height of each text element and the offset coefficient on each digit; calculate the current value based on the offset coefficient and the pixel height of each text element The overall offset pixels of the five text elements on the current digit; the transparency displayed by the text elements on the current digit is controlled according to the distance of the overall offset pixels on the current digit. The instrument digital display speed is fast and effective. Avoid the need to frequently instantiate multiple UI objects to display existing instrument data, resulting in reduced UI drawing performance, increased burden on the garbage collector, and reduced operating performance of system software, which affects the timely display of data information on the dashboard, causing problems for users when using the equipment. Issues that affect prediction and adverse consequences, seriously affecting user experience. Therefore, it has industrial practicality.

Claims (10)

  1. 一种仪表数字显示方法,应用于呈现数字变化趋势的界面上,所述方法包括如下步骤:An instrument digital display method is applied to an interface that presents digital change trends. The method includes the following steps:
    设置仪表数字显示所需要的数位;Set the required digits for the instrument’s digital display;
    每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;Each digit is fixedly configured with five text elements in descending order from large to small and from top to bottom;
    计算每个文本元素的像素高度;Calculate the pixel height of each text element;
    计算每个数位上的偏移系数;其中,当前数位的偏移系数为比它低一位的数位上的数字;Calculate the offset coefficient on each digit; where the offset coefficient of the current digit is the number on the digit one lower than it;
    根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;Calculate the overall offset pixels of the five text elements at the current position according to the offset coefficient and the pixel height of each text element;
    根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度。The transparency displayed by the text element on the current digit is controlled according to the distance of the overall offset pixel on the current digit.
  2. 根据权利要求1所述的仪表数字显示方法,其中,所述根据所述偏移系数和每个文本元素的像素高度计算当前五个文本元素的整体偏移像素包括:The instrument digital display method according to claim 1, wherein calculating the overall offset pixels of the current five text elements based on the offset coefficient and the pixel height of each text element includes:
    将当前数位比它低一位的数位上的数字作为当前数位的偏移系数P;The number on the digit that is one digit lower than the current digit is used as the offset coefficient P of the current digit;
    计算当前数位上的每个文本元素的像素高度H;Calculate the pixel height H of each text element at the current position;
    根据所述偏移系数P和每个文本元素的像素高度H计算当前数位的五个文本元素的整体偏移像素L,即L=P*H。Calculate the overall offset pixel L of the five text elements at the current digit according to the offset coefficient P and the pixel height H of each text element, that is, L=P*H.
  3. 根据权利要求2所述的仪表数字显示方法,其中,所述根据所述偏移系数和每个文本元素的像素高度计算当前五个文本元素的整体偏移像素包括计算数位为个位上的整体偏移像素,具体包括:The instrument digital display method according to claim 2, wherein said calculating the overall offset pixels of the current five text elements based on the offset coefficient and the pixel height of each text element includes calculating the overall offset pixels in the units digit. Offset pixels, including:
    将小数点所在数位后的第一位数字作为个位的偏移系数;Use the first digit after the decimal point as the offset coefficient of the units digit;
    计算数位为个位上的每个文本元素的像素高度;Calculates the pixel height of each text element in the ones digit;
    根据所述偏移系数和每个文本元素的像素高度计算当前数位为个位的五个文本元素的整体偏移像素。Calculate the overall offset pixels of the five text elements whose current digit is units based on the offset coefficient and the pixel height of each text element.
  4. 根据权利要求2所述的仪表数字显示方法,其中,所述根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度包括:The instrument digital display method according to claim 2, wherein said controlling the transparency displayed by the text element on the current digit according to the distance of the overall offset pixel on the current digit includes:
    将排列在中间位置的文本元素的中心线设置为基准线,该基准线对应基准数0,判断所述整体偏移像素与基准数0的大小;Set the center line of the text element arranged in the middle position as the baseline line, which corresponds to the reference number 0, and determine the size of the overall offset pixel and the reference number 0;
    当所述整体偏移像素L小于所述基准数0时,则控制当前数位上的所述文本元素整体向上偏移;When the overall offset pixel L is less than the reference number 0, control the entire text element at the current digit to shift upward;
    当所述整体偏移像素L大于所述基准数0时,则控制当前数位上的所述文本元素整体向下偏移。When the overall offset pixel L is greater than the reference number 0, the entire text element at the current digit is controlled to be offset downward.
  5. 根据权利要求2所述的仪表数字显示方法,其中,所述根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度还包括:当所述整体偏移像素L等于所述基准数0时,则说明当前数位上的所述五个文本元素偏移了一个H像素距离,在所述原本显示的文本元素的数字上进行加1或减1显示,并作为下次迭代显示基础。The instrument digital display method according to claim 2, wherein the controlling the transparency of the text element displayed on the current digit according to the distance of the overall offset pixel on the current digit further includes: when the When the overall offset pixel L is equal to the reference number 0, it means that the five text elements at the current digit are offset by a distance of H pixels, and 1 is added or subtracted from the number of the originally displayed text element. Display and serve as the basis for the next iteration.
  6. 根据权利要求2所述的仪表数字显示方法,其中,所述根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度包括:The instrument digital display method according to claim 2, wherein said controlling the transparency displayed by the text element on the current digit according to the distance of the overall offset pixel on the current digit includes:
    将当前数位上的中间文本元素的中心线作为原始中线;Use the center line of the middle text element on the current digit as the original center line;
    在每个文本元素上标定三个采样点,这三个采样点分别对应文本元素的顶部、中间和底部;Calibrate three sampling points on each text element. These three sampling points correspond to the top, middle and bottom of the text element respectively;
    计算每个文本元素的每个采样点与原始中线的距离;Calculate the distance of each sample point of each text element from the original center line;
    根据所述每个文本元素的每个采样点与原始中线的距离的大小来控制采样点的透明度;距离越小,采样点的不透明度越大。The transparency of the sampling points is controlled according to the distance between each sampling point of each text element and the original center line; the smaller the distance, the greater the opacity of the sampling point.
  7. 根据权利要求2所述的仪表数字显示方法,其中,所述设置仪表数字显示所需要的数位包括:The instrument digital display method according to claim 2, wherein the digits required for setting the instrument digital display include:
    根据仪表数字显示需要设置的数位包括小数点前的数位个位、十位、百位、千位、万位以及小数点后第一数位十分位、第二数位百分位、第三数位千分位。The digits that need to be set according to the digital display of the instrument include the ones, tens, hundreds, thousands, and ten thousand digits before the decimal point, as well as the first tenth digit, the second digit hundredth, and the third digit thousandth after the decimal point.
  8. 一种仪表数字显示装置,其中,所述仪表数字显示装置采用如权利要求1-7任一项所述的仪表数字显示方法中步骤,所述仪表数字显示装置包括相互连接的数位设置单元、文本元素配置单元、计算单元、偏移像素计算单元以及文本元素透明度控制单元;An instrument digital display device, wherein the instrument digital display device adopts the steps of the instrument digital display method according to any one of claims 1 to 7, and the instrument digital display device includes interconnected digital setting units, text Element configuration unit, calculation unit, offset pixel calculation unit and text element transparency control unit;
    所述数位设置单元,设置为设置仪表数字显示所需要的数位;The digit setting unit is configured to set the digits required for the digital display of the instrument;
    所述文本元素配置单元,设置为将每个数位上按照数字从大到小,从上往下依次递减排序固定配置五个文本元素;The text element configuration unit is configured to fixedly configure five text elements in each digit in descending order from large to small and from top to bottom;
    所述计算单元,设置为计算每个文本元素的像素高度以及确定每个数位上的偏移系数;The calculation unit is configured to calculate the pixel height of each text element and determine the offset coefficient on each digit;
    所述偏移像素计算单元,设置为根据所述偏移系数和每个文本元素的像素高度计算当前数位上的五个文本元素的整体偏移像素;The offset pixel calculation unit is configured to calculate the overall offset pixels of the five text elements at the current digit according to the offset coefficient and the pixel height of each text element;
    所述文本元素透明度控制单元,设置为根据当前数位上的所述整体偏移像素的距离大小来控制所在数位上的所述文本元素所显示的透明度,距离越大,文本元素显示的透明度越小。The text element transparency control unit is configured to control the transparency displayed by the text element at the current digit according to the distance of the overall offset pixel at the current digit. The greater the distance, the smaller the transparency displayed by the text element. .
  9. 一种仪表数字显示设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至7中任一项所述的仪表数字显示方法的步骤。An instrument digital display device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the computer program implements claims 1 to 7 The steps of the instrument digital display method described in any one of the above.
  10. 一种计算机可读存储介质其上存储有仪表数字显示方法的控制程序,所述仪表数字显示方法的控制程序被处理器执行时实现如权利要求1至7中任一项所述的仪表数字显示方法的步骤。A computer-readable storage medium on which is stored a control program for an instrument digital display method. When the control program for the instrument digital display method is executed by a processor, the instrument digital display as claimed in any one of claims 1 to 7 is realized. Method steps.
PCT/CN2023/111532 2022-08-12 2023-08-07 Instrument digital display method, apparatus and device, and computer-readable storage medium WO2024032564A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210968457.6A CN115291991A (en) 2022-08-12 2022-08-12 Meter digital display method, device, equipment and computer readable storage medium
CN202210968457.6 2022-08-12

Publications (1)

Publication Number Publication Date
WO2024032564A1 true WO2024032564A1 (en) 2024-02-15

Family

ID=83829875

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/111532 WO2024032564A1 (en) 2022-08-12 2023-08-07 Instrument digital display method, apparatus and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN115291991A (en)
WO (1) WO2024032564A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115291991A (en) * 2022-08-12 2022-11-04 亿航智能设备(广州)有限公司 Meter digital display method, device, equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140108984A1 (en) * 2012-10-16 2014-04-17 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same, and storage medium
CN106919320A (en) * 2015-12-24 2017-07-04 阿里巴巴集团控股有限公司 A kind of digit information reminding method and device
CN111198997A (en) * 2019-12-30 2020-05-26 深圳市优必选科技股份有限公司 Digital display method and device based on webpage
CN114611031A (en) * 2022-03-09 2022-06-10 平安科技(深圳)有限公司 Digital scrolling display method, device, equipment and medium
CN115291991A (en) * 2022-08-12 2022-11-04 亿航智能设备(广州)有限公司 Meter digital display method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140108984A1 (en) * 2012-10-16 2014-04-17 Canon Kabushiki Kaisha Information processing apparatus, method of controlling the same, and storage medium
CN106919320A (en) * 2015-12-24 2017-07-04 阿里巴巴集团控股有限公司 A kind of digit information reminding method and device
CN111198997A (en) * 2019-12-30 2020-05-26 深圳市优必选科技股份有限公司 Digital display method and device based on webpage
CN114611031A (en) * 2022-03-09 2022-06-10 平安科技(深圳)有限公司 Digital scrolling display method, device, equipment and medium
CN115291991A (en) * 2022-08-12 2022-11-04 亿航智能设备(广州)有限公司 Meter digital display method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN115291991A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
WO2024032564A1 (en) Instrument digital display method, apparatus and device, and computer-readable storage medium
CN106575308B (en) Semantic distance-based assignment of data elements to visualization edges
US11403358B2 (en) Interactive geographical map
US10290128B2 (en) Interactive scene graph manipulation for visualization authoring
US10749755B2 (en) Network topology self-adapting data visualization method, device, apparatus, and storage medium
JP6126608B2 (en) User interface for editing values in-place
CN102200880B (en) graph display apparatus and graph display method
CN102902408B (en) A kind of method controlling electronic device touchscreen work and a kind of electronic equipment
JP2013164822A (en) Load threshold value calculating program, load threshold value calculating device, and load threshold value calculating method
CN103578553B (en) A kind of vector line style fast erase method
CN110675728A (en) Generation method, device and equipment of thermodynamic diagram and computer readable storage medium
CN110471609B (en) Text information editing method and device, computer equipment and storage medium
CN109343903A (en) A kind of method and terminal of more new user interface
CN107395594A (en) A kind of automatic identifying method for pulling identifying code
CN104375211B (en) A kind of weather forecast isogram update method and system
CN108241505A (en) A kind of page adaptation method and device
CN116206012A (en) Element layout method and related equipment
CN109062461A (en) Touch panel
US8959424B2 (en) Comparative and analytic lens for displaying a window with a first column for first data and a second column for comparison values of the first data and second data
CN111259270A (en) Weather reminding method, equipment and computer readable medium
US20140192082A1 (en) Methods and systems for generating an aggregated data visualization
JP5866957B2 (en) Information processing apparatus, display control method, and program
US9547431B2 (en) Consuming data on a touchscreen device
CN107515751A (en) A kind of UI layout adaptive approach and device
CN110515685A (en) A kind of information flow methods of exhibiting and equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23851785

Country of ref document: EP

Kind code of ref document: A1