X-ray free electron laser (XFEL) pulse time diagnosis technology is often used to detect the relative arrival time of XFEL pulse and auxiliary laser near the experimental station. It is an important auxiliary technology and provides a reference signal for the pump-probe pulse in the XFEL laser pump-probe experiment. With the development of XFEL towards high repetition frequency and short pulse, higher requirements are put forward for diagnostic frequency, pump sample and resolution in time diagnosis. The technology is realized by the pump-probe method and optical cross-correlation method. When the XFEL pulse is incident on the high-bandwidth semiconductor solid target instantaneously, the complex refractive index of the solid target will change, then the arrival time of XFEL will be encoded in the mutation space. In thiswork, we design an XFEL pulse arrival time diagnostic device based on two methods: spatial coding and spectral coding. In this framework, the interaction between X-ray and solid target is explored by Beer's absorption theory and atomic scattering theory. Therefore, the response to X-ray absorption and refractive index in this process are investigated, and the solid target selection model is developed. This model is used to analyze the influence of solid target type and thickness in diagnosis, while avoiding situations where the sample is too hot due to a lot X-ray absorption. Moreover, the influence of hard X-ray on sample temperature at high frequency is considered, and the samples suitable for different X-ray bands are given. The chirped pulse modulation in spectral coding is analyzed, and the influence of dispersion medium and pulse parameters on the diagnostic resolution of spectral coding are obtained. Finally, the error effects of X-ray, spatial coding and spectral coding on the results are analyzed, and the analysis methods and consideration factors of the two coding methods are given. This work is of great significance in using the XFEL pulse arrival time diagnostic device.