A method for generating a digital signature, the method comprising: generating, by a device, a digital signature parameter r satisfying a validity judgment condition; generating, by the device, a digital signature parameter s using a private key d A, a random number k in the range [1, n-1], the digital signature parameter r, and an elliptical curve parameter n in the equation of: s = 1 + d A − 1 ⋅ r + k − r mod n; judging, by the device, whether the digital signature parameter s is 0, and if the digital signature parameter s is 0, then regenerating a digital signature parameter r satisfying the validity judgment condition, and regenerating the digital signature parameter s using the private key d A, a regenerated random number k in the range [1, n -1], the digital signature parameter r regenerated, and the elliptical curve parameter n until the digital signature parameter s is not 0; and converting, by the device, the data type of the resulting digital signature parameter r and digital signature parameter s which is not 0 into a string of bytes to obtain a digital signature ( r, s); wherein generating, by the device, the digital signature parameter s in the equation of s = ((1 + d A) -1 · ( r + k) - r)mod n comprises: after performing a large integer addition operation on the digital signature parameter r and the random number k, performing, by the device, an operation of a result ( r + k) of the large integer addition operation modulo the elliptical curve parameter n, and after adding 1 to the private key d A, calculating, by the device, a modular inverse of (1+ d A) modulo the elliptical curve parameter n; performing, by the device, a large integer multiplication operation on a result of the large integer addition operation result modulo n, and a result of the modular inverse; and performing, by the device, an operation of a large integer multiplication operation result, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s; or performing, by the device, an operation of a result of the large integer multiplication operation result module n, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s. generating, by a device, a digital signature parameter r satisfying a validity judgment condition; generating, by the device, a digital signature parameter s using a private key d A, a random number k in the range [1, n-1], the digital signature parameter r, and an elliptical curve parameter n in the equation of: s = 1 + d A − 1 ⋅ r + k − r mod n; judging, by the device, whether the digital signature parameter s is 0, and if the digital signature parameter s is 0, then regenerating a digital signature parameter r satisfying the validity judgment condition, and regenerating the digital signature parameter s using the private key d A, a regenerated random number k in the range [1, n -1], the digital signature parameter r regenerated, and the elliptical curve parameter n until the digital signature parameter s is not 0; and converting, by the device, the data type of the resulting digital signature parameter r and digital signature parameter s which is not 0 into a string of bytes to obtain a digital signature ( r, s); wherein generating, by the device, the digital signature parameter s in the equation of s = ((1 + d A) -1 · ( r + k) - r)mod n comprises: after performing a large integer addition operation on the digital signature parameter r and the random number k, performing, by the device, an operation of a result ( r + k) of the large integer addition operation modulo the elliptical curve parameter n, and after adding 1 to the private key d A, calculating, by the device, a modular inverse of (1+ d A) modulo the elliptical curve parameter n; performing, by the device, a large integer multiplication operation on a result of the large integer addition operation result modulo n, and a result of the modular inverse; and performing, by the device, an operation of a large integer multiplication operation result, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s; or performing, by the device, an operation of a result of the large integer multiplication operation result module n, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s. after performing a large integer addition operation on the digital signature parameter r and the random number k, performing, by the device, an operation of a result ( r + k) of the large integer addition operation modulo the elliptical curve parameter n, and after adding 1 to the private key d A, calculating, by the device, a modular inverse of (1+ d A) modulo the elliptical curve parameter n; performing, by the device, a large integer multiplication operation on a result of the large integer addition operation result modulo n, and a result of the modular inverse; and performing, by the device, an operation of a large integer multiplication operation result, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s; or performing, by the device, an operation of a result of the large integer multiplication operation result module n, after the digital signature parameter r being subtracted, modulo the elliptical curve parameter n to obtain the digital signature parameter s.