The invention discloses a masonry algorithm of a bricking robot linear wall and taking plasticity of mortar into consideration. The masonry algorithm comprises the following steps that a, a datum coordinate system is determined; b, the number of bricks and an arrangement mode of each brick are calculated; c, the coordinate position of each brick is calculated; d, The distance J between a linear track and a wall center line is determined; e, the mortar plastic time is determined, the number N of needed bricking robots is calculated, the number NS of bricked bricks of each standing posture of each robot is calculated, and the distance S between the adjacent standing postures is calculated; f, the number N of the needed bricking robots is calculated according to the mortar plastic time; and g, the bricking order of each robot is set up, an action command is sent to a programming control system, so that the programming control system implements corresponding action to conduct masonry of the linear wall. According to the masonry algorithm, By taking mortar plasticity condition into consideration, masonry is achieved through the multiple robots, the number of the bricked bricks of each robot is determined, the brick clamping and bricking processes are completed in the plasticity time of the mortar, the practicability is high, and the overall masonry efficiency is improved.