You need to understand how the song is created, which should allow you then to unlock some of the harmonic elements within it. You can take a modal approach to soloing, which is cool, and then subvert it by substituting the modes.
Bass solos can be great, but they can also be woefully indulgent. One of the main reasons is that it's difficult to make intervalic leaps. It's also that bass itself is low end, and solos can sound muddy to the listener.
It can also be difficult to play with time as you're there to underpin everything.
Personally, I'd avoid an extended solo - even in a group jam. In some cases, it can help you get the gig as there's nothing worse than seeing someone getting lost in the groove, and then just getting lost.
If you want to study it, there are some great books out there, but they're focussed around jazz playing. One thing that helped me was to start to listen to horn players. They can help to highlight how to outline changes while creating new melodies on top. It can be quite tough to follow sometimes, but it's how a number of contemporary bass players found their own voices.