Display method and device of user interface and electronic equipment
By determining the screen resolution and logic density on the display device and calculating the scaling parameters, the problem of inconsistent display of the user interface on different devices is solved, and the adaptive display of interface elements is realized.
Patent Information
- Application Number
- CN202411756210.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-25
AI Technical Summary
The user interfaces on different display devices may have differences in interface element size and layout at the same resolution, making it difficult for the user interface to adapt to each display device.
By determining the screen resolution and logical density of the display device, scaling parameters for the user interface are calculated and the user interface is displayed based on these parameters.
It realizes adaptive display of the user interface, ensuring that the size and layout of interface elements are consistent on different display devices, and adapts to different screen parameters such as high-score screen and aging-friendly mode.
Smart Images

Figure CN119883454A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of display devices, and in particular to the technical field of scaling of user interfaces and resolution adjustment of display devices. Background Art
[0002] Different display device manufacturers and different versions of display device systems may have different resolutions or customized screen display parameters. Therefore, even at the same resolution, the size and layout of the interface elements displayed on the user interface on different display devices may be different. The various screen display parameters of display devices are never standardized. Therefore, the same user interface may have interface elements displayed too large or too small on different display devices, making it difficult to adapt the display of the user interface to each display device. Summary of the invention
[0003] The present disclosure provides a database content synchronization method, device, and electronic device for solving at least one of the above technical problems.
[0004] According to one aspect of the present disclosure, a method for displaying a user interface is provided, wherein the method comprises:
[0005] Determine the screen resolution and logical density of the display device;
[0006] Determining scaling parameters for a user interface based on the screen resolution and logical density;
[0007] Wherein, the display device displays the user interface based on the scaling parameter.
[0008] According to one aspect of the present disclosure, a display device for a user interface is provided, wherein the device comprises:
[0009] A determination module, used to determine the screen resolution and logical density of the display device;
[0010] A scaling module, configured to determine scaling parameters for a user interface based on the screen resolution and logical density;
[0011] Wherein, the display device displays the user interface based on the scaling parameter.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the above method.
[0017] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0020] Figure 1 is a flowchart of a method for displaying a user interface provided by the first embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of a method for displaying a user interface provided by the second embodiment of the present disclosure;
[0022] Figure 3 is an exemplary flow chart of S205;
[0023] Figure 4 is an exemplary flow chart of S2052;
[0024] Figure 5 is a structural schematic diagram of a display device of a user interface provided in a third embodiment of the present disclosure;
[0025] Figure 6 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0028] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0029] The terminology used herein is for describing particular embodiments only and is not intended to limit the present disclosure.As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0030] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0031] The display method of the user interface according to the present disclosure can be executed by an electronic device such as a terminal device or a server, and the terminal device can be a vehicle-mounted device, a display device (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. Alternatively, the display method of the user interface provided by the present disclosure can be executed by a server.
[0032] In the related art, two methods are usually used to adjust the display of the user interface on different display devices.
[0033] Method 1: Application developers set multiple customized screen display schemes for display devices with different resolutions. The application program detects the resolution of the display device and calls the preset screen display scheme to display the user interface. This method only refers to the screen resolution, which is not flexible enough. On the other hand, it may cause the text to be too large on mobile phones with high resolution and high logic density, or too small on mobile phones with low zoom ratio.
[0034] Method 2 uses scaled pixels (sp) or device independent pixels (dp) as the unit of scaling adjustment, so that the display device system performs adaptive adjustment based on sp or dp. This method also has the problem of too large text on mobile phones with high scaling ratios, or too small text on mobile phones with low logic density.
[0035] Before introducing the solutions of each embodiment of the present application, the terms involved in each embodiment of the present application are first explained:
[0036] Pixel: Also known as picture element (pixel, px), it is the unit of resolution. In electronic devices, the resolution is usually expressed in pixels per inch (PPI) or dots per inch (DPI). For example, a resolution of 300x300PPI means that the number of pixels per inch in the horizontal and vertical directions is 300, which can also be expressed as 90,000 pixels in one square inch (i.e. 300x300).
[0037] Physical pixel: also known as device pixel or hardware pixel, which is determined by the screen hardware of the display device. Each physical pixel is the smallest unit that can control the display on the screen of the display device. Taking the screen of the display device as a light emitting diode (LED) LCD screen as an example, the liquid crystal body on the LCD panel of the LED LCD screen is divided into a grid form. If the display device can control the display of each liquid crystal body separately, then each liquid crystal body on the LCD panel is a physical pixel.
[0038] Physical resolution: The maximum resolution of a display, which is the mathematical expression of the number of pixel rows and columns that actually exist on the screen. It is an inherent parameter of the display and cannot be adjusted. It means the maximum number of pixels that can be displayed on the display.
[0039] Physical pixel density: Physical pixel density is how many physical pixels are arranged per inch on the screen, or how many physical pixels are contained in each square inch.
[0040] Logical pixel: Determined by the system software of the electronic device, each logical pixel can be regarded as the smallest area in the display area of the screen that can be controlled by the software program. Different platforms have different literal definitions of logical pixels. Logical pixels can also be called display points (Point, PT) or device independent pixels (device independent pixels, dp).
[0041] Logical resolution: depends on how the system software currently divides the display area of the screen into logical pixels. For example, when the logical resolution of the screen of an electronic device is 1024×768, it means that the system software divides the display area of the screen into 1024 logical pixels horizontally and 768 logical pixels vertically. When dividing logical pixels, the system software of the electronic device can divide the display area corresponding to one physical pixel into one logical pixel, or it can divide the display area corresponding to multiple physical pixels into one logical pixel.
[0042] Density Independent Pixels (dip): An abstract pixel used by programs to define interface elements. It is a unit that is independent of actual density and helps programmers build a layout plan (width, height, and position of interface elements). In terms of logical size, it is consistent with a pixel on a screen with a pixel density of 160 DPI.
[0043] Logical density (logical density or denisty): A scaling factor for density-independent pixels that provides a benchmark for system display. Logical density does not completely follow the actual screen size, but is used to gradually scale the size of the entire user interface based on the overall change in the screen's DPI.
[0044] In the first embodiment disclosed, see Figure 1 , Figure 1 A flowchart of a method for displaying a user interface provided by the first embodiment of the present disclosure is shown. The method comprises:
[0045] S101. Determine the screen resolution and logical density of a display device.
[0046] S102: Determine a scaling parameter for the user interface based on the screen resolution and the logical density.
[0047] The display device displays the user interface based on the scaling parameter.
[0048] It should be noted that, in this application, the "screen resolution" mentioned below may refer to physical resolution or logical resolution, and the following description will take the screen resolution as the physical resolution as an example.
[0049] In S101, the current screen resolution and logic density of the display device can be obtained through the interface of the display device. The order of obtaining the screen resolution and logic density is not limited, and the screen resolution and logic density can be obtained at the same time or separately.
[0050] In S102, after the screen resolution and the logical density are obtained, a scaling parameter for the user interface is determined based on the two. Specifically, the scaling parameter may be any parameter for configuring the display ratio of the user interface, such as: the layout size of the user interface, the display size of the interface elements included in the user interface, wherein the interface elements include at least one of the following: text, image, multimedia file, interactive control, etc. The display device generates and displays the user interface based on the size and layout corresponding to the determined scaling parameter.
[0051] In the related art, only the screen resolution is considered to adapt to the display of the application. Since the display device may set custom screen display parameters (such as logical density parameters), the display of the user interface is different at the same resolution. The method provided by the present disclosure refers to the screen resolution and logical density at the same time to determine the scaling parameters of the user interface, and further displays the user interface based on the scaling parameters, thereby considering both the screen resolution of the display device itself and the logical density at the logical level. Therefore, it is possible to obtain a user interface that adapts to various resolutions and different screen display parameter settings, so that the display layout and size of the user interface adapt to the display device, for example: adapt to the user interface display of a display device with a high-resolution screen, and adapt to the user interface display in an aging-friendly mode.
[0052] In disclosing the second embodiment, see Figure 2 , Figure 2 A flow chart of a method for displaying a user interface provided by a second embodiment of the present disclosure is shown. The method comprises:
[0053] S201. Determine the screen resolution and logical density of a display device.
[0054] In some examples, the current screen resolution and logical density of the display device may be obtained through an interface of the display device, wherein the order of obtaining the screen resolution and the logical density is not limited, and the screen resolution and the logical density may be obtained simultaneously or separately.
[0055] S202: Determine whether the display device meets a preset user interface scaling condition according to the screen resolution of the display device.
[0056] If the preset user interface scaling condition is met, the subsequent steps, such as S203 or S204, are executed.
[0057] If the preset user interface scaling condition is not met, the process ends.
[0058] Among them, multiple scaling conditions of user interfaces can be preset to determine whether to enable the relevant steps of determining the scaling parameters of the user interface in the subsequent step of this application.
[0059] The scaling condition of the user interface may include, for example, at least one of the following:
[0060] Example 1: The scaling condition of the user interface is that the screen resolution exceeds the preset threshold. The preset threshold can be set as needed. For example, the preset threshold is 1920×1080DPI. In this case, since the current development trend of display devices is high-resolution screens, that is, screens with a resolution exceeding 1920×1080DPI, and the current application software is generally designed based on non-high-resolution screens, it is easy for the user interface to be incompatible on high-resolution screen display devices, such as when the interface elements are too small. Therefore, by judging that the screen resolution exceeds the preset threshold, it can be determined that the display device is a high-resolution screen display device, so that the subsequent scaling steps are applied to the display device. If it is not a high-resolution display device, the subsequent steps may not be enabled.
[0061] Example 2: The scaling condition of the user interface is that it does not contain interface elements that cannot be scaled. Some interface elements cannot be scaled, so in some cases, in order to avoid display errors, you can verify whether the multiple interface elements contained in the user interface include interface elements that cannot be scaled. If so, end, if not, execute the subsequent steps.
[0062] Of course, there may be other conditions for scaling the user interface, which are not limited here.
[0063] It should be noted that S202 is an optional step. In some examples, S202 may be omitted, which is not limited here.
[0064] S203: Detect the current display state of the display device, and generate a display state processing operation according to the detection result.
[0065] In some cases, an abnormal display state may occur and the correct screen resolution and / or logical density cannot be obtained. Therefore, the display state can be detected and the screen resolution and logical density can be obtained when the display state is compliant, thereby ensuring that the correct parameters are obtained.
[0066] In some examples, S203 includes:
[0067] S2031. When the detection result is a qualified display state, the display state processing operation is empty.
[0068] S2032: When the detection result is an unqualified display state, the display state processing operation is an abnormal prompt operation of prompting an unqualified display state, or the display state processing operation is a filtering operation of filtering the currently acquired screen resolution.
[0069] If the display state is detected to be compliant, no operation is performed. In other words, the display state processing operation is empty and the subsequent steps can be performed. If the display state is detected to be non-compliant, a prompt message can be generated and an abnormal prompt operation can be performed to remind the user to correct the abnormal display state; or, the screen resolution and / or logical density obtained this time can be directly filtered out, and the abnormal parameters can be discarded until the screen resolution and / or logical density with compliant display state is obtained.
[0070] In some examples, an unqualified display state includes at least one of the following: a display state after a rotation operation, for example, the screen resolution obtained by default in this application is in landscape mode, and after a rotation operation, the current display state is in portrait mode, then the obtained screen resolution is incorrect, and therefore the display state after a rotation operation (for example, in portrait mode) is determined as an unqualified display state; a display state in folding screen mode, in a folding screen display device, the screen resolutions of the display devices in folding screen mode and in full screen mode are different, for example, the screen resolution obtained by default in this application is in full screen mode, and the screen resolution obtained in folding screen mode is incorrect, and therefore the display state in folding screen mode is determined as an unqualified display state; currently, unqualified display states may include more, which can be set according to the scene and are not limited here.
[0071] In this way, abnormal screen resolution and / or logical density can be excluded, thereby ensuring the accuracy of the scaling parameters obtained subsequently.
[0072] It should be noted that S203 is an optional step. In some examples, S203 may be omitted, which is not limited here.
[0073] S204: Determine a current display ratio state value of the display device based on the screen resolution and the logical density.
[0074] The display ratio state value is a value indicating the display ratio state of the current user interface of the display device. There may be multiple implementations. The value range of the display ratio state value is a natural number greater than 0.
[0075] In some examples, S204 specifically includes:
[0076] Sub-step 1: Determine the current display ratio state value of the display device based on the ratio of the screen resolution to the logical density.
[0077] Specifically, sub-step 1 can be determined according to the following formula:
[0078]
[0079] Among them, hcr_d is the display ratio status value, dpi is the screen resolution, and density is the logical density.
[0080] In this case, for example, the actual meaning of the display ratio state value obtained by formula (1) is: how many dip units of content are contained in each inch of the screen. The display ratio state value obtained in this way takes into account both the screen resolution of the display device itself and the logic density at the logical level, so that an accurate value representing the display ratio state of the current user interface of the display device can be obtained.
[0081] In some examples, the screen resolution is any one of the screen resolution in the width direction and the screen resolution in the height direction. The screen resolution in the width direction is also the horizontal screen resolution, and the screen resolution in the height direction is also the vertical screen resolution. When calculating, since the logical density in the width direction and the height direction are consistent, only one of the width direction and the height direction is used to calculate the display ratio state value. Currently, it can also be calculated twice, and then the final display ratio state value is determined based on the results of the two calculations, which is not limited here.
[0082] S205: Determine a zoom parameter according to the display ratio state value.
[0083] The display device displays the user interface based on the scaling parameter.
[0084] For some examples, see Figure 3 , Figure 3 An exemplary flow chart of S205 is shown, wherein S205 includes:
[0085] S2051: Determine a preset threshold range to which the display ratio state value belongs.
[0086] S2052: Determine a corresponding zoom parameter based on a zoom ratio coefficient corresponding to a preset threshold interval to which the display ratio state value belongs.
[0087] A plurality of different threshold intervals may be preset for different display ratio situations, where the display ratio situation is represented by an online ratio state value, and different threshold intervals correspond to different preset zoom ratio coefficients, so that different degrees of zoom processing may be performed according to different display ratios.
[0088] In some examples, S2052 includes multiple situations, for example, the threshold interval includes: a first threshold interval, a second threshold interval, and a third threshold interval. Among them, the first threshold interval corresponds to an interval where the display ratio state value is too small, indicating that the interface elements and layout size of the current user interface are displayed small; the second threshold interval corresponds to an interval where the display ratio state value is normal, indicating that the interface elements and layout size of the current user interface are displayed normally; the third threshold interval corresponds to an interval where the display ratio state value is too large, indicating that the interface elements and layout size of the current user interface are displayed large.
[0089] The scaling factor includes: a first scaling factor corresponding to the first threshold interval and a second scaling factor corresponding to the third threshold interval, wherein the first scaling factor has a value range of (-∞, 1) and the second scaling factor has a value range of (1, +∞).
[0090] In this case, see Figure 4 , Figure 4 An exemplary flow chart of S2052 is shown, where S2052 includes:
[0091] S20521: When the display scale state value belongs to the first threshold interval, determine a zoom parameter based on a preset first zoom scale coefficient and the display scale state value.
[0092] The first threshold interval corresponds to an interval where the display ratio state value is too small, indicating that the interface elements and layout size of the current user interface are displayed small, so the scaling parameter is determined based on the display ratio state value and the first scaling factor. In this case, the scaling parameter is used to reduce the display ratio of the user interface, in other words, to reduce the layout size of the user interface and the size of the interface elements, so that the user interface adapts to the current display device. In some examples, the display device in this case may be a high-resolution screen display device.
[0093] Specifically, there are many ways to implement S20521. For example, the zoom parameter is determined by multiplying the first zoom ratio coefficient and the display ratio state value.
[0094] S20522: When the display ratio state value belongs to the second threshold range, the scaling parameter is empty.
[0095] S20523: When the display scale state value belongs to the third threshold interval, determine a zoom parameter based on a preset second zoom scale coefficient and the display scale state value.
[0096] The third threshold interval corresponds to an interval where the display scale state value is too large, indicating that the interface elements and layout size of the current user interface are displayed larger, so the scaling parameter is determined based on the display scale state value and the second scaling factor. In this case, the scaling parameter is used to enlarge the display scale of the user interface, in other words, to enlarge the layout size of the user interface and the size of the interface elements so that the user interface adapts to the current display device. In some examples, the display device may be in an aging-friendly mode in this case.
[0097] Specifically, there are many ways to implement S20523. For example, the zoom parameter is determined by multiplying the second zoom ratio coefficient and the display ratio state value.
[0098] Of course, in other implementations, more threshold intervals and more zoom ratio coefficients can be set. For example, in the case where the display ratio status value is too small, multiple threshold intervals and zoom ratio coefficients corresponding to different magnification ratios can be set to magnify the user interface to different degrees, making the zoom adjustment interval more precise and flexible.
[0099] It should be noted that S204 and S205 are one implementation of S202. There are other implementations of S202, which are not limited here.
[0100] In the third embodiment disclosed, based on Figure 1 The same principle, Figure 5 A display device 50 of a user interface provided by a third embodiment of the present disclosure is shown, and the device includes:
[0101] A determination module 501 is used to determine the screen resolution and logical density of a display device;
[0102] A scaling module 502, configured to determine scaling parameters for the user interface based on the screen resolution and the logical density;
[0103] The display device displays the user interface based on the scaling parameter.
[0104] In some examples, the scaling module is specifically configured to:
[0105] Based on the screen resolution and logical density, determine the current display ratio state value of the display device;
[0106] Determine the scaling parameters based on the display scale status value.
[0107] In some examples, the scaling module, when determining a current display scale state value of the display device based on the screen resolution and the logical density, is used to:
[0108] Based on the ratio of the screen resolution to the logical density, the current display ratio state value of the display device is determined.
[0109] In some examples, the scaling module, when determining the scaling parameter according to the display scale state value, is used to:
[0110] Determine a preset threshold interval to which the display ratio state value belongs;
[0111] Based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs, the corresponding zoom parameter is determined.
[0112] In some examples, the threshold intervals include: a first threshold interval, a second threshold interval, and a third threshold interval;
[0113] The scaling factor includes: a first scaling factor corresponding to the first threshold interval and a second scaling factor corresponding to the third threshold interval;
[0114] The zoom module is used to determine the corresponding zoom parameter based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs:
[0115] When the display scale state value belongs to the first threshold interval, determining the zoom parameter based on the preset first zoom scale coefficient and the display scale state value;
[0116] When the display ratio state value belongs to the second threshold interval, the scaling parameter is empty;
[0117] When the display scale state value belongs to the third threshold interval, the zoom parameter is determined based on the preset second zoom scale coefficient and the display scale state value.
[0118] In some examples, the screen resolution is any one of a screen resolution in a width direction and a screen resolution in a height direction.
[0119] In some examples, the apparatus further comprises:
[0120] The detection module is used to detect the current display state of the display device and generate a display state processing operation according to the detection result.
[0121] In some examples, the detection module is specifically used to:
[0122] When the test result is a qualified display state, the display state processing operation is empty;
[0123] When the detection result is an unqualified display state, the display state processing operation is an abnormal prompting operation of prompting the unqualified display state, or the display state processing operation is a filtering operation of filtering the currently acquired screen resolution.
[0124] In some examples, the apparatus further comprises:
[0125] A condition determination module, used to determine whether the display device meets a preset user interface scaling condition according to the screen resolution of the display device;
[0126] If satisfied, the scaling parameters for the user interface are determined based on the screen resolution and logical density.
[0127] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0128] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0129] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0130] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from the storage unit 602 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0131] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0132] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a test method for a graphical user interface. For example, in some embodiments, the test method for a graphical user interface may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the test method for the graphical user interface described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured with a test method for a graphical user interface in any other appropriate manner (e.g., by means of firmware).
[0133] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0134] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0135] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0137] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0138] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0139] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.
[0140] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for displaying a user interface, wherein: The method comprises: Determine the screen resolution and logical density of the display device; Determining scaling parameters for a user interface based on the screen resolution and logical density; Wherein, the display device displays the user interface based on the scaling parameter.
2. The method according to claim 1, wherein: The determining, based on the screen resolution and the logical density, a scaling parameter for the user interface comprises: Determining a current display ratio state value of the display device based on the screen resolution and the logical density; The scaling parameter is determined according to the display scale state value.
3. The method according to claim 2, wherein: The determining, based on the screen resolution and the logical density, a current display ratio state value of the display device includes: Based on the ratio of the screen resolution to the logical density, a current display ratio state value of the display device is determined.
4. The method according to claim 2 or 3, wherein: The step of determining the scaling parameter according to the display ratio state value includes: Determining a preset threshold interval to which the display ratio state value belongs; Based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs, a corresponding zoom parameter is determined.
5. The method according to claim 4, wherein: The threshold intervals include: a first threshold interval, a second threshold interval and a third threshold interval; The scaling factor includes: a first scaling factor corresponding to the first threshold interval and a second scaling factor corresponding to the third threshold interval; The determining of the corresponding zoom parameter based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs includes: When the display scale state value belongs to the first threshold interval, determining the zoom parameter based on a preset first zoom scale coefficient and the display scale state value; When the display ratio state value belongs to the second threshold interval, the scaling parameter is empty; When the display scale state value belongs to the third threshold interval, the zoom parameter is determined based on a preset second zoom scale coefficient and the display scale state value.
6. The method according to any one of claims 1 to 5, wherein: The screen resolution is any one of a screen resolution in a width direction and a screen resolution in a height direction.
7. The method according to any one of claims 1 to 6, wherein: After determining the screen resolution and logical density of the display device and before determining the scaling parameter for the user interface based on the screen resolution and logical density, the method further includes: The current display state of the display device is detected, and a display state processing operation is generated according to the detection result.
8. The method according to claim 7, wherein: The detecting the current display state of the display device and generating a display state processing operation according to the detection result includes: In the case where the detection result is a qualified display state, the display state processing operation is empty; In the case where the detection result is an unqualified display state, the display state processing operation is an abnormal prompting operation of prompting the unqualified display state, or the display state processing operation is a filtering operation of filtering the currently acquired screen resolution.
9. The method according to any one of claims 1 to 8, wherein: After determining the screen resolution and logical density of the display device and before determining the scaling parameter for the user interface based on the screen resolution and logical density, the method further includes: Determining whether the display device meets a preset user interface scaling condition according to a screen resolution of the display device; If so, determining a scaling parameter for the user interface based on the screen resolution and the logical density is performed.
10. A display device for a user interface, wherein: The device comprises: A determination module, used to determine the screen resolution and logical density of the display device; A scaling module, configured to determine scaling parameters for a user interface based on the screen resolution and logical density; Wherein, the display device displays the user interface based on the scaling parameter.
11. The device according to claim 10, wherein: The scaling module is specifically used for: Determining a current display ratio state value of the display device based on the screen resolution and the logical density; The scaling parameter is determined according to the display scale state value.
12. The device according to claim 11, wherein The scaling module is used, when determining the current display ratio state value of the display device based on the screen resolution and the logical density, to: Based on the ratio of the screen resolution to the logical density, a current display ratio state value of the display device is determined.
13. The device according to claim 11 or 12, wherein: The scaling module, when determining the scaling parameter according to the display scale state value, is used to: Determining a preset threshold interval to which the display ratio state value belongs; Based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs, a corresponding zoom parameter is determined.
14. The device according to claim 13, wherein: The threshold intervals include: a first threshold interval, a second threshold interval and a third threshold interval; The scaling factor includes: a first scaling factor corresponding to the first threshold interval and a second scaling factor corresponding to the third threshold interval; The zoom module is used to determine the corresponding zoom parameter based on the zoom ratio coefficient corresponding to the preset threshold interval to which the display ratio state value belongs: When the display scale state value belongs to the first threshold interval, determining the zoom parameter based on a preset first zoom scale coefficient and the display scale state value; When the display ratio state value belongs to the second threshold interval, the scaling parameter is empty; When the display scale state value belongs to the third threshold interval, the zoom parameter is determined based on a preset second zoom scale coefficient and the display scale state value.
15. The device according to any one of claims 10 to 14, wherein: The screen resolution is any one of a screen resolution in a width direction and a screen resolution in a height direction.
16. The device according to any one of claims 10 to 15, wherein: The device also includes: The detection module is used to detect the current display state of the display device and generate a display state processing operation according to the detection result.
17. The device according to claim 16, wherein: The detection module is specifically used for: In the case where the detection result is a qualified display state, the display state processing operation is empty; In the case where the detection result is an unqualified display state, the display state processing operation is an abnormal prompting operation of prompting the unqualified display state, or the display state processing operation is a filtering operation of filtering the currently acquired screen resolution.
18. The device according to any one of claims 10 to 17, wherein: The device also includes: A condition determination module, used to determine whether the display device meets a preset user interface scaling condition according to the screen resolution of the display device; If so, determining a scaling parameter for the user interface based on the screen resolution and the logical density is performed.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.
21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.