For thermal diagnostics of friction determining the time dependence of frictional heat generation and, accordingly, the moment of friction in self-lubricating sliding bearings using temperature data, an algorithm for solving the inverse problem of heat conduction by iterative regularization is proposed. The iterative regularization algorithm for restoring the frictional heat generation function from temperature data using a three-dimensional model of the thermal process and taking into account the speed of the swinging movement of the shaft is implemented. An assumption was made about the uniform distribution of specific heat generation along the length of the bearing to simplify the formulation of the problem. The numerical solution of the model problem was carried out with the shaft oscillating with a frequency of 1 Hz and amplitude of 7.5°. The time step was chosen from the Courant condition and was 0.1 s. The full-time interval was divided into local ones when solving the inverse problem in order to avoid storing large arrays of temperature data at each iteration. The solutions at the junctions of local intervals were glued. A condition for stopping the iterative process of restoring the frictional heat generation function is proposed, taking into account the total error in temperature measurements and calculations using local intervals. Calculations show that the accuracy of restoring the function of the specific intensity of frictional heat generation using the developed algorithm for solving the inverse problem of 9.9% is commensurate with the accuracy of 3.8% of specifying temperature information. The developed algorithm for determining frictional heat generation using a 3D model of the thermal process can be used to determine the friction torque from temperature data in real self-lubricating sliding bearings operating in the oscillation mode.