The invention discloses a power determination method, a switch, a storage medium and a program product, and is applied to the technical field of
Ethernet power supply. The power determination method is applied to the switch, and the switch comprises a mainboard and an output port. The method comprises the following steps: acquiring operation parameters of the switch, wherein the operation parameters comprise mainboard temperature, output port number,
transmission rate and wire length of each output port, and
total current; a first coefficient is calculated based on the mainboard temperature, a second coefficient is calculated based on the
transmission rate and the
line length of each output port, a third coefficient is calculated based on the
total current, and the first coefficient, the second coefficient and the third coefficient are all proportions of the actual
power consumption of the mainboard to the reference
power consumption; determining the actual
power consumption of the mainboard based on the first coefficient, the second coefficient, the third coefficient and the reference power consumption; and determining an external total
power budget of the output port based on the rated power of the switch and the actual power consumption of the mainboard. The external total
power budget can be improved, and the on-load performance of the switch and the user experience can be improved.