The era of big data (BD) has arrived. How to train models to find correlations in data and help people make decisions has become a major research topic and direction. As an elastic and scalable distributed computing mode (refers to a whole consisting of multiple interconnected computers that cooperate to perform a common or different task in a set of system software environments, with minimal reliance on centralized control processes, data, and hardware), cloud computing can provide powerful computing and storage capabilities and has been widely used in BD query and difficult processing. This paper aims to study the algorithm in the environment of cloud computing. Different from the traditional research algorithms, the relational BD algorithm is controllable in real time. Moreover, it has been optimized and upgraded on the previous real-time controllable algorithm. Also, it performs serial and parallel simulation tests on the algorithm. When the optimal situation of the parallel algorithm is obtained, the test results show that the relevant mining time of the optimized algorithm is significantly shorter than the traditional data mining time under the same dataset. The traditional mining time is about 3.5 times the data mining time of this paper, and the running power consumption of the optimization algorithm is reduced to 20 W.