There are multiple reasons for ulcers ranging from stress induced to multivit deficiency to traumatic origin and in few tobacco induced ulcers which could be cancerous in nature , in your case it looks more like stress induced but please visit a qualified dentist to know the exact origin , taking multivitamins will help and local anaesthetic application on the ulcer will take the pain off if any
Next Steps
Visit a dentist near by
Health Tips
For immediate relief you can get a laser treatment