Power supply power detection method and device of computer equipment, medium and equipment
By stress testing the target high-power components in computer equipment, detecting their actual power consumption and comparing them with the rated power, the problem of inaccurate power detection in the prior art is solved, and accurate evaluation of power requirements and identification of false power is achieved.
Patent Information
- Application Number
- CN202411978155.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
AI Technical Summary
It is difficult for the prior art to accurately determine whether the power power of a computer device meets the actual needs of the equipment, and there is a power supply problem with false power in the market.
By receiving power power detection instructions, target high-power components in computer equipment are determined and stress-tested on these components to obtain their actual power consumption. Then, based on the actual power consumption and rated power, check whether the currently connected power supply meets the power supply power requirements of the device.
Accurate detection of the power demand for computer equipment power is achieved, equipment failures and cost increase caused by improper power selection, and power supply products that help identify false power.
Smart Images

Figure CN120066867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, storage medium, and computer device for detecting the power of a computer device. Background Art
[0002] As one of the most crucial hardware components in a computer, if the power supply has insufficient power, the processor will throttle at best, and at worst, the computer will directly black out or restart, or even damage the hardware.
[0003] The prior art only allows users to evaluate the power consumption of the hardware provided by the official when configuring the computer, and then purchase a power supply with the corresponding power. However, most users simply choose a power supply randomly and may unknowingly purchase a low-power power supply. Moreover, even if users have this awareness, there are many power supplies on the market with false power ratings, and users have no way of knowing, so there may also be a situation where the power is insufficient, and it is impossible to know where the problem lies when a problem occurs. Summary of the Invention
[0004] In view of this, the embodiments of this application provide a method, device, storage medium, and computer device for detecting the power of a computer device, enabling users to more accurately understand whether the actual power supply requirements of the computer device are met.
[0005] According to one aspect of this application, a method for detecting the power of a computer device is provided. The method includes:
[0006] Receiving a power detection instruction, and determining a target high-power component in the computer device, where the target high-power component is a component in the computer device with a rated power higher than a preset power threshold;
[0007] Performing a stress test on the target high-power component, and obtaining the actual power consumption corresponding to the target high-power component;
[0008] Detecting whether the power of the power supply currently connected to the computer device meets the power requirements of the computer device according to the actual power consumption and the rated power of the target high-power component.
[0009] In an optional embodiment, the target high-power components include a central processing unit, a graphics processing unit, a hard disk, an optical drive, and a cooling fan; the performing a stress test on the target high-power component and obtaining the actual power consumption corresponding to the target high-power component includes:
[0010] Performing stress tests on the central processing unit and the graphics processing unit respectively, and obtaining the first actual power consumption of the central processing unit and the graphics processing unit during their respective stress tests;
[0011] Detecting whether the power of the power supply currently connected to the computer device meets the power requirement of the computer device according to the actual power consumption and the rated power of the target high-power component includes:
[0012] Extracting a first CPU power consumption peak value corresponding to the first actual power consumption of the central processing unit, and extracting a first GPU power consumption peak value corresponding to the first actual power consumption of the graphics processing unit;
[0013] If at least one of the conditions that the first CPU power consumption peak value is less than the rated power of the central processing unit and the first GPU power consumption peak value is less than the rated power of the graphics processing unit is satisfied, it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0014] In an alternative embodiment, the method further includes:
[0015] If the first CPU power consumption peak value is greater than or equal to the rated power of the central processing unit and the first GPU power consumption peak value is greater than or equal to the rated power of the graphics processing unit, a stress test is simultaneously performed on the central processing unit and the graphics processing unit, and the respective second actual power consumptions of the central processing unit and the graphics processing unit during the stress test are obtained;
[0016] Extracting a second CPU power consumption peak value corresponding to the second actual power consumption of the central processing unit, and extracting a second GPU power consumption peak value corresponding to the second actual power consumption of the graphics processing unit;
[0017] If at least one of the conditions that the second CPU power consumption peak value is less than the rated power of the central processing unit and the second GPU power consumption peak value is less than the rated power of the graphics processing unit is satisfied, it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0018] In an alternative embodiment, the method further includes:
[0019] If the second CPU power consumption peak value is greater than or equal to the rated power of the central processing unit and the second GPU power consumption peak value is greater than or equal to the rated power of the graphics processing unit, a stress test is simultaneously performed on all target high-power components, and the respective third actual power consumptions of the target high-power components during the stress test are obtained;
[0020] Respectively extract the component power peak values corresponding to each target high-power component;
[0021] If the peak component power of each target high-power component is greater than or equal to the corresponding rated power, it is determined that the power of the power supply currently connected to the computer device meets the power supply requirement of the computer device; otherwise, it is determined that the power of the power supply currently connected to the computer device does not meet the power supply requirement of the computer device.
[0022] In an alternative embodiment, the stress test on the central processing unit includes:
[0023] Running a central processing unit stress test software or running at least one preset central processing unit stress test program to implement the stress test on the central processing unit, where the preset processor stress test program is a CPU-intensive program written in advance;
[0024] The stress test on the graphics processing unit includes:
[0025] Running a graphics processing unit stress test software or running at least one graphics-intensive game and adjusting the resolution of the graphics-intensive game to the maximum.
[0026] In an alternative embodiment, before the stress test on the target high-power component, the method further includes:
[0027] Obtaining the rated power of each component in the computer device, and calculating the sum of the rated powers of each component as the rated power of the computer device;
[0028] Obtaining the power supply power mark value of the power supply connected to the computer device, and if the power supply power mark value is greater than or equal to the rated power of the computer device, performing the step of stress testing the target high-power component;
[0029] If the power supply power mark value is less than the rated power of the computer device, it is determined that the power of the power supply currently connected to the computer device does not meet the power supply requirement of the computer device.
[0030] In an alternative embodiment, the method further includes:
[0031] When it is determined that the power of the power supply currently connected to the computer device meets the power supply requirement of the computer device, outputting a prompt message indicating that the power supply meets the power supply requirement;
[0032] When it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device, obtain the peak device power consumption of the computer device during the stress test, determine the current power of the computer device based on the peak device power consumption, and output a prompt message indicating that the power supply does not meet the power requirement according to the current power and the rated power of the computer device.
[0033] According to another aspect of the present application, there is provided a power detection device for a computer device, the device comprising:
[0034] An instruction receiving module, configured to receive a power detection instruction and determine a target high-power component in the computer device, where the target high-power component is a component in the computer device whose rated power is higher than a preset power threshold;
[0035] A stress test module, configured to perform a stress test on the target high-power component and obtain the actual power consumption corresponding to the target high-power component;
[0036] A power detection module, configured to detect whether the power of the power supply currently connected to the computer device meets the power requirement of the computer device according to the actual power consumption and the rated power of the target high-power component.
[0037] In an optional embodiment, the target high-power component includes a central processing unit, a graphics processing unit, a hard disk, an optical drive, and a cooling fan; the stress test module is further configured to:
[0038] Perform stress tests on the central processing unit and the graphics processing unit respectively, and obtain the first actual power consumption of the central processing unit and the graphics processing unit during their respective stress tests;
[0039] The power detection module is further configured to:
[0040] Extract the first central processing unit power consumption peak corresponding to the first actual power consumption of the central processing unit, and extract the first graphics processing unit power consumption peak corresponding to the first actual power consumption of the graphics processing unit;
[0041] If at least one of the first central processing unit power consumption peak being less than the rated power of the central processing unit and the first graphics processing unit power consumption peak being less than the rated power of the graphics processing unit is satisfied, it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0042] In an optional embodiment, the stress test module is further configured to:
[0043] If the peak power consumption of the first central processing unit is greater than or equal to the rated power of the central processing unit and the peak power consumption of the first graphics processing unit is greater than or equal to the rated power of the graphics processing unit, then perform stress tests on the central processing unit and the graphics processing unit simultaneously, and obtain the respective second actual power consumptions of the central processing unit and the graphics processing unit during the stress tests;
[0044] The power detection module is further configured to:
[0045] Extract the second peak power consumption of the central processing unit corresponding to the second actual power consumption of the central processing unit, and extract the second peak power consumption of the graphics processing unit corresponding to the second actual power consumption of the graphics processing unit;
[0046] If at least one of the conditions that the second peak power consumption of the central processing unit is less than the rated power of the central processing unit and the second peak power consumption of the graphics processing unit is less than the rated power of the graphics processing unit is satisfied, then determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0047] In an alternative embodiment, the stress test module is further configured to:
[0048] If the second peak power consumption of the central processing unit is greater than or equal to the rated power of the central processing unit and the second peak power consumption of the graphics processing unit is greater than or equal to the rated power of the graphics processing unit, then perform stress tests on all target high-power components simultaneously, and obtain the respective third actual power consumptions of the target high-power components during the stress tests;
[0049] The power detection module is further configured to:
[0050] Extract the component power peaks corresponding to the respective target high-power components;
[0051] If the component power peaks of all target high-power components are greater than or equal to the corresponding rated powers, then determine that the power of the power supply currently connected to the computer device meets the power requirement of the computer device; otherwise, determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0052] In an alternative embodiment, the stress test module is further configured to:
[0053] Run the central processing unit stress test software or run at least one preset central processing unit stress test program to implement the stress test on the central processing unit, where the preset processor stress test program is a CPU-intensive program written in advance;
[0054] Run the graphics processor stress test software or run at least one graphics-intensive game and adjust the resolution of the graphics-intensive game to the maximum.
[0055] In an alternative embodiment, the stress test module is further configured to:
[0056] Obtain the rated power of each component in the computer device, and calculate the sum of the rated powers of each component as the rated power of the computer device;
[0057] Obtain the power rating value of the power supply connected to the computer device. If the power rating value is greater than or equal to the rated power of the computer device, perform the step of stress testing the target high-power component;
[0058] If the power rating value is less than the rated power of the computer device, determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0059] In an alternative embodiment, the power supply detection module is further configured to:
[0060] When it is determined that the power of the power supply currently connected to the computer device meets the power requirement of the computer device, output a prompt message indicating that the power supply meets the power requirement;
[0061] When it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device, obtain the peak device power consumption of the computer device during the stress test, and determine the current power of the computer device based on the peak device power consumption. Output a prompt message indicating that the power supply does not meet the power requirement according to the current power and the rated power of the computer device.
[0062] According to another aspect of the present application, there is provided a storage medium, on which a computer program is stored, and when the program is executed by a processor, the power supply power detection method of the above computer device is implemented.
[0063] According to still another aspect of the present application, there is provided a computer device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor. When the processor executes the program, the power supply power detection method of the above computer device is implemented.
[0064] By the above technical solution, a method, a device, a storage medium and a computer device for detecting the power of a computer device provided by an embodiment of the present application perform a stress test on a target high-power component in the computer device, and thus detect whether the power supply currently connected to the computer device meets the power requirements of the device according to the actual power consumption of the target high-power component and the rated power of the target high-power component during the stress test. By directly performing a stress test and power consumption measurement on the high-power components in the computer device, users can more accurately understand the actual power requirements of the computer device, avoid subsequent troubles and increased costs caused by improper power supply selection, and thus avoid using a power supply with insufficient power, which helps prevent problems such as processor downclocking, computer black screen or restart caused by insufficient power, thereby enhancing the stability and security of the computer system. In addition, through actual measurement and comparison, users can more easily identify those power supplies with false power ratings, thus avoiding purchasing unqualified power supply products.
[0065] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the following specifically describes the specific embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0067] Figure 1 shows a schematic flow chart of a method for detecting the power of a computer device provided by an embodiment of the present application;
[0068] Figure 2 shows a schematic flow chart of another method for detecting the power of a computer device provided by an embodiment of the present application;
[0069] Figure 3 shows a schematic structural diagram of a device for detecting the power of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0070] The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0071] In this embodiment, a method for detecting the power of a computer device is provided. As Figure 1 shown, the method includes:
[0072] Step 101: Receive a power supply power detection instruction and determine the target high-power components in the computer device, where the target high-power components are the components in the computer device whose rated power is higher than a preset power threshold.
[0073] Step 102: Perform a stress test on the target high-power components and obtain the actual power consumption corresponding to the target high-power components.
[0074] Step 103: According to the actual power consumption and the rated power of the target high-power components, detect whether the power supply power of the power supply currently connected to the computer device meets the power supply power requirements of the computer device.
[0075] An embodiment of the present application proposes a method for detecting the power supply power of a computer device, aiming to help users accurately determine whether the currently connected power supply meets the power supply power requirements of the computer device. First, receive an instruction for detecting the power supply power. Then, determine the target high-power components in the computer device. Among them, according to a preset power threshold, identify and determine which components in the computer device have a rated power higher than this threshold. These components are regarded as target high-power components because they have a large demand for power supply power and are the key factors determining whether the power supply is sufficient. Next, perform a stress test on these target high-power components. The stress test is to test the performance and power consumption of the components by simulating high-load conditions, so as to obtain the power consumption data of these components in actual operation. These actual power consumption data will be used for subsequent judgment of whether the power supply is sufficient. Finally, after obtaining the actual power consumption of the target high-power components, compare these power consumption data with the rated power of the components, and judge whether the currently connected power supply can meet the overall power supply requirements of the computer device according to the comparison result. Among them, if the target high-power components can reach the corresponding rated power during the stress test, it means that the power supply may be able to meet the power supply power requirements of the computer device, otherwise it means that the power supply power requirements cannot be met.
[0076] By applying the technical solution of this embodiment, perform a stress test on the target high-power components in the computer device, so as to detect whether the power supply currently connected to the computer device meets the power supply power requirements of the device according to the actual power consumption of the target high-power components and the rated power of the target high-power components during the stress test. Through directly performing a stress test and power consumption measurement on the high-power components in the computer device, users can more accurately understand the actual power supply requirements of the computer device, avoid subsequent troubles and increased costs caused by improper power supply selection, thus avoiding using a power supply with insufficient power, which helps prevent problems such as processor downclocking, computer black screen or restart caused by insufficient power supply, thereby enhancing the stability and security of the computer system. In addition, through actual measurement and comparison, users can more easily identify those power supplies with false power ratings, thus avoiding purchasing unqualified power supply products.
[0077] Further, as a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for detecting the power of a computer device is provided. As Figure 2 shown, the method includes:
[0078] Step 201: Receive a power detection instruction, and determine the target high-power components in the computer device. Among them, the target high-power components are the components in the computer device whose rated power is higher than a preset power threshold, and the target high-power components include a central processing unit, a graphics processing unit, a hard disk, an optical drive, and a cooling fan.
[0079] Step 202: Obtain the rated power of each component in the computer device, calculate the sum of the rated powers of each component as the rated power of the computer device, and obtain the power mark value of the power supply connected to the computer device.
[0080] Step 203: If the power mark value is less than the rated power of the computer device, determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0081] In this embodiment, receive an instruction to start the power detection process and perform a stress test on the target high-power components. The target high-power components are defined as those components whose rated power is higher than a preset power threshold, and these components include a central processing unit (CPU), a graphics processing unit (GPU), a hard disk, an optical drive, and a cooling fan. By obtaining the rated power of each component and adding them together, the total rated power of the computer device is obtained. If the marked power value of the power supply is less than the rated power of the computer device, it is directly determined that the power supply does not meet the requirements.
[0082] Step 204: If the power mark value is greater than or equal to the rated power of the computer device, perform stress tests on the central processing unit and the graphics processing unit respectively, and obtain the first actual power consumption of the central processing unit and the image processing unit during their respective stress tests.
[0083] Step 205: Extract the first central processing unit power consumption peak value corresponding to the first actual power consumption of the central processing unit, and extract the first graphics processing unit power consumption peak value corresponding to the first actual power consumption of the graphics processing unit.
[0084] Step 206: If at least one of the conditions that the first central processing unit power consumption peak value is less than the rated power of the central processing unit and the first graphics processing unit power consumption peak value is less than the rated power of the graphics processing unit is satisfied, determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0085] In this embodiment, if the marked power value of the power supply is greater than or equal to the rated power of the computer device, stress tests are respectively performed on the CPU and the GPU to obtain their actual power consumption during the stress test. The peak power consumption of each is extracted from the stress test data of the CPU and the GPU. If at least one of the peak power consumptions of the CPU or the GPU is less than its rated power, but the marked power of the power supply seems sufficient, this may be due to insufficient or unstable actual output power of the power supply. Therefore, in this case, it is still determined that the power of the power supply does not meet the power requirement of the computer device. By comprehensively considering the rated power of all key components in the computer device and performing stress tests on them, it is possible to more accurately evaluate whether the power supply is sufficient. This provides an effective way for users to check whether the power supply is sufficient, avoiding problems such as performance degradation or system crashes caused by insufficient power supply, thereby improving the user experience. Even if the marked power of the power supply seems sufficient, but if the peak power consumption of the CPU or the GPU exceeds its rated power during the stress test, this may indicate insufficient actual output power or false marking of the power supply, which helps users avoid purchasing substandard power supply products.
[0086] Step 207: If the peak power consumption of the first central processing unit is greater than or equal to the rated power of the central processing unit and the peak power consumption of the first graphics processing unit is greater than or equal to the rated power of the graphics processing unit, perform stress tests on the central processing unit and the graphics processing unit simultaneously, and obtain the respective second actual power consumptions of the central processing unit and the graphics processing unit during the stress test;
[0087] Step 208: Extract the second peak power consumption of the central processing unit corresponding to the second actual power consumption of the central processing unit, and extract the second peak power consumption of the graphics processing unit corresponding to the second actual power consumption of the graphics processing unit.
[0088] Step 209: If at least one of the conditions that the second peak power consumption of the central processing unit is less than the rated power of the central processing unit and the second peak power consumption of the graphics processing unit is less than the rated power of the graphics processing unit is satisfied, determine that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0089] Step 210: If the second peak power consumption of the central processing unit is greater than or equal to the rated power of the central processing unit and the second peak power consumption of the graphics processing unit is greater than or equal to the rated power of the graphics processing unit, perform stress tests on all target high-power components simultaneously, and obtain the respective third actual power consumptions of each target high-power component during the stress test.
[0090] Step 211: Extract the component power peaks corresponding to each target high-power component respectively; if the component power peaks of all target high-power components are greater than or equal to their corresponding rated powers, it is determined that the power of the power supply currently connected to the computer device meets the power requirement of the computer device, otherwise it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0091] In this embodiment, if after the previous steps of performing stress tests on the CPU and GPU respectively, the peak power consumptions of the CPU and GPU have reached or exceeded their rated powers, this indicates that their power consumptions under high loads may be very high. Therefore, it is necessary to perform further stress tests on them to obtain more accurate actual power consumption data. The second stress test is a simultaneous stress test on the CPU and GPU. During the second stress test, record the actual power consumptions of the CPU and GPU, and extract the peak power consumptions of each from them. If the peak power consumptions of the CPU and GPU are less than or equal to their rated powers during the second stress test, it can be considered that the power supply power does not meet the requirements. If the peak power consumptions of the CPU and GPU both reach or exceed their rated powers, a simultaneous stress test is performed on all target high-power components to comprehensively evaluate the power output ability of the power supply. After performing stress tests on all target high-power components, extract the peak power consumption of each component and compare it with its rated power. If the peak power consumptions of all components have reached or exceeded their rated powers, then it can be considered that the power output ability of the power supply may be sufficient to meet the overall needs of the computer device. However, if the peak power consumption of any one component does not exceed its rated power, then it can be considered that the power of the power supply does not meet the requirements. By gradually increasing the scope and intensity of the stress test in the embodiments of the present application, the performance of the power supply in actual use can be evaluated more accurately. The comprehensive stress test helps to identify system instability factors that may be caused by insufficient power supply, so as to take measures in advance to avoid potential problems.
[0092] In an alternative embodiment, performing a stress test on the central processing unit includes: running central processing unit stress test software or running at least one preset central processing unit stress test program to implement the stress test on the central processing unit, where the preset processor stress test program is a CPU-intensive program written in advance.
[0093] In the above embodiments, the CPU can be stress - tested by running specific software or programs to evaluate its performance and power consumption under high loads. Special - designed software tools such as Prime95 can be used to stress - test the CPU, enabling users to easily configure test parameters, monitor the CPU usage during the test, and obtain test results. Another method is to run pre - written CPU - intensive programs. These programs are designed to consume as much CPU resource as possible to simulate high - load scenarios. By running these programs, the performance of the CPU under extreme conditions can be observed, including its processing speed, power consumption, and whether overheating occurs. The preset CPU - intensive programs can be compute - intensive tasks (such as large - scale matrix operations, data encryption and decryption, etc.) or I / O - intensive tasks (such as a large number of file read - write operations). By using specially designed stress - test software or preset CPU - intensive programs in the embodiments of the present application, high - load scenarios in actual use of the CPU can be more accurately simulated. This helps to improve the pertinence and accuracy of the test, and thus more accurately evaluate the power output capacity of the power supply and the performance of the CPU. When using preset CPU - intensive programs for stress - testing, the complexity and running time of the programs can be adjusted according to needs to meet different test requirements.
[0094] In an alternative embodiment, stress - testing the graphics processor includes: running graphics processor stress - test software or running at least one graphics - intensive game and adjusting the resolution of the graphics - intensive game to the maximum.
[0095] In the above embodiments, similar to the CPU stress test, the GPU stress test aims to evaluate its performance and power consumption under high load by running specific software or programs. Specialized software tools such as FurMark can be used to perform the GPU stress test, enabling users to easily configure test parameters (such as resolution, frame rate limit, anti-aliasing level, etc.), monitor the GPU usage during the test (such as video memory occupancy, GPU temperature, power consumption, etc.), and obtain the test results. Another method is to run graphically intensive games and adjust the game resolution to the maximum. Graphically intensive games usually have complex graphics rendering and computing requirements, which can fully utilize the GPU resources. By adjusting the game resolution to the maximum, the GPU load can be further increased to simulate the performance under extreme conditions. The advantage of this method is that it can not only test the performance of the GPU under high-performance requirements but also reflect the user experience in the actual game scenario. At the same time, since games are usually part of the user's daily use, this method also has a certain degree of practicality and practical significance. In the embodiments of the present application, by using specialized GPU stress test software or running graphically intensive games, the high-load scenario of the GPU in actual use can be more accurately simulated. Using graphically intensive games for stress testing can not only evaluate the performance of the GPU but also reflect the user experience in actual use. By adjusting the game resolution to the maximum, the performance requirements under extreme conditions can be further simulated, thus more comprehensively evaluating the capabilities of the GPU.
[0096] In an alternative embodiment, the method further includes: when it is determined that the power of the power supply currently connected to the computer device meets the power requirement of the computer device, outputting a prompt message indicating that the power supply meets the power requirement; when it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device, obtaining the peak device power consumption of the computer device during the stress test, determining the current power of the computer device based on the peak device power consumption, and outputting a prompt message indicating that the power supply does not meet the power requirement according to the current power and the rated power of the computer device.
[0097] In the above embodiments, when it is detected that the power of the power supply currently connected to the computer device meets the power supply requirements of the device, a prompt message is output to inform the user that the power supply is sufficient, eliminating the user's concern about the power supply performance and confirming that the device can operate stably under normal conditions. When it is detected that the power supply does not meet the requirements, first, the peak device power consumption of the computer device during the stress test is obtained, and this peak represents the maximum power consumption demand of the device under high load. Based on the peak device power consumption, the current power supply power of the computer device is further determined. Since the peak device power is the maximum power consumption that the computer device can reach during the stress test, the peak device power can be used as the current power supply power of the computer device. Finally, a prompt message is output to inform the user that the power supply is insufficient, and it may include the current power supply power, the rated power of the device, and possible solutions or suggestions (such as replacing the power supply with a higher power), enabling the user to directly understand the power supply status of the device. When it is detected that the power supply is insufficient, the system can immediately issue a warning to the user, thus avoiding potential device failures or performance degradation.
[0098] Further, as Figure 1 a specific implementation of the method, an embodiment of the present application provides a power supply power detection device for a computer device, as Figure 3 shown, the device includes:
[0099] An instruction receiving module, configured to receive a power supply power detection instruction and determine a target high-power component in the computer device, where the target high-power component is a component in the computer device whose rated power is higher than a preset power threshold;
[0100] A stress test module, configured to perform a stress test on the target high-power component and obtain the actual power consumption corresponding to the target high-power component;
[0101] A power supply detection module, configured to detect whether the power supply power of the power supply currently connected to the computer device meets the power supply requirements of the computer device according to the actual power consumption and the rated power of the target high-power component.
[0102] In an alternative embodiment, the target high-power components include a central processing unit, a graphics processing unit, a hard disk, an optical drive, and a cooling fan; the stress test module is further configured to:
[0103] Perform stress tests on the central processing unit and the graphics processing unit respectively, and obtain the first actual power consumption of the central processing unit and the graphics processing unit during their respective stress tests;
[0104] The power supply detection module is further configured to:
[0105] Extract a first central processing unit (CPU) power consumption peak corresponding to the first actual power consumption of the CPU, and extract a first graphics processing unit (GPU) power consumption peak corresponding to the first actual power consumption of the GPU;
[0106] If at least one of the conditions that the first CPU power consumption peak is less than the rated power of the CPU and the first GPU power consumption peak is less than the rated power of the GPU is satisfied, it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0107] In an alternative embodiment, the stress test module is further configured to:
[0108] If the first CPU power consumption peak is greater than or equal to the rated power of the CPU and the first GPU power consumption peak is greater than or equal to the rated power of the GPU, perform stress tests on the CPU and the GPU simultaneously, and obtain the respective second actual power consumptions of the CPU and the GPU during the stress test;
[0109] The power supply detection module is further configured to:
[0110] Extract a second CPU power consumption peak corresponding to the second actual power consumption of the CPU, and extract a second GPU power consumption peak corresponding to the second actual power consumption of the GPU;
[0111] If at least one of the conditions that the second CPU power consumption peak is less than the rated power of the CPU and the second GPU power consumption peak is less than the rated power of the GPU is satisfied, it is determined that the power of the power supply currently connected to the computer device does not meet the power requirement of the computer device.
[0112] In an alternative embodiment, the stress test module is further configured to:
[0113] If the second CPU power consumption peak is greater than or equal to the rated power of the CPU and the second GPU power consumption peak is greater than or equal to the rated power of the GPU, perform stress tests on all target high-power components simultaneously, and obtain the respective third actual power consumptions of the target high-power components during the stress test;
[0114] The power supply detection module is further configured to:
[0115] Extract the component power consumption peaks corresponding to the respective target high-power components;
[0116] If the peak component power of each target high-power component is greater than or equal to the corresponding rated power, it is determined that the power of the power supply currently connected to the computer device meets the power supply requirement of the computer device; otherwise, it is determined that the power of the power supply currently connected to the computer device does not meet the power supply requirement of the computer device.
[0117] In an alternative embodiment, the stress test module is further configured to:
[0118] Run the central processing unit stress test software or run at least one preset central processing unit stress test program to perform a stress test on the central processing unit, where the preset processor stress test program is a CPU-intensive program written in advance;
[0119] Run the graphics processing unit stress test software or run at least one graphics-intensive game and adjust the resolution of the graphics-intensive game to the maximum.
[0120] In an alternative embodiment, the stress test module is further configured to:
[0121] Obtain the rated power of each component in the computer device, and calculate the sum of the rated powers of each component as the rated power of the computer device;
[0122] Obtain the power supply power mark value of the power supply connected to the computer device. If the power supply power mark value is greater than or equal to the rated power of the computer device, perform the step of performing a stress test on the target high-power component;
[0123] If the power supply power mark value is less than the rated power of the computer device, it is determined that the power of the power supply currently connected to the computer device does not meet the power supply requirement of the computer device.
[0124] In an alternative embodiment, the power supply detection module is further configured to:
[0125] When it is determined that the power of the power supply currently connected to the computer device meets the power supply requirement of the computer device, output a prompt message indicating that the power supply meets the power supply requirement;
[0126] When it is determined that the power of the power supply currently connected to the computer device does not meet the power supply requirement of the computer device, obtain the peak device power consumption of the computer device during the stress test, and determine the current power supply power of the computer device based on the peak device power consumption, and output a prompt message indicating that the power supply does not meet the power supply requirement according to the current power supply power and the rated power of the computer device.
[0127] It should be noted that for other corresponding descriptions of the various functional units involved in the power detection device of a computer device provided in the embodiments of the present application, reference can be made to Figures 1 to 2 the corresponding descriptions in the method, which will not be elaborated here.
[0128] The embodiments of the present application further provide a computer device, which may specifically be a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory, and a communication interface, and may further include an input / output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the method embodiments are implemented.
[0129] Those skilled in the art can understand that the structure of the above computer device is only a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components, or combine some components, or have different component arrangements.
[0130] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and a computer program is stored thereon. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0131] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties.
[0133] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0134] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0135] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for detecting power supply of a computer device, characterized in that: The method comprises: receiving a power supply power detection instruction, and determining a target high-power component in the computer device, wherein the target high-power component is a component in the computer device whose rated power is higher than a preset power threshold; Performing a stress test on the target high-power component and obtaining actual power consumption corresponding to the target high-power component; According to the actual power consumption and the rated power of the target high-power component, it is detected whether the power of the power supply currently connected to the computer device meets the power requirement of the computer device.
2. The method according to claim 1, characterized in that The target high-power components include a central processing unit, a graphics processing unit, a hard disk, an optical drive, and a cooling fan; the stress test is performed on the target high-power components, and the actual power consumption corresponding to the target high-power components is obtained, including: Performing stress tests on the central processing unit and the graphics processing unit respectively, and obtaining first actual power consumptions of the central processing unit and the graphics processing unit during the respective stress tests; The detecting, according to the actual power consumption and the rated power of the target high-power component, whether the power supply power of the power supply currently connected to the computer device meets the power supply power requirement of the computer device comprises: Extracting a first central processing unit power consumption peak value corresponding to the first actual power consumption of the central processing unit, and extracting a first graphics processing unit power consumption peak value corresponding to the first actual power consumption of the graphics processor; If at least one of the first central processing unit power consumption peak value is less than the rated power of the central processing unit and the first graphics processor power consumption peak value is less than the rated power of the graphics processor is met, it is determined that the power supply power currently connected to the computer device does not meet the power supply power requirement of the computer device.
3. The method according to claim 2, characterized in that The method further comprises: If the peak power consumption of the first central processing unit is greater than or equal to the rated power of the central processing unit and the peak power consumption of the first graphics processing unit is greater than or equal to the rated power of the graphics processing unit, stress testing the central processing unit and the graphics processing unit simultaneously, and obtaining the second actual power consumption of each of the central processing unit and the graphics processing unit during the stress testing process; Extracting a second central processing unit power consumption peak value corresponding to the second actual power consumption of the central processing unit, and extracting a second graphics processing unit power consumption peak value corresponding to the second actual power consumption of the graphics processor; If at least one of the following conditions is met: the second CPU power consumption peak is less than the rated power of the CPU and the second GPU power consumption peak is less than the rated power of the GPU, it is determined that the power supply power currently connected to the computer device does not meet the power supply power requirement of the computer device.
4. The method according to claim 3, characterized in that The method further comprises: If the peak power consumption of the second central processing unit is greater than or equal to the rated power of the central processing unit and the peak power consumption of the second graphics processing unit is greater than or equal to the rated power of the graphics processing unit, stress testing is performed on all target high-power components at the same time, and the third actual power consumption of each target high-power component during the stress testing process is obtained; Extract the component power peak value corresponding to each target high-power component respectively; If the component power peaks of each target high-power component are greater than or equal to the corresponding rated power, it is determined that the power supply power of the power supply currently connected to the computer device meets the power supply power requirements of the computer device; otherwise, it is determined that the power supply power of the power supply currently connected to the computer device does not meet the power supply power requirements of the computer device.
5. The method according to any one of claims 2 to 4, characterized in that Performing stress testing on the central processing unit, including: Running a CPU stress test software or running at least one preset CPU stress test program to implement stress testing of the CPU, wherein the preset CPU stress test program is a pre-written CPU intensive program; Performing a stress test on the graphics processor includes: Run graphics processor stress test software or run at least one graphics-intensive game and adjust the resolution of the graphics-intensive game to the maximum.
6. The method according to any one of claims 1 to 4, characterized in that Before performing the stress test on the target high-power component, the method further includes: Obtaining the rated power of each component in the computer device, and calculating the sum of the rated power of each component as the rated power of the computer device; Obtaining a power supply power mark value of a power supply connected to the computer device, and if the power supply power mark value is greater than or equal to the rated power of the computer device, executing a step of performing a stress test on the target high-power component; If the power source power mark value is less than the rated power of the computer device, it is determined that the power source power of the power source currently connected to the computer device does not meet the power source power requirement of the computer device.
7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: When it is determined that the power supply currently connected to the computer device meets the power supply requirement of the computer device, outputting prompt information that the power supply meets the power supply requirement; When it is determined that the power supply power of the power supply currently connected to the computer device does not meet the power supply power requirement of the computer device, the peak power consumption of the computer device during the stress test is obtained, and the current power supply power of the computer device is determined based on the peak power consumption of the device, and a prompt message is provided that the power supply does not meet the power supply power requirement based on the current power supply power and the rated power of the computer device.
8. A power detection device for a computer device, characterized in that: The device comprises: An instruction receiving module, used to receive a power supply power detection instruction and determine a target high-power component in the computer device, wherein the target high-power component is a component in the computer device whose rated power is higher than a preset power threshold; A stress test module, used to perform a stress test on the target high-power component and obtain the actual power consumption corresponding to the target high-power component; The power supply detection module is used to detect whether the power supply power of the power supply currently connected to the computer device meets the power supply power requirement of the computer device according to the actual power consumption and the rated power of the target high-power component.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.