Learning of software upgrade methods and devices for blockchain