In recent years, deep learning has been applied to a variety of scenarios in Industrial Internet of Things (IIoT), including enhancing the security of IIoT. However, the existing deep learning methods utilised in IIoT security are manually designed by heavily relying on the experience of the designers. The authors have made the first contribution concerning the joint optimisation of neural architecture search and hyper-parameters optimisation for securing IIoT. A novel automated deep learning method called synchronous optimisation of parameters and architectures by GA with CNN blocks (SOPA-GA-CNN) is proposed to synchronously optimise the hyperparameters and block-based architectures in convolutional neural networks (CNNs) by genetic algorithms (GA) for the intrusion detection issue of IIoT. An efficient hybrid encoding strategy and the corresponding GA-based evolutionary operations are designed to characterise and evolve both the hyperparameters, including batch size, learning rate, weight optimiser and weight regularisation, and the architectures, such as the block-based network topology and the parameters of each CNN block. The experimental results on five intrusion detection datasets in IIoT, including secure water treatment, water distribution, Gas Pipeline, Botnet in Internet of Things and Power System Attack Dataset, have demonstrated the superiority of the proposed SOPA-GA-CNN to the state-of-the-art manually designed models and neuron-evolutionary methods in terms of accuracy, precision, recall, F1score, and the number of parameters of the deep learning models.