CN-121996233-A - Instruction sequence visual configuration and automatic code generation method for hyperspectral satellite system
Abstract
A command sequence visual configuration and automatic code generation method for a hyperspectral satellite service system belongs to the field of hyperspectral remote sensing satellite command sequence configuration. The method solves the problems of low efficiency, high maintenance cost and difficult guarantee of consistency between the sky and the earth in the existing hyperspectral satellite service instruction sequence configuration scene. The method comprises the steps of constructing a multi-level nestable sequence, including an FSM sub-sequence facing a single machine device and a TASK sequence facing a complete TASK, performing interactive editing through an integrated visual configuration interface, providing an original mode and a PAR mode dual-mode configuration for instruction parameters by adopting an automatic parameter configuration mechanism, synchronously generating a star-service embedded C code and a structured instruction description JSON file based on user configuration, wherein the C code contains all parameters, the JSON file only contains PAR mode parameters, and the two share the same parameter list data structure to ensure the consistency of the space and the earth. The method is used in the field of satellite software development.
Inventors
- SHAO CHUNFENG
- CHEN JIAN
- QU CHENGGANG
- LIU XIANYI
- HE XUEMING
Assignees
- 哈尔滨工大卫星技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260210
Claims (10)
- 1. The method for visual configuration of instruction sequences and automatic code generation for a hyperspectral satellite system is characterized by comprising the following steps: constructing a multi-level nestable sequence, wherein the multi-level nestable sequence comprises an FSM subsequence facing single machine equipment and a TASK sequence facing complete TASKs, the FSM subsequence is composed of original instructions of the same single machine, and the TASK sequence comprises a plurality of single machine instructions and defined FSM subsequences; Interactive editing is carried out through an integrated visual configuration interface, wherein the interface comprises a sequence management panel, a single instruction library panel, a current sequence instruction arrangement area, a dynamic parameter configuration area, a PARn dynamic parameter mapping table and a star C code real-time preview window; an automatic parameter configuration mechanism is adopted to provide dual-mode configuration of an original mode and a PAR mode for instruction parameters, wherein the original mode reserves parameter semantics, and the PAR mode abstracts the parameters into dynamic placeholders PARn; Based on user configuration, a star embedded C code and a structured instruction description JSON file are synchronously generated, wherein the C code contains all parameters, the JSON file only contains PAR mode parameters, and the two share the same parameter list data structure to ensure the consistency of the heaven and earth.
- 2. The method for visualized configuration and automatic code generation of command sequences for hyperspectral satellite systems according to claim 1, wherein the step of constructing a multi-level nestable sequence comprises an FSM compound command registration mechanism, when a user completes configuration and storage of an FSM sub-sequence, the system automatically registers the FSM sub-sequence as a compound command of a virtual FSM single machine, and the compound command is named as < single name > < command sequence number > < command name > andcan be called by other FSM sequences or TASK sequences, so that sub-TASK encapsulation and recursive multiplexing are realized.
- 3. The method for configuring and automating code generation of command sequence visualization for hyperspectral satellite systems according to claim 2 wherein the step of constructing a multi-level nestable sequence further comprises a recursive flattening algorithm for linearizing the nested structure into a single command stream using a depth-first recursive unfolding algorithm when the TASK sequence contains FSM complex commands, the algorithm flow comprising: processing each instruction in sequence from the first instruction of the TASK sequence; If the instruction is a common single instruction, directly adding an output instruction stream; If the instruction is an FSM compound instruction, recursively expanding the instructions in the subsequence until all the instructions are processed; The time sequence configuration adopts an absolute time sequence mode, the execution time of each instruction is set relative to the task starting time T0, and time sequence accumulation calculation is not needed.
- 4. The method for visual configuration and automatic code generation of command sequences for a hyperspectral satellite system according to claim 1, wherein the dynamic parameter configuration area of the visual configuration interface dynamically generates a UI control according to the parameter definition of the currently selected command, and the method comprises the following steps: For the original mode parameters, providing a fixed value read-only text box, a selectable value drop-down selection box or an editable value text box according to the parameter types; for PAR mode parameters, a PAR number assignment interface is provided to support automatic assignment or manual assignment.
- 5. The method for visual configuration and automatic code generation of command sequences for a hyperspectral satellite system according to claim 1, wherein the automatic allocation algorithm PARn in the automatic parameter configuration mechanism comprises the following steps: extracting the initial byte and bit length information of each PAR mode parameter; Calculating PAR byte requirements according to bit length, wherein if the bit length is an integer multiple of 8, the whole PAR byte is occupied independently, and if the bit length is not an integer multiple of 8, a plurality of parameters share the same PAR byte and are packed through bit accumulation; and continuously distributing PAR numbers, ensuring no jump number, and feeding back a distribution result in real time in a PARn dynamic parameter mapping table.
- 6. The method for visual configuration and automatic code generation of command sequences for hyperspectral satellite systems according to claim 1, wherein the PARn automatic allocation algorithm supports manual specification of PAR numbers by users, the system performs verification according to the bit length of parameters, errors are displayed if the specified numbers are not matched with the bit length, and PAR allocation of subsequent parameters is automatically adjusted.
- 7. The method for visual configuration and automatic code generation of command sequences for hyperspectral satellite systems according to claim 1, wherein in the step of generating the embedded C codes and the structured JSON file for the satellites synchronously, the C code generator traverses the parameter list to output C language expressions of all parameters, and the JSON generator traverses the same parameter list but only outputs PAR mode parameters, so as to ensure the correspondence of PAR numbers, parameter semantics and byte positions.
- 8. The method for visual configuration and automatic code generation of the command sequence for the hyperspectral satellite system according to claim 1 is characterized by further comprising a space-earth collaborative work flow, wherein the ground measurement and control system analyzes dynamic parameters after importing a JSON file to generate a parameter filling interface, and the on-board system injects the parameters into PAR placeholders in the C code according to byte order after inputting parameter values to realize automatic mapping and command execution of the parameters.
- 9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a method for instruction sequence visualization configuration and automation code generation for a hyperspectral satellite system according to any one of claims 1 to 8.
- 10. A computer-readable storage medium, characterized in that it has stored thereon a computer program which, when being executed by a processor, performs the steps of a method for instruction sequence visualization configuration and automation code generation for a hyperspectral satellite system according to any of claims 1 to 8.
Description
Instruction sequence visual configuration and automatic code generation method for hyperspectral satellite system Technical Field The invention belongs to the field of hyperspectral remote sensing satellite instruction sequence configuration, and particularly relates to an instruction sequence visual configuration and automatic code generation method for a hyperspectral satellite system. Background The on-board task execution of the hyperspectral remote sensing satellite depends on precise command sequence control, and the development core of the satellite software is the configuration of the command sequence. At present, two modes of a traditional manual coding mode and a script-based semiautomatic tool exist in a commonly adopted instruction sequence configuration method in the field, however, the two existing technologies have obvious and difficult defects to overcome, and the requirements of increasing task complexity and reliability of hyperspectral satellites cannot be met. The most common in the current domestic and foreign star software development is a traditional manual coding mode. In this way, a developer needs to manually write the instruction sequence C language code for on-board execution directly in the integrated development environment, and separately write a structured instruction description file for analysis of the ground measurement and control system, which is usually in JSON format. Taking a medium complexity "push broom imaging task" sequence containing 22 instructions as an example, a developer needs to manually write about 100 lines of C code and up to 500 lines of JSON description code, and the complete configuration period is up to 4 to 6 hours. The purely manual operation is heavy in workload, and higher error rate is caused, and common errors comprise parameter byte position dislocation, parameter configuration errors, dynamic parameter (PARn) number jump or repeat, parameter length calculation errors and inconsistency between an on-board C code and a ground JSON description file. The method has the following four fundamental defects that firstly, the configuration process is quite invisible, a visual interaction interface is lacked, a developer needs to directly operate a data structure such as a bottom hexadecimal byte array and the like, the cognitive burden is heavy, human errors are easy to introduce, secondly, the same logic needs to be respectively realized and maintained in two sets of heterogeneous files (a C structure body array and a JSON object) on the satellite and the ground to form double maintenance dilemma, the inconsistent data on the ground is extremely easy to be caused by negligence, understanding deviation or version management confusion, and further, an effective multiplexing mechanism is lacked, a common subtask flow such as a camera starting sequence cannot be packaged into a multiplexing unit, complete rewriting is needed each time, a large number of repeated labor is caused, and finally, the management of dynamic parameters is completely dependent on manual work, and a unified distribution, sequencing and visual tracking means for PARn parameters are lacked, so that the parameter management is disordered. To alleviate the burden of manual coding, some research institutions have attempted to use script-based semi-automated tools, such as filling in instruction parameters using Excel form templates, and translating into C-code or JSON files via Python scripts. However, this approach is only a limited automation of manual labor, and there are still obvious technical shortboards. The method can not support the recursive multiplexing of the subsequences, and even if the multiplexing instruction sequence fragments exist, the multiplexing instruction sequence fragments still need to be copied, pasted and renumbered, so that the problem of inconsistent versions is extremely easy to introduce. Meanwhile, the configuration process lacks a real-time feedback mechanism, a developer cannot preview the generated result in the filling process, and only can view the output after executing the script, so that the debugging efficiency is low. In addition, most tools still generate satellite-ground files separately, if C codes and JSON files are required to be output simultaneously, different scripts or manual combination are required to be run, the risk of inconsistent space and ground still exists, and the management capability of the tool on dynamic parameters is weak, so that the problem can not be solved fundamentally. The command sequence configuration of hyperspectral remote sensing satellites presents a more unique and more serious technical challenge than that of general optical remote sensing satellites, which further amplifies the drawbacks of the prior art. The push-broom imaging task of the hyperspectral satellite needs to synchronously control a plurality of subsystems such as a power supply, a relay, a load camera, storage, data transmission and the like