The oil industry is investing in artificial intelligence and sophisticated data analysis to keep it competitive in a changing energy market.