A Code Base File Generation, Code Search, Joining, Optimization, and Porting Method is disclosed. , First, the library file of each meta-code segment is generated, the characteristic information of each meta-code segment is stored in the library file, and the feature information in the library file is extracted and stored in the summary file together with the address of the library file, The usercan get the code segment of the library file by retrieving the summary file to realize the code recommendation, and then add the code segment selected by the user to the source code written by the user according to the user's settings to realize the code connection, on this basis, the automatic code optimization and the application of auxiliary program transplantation can be realized. The summaryfile pointing to the library file of the invention only stores the simplified characteristic information of the metacode segment, so that only the input/output parameter types of the code segment andthe output result and the like are analyzed, the full-text semantic analysis of the code segment is not needed, and the content of the metacode segment is summarized and the calculation amount of thecharacteristic is reduced.