A hardware acceleration method, comprising: obtaining source code; compiling a code segment in the source code into first executable code matching a first processor and running in the first processor; and if first execution information collected by the first processor for executing the first executable code by the first processor is received, determining , according to the first execution information, that the code segment corresponding to the first executable code matches a second processor, and compiling the code segment corresponding to the first executable code into second executable code, wherein the second executable code is executable code matching the second processor; wherein the first execution information comprises a first execution parameter of the first executable code in the first processor, and the determining, according to the first execution information, that the code segment corresponding to the first executable code matches a second processor comprises: when the first execution parameter exceeds a first threshold, determining that the code segment corresponding to the first executable code matches the second processor, wherein the first threshold is determined according to estimating a second execution parameter of the code segment corresponding to the first executable code in the second processor; and wherein the first execution parameter is an execution duration of the first executable code in the first processor, and the estimated second execution parameter is an estimated execution duration of the second executable code in the second processor; or wherein the first execution parameter is a quantity of execution times of the first executable code in the first processor, and the estimated second execution parameter is an estimated quantity of execution times of the second executable code in the second processor. obtaining source code; compiling a code segment in the source code into first executable code matching a first processor and running in the first processor; and if first execution information collected by the first processor for executing the first executable code by the first processor is received, determining , according to the first execution information, that the code segment corresponding to the first executable code matches a second processor, and compiling the code segment corresponding to the first executable code into second executable code, wherein the second executable code is executable code matching the second processor; wherein the first execution information comprises a first execution parameter of the first executable code in the first processor, and the determining, according to the first execution information, that the code segment corresponding to the first executable code matches a second processor comprises: when the first execution parameter exceeds a first threshold, determining that the code segment corresponding to the first executable code matches the second processor, wherein the first threshold is determined according to estimating a second execution parameter of the code segment corresponding to the first executable code in the second processor; and wherein the first execution parameter is an execution duration of the first executable code in the first processor, and the estimated second execution parameter is an estimated execution duration of the second executable code in the second processor; or wherein the first execution parameter is a quantity of execution times of the first executable code in the first processor, and the estimated second execution parameter is an estimated quantity of execution times of the second executable code in the second processor. <EOS>