Inclusion Criteria:  Volunteer to participate in this clinical study and sign the ICF before the study begins; Aged 40-80 (including 40 and 80) ; Female or male subjects with child-bearing potential who agree and promise to take effective contraceptive measures; Diagnosed with IPF according to the Official ATS/ERS/JRS/ALAT Clinical Practice Guideline for IPF Diagnosis (2018); FEV1/FVC ≥ 0.7; FVC ≥ 45% predicted; DLCO corrected for Haemoglobin (Hb) ≥ 30% predicted of normal; In the opinion of the Investigator, subjects are willing and able to comply with the protocol requirements and attend the visit.  Exclusion Criteria:  In the opinion of the Investigator, subjects underwent significant deterioration in IPF within one month before randomization; Interstitial lung disease caused by other known causes; Any bacterial, viral, parasitic or fungal infection that needs to be treated at screening; Expected to receive lung transplantation during the study; Expected survival is less than 6 months; History of tumors within 5 years before screening (except for localized cancers such as basal cell carcinoma); Moderate to severe hepatic insufficiency (Child-Pugh grade B or C, see Appendix 4); History of unstable or worsening heart disease within 6 months before screening; Cannot perform 6MWT or PFT; Allergic to any component of HEC585 Tablets or pirfenidone tablets; Participated in other clinical study and received the last dose within 3 months before screening; Pregnant or breastfeeding; History of smoking within 3 months before screening or are unwilling to quit smoking during the study; Subjects often drink alcohol within 6 months before the screening (drink more than 21 units of alcohol a week), or refuse to reduce alcohol intake during the study; History of drug abuse within 6 months before the screening; Family or personal history of QT prolongation syndrome; Any condition that, in the opinion of the investigator, would compromise the safety or compliance of the subject, or prevent the subject from completing the study. TBil > 1.5 × ULN or AST or ALT > 2 × ULN; CLcr < 50 mL/min; Human immunodeficiency virus (HIV) antibody is positive; Uncontrolled hepatitis B virus infection or hepatitis C virus infection; QTcF > 480 ms.  Subjects have received any of the following treatments within 28 days before randomization:  Any cytotoxic drug or immunosuppressant Therapeutic drugs for IPF, including but not limited to pirfenidone, nintedanib, prednisone at > 15 mg/d or other glucocorticoids of the equivalent dose, N-acetylcysteine at > 600 mg/d. Moderate and strong inhibitor or strong inducer of CYP1A2. Strong inducers or strong CYP3A4 inhibitors.