Disclosure of Invention
The application aims to provide a method, a device and a medium for switching resolution and refresh rate, and solves the problem that a lot of time is spent on manually switching all the resolution and refresh rates for testing.
In order to solve the above technical problem, the present application provides a method for switching resolution and refresh rate, including:
acquiring the name of a video interface and the connection state of display equipment;
generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by the display equipment connected with each video interface;
switching the resolution and the refresh rate at the resolution according to the display information for displaying an image according to the resolution and the refresh rate.
Preferably, the switching the resolution and the refresh rate at the resolution according to the display information includes:
traversing each row of information in the display information;
dividing each line of the information into a plurality of character strings;
in the character strings of each row, acquiring a first character string of each row as the resolution, and acquiring the remaining character strings of each row as the refresh rate under the resolution;
sequentially switching the resolution and the refresh rate at the resolution.
Preferably, before the dividing the information of each line into a plurality of character strings, the method further includes:
searching for a connection keyword of the display equipment in the display information;
if the connection keyword of the display equipment in the display information cannot be found, acquiring mark bit information;
if the flag bit information is 1, confirming that the information of the current row in the display information is the resolution and the refresh rate, and entering the step of dividing the information of each row into a plurality of character strings respectively;
if the flag bit information is 0, confirming that the information of the current row in the display information is not the resolution and the refresh rate, acquiring the information of the next row in the display information, and returning to the step of searching for the connection keyword of the display equipment in the display information.
Preferably, if the connection keyword of the display device in the display information is found, the method further includes:
judging whether the video interface is connected with the display equipment or not according to the connection keyword;
if not, setting the flag bit to be 0, acquiring the next line of information of the display information, and returning to the step of searching the connection keyword of the display equipment in the display information;
if yes, setting the flag bit to be 1, acquiring the name of the video interface, acquiring the next line of information of the display information, and returning to the step of searching the connection keyword of the display equipment in the display information.
Preferably, after the sequentially switching the resolution and the refresh rate at the resolution, the method further includes:
and printing a screenshot file containing the data of the current resolution and the current refresh rate after preset time, and naming the screenshot file according to the current resolution and the current refresh rate.
Preferably, after the dividing the information of each line into a plurality of character strings, the method further includes:
and deleting the rest characters except the numbers in the character string.
Preferably, the switching the resolution and the refresh rate at the resolution according to the display information includes:
and outputting and displaying the resolution and the refresh rate under the resolution through an xrandr instruction, and outputting the name of the video interface.
In order to solve the above technical problem, the present application further provides a switching device for resolution and refresh rate, including:
the acquisition module is used for acquiring the name of the video interface and the connection state of the display equipment;
the generating module is used for generating display information of the display equipment according to the name and the connection state; the display information includes resolution and refresh rate supported by the display device connected to each video interface;
and the switching module is used for switching the resolution and the refresh rate under the resolution according to the display information so as to display an image according to the resolution and the refresh rate.
In order to solve the above technical problem, the present application further provides another switching device for resolution and refresh rate, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the switching method of the resolution and the refresh rate when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for switching between the resolution and the refresh rate.
According to the switching method of the resolution and the refresh rate, the name of a video interface and the connection state of display equipment are obtained; generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface; and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate. Therefore, the scheme realizes the switching display of the resolution ratio and the refresh rate through the display information by generating the display information containing the resolution ratio and the refresh rate supported by the display equipment connected with each video interface, greatly improves the display efficiency, avoids the possibility of human errors caused by manual switching, and saves the labor and time cost.
In addition, the embodiment of the application also provides a switching device for the resolution and the refresh rate and a computer readable storage medium, and the effects are the same as above.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a switching method, a device and a medium for resolution and refresh rate.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
At present, when a manufacturer tests some OS systems, display cards, display screens, etc., it is necessary to switch all resolutions and refresh rates for testing to determine whether their display functions are normal. However, the resolution is related to the collocated display card and display screen, the supported resolutions of different configurations are different, and each resolution is collocated with a plurality of refresh rates, and it takes a lot of time to manually switch all resolutions and refresh rates for testing. Therefore, the method for switching the resolution and the refresh rate is mainly applied to scenes for switching a large number of display devices. It should be noted that the switching scenario of the switching method of the resolution and the refresh rate in this embodiment is only a preferred embodiment, and there is no limitation on the application scenario of the switching method of the resolution and the refresh rate, and other scenarios of switching the resolution and the refresh rate may also be applied, depending on the specific implementation. Fig. 1 is a flowchart of a resolution and refresh rate switching method according to an embodiment of the present disclosure. As shown in fig. 1, the method comprises:
s10: and acquiring the name of the video interface and the connection state of the display equipment.
S11: generating display information of the display device according to the name and the connection state; the display information includes resolution and refresh rate supported by the display device connected to each video interface.
S12: and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate.
It will be appreciated that the video interface of the host device that performs the resolution and refresh rate switching is connected to the different display devices via a connection line. In this embodiment, the types of the Video interfaces include a Video Graphics Array (VGA) Interface and a High Definition Multimedia Interface (HDMI), and may further include a displayport (dp) Interface, and the types of the Video interfaces are not limited and are determined according to specific implementation conditions.
The connection state of the display device, i.e., whether the display device connected through the video interface is in a connected state. Therefore, in step S10, in order to realize switching of the resolution and the refresh rate of the display device, it is necessary to acquire the name of the video interface and the connection state of the display device, determine which video interface the display device switching the resolution and the refresh rate is connected to, and determine whether the display device is connected to the video interface.
Taking Linux system as an example, the "xrandr" instruction may be used to obtain the name of the video interface supported in the current configuration and the connection state of the display device. The executable program for subsequent resolution and refresh rate switching may be implemented in python language. It should be noted that the method for switching resolution and refresh rate in this embodiment is implemented by python language based on Linux system, and is only a preferred embodiment, and there is no limitation to the implementation of the method for switching resolution and refresh rate, which depends on the specific implementation.
Further, after the name of the video interface and the connection state of the display device are obtained, display information of the display device is generated according to the name of the video interface and the connection state of the display device. The display information includes resolution and refresh rate supported by the display device connected to each video interface. It will be appreciated that for a single display device, there may be different resolutions, such as 1920 x 1080, 1600 x 900 or 1280 x 960; there are multiple refresh rates at each resolution, for example, 60.00 and 74.97 at 1920 x 1080 resolutions. The resolution and refresh rate of the different display devices are determined by the display devices themselves, and the resolution and refresh rate included in the display devices are not limited in this embodiment.
It should be noted that, in this embodiment, the generation format of the display information of the display device is not limited; as a preferred embodiment, in order to achieve convenience of reading and writing and information identification, the format of the display information may be set to txt format. After the display information is obtained, the resolution and the refresh rate at the resolution are switched according to the information for displaying the image according to the switched resolution and refresh rate. The embodiment does not limit the specific process of switching the resolution and the refresh rate under the resolution according to the information, and is determined according to the specific implementation situation.
In the embodiment, the name of the video interface and the connection state of the display device are acquired; generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface; and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate. Therefore, according to the scheme, the display information comprising the resolution ratio and the refresh rate supported by the display equipment connected with each video interface is generated, and the switching display of the resolution ratio and the refresh rate is realized through the display information, so that the display efficiency is greatly improved, the possibility of human errors caused by manual switching is avoided, and the labor and time cost are saved.
On the basis of the above-described embodiment:
as a preferred embodiment, switching the resolution and the refresh rate at the resolution according to the display information includes:
traversing each row of information in the display information;
dividing each line of information into a plurality of character strings;
in the character strings of each row, acquiring a first character string of each row as a resolution, and acquiring the rest character strings of each row as a refresh rate under the resolution;
the resolution and the refresh rate at the resolution are switched in turn.
In the above embodiments, there is no limitation on the specific process of switching the resolution and the refresh rate at the resolution according to the information, and the process is determined according to the specific implementation. As a preferred embodiment, after the display information is obtained, the information of each line in the display information is first traversed.
Fig. 2 is a schematic diagram of display information according to an embodiment of the present disclosure. In displaying information, the resolution and refresh rate are presented in the information of the rows, as shown in fig. 2. In order to extract the resolution and the refresh rate, it is necessary to traverse each line of information in the display information and divide each line of information into a plurality of character strings. It is understood that the character dividing function is employed in the present embodiment to divide each line of information into a plurality of character strings. After obtaining a plurality of character strings, in the character strings of each row, the first character string of each row is obtained as the resolution, and the remaining character strings of each row are obtained as the refresh rate under the resolution. The resolution and the refresh rate at the resolution are switched in turn. For example, the resolution in a row is 1920 × 1080, and the refresh rate at this resolution is 60.00 and 74.97, the switching resolution/refresh rate is: 1920 x 1080/60.00 and 1920 x 1080/74.97. After the current row resolution and refresh rate switching is completed, switching is made to the resolution and refresh rate of the next row.
In the embodiment, each row of information in the information is displayed by traversing; dividing each line of information into a plurality of character strings; in the character strings of each row, the first character string of each row is obtained as the resolution, the remaining character strings of each row are obtained as the refresh rate under the resolution, and the resolution and the refresh rate under the resolution are sequentially switched, so that the switching between the resolution and the refresh rate under the resolution is realized.
On the basis of the above-described embodiment:
as a preferred embodiment, before dividing each line of information into a plurality of character strings, the method further includes:
searching a connection keyword of the display equipment in the display information;
if the connection keyword of the display equipment in the display information cannot be found, acquiring the zone bit information;
if the flag bit information is 1, confirming that the current row information in the display information is the resolution and the refresh rate, and respectively dividing each row information into a plurality of character strings;
and if the flag bit information is 0, confirming that the current row information in the display information is not the resolution and the refresh rate, acquiring the next row information in the display information, and returning to the step of searching for the connection keyword of the display equipment in the display information.
As shown in fig. 2, the resolution and refresh rate in fig. 2 are the resolution and refresh rate of the VGA interfaced display device. It can be understood that the purpose of dividing each line of information into a plurality of character strings is to obtain the resolution and the refresh rate, but in the figure, it can be known that the content of a part of lines in the display information is not the resolution and the refresh rate, but the information of the video interface and the display device connected with the video interface, or other useless information; whereas it is possible to include the resolution and refresh rate in the next line information of the line containing information of the video interface and the display device to which it is connected.
In a specific implementation, before dividing each line of information into a plurality of character strings, a connection keyword of the display device in the display information is searched first. It is understood that the display information includes information of the display device to which the video interface is connected. However, in the specific implementation, due to some reasons, part of the display devices are not successfully connected, and the connection keyword is "disconnected"; and the connection keyword for the display device to which the connection is successful is "connected". As shown in fig. 2, the keyword for the display device to which the HDMI interface is connected is "disconnected", indicating that the display device is not connected; and the keyword of the display device connected with the VGA interface is 'connected', which indicates that the display device is successfully connected, and the resolution and the refresh rate of the display device connected with the VGA interface are in the next row of the row. It should be noted that in rows containing resolution and refresh rate, there are no connection keywords.
Therefore, if the connection keyword of the display device in the display information cannot be found, the zone bit information is obtained; the flag bit information is used for whether the current row is resolution and refresh rate information. If the flag bit information is 1, determining that the line information in the display information is the resolution and the refresh rate, so as to divide the line information into a plurality of character strings respectively, obtain the refresh rate under the resolution and the resolution, and switch the resolution and the refresh rate; if the flag bit information is 0, the information in the current row in the display information is determined not to be the resolution and the refresh rate, and the information in the current row is determined not to be the information of the display device connected with the video interface, the information in the current row is determined to be useless information or error information, the information in the next row in the display information needs to be obtained, and the connection keyword in the current row needs to be searched again.
In the embodiment, the connection keywords of the display equipment in the display information are searched; if the connection keyword of the display equipment in the display information cannot be found, acquiring the zone bit information; if the flag bit information is 1, confirming that the current row information in the display information is the resolution and the refresh rate, and respectively dividing each row information into a plurality of character strings; and if the flag bit information is 0, confirming that the current row information in the display information is not the resolution and the refresh rate, acquiring the next row information in the display information, and returning to the step of searching for the connection keyword of the display equipment in the display information, thereby determining whether the row of the display information contains the resolution and the refresh rate.
On the basis of the above-described embodiment:
as a preferred embodiment, if the connection keyword of the display device in the display information is found, the method further includes:
judging whether the video interface is connected with the display equipment or not according to the connection keyword;
if not, setting the flag bit to be 0, acquiring the next line of information of the display information, and returning to the step of searching for the connection keyword of the display equipment in the display information;
if yes, setting the flag bit to be 1, acquiring the name of the video interface, acquiring the next line of information of the display information, and returning to the step of searching the connection keyword of the display equipment in the display information.
In the above embodiment, the content of a part of the rows of the display information is the resolution and the refresh rate, and the content of another part of the rows is the information or the useless information of the video interface and the display device connected thereto. Therefore, for a row with display information of a connection keyword, in order to facilitate acquisition of resolution and refresh rate of a row next to the row, it is necessary to set flag bit information according to the display information of the row. Specifically, whether the video interface is connected with the display equipment is judged according to the connection keyword; if the video interface is judged not to be connected with the display device according to the connection keyword, namely the connection keyword is disconnected, the flag bit is set to be 0 at the moment, the display device is confirmed not to be connected, the next line does not contain the resolution ratio and the refresh rate information, the next line of information of the display information is further obtained, and the connection keyword of the display device in the next line of display information is searched; if the video interface is judged to be connected with the display equipment according to the connection keyword, namely the connection keyword is 'connected', the connection of the display equipment is confirmed, the next line contains the information of resolution and refresh rate, the flag bit is set to be 1, the name of the video interface is obtained, the next line information of the display information is obtained, and the connection keyword of the display equipment in the next line of the display information is searched.
In the embodiment, whether the video interface is connected with the display equipment or not is judged according to the connection keyword; if not, setting the flag bit to be 0, acquiring the next line of information of the display information, and returning to the step of searching the connection keyword of the display equipment in the display information; if yes, setting the flag bit to be 1, acquiring the name of the video interface, acquiring the next line of information of the display information, and returning to the step of searching the connection keyword of the display equipment in the display information. The setting of the flag bit is realized so as to conveniently judge whether the next row of display information is the resolution and the refresh rate.
On the basis of the above-described embodiment:
as a preferred embodiment, after sequentially switching the resolution and the refresh rate at the resolution, the method further includes:
and printing a screenshot file containing data of the current resolution and the current refresh rate after a preset time, and naming the screenshot file according to the current resolution and the current refresh rate.
It can be understood that, in a large-scale switching scenario of the resolution and refresh rate of the display device, continuously monitoring the display condition of the display device is an arduous process for workers. Therefore, as a preferred embodiment, in this embodiment, the screenshot file including the data of the current resolution and the current refresh rate is printed at the preset time after the resolution and the refresh rate under the resolution are sequentially switched, and the screenshot file is named according to the current resolution and the current refresh rate, so that the sufficient resolution switching time is ensured, and thus the display condition of the current resolution and the refresh rate is kept, so that the staff does not need to timely and sequentially monitor the screenshot, and the energy consumption of the staff can be effectively reduced. It should be noted that, in the present embodiment, the preset time is not limited, and may be 20s or other time lengths, which is determined according to specific implementation situations.
In the embodiment, the screenshot file containing the data of the current resolution and the current refresh rate is printed after the preset time, and the screenshot file is named according to the current resolution and the current refresh rate, so that a worker can conveniently check the resolution and the refresh rate of the display device, and the experience of the worker is improved.
On the basis of the above-described embodiment:
as a preferred embodiment, after dividing each line of information into a plurality of character strings, the method further includes:
the remaining characters in the string, except for the digits, are deleted.
It will be appreciated that since the rows of display information contain a resolution and refresh rate, there may be other information in addition to the resolution and refresh rate. This information is useless for obtaining the resolution and refresh rate and may also cause errors in reading the string. Therefore, in the present embodiment, after dividing each line of information into a plurality of character strings, the remaining characters except the number in the character strings are deleted, so as to obtain the processed character strings, and prevent the character string reading error from obtaining the wrong resolution or refresh rate.
On the basis of the above-described embodiment:
as a preferred embodiment, switching the resolution and the refresh rate at the resolution according to the display information includes:
and outputting the display resolution and the refresh rate under the resolution through an xrandr instruction, and outputting the name of the video interface.
It will be appreciated that the xrandr instruction is an instruction for display of resolution and refresh rate under the Linux system. Therefore, switching the resolution and the refresh rate under the resolution according to the display information is specifically as follows: and outputting the display resolution and the refresh rate under the resolution through an xrandr instruction, and outputting the name of the video interface. The output result is 'xrandr-output video interface name-mode resolution-rate refresh rate' to switch the display resolution and refresh rate.
In order to make those skilled in the art better understand the technical solution of the present application, the present application is further described in detail below with reference to fig. 3. Fig. 3 is a flowchart of a resolution and refresh rate switching method in an application scenario according to an embodiment of the present application. As shown in fig. 3, the method includes:
s20: and acquiring the video interface name and the display device connection state supported under the current configuration by using an 'xrandr' instruction.
S21: and generating a txt file, and keeping the video interface name and the connection state of the display equipment.
S22: each row in the txt file is traversed.
S23: searching whether the current line contains a keyword 'disconnected'; if yes, go to step S24; if not, the process proceeds to step S25.
S24: the flag is set to 0, and the process advances to step S34.
S25: searching whether the current line contains a keyword 'connected'; if yes, go to step S26; if not, the process proceeds to step S27.
S26: setting the flag bit to be 1, and acquiring a first character string of the line as a video interface name; the process advances to step S34.
S27: judging whether the flag bit is 1; if yes, go to step S28; if not, the process proceeds to step S34.
S28: by "dividing this line into a plurality of character strings", characters other than numerals in the character strings are deleted.
S29: the first string is taken as the resolution to be switched.
S30: each of the remaining strings is traversed as a refresh rate to be switched.
S31: and outputting a Linux instruction of xrandr-output video interface name-mode resolution-rate refresh rate, wherein the system can automatically switch the resolution and the refresh rate.
S32: and waiting for 20s, printing the current resolution and the refresh rate at the terminal, carrying out screenshot, and renaming the screenshot file to be the current resolution and the refresh rate.
S33: judging whether traversing to the last character string; if yes, go to step S34; if not, the process proceeds to step S30.
S34: judging whether the file is the last line of the file or not; if not, go to step S22 to continue traversing other rows. If yes, ending.
The switching of the resolution and the refresh rate is finally realized through the steps in the application scene.
In the above embodiments, the method for switching the resolution and the refresh rate is described in detail, and the present application also provides embodiments corresponding to the device for switching the resolution and the refresh rate. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one is based on the functional module, and the other is based on the hardware structure.
Fig. 4 is a schematic structural diagram of a switching device for resolution and refresh rate according to an embodiment of the present disclosure. As shown in fig. 4, the switching means of the resolution and the refresh rate includes:
an obtaining module 10, configured to obtain a name of a video interface and a connection state of a display device;
the generating module 11 is configured to generate display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface;
and a switching module 12, configured to switch the resolution and the refresh rate at the resolution according to the display information, so as to display the image according to the resolution and the refresh rate.
The switching device for the resolution and the refresh rate provided by the embodiment comprises an acquisition module, a generation module and a switching module. The method comprises the steps of obtaining the name of a video interface and the connection state of display equipment; generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface; and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate. Therefore, the scheme realizes the switching display of the resolution ratio and the refresh rate through the display information by generating the display information containing the resolution ratio and the refresh rate supported by the display equipment connected with each video interface, greatly improves the display efficiency, avoids the possibility of human errors caused by manual switching, and saves the labor and time cost.
Fig. 5 is a schematic structural diagram of another resolution and refresh rate switching device according to an embodiment of the present application, and as shown in fig. 5, the resolution and refresh rate switching device includes:
a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the method of switching resolution and refresh rate as mentioned in the above embodiments when executing the computer program.
The switching device for the resolution and the refresh rate provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The Processor 21 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the switching method of the resolution and the refresh rate disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among other things, Windows, Unix, Linux, etc. Data 203 may include, but is not limited to, data related to the switching method of resolution and refresh rate.
In some embodiments, the switching device for resolution and refresh rate may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 5 does not constitute a limitation of the switching means of resolution and refresh rate and may include more or fewer components than those shown.
The switching device for the resolution and the refresh rate provided by the embodiment comprises a memory and a processor. Wherein the processor is adapted to carry out the steps of the method of switching resolution and refresh rate as mentioned in the above embodiments when executing the computer program. The method comprises the steps of obtaining the name of a video interface and the connection state of display equipment; generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface; and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate. Therefore, according to the scheme, the display information comprising the resolution ratio and the refresh rate supported by the display equipment connected with each video interface is generated, and the switching display of the resolution ratio and the refresh rate is realized through the display information, so that the display efficiency is greatly improved, the possibility of human errors caused by manual switching is avoided, and the labor and time cost are saved.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps described in the above method embodiments. The method comprises the steps of obtaining the name of a video interface and the connection state of display equipment; generating display information of the display device according to the name and the connection state; the display information comprises resolution and refresh rate supported by display equipment connected with each video interface; and switching the resolution and the refresh rate at the resolution according to the display information for displaying the image according to the resolution and the refresh rate. Therefore, according to the scheme, the display information comprising the resolution ratio and the refresh rate supported by the display equipment connected with each video interface is generated, and the switching display of the resolution ratio and the refresh rate is realized through the display information, so that the display efficiency is greatly improved, the possibility of human errors caused by manual switching is avoided, and the labor and time cost are saved.
The method, apparatus and medium for switching resolution and refresh rate provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.