| Algebraic coding theory plays an important role in promoting the development of digital communication.Finite field theory has always been one of the important tools of algebraic coding theory.In the finite field Fq,the error-correcting code C whose minimum distance reaches the Singleton bound is called MDS code.The error-correcting code C satisfying C=C⊥is called self-dual code.The error-correcting code C satisfying C(?)C⊥is called self-orthogonal code.In recent years,MDS self-dual codes and MDS self-orthogonal codes have attracted the attention and research of scholars because of their dual advantages.Based on previous studies,this paper considers the existence of MDS self-dual codes in odd characteristic finite fields.Several classes of MDS self-dual codes and MDS self-orthogonal codes are constructed by using GRS codes and extended GRS codes.The main results are as follows:Let q=r~2,r is an odd prime power.Suppose s and t are even factors of q-1 with s|r+1 and t|r-1.Let l=(q-1)/s,m=(q-1)/t,1≤h≤(?),1≤c≤t/2.1、If the parameters satisfy one of the following conditions,there exist a q-ary MDSself-dual code of the length n=hl+mc:(1)h is even,r≡1(mod 4);(2)h is odd,r≡3(mod 4),2s r+1.2、If the parameters satisfy one of the following conditions,there exist a q-ary MDSself-dual code of the length n+2=hl+mc+2:(1)h is even,r≡3(mod 4);(2)h is odd,r≡1(mod 4),2s r+1;(3)h is odd,r≡3(mod 4),2s(?)r+1.3、There exists an[n,k]qMDS self-orthogonal with 1≤k≤(n/2)-1 of length n=hl+mc4、If the parameters satisfy one of the following conditions,there exist a q-ary MDSalmost self-dual code of the length n+1=hl+mc+1:(1)h is even,r≡3(mod 4);(2)h is odd,r≡3(mod 4),2s|r+1. |