The invention relates to a method and system for implementing automatic programming. The system comprises a data structure and service interface compiler, a service logic compiler, a data structure and service interface description file, a service logic description file, a foundation library and a platform related compiler. The method comprises the following steps of: 1, defining the syntax of the data structure and service interface description file; 2, defining the syntax of the service logic description file; 3, writing the data structure and service interface compiler; 4, writing the service logic compiler; 5, writing the data structure and service interface description file; 6, compiling the data structure and service interface description file; 7, writing the service logic description file; 8, compiling the service logic description file; and 9, performing platform related compiling link, and compiling a project source program file to generate a platform related executable file by using the platform related compiler. The invention has the advantages of reducing the programming training cost, programming errors and time required for debugging and reducing the time costs for writing, debugging and modifying programs.