Relay location planning method based on online self-optimization