Instruction sequence visual configuration and automatic code generation method for hyperspectral satellite service system
By using multi-level nested sequences and automated parameter configuration, the problems of low efficiency, error susceptibility, and consistency in the configuration of hyperspectral satellite mission commands have been solved, achieving efficient and reliable command sequence generation and management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HARBIN GONGDA SATELLITE TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for configuring hyperspectral satellite mission command sequences suffer from problems such as low efficiency, susceptibility to errors, high maintenance costs, difficulty in ensuring consistency between space and ground, and inability to effectively handle complex tasks involving multiple payloads.
It adopts a multi-level nested sequence construction method, and generates embedded C code and structured instruction description JSON files through an integrated visual configuration interface and automatic parameter configuration mechanism, ensuring parameter consistency and supporting the registration and recursive reuse of FSM composite instructions.
It significantly improves configuration efficiency, reduces error rate, ensures consistency of ground and space parameters, enhances system reliability and maintainability, and simplifies the management of multi-load collaborative tasks.
Smart Images

Figure CN121996233A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of hyperspectral remote sensing satellite command sequence configuration, and in particular relates to a method for visual configuration and automated code generation of command sequences for hyperspectral satellite satellite systems. Background Technology
[0002] The execution of onboard missions by hyperspectral remote sensing satellites relies on precise command sequences, and the core of their onboard software development lies in the configuration of these command sequences. Currently, there are two main modes of command sequence configuration methods commonly used in this field: traditional manual coding and script-based semi-automated tools. However, both of these existing technologies have significant and insurmountable drawbacks, failing to meet the increasing mission complexity and reliability requirements of hyperspectral satellites.
[0003] Currently, the most common method in satellite software development, both domestically and internationally, is traditional manual coding. In this approach, developers must manually write the C language code for the instruction sequences to be executed on-board directly in the integrated development environment (IDE), and separately write a structured instruction description file, usually in JSON format, for the ground control system to parse. For example, a moderately complex "pushbroom imaging mission" sequence containing 22 instructions requires developers to manually write approximately 100 lines of C code and up to 500 lines of JSON description code, with a complete configuration cycle taking 4 to 6 hours. This purely manual operation is not only labor-intensive but also leads to a high error rate. Common errors include misplaced parameter bytes, incorrect parameter configuration, skipped or duplicate dynamic parameter (PARn) numbers, incorrect parameter length calculations, and inconsistencies between the onboard C code and the ground-based JSON description file. Its fundamental flaws lie in four aspects: First, the configuration process is extremely unintuitive, lacking a visual interactive interface. Developers need to directly manipulate underlying hexadecimal byte arrays and other data structures, resulting in a heavy cognitive burden and making them prone to human error. Second, the same logic needs to be implemented and maintained separately in two heterogeneous files (C structure arrays and JSON objects) for both satellite and ground, creating a double maintenance dilemma. This makes it extremely easy for inconsistencies between satellite and ground data to occur due to negligence, misunderstandings, or chaotic version management. Third, there is a lack of effective reuse mechanisms. Commonly used subtask processes, such as camera power-on sequences, cannot be encapsulated into reusable units and must be completely rewritten each time they are used, resulting in a large amount of repetitive work. Finally, the management of dynamic parameters relies entirely on manual labor, lacking unified allocation, sorting, and visual tracking methods for PARn parameters, leading to chaotic parameter management.
[0004] To alleviate the burden of manual coding, some research units have attempted to use script-based semi-automated tools, such as using Excel templates to fill in command parameters and then translating them into C code or JSON files using Python scripts. However, this method only provides limited automation of manual labor and still has significant technical shortcomings. It cannot support the recursive reuse of subsequences; even if reusable command sequence fragments exist, they still need to be copied, pasted, and renumbered during reuse, easily leading to version inconsistencies. Furthermore, the configuration process lacks a real-time feedback mechanism; developers cannot preview the generated results while filling in the information and can only view the output after executing the script, resulting in low debugging efficiency. In addition, most tools still generate satellite and ground files separately. If both C code and JSON files need to be output simultaneously, different scripts must be run or they must be manually merged, still posing a risk of inconsistencies between satellite and ground files. Moreover, their ability to manage dynamic parameters is weak, failing to fundamentally solve the problem.
[0005] Compared to general-purpose optical remote sensing satellites, hyperspectral remote sensing satellites face more unique and severe technical challenges in configuring command sequences, which further amplifies the shortcomings of existing technologies. Hyperspectral satellite pushbroom imaging missions require the simultaneous control of multiple subsystems, including power supply, relay, payload camera, storage, and data transmission. The number of commands in a single mission can be 2-3 times that of ordinary optical satellites, and there are strict time dependencies between commands, resulting in extremely high complexity in multi-payload coordination. Furthermore, the satellite supports multiple imaging modes such as multi-point, strip, tracking, and simultaneous image-and-transmission, requiring the configuration of various mission sequences and corresponding JSON files, further increasing configuration complexity. Most critically, the consistency requirements between space and ground parameters are extremely stringent: when the satellite's computer executes the command sequence in the C code, it relies on PARn placeholders; while the ground control system parses the command structure according to the JSON file and injects the parameter values into the corresponding placeholders. For example, PAR3 in the onboard code must precisely correspond to the "exposure time parameter, located in bytes 8-11, length 4 bytes" defined in the ground JSON. Any slight inconsistency will directly lead to parameter injection misalignment and mission failure.
[0006] In summary, existing technologies suffer from a series of bottlenecks in the configuration of hyperspectral satellite mission command sequences, including low efficiency, susceptibility to errors, high maintenance costs, difficulty in ensuring consistency between space and ground, and inability to effectively handle complex tasks involving multiple payloads. Summary of the Invention
[0007] In view of this, the present invention aims to propose a method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite mission systems, in order to solve the problems of low efficiency, error susceptibility, high maintenance costs, difficulty in ensuring consistency between space and ground, and inability to effectively handle complex tasks involving multiple payloads in the context of hyperspectral satellite mission instruction sequence configuration.
[0008] To achieve the above objectives, the present invention adopts the following technical solution: a method for visual configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems, the method comprising: Construct multi-level nestable sequences, including FSM sub-sequences oriented towards single-machine devices and TASK sequences oriented towards complete tasks. The FSM sub-sequences are composed of the original instructions of the same single machine, and the TASK sequences contain multiple single-machine instructions and the defined FSM sub-sequences. Interactive editing is performed through an integrated visual configuration interface, which includes a sequence management panel, a standalone instruction library panel, a current sequence instruction arrangement area, a dynamic parameter configuration area, a PARn dynamic parameter mapping table, and a real-time preview window for Star Service C code. An automatic parameter configuration mechanism is adopted to provide dual-mode configuration for command parameters, namely the original mode and the PAR mode. The original mode preserves the parameter semantics, while the PAR mode abstracts the parameters into dynamic placeholders PARn. Based on user configuration, embedded C code and structured instruction description JSON file are generated synchronously. The C code contains all parameters, while the JSON file contains only PAR mode parameters. Both share the same parameter list data structure to ensure consistency between space and ground.
[0009] Furthermore, a preferred approach is proposed, wherein the steps for constructing multi-level nestable sequences include an FSM composite instruction registration mechanism: after the user completes the FSM sub-sequence configuration and saves it, the system automatically registers it as a composite instruction of the virtual FSM single machine, with the naming format <single machine name>.<instruction number>.<instruction name>. This composite instruction can be called by other FSM sequences or TASK sequences, realizing the encapsulation and recursive reuse of subtasks.
[0010] Furthermore, a preferred approach is proposed, wherein the step of constructing a multi-level nestable sequence further includes a recursive flattening expansion algorithm: when the TASK sequence contains FSM compound instructions, a depth-first recursive expansion algorithm is used to linearize the nested structure into a single instruction stream. The algorithm flow includes: Starting with the first instruction in the TASK sequence, process each instruction sequentially. If the instruction is a normal single-machine instruction, add it directly to the output instruction stream; If the instruction is an FSM compound instruction, then the instructions in its subsequence are recursively expanded until all instructions have been processed. The timing configuration adopts an absolute timing mode, where the execution time of each instruction is set relative to the task start time T0, eliminating the need for timing accumulation calculations.
[0011] Furthermore, a preferred method is proposed, wherein the dynamic parameter configuration area of the visual configuration interface dynamically generates UI controls based on the parameter definition of the currently selected instruction, including: For the original mode parameters, provide a fixed-value read-only text box, an optional-value drop-down selection box, or an editable-value text box according to the parameter type; For PAR mode parameters, a PAR number allocation interface is provided, supporting automatic allocation or manual specification.
[0012] Furthermore, a preferred approach is proposed, wherein the PARn automatic allocation algorithm in the automatic parameter configuration mechanism includes the following steps: Extract the start byte and bit length information for each PAR mode parameter; The PAR byte requirement is calculated based on the bit length: if the bit length is a multiple of 8, then a complete PAR byte is used independently; if the bit length is not a multiple of 8, then multiple parameters share the same PAR byte and are packed by bit accumulation. PAR numbers are assigned continuously to ensure no skipped numbers, and the assignment results are fed back in real time in the PARn dynamic parameter mapping table.
[0013] Furthermore, a preferred method is proposed, wherein the PARn automatic allocation algorithm supports users to manually specify PAR numbers, and the system verifies the parameter length. If the specified number does not match the length, an error is displayed, and the PAR allocation of subsequent parameters is automatically adjusted.
[0014] Furthermore, a preferred method is proposed: in the step of synchronously generating embedded C code and structured JSON files for space missions, the C code generator traverses the parameter list and outputs the C language expressions of all parameters, while the JSON generator traverses the same parameter list but only outputs the PAR mode parameters, ensuring the correspondence of PAR number, parameter semantics, and byte position.
[0015] Furthermore, a preferred approach is proposed, which also includes a space-ground collaborative workflow: after the ground control system imports the JSON file, it parses the dynamic parameters and generates a parameter input interface; after the parameter values are input, the on-board system injects the parameters into the PAR placeholders in the C code in byte order, thereby realizing automatic parameter mapping and command execution.
[0016] Based on the same inventive concept, the present invention also proposes a computer device, including 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 visual configuration and automated code generation of instruction sequences for a hyperspectral satellite service system as described in any of the preceding claims.
[0017] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the instruction sequence visualization configuration and automated code generation method for a hyperspectral satellite service system as described in any of the above.
[0018] Compared with the prior art, the beneficial effects of the present invention are: The method proposed in this invention transforms the process of manually writing low-level code into an intuitive visual drag-and-drop and parameter configuration, significantly reducing the configuration cycle of a single medium-complexity task sequence from the traditional 4-6 hours to approximately 2 hours, improving efficiency by over 200%. This is mainly due to automated code generation and visual interaction, which completely liberates developers from tedious, error-prone, repetitive manual labor.
[0019] This invention fundamentally eliminates many common human errors. Through a core mechanism of one-time configuration and dual-end output, it ensures that the onboard C code and the ground-based JSON file originate from the same data source, fundamentally eliminating the risk of inconsistencies between space and ground parameters. Simultaneously, operations such as parameter positioning, length calculation, and PAR number allocation, which were originally highly prone to errors, are now automatically completed by the system algorithm. This reduces the error rate in the configuration process from an uncontrollable state to below 1%, and most residual errors are obvious parameter value mismatches, which can be intuitively and quickly discovered and corrected through the interface, greatly improving the reliability of the space operations software.
[0020] When task requirements change, developers only need to modify the configuration once in the visual interface to simultaneously update and regenerate both the satellite and ground files, completely solving the pain point of dual maintenance in the traditional method. Furthermore, the recursive reuse mechanism of FSM subsequences allows for the encapsulation and accumulation of commonly used functional modules, forming an internal instruction macro library. Subsequent development can directly call these verified standardized modules, not only avoiding redundant development but also ensuring the consistency of instruction sequence implementation across different tasks and models, greatly improving system maintainability and knowledge transfer efficiency.
[0021] This invention is specifically designed to address the complex requirements of multi-payload coordination and multiple imaging modes in hyperspectral satellites. The multi-level, nestable sequence construction mechanism (FSM and TASK sequences) naturally aligns with the hierarchical model of subsystem control and system-level task coordination, making the management of complex imaging tasks involving dozens of instructions clear in structure and easy to orchestrate. This inherent adaptability is not possessed by traditional manual coding or simple scripting tools. Attached Figure Description
[0022] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is an overall architecture diagram of the instruction sequence visualization configuration and automated code generation method for hyperspectral satellite space service systems described in this invention; Figure 2 This is a physical diagram of the visual configuration interface described in this invention; Figure 3 This is a flowchart of the ground verification closed loop described in this invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other, and the described embodiments are only some embodiments of the present invention, not all embodiments.
[0024] Implementation Method 1: This implementation method addresses the problems of low efficiency, error susceptibility, high maintenance costs, difficulty in ensuring consistency between space and ground, and inability to effectively handle complex tasks involving multiple payloads in the configuration of hyperspectral satellite mission command sequences. It proposes a method for visualized configuration and automated code generation of command sequences for hyperspectral satellite mission systems. The method includes: Construct multi-level nestable sequences, including FSM sub-sequences oriented towards single-machine devices and TASK sequences oriented towards complete tasks. The FSM sub-sequences are composed of the original instructions of the same single machine, and the TASK sequences contain multiple single-machine instructions and the defined FSM sub-sequences. Interactive editing is performed through an integrated visual configuration interface, which includes a sequence management panel, a standalone instruction library panel, a current sequence instruction arrangement area, a dynamic parameter configuration area, a PARn dynamic parameter mapping table, and a real-time preview window for Star Service C code. An automatic parameter configuration mechanism is adopted to provide dual-mode configuration for command parameters, namely the original mode and the PAR mode. The original mode preserves the parameter semantics, while the PAR mode abstracts the parameters into dynamic placeholders PARn. Based on user configuration, embedded C code and structured instruction description JSON file are generated synchronously. The C code contains all parameters, while the JSON file contains only PAR mode parameters. Both share the same parameter list data structure to ensure consistency between space and ground.
[0025] In this embodiment, the steps for constructing multi-level nestable sequences include an FSM composite instruction registration mechanism: after the user completes the FSM sub-sequence configuration and saves it, the system automatically registers it as a composite instruction of the virtual FSM single machine, with the naming format being <single machine name>.<instruction number>.<instruction name>. This composite instruction can be called by other FSM sequences or TASK sequences, realizing the encapsulation and recursive reuse of subtasks.
[0026] In this embodiment, the steps for constructing multi-level nestable sequences also include a recursive flattening expansion algorithm: when the TASK sequence contains FSM compound instructions, a depth-first recursive expansion algorithm is used to linearize the nested structure into a single instruction stream. The algorithm flow includes: Starting with the first instruction in the TASK sequence, process each instruction sequentially. If the instruction is a normal single-machine instruction, add it directly to the output instruction stream; If the instruction is an FSM compound instruction, then the instructions in its subsequence are recursively expanded until all instructions have been processed. The timing configuration adopts an absolute timing mode, where the execution time of each instruction is set relative to the task start time T0, eliminating the need for timing accumulation calculations.
[0027] In this embodiment, the dynamic parameter configuration area of the visual configuration interface dynamically generates UI controls based on the parameter definition of the currently selected command, including: For the original mode parameters, provide a fixed-value read-only text box, an optional-value drop-down selection box, or an editable-value text box according to the parameter type; For PAR mode parameters, a PAR number allocation interface is provided, supporting automatic allocation or manual specification.
[0028] The PARn automatic allocation algorithm in the automatic parameter configuration mechanism of this embodiment includes the following steps: Extract the start byte and bit length information for each PAR mode parameter; The PAR byte requirement is calculated based on the bit length: if the bit length is a multiple of 8, then a complete PAR byte is used independently; if the bit length is not a multiple of 8, then multiple parameters share the same PAR byte and are packed by bit accumulation. PAR numbers are assigned continuously to ensure no skipped numbers, and the assignment results are fed back in real time in the PARn dynamic parameter mapping table.
[0029] In this implementation, the PARn automatic allocation algorithm allows users to manually specify the PAR number. The system verifies the parameter length. If the specified number does not match the length, an error is displayed, and the PAR allocation for subsequent parameters is automatically adjusted.
[0030] In this embodiment, during the step of simultaneously generating embedded C code and structured JSON files for space missions, the C code generator traverses the parameter list and outputs the C language expressions for all parameters, while the JSON generator traverses the same parameter list but only outputs the PAR mode parameters, ensuring the correspondence of PAR numbers, parameter semantics, and byte positions.
[0031] The method described in this embodiment also includes a space-ground collaborative workflow: after the ground telemetry and control system imports the JSON file, it parses the dynamic parameters and generates a parameter input interface; after the parameter values are input, the on-board system injects the parameters into the PAR placeholders in the C code in byte order to achieve automatic parameter mapping and command execution.
[0032] The method described in this implementation treats a user-defined complete FSM subsequence as a reusable composite instruction and registers it in a virtual "FSM standalone" instruction library. This is essentially an automated creation and management mechanism for instruction macros, granting subtask flows first-class citizen status, allowing them to be called and managed like basic instructions. During code generation, a depth-first algorithm is used to automatically and recursively expand nested TASK sequences (which may contain multiple levels of FSM composite instructions) into a linear, executable instruction flow. This process is transparent to the user; the user only needs to focus on the logical orchestration without worrying about the complexity of the underlying implementation. Combined with an absolute timing model (each instruction's time is relative to the task start time T0), the complexity and error-proneness of timing calculations caused by the layering of nested sequences in traditional relative timing are completely avoided. This implementation constructs a unified internal parameter list data structure, which is dynamically maintained during configuration and contains complete attributes (name, type, position, mode, value / PAR number, etc.) of all parameters in the sequence. When generating output, the spaceborne C code generator and the ground-based JSON file generator do not work independently, but rather jointly traverse the same unified parameter list. The C code generator outputs all parameters in the list; the JSON generator selectively outputs only the parameters marked as "PAR mode". This same-source splitting generation mechanism fundamentally ensures that the sequence number, position, and length of the PARn placeholder in the spaceborne code perfectly match the definition in the ground-based JSON file, achieving configuration-consistency.
[0033] The method proposed in this implementation represents a leap from manual, decentralized management to centralized, unified system management of dynamic parameters (PARn). Based on the parameter's starting byte and bit length, a strategy combining "exclusive mode" (bit length a multiple of 8) and "shared mode" (bit length not a multiple of 8) is employed to automatically and continuously assign PAR numbers to all PAR mode parameters. This algorithm intelligently handles the packaging of bit-level parameters and ensures consecutive, skip-number assignments, avoiding conflicts and errors unavoidable in manual allocation. A dedicated PARn dynamic parameter mapping table area is provided in the interface, offering centralized, real-time visualization of the allocation status of all dynamic parameters, and providing a manual overwrite interface to meet specific protocol requirements. This design makes the parameter management status completely transparent to the user, achieving predictability and controllability with a "what you assign is what you get" approach.
[0034] Implementation Method 2, see below Figure 1 and Figure 2 This embodiment describes a specific implementation process for the instruction sequence visualization configuration and automated code generation method for a hyperspectral satellite service system described in Embodiment 1, including: Construct multi-level nestable sequences, including FSM sub-sequences oriented towards single-machine devices and TASK sequences oriented towards complete tasks. The FSM sub-sequences consist of the original instructions from the same single machine, and the TASK sequences contain multiple single-machine instructions and predefined FSM sub-sequences. Specifically: FSM sequence: A subtask process for a single device, consisting of raw instructions from the same device (such as camera, storage, power supply, etc.), for example, "camera power-on sequence"; TASK sequence: A complete command stream oriented to a task, which may contain multiple single-machine raw commands and predefined FSM subsequences, such as "push-broom imaging task".
[0035] Once a user completes the configuration and saves an FSM sequence, the system automatically registers it as a compound instruction for a virtual "FSM standalone machine," named according to the standard format <standalone machine name>.<instruction number>.<instruction name>, such as FSM.R0.0.camera_on. This compound instruction then appears in the standalone instruction library and can be called by other FSM sequences or TASK sequences like ordinary standalone instructions. This enables the encapsulation, reuse, and recursive combination of subtasks, significantly improving the efficiency and structural clarity of complex task construction.
[0036] When the TASK sequence contains FSM subsequences, the nested hierarchical structure needs to be linearized into a single instruction stream before generating the final executable code. This implementation uses a depth-first recursive expansion algorithm, the specific process of which is as follows: (1) Recursive identification and expansion: Starting with the first instruction in the TASK sequence, process each instruction sequentially according to the configuration order; For each instruction, determine whether it is an FSM composite instruction; If it is a normal single-machine instruction, add it directly to the output instruction stream; If it is an FSM compound instruction, then search the single-machine instruction library for the complete instruction list corresponding to the FSM sequence, and recursively call the expansion algorithm to process each instruction in the sub-sequence; The recursive process continues until the currently processed instruction is a normal single-machine instruction (recursion termination condition); Continue processing the next instruction in the TASK sequence until all instructions have been processed.
[0037] (2) Absolute timing: This implementation adopts an absolute timing configuration mode, that is, the execution time of each instruction is set relative to the task start time (T0), rather than relative to the previous instruction. When configuring the FSM sequence or TASK sequence, the time parameter set for each instruction is the absolute execution time of that instruction relative to T0; During the recursive unrolling process, there is no need to perform timing accumulation or recalculation; the absolute time of instructions in the subsequence directly inherits the user-configured value.
[0038] This design avoids the complexity of "overlapping parent and child sequence times" in the traditional relative timing model, ensuring the intuitiveness and predictability of timing configuration.
[0039] Interactive editing is performed through an integrated visual configuration interface, which includes a sequence management panel, a standalone instruction library panel, a current sequence instruction arrangement area, a dynamic parameter configuration area, a PARn dynamic parameter mapping table, and a real-time preview window for Star Service C code. Preferably: The graphical user interface described in this embodiment is divided into six functional areas, supporting intuitive and efficient interactive configuration: Area 1: Sequence Management Panel, divided into two parts—the upper part is the list of saved FSM sequences, and the lower part is the list of TASK sequences; it supports operations such as creating new sequences, double-clicking to load and edit, and deleting. Area 2: Standalone Command Library Panel, which lists all physical standalone commands (such as Camera, Storage) and virtual FSM standalone commands; each standalone command can be expanded to view all available commands, including raw commands and user-generated FSM composite commands; Area 3: Current sequence instruction arrangement area, displaying the instruction list of the selected sequence; supports adding instructions from the instruction library by double-clicking, deleting by right-clicking, and adjusting the execution order by dragging, and clicking on an instruction can expand to configure common parameters such as time; Area 4: Dynamic Parameter Configuration Area. Clicking on any command will expand its dynamic parameters, dynamically generating UI controls based on the parameter definition of the currently selected command, and providing corresponding interaction methods according to parameter type (original mode: fixed value, optional, editable value; dynamic mode: PARn). Section 5: Dynamic Parameter (PARn) Mapping Table, which centrally displays all parameters in the current sequence that are in PAR mode and their assigned PARn numbers, and supports renaming to enhance readability; Bottom area: Real-time preview window of Star Service C code, which updates instantly as any parameter or sequence structure is adjusted. It displays the structure array code that conforms to the Star Service executor interface. Static parameters are presented in hexadecimal form, and dynamic parameters are filled in order as PAR0, PAR1, ..., PARn.
[0040] An automatic parameter configuration mechanism is adopted, providing dual-mode configuration for command parameters: original mode and PAR mode. The original mode preserves parameter semantics, while the PAR mode abstracts parameters into dynamic placeholders PARn. Preferably: This implementation provides two configuration modes for each parameter of each instruction, flexibly adapting to different use cases: Original mode: Preserves the original semantics and value retrieval methods of parameters, and automatically matches UI controls based on parameter type. Fixed value: Read-only text box; Optional values: Drop-down selection box, limiting the valid options; Editable value: An editable text box that allows users to input compliant values.
[0041] PAR mode: The dynamic parameter placeholder mechanism abstracts parameters into dynamic placeholders PARn, suitable for parameters that need to be dynamically injected in orbit or managed uniformly by the ground system. The system provides two PAR numbering management methods: automatic allocation and manual assignment, and provides real-time feedback in the visual interface.
[0042] In this implementation, the PARn automatic allocation algorithm automatically calculates and assigns PAR numbers based on all parameters in PAR mode in the current configuration sequence (FSM sequence or TASK sequence). The specific rules are as follows: Parameter information extraction: The following attributes are predefined in the single-machine instruction library for each instruction parameter: Parameter start byte: The starting position of this parameter in the instruction parameters, in bytes; Parameter bit length: The number of bits occupied by this parameter (e.g., 8 means occupying 8 bits, or 1 byte). When the user switches a parameter to PAR mode, the system reads the start byte and bit length information of the parameter from the instruction library.
[0043] The PAR byte requirement calculation and allocation strategy varies depending on the bit length of the parameter. The system employs different PAR allocation strategies: Case A: Parameter length is an integer multiple of 8 (Exclusive Mode). When the parameter length is divisible by 8, the parameter independently occupies a number of complete PAR bytes: Number of PAR bytes = Parameter length / 8 Case B: Parameter length is not an integer multiple of 8 (sharing mode) When the parameter length is not divisible by 8 (e.g., 1 bit, 3 bits, etc.), multiple such parameters will share the same PAR byte. The system will perform byte-level packing according to the following rules: Bit accumulation: When the sum of the lengths of multiple parameters is 8 bits, multiple parameters are shared by one byte.
[0044] PAR numbering consecutive allocation rule: PAR numbers must be assigned consecutively without skipping numbers.
[0045] Real-time synchronization and UI feedback: such as Figure 2 As shown, the system provides a "PARn Dynamic Parameter Mapping Table" area on the right side of the interface, which displays the PAR allocation status of the current sequence in real time.
[0046] User-defined PAR number: Allows users to manually specify the PAR number for a parameter to adapt to existing ground control protocols or specific parameter injection sequences. Input is achieved by double-clicking the PAR number. This is necessary if the parameter "file number" exists in different instructions within the current sequence, and the saved file number is the same for this task. When a user specifies a PAR number for a parameter, the system checks its correctness based on the parameter's bit length. For example, if a 2-byte parameter is assigned only one PARn, an error will be displayed. Furthermore, after configuration, the PAR allocation for subsequent parameters will be updated based on the available sequence numbers in the current sequence, preventing situations where specifying a number causes other parameters to skip numbers.
[0047] This dual-mode mechanism ensures both configuration flexibility and the consistency and traceability of dynamic parameters across the satellite-to-ground link.
[0048] Based on user configuration, embedded C code and structured instruction description JSON file are generated synchronously. The C code contains all parameters, while the JSON file contains only PAR mode parameters. Both share the same parameter list data structure to ensure consistency between space and ground.
[0049] After the user completes the sequence configuration, two types of key outputs can be generated with one click: Spaceborne Embedded C Code Generation: The entire sequence (including nested FSM subsequences) is expanded into a linear instruction stream using a recursive flattening algorithm, generating an array of C language structures conforming to the spaceborne executor interface. The generated C code contains all parameters for all instructions in the sequence, regardless of whether the parameters are in raw mode or PAR mode. For raw mode parameters (fixed values / optional values / editable values), the user-configured parameter values are converted to hexadecimal format and filled into the structure; for PAR mode parameters, according to the allocation results of the PARn mapping table, the parameter values are replaced with the corresponding PAR placeholders (such as PAR0 to PARn) and filled into the structure. The generated code can be directly compiled and burned to the onboard computer without secondary modification.
[0050] The structured instructions describe the generation of the JSON file: Simultaneously exporting FSM sequence JSON and TASK sequence JSON, this JSON file is specifically for use by the ground control system. Unlike the C code, the JSON file only contains parameters in PAR mode, excluding the fixed parameters of the original mode. This is because the values of the fixed parameters are already programmed into the satellite in the C code and do not require ground injection; while PAR mode parameters represent parameters that need to be dynamically injected in orbit. The ground control system needs to know the semantic information of these parameters (name, type, default value, etc.) so that operators can understand and fill them in. The JSON file fully records the attributes of each dynamic parameter.
[0051] A unified parameter list data structure is used as the data source for both C code and JSON file generation. This parameter list contains all parameters in the sequence and their complete attributes, including: parameter name, data type, starting byte, bit length, parameter mode (raw mode or PAR mode), specific configuration value, and PAR number (if PAR mode). The C code generator iterates through this parameter list and outputs the C language expressions for all parameters; the JSON generator iterates through the same parameter list but only filters and outputs parameters with the "PAR" mode. Because both share the same data source, the mechanism ensures that the PARn placeholders in the onboard C code are completely consistent with the dynamic parameter definitions in the ground-based JSON file, including the precise correspondence of key information such as PAR number, parameter semantics, and byte position.
[0052] The space-ground collaborative workflow is as follows: After importing the JSON file, the ground control system parses the dynamic parameter list and generates a parameter input interface for operators to input or modify parameter values. Once the operator has filled in the parameters, they send a command. Upon receiving the remote control command, the satellite locates the corresponding command and, according to byte order (first byte for PAR0, second byte for PAR1, and so on), fills the parameters from the ground into the dynamic parameter positions of the command, then executes the command sequence. Because the byte order of the parameters in the JSON is strictly consistent with the order of the PAR placeholders in the C code (both generated from the same parameter list), the ground system only needs to inject the PAR values in sequence; no special correspondence between parameters and commands needs to be established. The satellite software automatically completes the parameter mapping based on the byte order of the parameters and the PAR placeholder numbers in the C code structure.
[0053] Through the above mechanism, the method proposed in this implementation achieves the technical effects of configuration-on-generation, WYSIWYG, and consistency between space and ground capabilities. After completing the configuration in the visual interface, the user can simultaneously generate satellite C code and ground JSON files with one click, reducing the configuration workload from manual code and JSON writing to visual operation. The C code and JSON files are generated driven by a unified parameter list, with parameter names, serial numbers, and positions being completely consistent. This fundamentally eliminates the inconsistency risk caused by manually maintaining two sets of documents, significantly improving the design efficiency, reliability, and maintainability of hyperspectral remote sensing satellite mission sequences.
[0054] Implementation Method 3: This implementation method proposes a computer device, including a memory and a processor. The memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes a method for visual configuration and automated code generation of instruction sequences for a hyperspectral satellite service system, as described in any one of Implementation Methods 1 to 2.
[0055] Implementation Method 4: This implementation method proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of a method for visual configuration and automated code generation of instruction sequences for a hyperspectral satellite service system as described in any one of Implementation Methods 1 to 2.
[0056] Implementation Method 5, see below Figure 3 This embodiment describes a system for visually configuring and automatically generating command sequences for hyperspectral satellite operations, based on the instruction sequence visualization configuration and automated code generation method proposed in Embodiments 1 and 2. The system includes: A multi-level sequence construction module, configured to create and manage FSM sequences and TASK sequences, supports recursive registration and invocation; The visual configuration interface module integrates six functional areas and supports command drag-and-drop, parameter configuration, and real-time preview. The parameter automatic management module is configured to execute the PARn allocation algorithm and manually specify verification. The code synchronous generation module is configured to output C code and JSON files, and ensures that the top and bottom parameters are consistent.
[0057] The system proposed in this embodiment is applied to the ground verification process of a pushbroom imaging mission of a certain type of hyperspectral remote sensing satellite (abbreviated as DX for security reasons). Based on the x86 architecture ground test environment, the correctness of the instruction sequence is verified through a multi-step closed loop of "configuration-generation-compilation-execution-comparison".
[0058] In this embodiment, the hardware platform is an x86 architecture general-purpose computer, and the software consists of: the instruction sequence visualization configuration and automated code generation system (hereinafter referred to as the "configuration tool") described in this invention; an x86 test program simulating a space mission system; and a ground test system.
[0059] The processing flow is as follows: (1) Create and configure FSM subsequences Click "New," select "New FSM Sequence," and enter the sequence name and sequence unique identifier (NID). Double-click each of the required single-machine instructions for the sequence to configure the general and dynamic parameters. After saving, the sequence will be automatically registered as a composite instruction in the FSM virtual single machine.
[0060] (2) Create and configure TASK sequences Click "New," select "New TASK Sequence," and enter the sequence name and sequence unique identifier (NID). Double-click all the necessary instructions for the sequence (including composite instructions for FSM) in sequence, configure the general and dynamic parameters of the instructions, and save.
[0061] (3) Generate Star Service Code and JSON File After clicking save, the system will simultaneously generate a Star Service C code snippet and a mission description file.
[0062] (4) Compile and execute the test program Paste the C code snippet into the x86 test program of the simulated space service system, run the compilation script, and run the executable program directly after compilation.
[0063] (5) Import JSON and send instructions Import the generated TASK sequence JSON into the ground test system. After the system parses it, it generates the remote control command corresponding to the push-broom mission in the remote control command sending process. After filling in the parameters, click send.
[0064] Ground verification process as follows Figure 3 As shown, for one imaging mode, "pushbroom mode," it contains approximately 22 instructions (compound instructions are counted as one, not expanded), with about 100 lines of code. The JSON file requires manual writing of about 500 lines (excluding telemetry and stand-alone parameter configuration). After using this system, through visualized parameter configuration and one-click generation of satellite service code and JSON, the speed has increased by 200% (manually requiring 6 hours, this system only takes 2 hours). The error rate is below 1%, and the only cause of errors is that the configuration personnel accidentally misconfigured the parameters. Moreover, due to the visualization, error checking is also very intuitive.
[0065] After configuration, run the satellite model program and use the ground test system to send commands. Observe the satellite model program's log: the command execution order is consistent with the configuration; the execution time of each command is accurate; the dynamic parameter injection is correct; the FSM subsequence is correctly and completely expanded and executed.
[0066] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0067] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0068] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the published pending claims.
Claims
1. A method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems, characterized in that, The method includes: Construct multi-level nestable sequences, including FSM sub-sequences oriented towards single-machine devices and TASK sequences oriented towards complete tasks. The FSM sub-sequences are composed of the original instructions of the same single machine, and the TASK sequences contain multiple single-machine instructions and the defined FSM sub-sequences. Interactive editing is performed through an integrated visual configuration interface, which includes a sequence management panel, a standalone instruction library panel, a current sequence instruction arrangement area, a dynamic parameter configuration area, a PARn dynamic parameter mapping table, and a real-time preview window for Star Service C code. An automatic parameter configuration mechanism is adopted to provide dual-mode configuration for command parameters, namely the original mode and the PAR mode. The original mode preserves the parameter semantics, while the PAR mode abstracts the parameters into dynamic placeholders PARn. Based on user configuration, embedded C code and structured instruction description JSON file are generated synchronously. The C code contains all parameters, while the JSON file contains only PAR mode parameters. Both share the same parameter list data structure to ensure consistency between space and ground.
2. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, The steps for constructing multi-level nestable sequences include an FSM composite instruction registration mechanism: after the user completes the FSM sub-sequence configuration and saves it, the system automatically registers it as a composite instruction of the virtual FSM single machine, with the naming format <single machine name>.<instruction number>.<instruction name>. This composite instruction can be called by other FSM sequences or TASK sequences to realize the encapsulation and recursive reuse of subtasks.
3. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 2, characterized in that, The step of constructing a multi-level nestable sequence also includes a recursive flattening expansion algorithm: when the TASK sequence contains FSM compound instructions, a depth-first recursive expansion algorithm is used to linearize the nested structure into a single instruction stream. The algorithm flow includes: Starting with the first instruction in the TASK sequence, process each instruction sequentially. If the instruction is a normal single-machine instruction, add it directly to the output instruction stream; If the instruction is an FSM compound instruction, then the instructions in its subsequence are recursively expanded until all instructions have been processed. The timing configuration adopts an absolute timing mode, where the execution time of each instruction is set relative to the task start time T0, eliminating the need for timing accumulation calculations.
4. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, The dynamic parameter configuration area of the visual configuration interface dynamically generates UI controls based on the parameter definition of the currently selected command, including: For the original mode parameters, provide a fixed-value read-only text box, an optional-value drop-down selection box, or an editable-value text box according to the parameter type; For PAR mode parameters, a PAR number allocation interface is provided, supporting automatic allocation or manual specification.
5. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, The automatic parameter configuration mechanism includes the following steps in its PARn automatic allocation algorithm: Extract the start byte and bit length information for each PAR mode parameter; The PAR byte requirement is calculated based on the bit length: if the bit length is a multiple of 8, then a complete PAR byte is used independently; if the bit length is not a multiple of 8, then multiple parameters share the same PAR byte and are packed by bit accumulation. PAR numbers are assigned continuously to ensure no skipped numbers, and the assignment results are fed back in real time in the PARn dynamic parameter mapping table.
6. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, The PARn automatic allocation algorithm allows users to manually specify PAR numbers. The system verifies the parameter length. If the specified number does not match the length, an error is displayed, and the PAR allocation for subsequent parameters is automatically adjusted.
7. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, In the step of synchronously generating embedded C code and structured JSON files for space missions, the C code generator traverses the parameter list and outputs the C language expressions for all parameters, while the JSON generator traverses the same parameter list but only outputs the PAR mode parameters, ensuring the correspondence of PAR number, parameter semantics, and byte position.
8. The method for visualized configuration and automated code generation of instruction sequences for hyperspectral satellite space service systems according to claim 1, characterized in that, The method also includes a space-ground collaborative workflow: after the ground-based telemetry and control system imports the JSON file, it parses the dynamic parameters and generates a parameter input interface; After inputting parameter values, the onboard system injects the parameters into the PAR placeholders in the C code in byte order, thereby achieving automatic parameter mapping and instruction execution.
9. A computer device, characterized in that: It includes 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 visual configuration and automated code generation of instruction sequences for a hyperspectral satellite service system according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the instruction sequence visualization configuration and automated code generation method for a hyperspectral satellite service system as described in any one of claims 1-8.