Power supply voltage control method and apparatus, blockchain server, and storage medium
Embodiments of this application provide a power supply voltage control method and apparatus, a blockchain server, and a storage medium. The method includes: determining a voltage determination parameter based on a ratio of a first value to a second value, where the first value is a number of cores in an operating state in a blockchain server, and the second value is a total number of cores in the blockchain server; determining a target voltage value of a power supply of the blockchain server based on the voltage determination parameter; and controlling a value of an output voltage of the power supply to be the target voltage value.
1 . A power supply voltage control method, comprising:
determining a voltage determination parameter based on a ratio of a first value to a second value, wherein the first value is a number of cores in an operating state in a blockchain server, and the second value is a total number of cores in the blockchain server;
determining a target voltage value of a power supply of the blockchain server based on the voltage determination parameter; and
controlling a value of an output voltage of the power supply to be the target voltage value,
wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing a voltage value of the power supply with a predetermined uniform voltage adjustment step until the voltage determination parameter remains unchanged or starts to decrease; then gradually reducing the voltage value with the voltage adjustment step; and when the voltage determination parameter starts to decrease, determining a sum of the current voltage value of the power supply and one said voltage adjustment step as the target voltage value, or determining a maximum value of the voltage determination parameter of the blockchain server during a frequency up-conversion stage after startup as a predetermined target value; and
gradually adjusting, based on a relative magnitude between the voltage determination parameter and the predetermined target value, the voltage value of the power supply with the voltage adjustment step to determine the target voltage value of the power supply of the blockchain server.
2 . The method according to claim 1 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually reducing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is equal to the predetermined target value; and
determining a result of summation of a current voltage value of the power supply and a single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter starts to decrease.
3 . The method according to claim 1 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is less than the predetermined target value;
determining a result obtained by subtracting a single voltage adjustment step from a current voltage value of the power supply as the target voltage value when the voltage value is increased until the voltage determination parameter remains unchanged; and
gradually reducing the voltage value with the voltage adjustment step when the voltage value is increased until the voltage determination parameter starts to decrease, and determining a result of summation of the current voltage value of the power supply and the single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter first increases, then remains unchanged, and then starts to decrease.
4 . The method according to claim 1 , further comprising:
determining the second value based on a number of chips in the blockchain server and a number of cores included in each of the chips.
5 . The method according to claim 1 , further comprising:
transmitting computing tasks to all cores in the blockchain server, respectively;
counting cores that execute the computing tasks to return a specified random number; and
determining a number of the counted cores as the first value.
6 . A blockchain server, comprising:
a chip board, comprising a plurality of chips, wherein each of the chips comprises at least one core; and
a control board, comprising a memory and a processor, wherein the memory stores an application that, when executed by the processor, implements a power supply voltage control method according to claim 1 comprising:
determining a voltage determination parameter based on a ratio of a first value to a second value, wherein the first value is a number of cores in an operating state in the blockchain server, and the second value is a total number of cores in the blockchain server;
determining a target voltage value of a power supply of the blockchain server based on the voltage determination parameter; and
controlling a value of an output voltage of the power supply to be the target voltage value,
wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing a voltage value of the power supply with a predetermined uniform voltage adjustment step until the voltage determination parameter remains unchanged or starts to decrease; then gradually reducing the voltage value with the voltage adjustment step; and when the voltage determination parameter starts to decrease, determining a sum of the current voltage value of the power supply and one said voltage adjustment step as the target voltage value, or
determining a maximum value of the voltage determination parameter of the blockchain server during a frequency up-conversion stage after startup as a predetermined target value; and gradually adjusting, based on a relative magnitude between the voltage determination parameter and the predetermined target value, the voltage value of the power supply with the voltage adjustment step to determine the target voltage value of the power supply of the blockchain server; and
wherein the chip board forms a signal connection to the control board through a signal connection interface, and the chip board forms an electrical connection to the power supply through a power connection interface.
7 . The blockchain server according to claim 6 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually reducing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is equal to the predetermined target value; and
determining a result of summation of a current voltage value of the power supply and a single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter starts to decrease.
8 . The blockchain server according to claim 6 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is less than the predetermined target value;
determining a result obtained by subtracting a single voltage adjustment step from a current voltage value of the power supply as the target voltage value when the voltage value is increased until the voltage determination parameter remains unchanged; and
gradually reducing the voltage value with the voltage adjustment step when the voltage value is increased until the voltage determination parameter starts to decrease, and determining a result of summation of the current voltage value of the power supply and the single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter first increases, then remains unchanged, and then starts to decrease.
9 . The blockchain server according to claim 6 , the method further comprising:
determining the second value based on a number of chips in the blockchain server and a number of cores included in each of the chips.
10 . The blockchain server according to claim 6 , the method further comprising:
transmitting computing tasks to all cores in the blockchain server, respectively;
counting cores that execute the computing tasks to return a specified random number; and
determining a number of the counted cores as the first value.
11 . A non-transitory computer-readable storage medium, storing computer-readable instructions, wherein the computer-readable instructions are used for performing a power supply voltage control method comprising:
determining a voltage determination parameter based on a ratio of a first value to a second value, wherein the first value is a number of cores in an operating state in a blockchain server, and the second value is a total number of cores in the blockchain server;
determining a target voltage value of a power supply of the blockchain server based on the voltage determination parameter; and
controlling a value of an output voltage of the power supply to be the target voltage value,
wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing a voltage value of the power supply with a predetermined uniform voltage adjustment step until the voltage determination parameter remains unchanged or starts to decrease; then gradually reducing the voltage value with the voltage adjustment step; and when the voltage determination parameter starts to decrease, determining a sum of the current voltage value of the power supply and one said voltage adjustment step as the target voltage value, or
determining a maximum value of the voltage determination parameter of the blockchain server during a frequency up-conversion stage after startup as a predetermined target value; and gradually adjusting, based on a relative magnitude between the voltage determination parameter and the predetermined target value, the voltage value of the power supply with the voltage adjustment step to determine the target voltage value of the power supply of the blockchain server.
12 . The non-transitory computer-readable storage medium according to claim 11 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually reducing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is equal to the predetermined target value; and
determining a result of summation of a current voltage value of the power supply and a single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter starts to decrease.
13 . The non-transitory computer-readable storage medium according to claim 11 , wherein the determining the target voltage value of the power supply of the blockchain server based on the voltage determination parameter comprises:
gradually increasing the voltage value of the power supply with the voltage adjustment step when the voltage determination parameter is less than the predetermined target value;
determining a result obtained by subtracting a single voltage adjustment step from a current voltage value of the power supply as the target voltage value when the voltage value is increased until the voltage determination parameter remains unchanged; and
gradually reducing the voltage value with the voltage adjustment step when the voltage value is increased until the voltage determination parameter starts to decrease, and determining a result of summation of the current voltage value of the power supply and the single voltage adjustment step as the target voltage value when the voltage value is reduced until the voltage determination parameter first increases, then remains unchanged, and then starts to decrease.
14 . The non-transitory computer-readable storage medium according to claim 11 , the method further comprising:
determining the second value based on a number of chips in the blockchain server and a numb of cores included in each of the chips.