I want to exclude all contract account to use my contract. How can I detect the account has deployed contract or not?
Unfortunately, this isn't possible at the moment. The best you can do is have an oracle that keeps track of this information and query a table from the oracle, however this isn't guaranteed to work as oracle's can break or go offline and in general are 'centralised solutions'.
This is no contract account like ETH, there are only accounts who deployed contracts, so you can't judge wether an account is so called contract account or not just by name.
You can use
cleos get code accountname
and check the code hash result
cleos get code notacontract code hash: 0000000000000000000000000000000000000000000000000000000000000000 cleos get code eosio code hash: 66444bcdb50a89cec3e028e94d9d096bee050377048ba48cd6bea172ecdf6f85
There are several tools such as EOSpark which provide all the details of an EOS account including deployed contract details. You simply enter the account name on the website/portal. It provides information including EOS balance, how custom tokens & airdrops, transaction details (including any deployed contracts), staking/unstaking, ect.