The invention discloses a dynamic instruction general generation method based on a Lua language, which comprises the following steps of: designing a general binary
standardization processing method, a
checksum calculation method, a floating-point number
processing method and a Redis memory
database interface
access method by adopting the Lua language, and packaging into an
algorithm library file; establishing a dynamic instruction management
directory for each model, putting a dynamic instruction generation main file and an
algorithm library file in the dynamic instruction management
directory, and designing and realizing a dynamic instruction generation function in the dynamic instruction generation main file according to a dynamic instruction format and parameters; after a background dynamic instruction generation main program is started, a dynamic instruction generation main file and an
algorithm library file are loaded, an instruction to be sent is selected on a console, parameters to be set are filled in according to the state of the
spacecraft, and the parameters are sent to the background dynamic instruction generation main program; and after receiving the instruction, generating a
remote control instruction code word and sending the
code word to the
spacecraft for execution. According to the invention, a universal algorithm library is provided, the maintenance cost is reduced, and a tester can conveniently use and generate a more normative dynamic instruction.