Can software apply for utility model patent?

That depends on what software you have.

If it's a software patent about a pure computer, it's not within the scope of patent protection.

However, if you really want to apply for a patent in this field, you can change your statement slightly when writing the patent, so you can also apply.

do you want to apply for a utility model patent or an invention patent?