Diesel, one of the main petroleum products, is widely used in industry and transportation. Only high quality diesel product can survive in the more and more competitive market. The optimization methodology for diesel production and management is critical to refineries' profitability. LP/MIP models have been applied in diesel blending planning and scheduling in the last decades. With the benefits of reducing the model scale and computing efforts, LP/MIP models lead to operation results with inaccurate property estimation and profit loss due to the accuracy loss in the linearisation of blending models. To improve model accuracy, more accurate property prediction models for diesel blending should be incorporated into the refinery planning and schedule methods to improve decision making procedure in the case of scheduling for diesel blending, where academic effort is almost absent. A model for planning of refinery diesel streams is developed to optimise the diesel production of a refinery. Nonlinear blending models are applied to calculate blending properties more precisely than conventional linear models. Due to the large number of equations and variables, it may be generated to an infeasible solution if the given initial points are not good enough. To avoid this situation, a solution algorithm is proposed. Based on the NLP planning model, a model for scheduling diesel blending is developed. In order to improve the model accuracy, nonlinear blending correlations are used, which lead to a complicated MINLP problem that cannot be solved by existing MINLP solver directly. A robust solution algorithm is proposed in this thesis to help optimizing the MINLP problem. A case study of diesel production blending scheduling is introduced to illustrate how to model a diesel blending scheduling problem and the efficient and reliability of the solution algorithm. Besides, the proposed MINLP model and the solution algorithm can be extensively applied to other processes in a refinery, such as gasoline blending. Once gasoline blending models are taken into account, the model can be modified to optimize the gasoline blending scheduling problem.