Traditional wireless sensor networks are vulnerable to data interception and tampering due to their low security. In order to meet the data security requirements under the current data explosion network environment, based on the traditional wireless sensor network, an intermediate node storage node is added between the sensing node and the base station to form a two-layer wireless sensor network, which makes the data management more secure, and makes the network expansion, deletion, and maintenance more convenient. At the same time, in the process of data encryption, lightweight national encryption algorithms SM2 and SM3 are used to improve the speed of data encryption while reducing the hardware demand for data. Therefore, a network model of "two-layer wireless sensor network data encryption based on national security algorithm" is proposed.