An electro-hydraulic braking system, comprising: a main casing; characterized in that a hydraulic unit brake master cylinder is provided in the main casing, an outer end of a piston rod of the brake master cylinder is connected to a first end of an output top rod, a second end of the output top rod is provided with an input rod, a first end of the input rod is slidably connected in the main casing along only a length direction of the input rod, and a second end of the input rod is provided with a push rod that is configured to transmit a force from a brake pedal; a reset member and a displacement sensor are provided; the displacement sensor is arranged in the main casing, wherein the reset member is configured to push the push rod away from the brake master cylinder to reset and the displacement sensor is configured to sense a displacement of the push rod; and the input rod and the output top rod are set to be spaced or abutted on each other; when the input the input rod and the output top rod are spaced, a system performs a regenerative brake by a vehicle drive motor torque; when the input rod and the output top rod are abutted on each other, the system uses the regenerative brake of the vehicle drive motor torque as a primary braking force, and uses hydraulic braking generated by the output top rod pushing the piston rod of the brake master cylinder as a compensatory braking force; the displacement sensor comprises a magnetic element and a Hall sensor, and the Hall sensor is configured to sense a relative displacement of the magnetic element; characterized in that the reset member is arranged in the main casing; the magnetic element comprises lateral magnetic blocks and longitudinal magnetic blocks, wherein the lateral magnetic blocks and the longitudinal magnetic blocks are distributed along a moving direction of the push rod, the lateral magnetic blocks are located on the same straight line and have the same north magnetic pole orientation, one of the longitudinal magnetic blocks is provided between adjacent lateral magnetic blocks among the lateral magnetic blocks, a direction of a connecting line between two magnetic poles of each of the longitudinal magnetic blocks is perpendicular to a direction of a connecting line between two magnetic poles of each of the lateral magnetic blocks, and adjacent longitudinal magnetic blocks among the longitudinal magnetic blocks have opposite north magnetic pole orientations. a reset member and a displacement sensor are provided; the displacement sensor is arranged in the main casing, wherein the reset member is configured to push the push rod away from the brake master cylinder to reset and the displacement sensor is configured to sense a displacement of the push rod; and the input rod and the output top rod are set to be spaced or abutted on each other; when the input the input rod and the output top rod are spaced, a system performs a regenerative brake by a vehicle drive motor torque; when the input rod and the output top rod are abutted on each other, the system uses the regenerative brake of the vehicle drive motor torque as a primary braking force, and uses hydraulic braking generated by the output top rod pushing the piston rod of the brake master cylinder as a compensatory braking force; the displacement sensor comprises a magnetic element and a Hall sensor, and the Hall sensor is configured to sense a relative displacement of the magnetic element; characterized in that the reset member is arranged in the main casing; the magnetic element comprises lateral magnetic blocks and longitudinal magnetic blocks, wherein the lateral magnetic blocks and the longitudinal magnetic blocks are distributed along a moving direction of the push rod, the lateral magnetic blocks are located on the same straight line and have the same north magnetic pole orientation, one of the longitudinal magnetic blocks is provided between adjacent lateral magnetic blocks among the lateral magnetic blocks, a direction of a connecting line between two magnetic poles of each of the longitudinal magnetic blocks is perpendicular to a direction of a connecting line between two magnetic poles of each of the lateral magnetic blocks, and adjacent longitudinal magnetic blocks among the longitudinal magnetic blocks have opposite north magnetic pole orientations.