Investigation of the mechanism of solar flare and acceleration of solar cosmic rays in real conditions of the solar corona