## 1 Introduction  
Ultrafast X-ray diffraction (UXRD), which combines the sub-picosecond temporal resolution and sub-angstrom spatial resolution, can be used as a camera to real-time map atomic motions in reciprocal space and thus decipher those nonequilibrium phenomena in condensed matter physics, such as photoinduced phase transitions [1; 2] and photoacoustic stress propagation [3; 4; 5]. Large-scale accelerator-generated X-ray sources (e.g., synchrotrons or X-ray free-electron laser (XFEL)) with high brightness and good stability are ideal for time-resolved diffraction [6; 7; 8], but their high cost and limited beamtime limit the extensive use. Laser plasma-based X-ray sources with advantages of ultrashort pulse duration and low cost then emerge as a valuable supplement to large-scale accelerator-based sources. However, the relatively low brightness and flux stability of ultrashort X-ray pulses greatly hinder its performance in measuring poor quality single-crystal or polycrystalline samples considering that UXRD usually needs a long time to acquire enough diffracted X-ray photons for a high-quality diffraction pattern. In fact, the flux of laser plasma X-ray sources is generally on the order of 10\({}^{10}\) photons/s [9; 10; 11].  
Since the 21 century, the development of femtosecond laser technology has enabled the generation of ultrashort hard X-ray pulses with a kilohertz repetition rate [12; 13; 14; 15; 16]. Since then, substantial efforts have been devoted to improving the reliability and photon flux in the femtosecond laser plasma-induced X-ray source, mainly including (i) optical designs to change the wavelength of laser pulses from 800 nm to mid-infrared [17; 18] or increase the contrast between the pre-pulse and the main pulse [19; 20]; and (ii) mechanical designs to enhance the laser pointing stability on the target foil surface [12]. Nevertheless, the fluctuation of pulse-to-pulse stability of photon flux in hard X-ray sources is still larger than 2% (root-mean-square (RMS)) and the total photon flux of less than 1011 photons/s is serval orders of magnitude lower than one in large-scale ultrashort X-ray sources [10; 12; 16; 21]. These key metrics largely restrict the application of laser-plasma-based hard X-ray pulse sources and further improvements are required. In this work, we have designed and demonstrated a novel, highly compact Cu-K\({}_{\alpha}\) X-ray ultrashort source operating at a kHz repetition rate, which provides a reliable pulse-to-pulse stability with a fluctuation of 1% (RMS) and a total flux of Cu-K\({}_{\alpha}\) X-ray photons above 1011 photons/s. The superior performance of our novel hard X-ray pulses is mainly due to the optimization of both the software and hardware. From a hardware perspective, an independent copper reaction chamber is designed to prevent the spread of debris. Furthermore, a homemade target tape driving system based on a stepping motor and the laser displacement sensor is introduced to ensure the smooth moving of the target tape. While from a software perspective, the home-built software that can simultaneously control the target tape driver, monitor laser focal spot/optical alignment, and automatically obtain transient data traces, is adopted to ensure the stable and efficient operation of our X-ray sources. To verify the functionality of our X-ray pulse sources, UXRD experiments on different samples are conducted, which show a good consistency with previous results obtained in other X-ray sources.