Your pain is most probably due to ovarian cysts (fluid filled sacs on ovaries). These can appear periodically increasing in size during ovulation and can break causing sharp pain. They can occur without any specific cause and are common in reproductive age group. When associated with other problems like irregular periods, acne, increased body hair (hirsutism) and high blood sugar ovarian cysts can be due to PCOD (Polycystic ovarian disease). If you are having any such problems, do consult your Gynecologist for hormonal analysis and treatment as PCOS can cause infertility.
Uncomplicated ovarian cysts usually resolve spontaneously and doctors follow a wait and watch approach in most cases. But, as you are having bothersome symptoms since 2 years, further evaluation and intervention by a Gynecologist is necessary. If required, cysts can be removed laparoscopically. Birth control pills (combined oral contraceptives ) can be useful in reducing the cyst formation and pain by preventing the ovulation.
An ultrasound examination can reveal the size and nature of cysts. Cysts persisting for long periods can be due to ovarian tumors. Tumor cysts can be filled with blood and should be examined with CT/MRI. Most tumors are usually benign in reproductive age group but blood tests for tumor marker CA-125 can be useful in case of suspicion of cancer. Tumors can be surgically removed by laparotomy and followed up with chemotherapy/radiotherapy.
Thank you. Do let me know if you have any further questions.