A Qxlsx-based task instruction one-key generation method
By adopting a one-click method for generating task instructions based on Qxlsx and Lua scripts, the problem of low efficiency in generating autonomous satellite task instructions has been solved. This method enables efficient and secure instruction generation and batch processing, and is applicable to task management of different satellite models.
Patent Information
- Application Number
- CN202411477242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing technologies are inefficient in generating autonomous mission instructions for satellites, with repetitive parameter input and significant format differences, failing to meet the requirements for efficient and secure autonomous mission management.
A one-click task instruction generation method based on Qxlsx is adopted. It uses xlsx format tables to read parameters and combines them with Lua scripts to dynamically call instructions to generate binary files. The structured tables reduce the input threshold and enable rapid generation and batch processing of instructions.
It enables the efficient generation of satellite autonomous mission commands, reduces the complexity of manual operations, improves the safety and reliability of the generation process, and supports the unification of command formats and rapid debugging for different satellite models.
Smart Images

Figure CN119718453B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of satellite autonomous task remote control instruction generation, and particularly relates to a task instruction one-key generation method based on Qxlsx. BACKGROUND
[0002] Satellite autonomous task management generates an ordered instruction sequence autonomously through a specific algorithm under the conditions of meeting time requirements and resource constraints according to the guidance information, task scheduling information and task information on the satellite or inter-satellite forwarding, so as to ultimately achieve the purpose of simplifying satellite-ground operation and shielding satellite design details that users are not interested in. In satellite ground testing and on-orbit testing, the instruction generation of the task uploaded is closely related to whether the whole satellite task can be executed correctly, and is a key link for testing the whole satellite function.
[0003] The autonomous task uploaded instruction parameters are numerous, the conversion of each parameter engineering value to source code is complex and diverse, and multiple complex instructions need to be uploaded each time for autonomous task. When the instructions are made on the ground, each information of each instruction needs to be filled in. Some of the parameters in these instructions are the same or are related to each other, such as the task start time, which is used by multiple instructions and is inefficient to fill repeatedly.
[0004] The existing common autonomous task instruction generation means is to generate a binary file according to the instruction code word specification requirements, and then send the binary file to the satellite. This method is relatively cumbersome in the instruction making process, and needs to manually convert the engineering value (provided by the demand) to the binary source code, and fill in the binary source code byte by byte, which cannot meet the efficient testing requirements. Beijing Spacecraft General Design Department proposes a spacecraft remote control rapid testing and verification system and method based on Lua script (authorized publication number: CN109976306B), which can flexibly set the parameter engineering value when sending, and generate a binary file to send to the satellite. However, in this method, all parameter values need to be filled in one by one when sending the instruction, and only one instruction can be generated and sent at a time, which is difficult to meet the demand of simple and batch generation of task instructions.
[0005] In summary, the satellite task demand is complex, the conversion from software demand to instruction code word is extremely complex, and the replaceability of the staff is poor; the task instruction format of different types of satellites is different, the task software reusability is low, and the repeated development rate is high; the task instruction code word is long, and needs to be manually checked in multiple ways, and the safety needs to be improved. The existing method cannot meet the high-quality and efficient autonomous task management testing requirements. SUMMARY
[0006] Therefore, the application provides a task instruction one-key generation method based on Qxlsx.
[0007] The technical scheme of the application is as follows:
[0008] A task instruction one-key generation method based on Qxlsx, parameter reading obtains instruction code sequences and parameters of each task by reading an autonomous task design file, instruction one-key generation software loads a dynamic instruction library, and corresponding dynamic instructions are called through instruction code matching, finally, instruction code words are generated to a specific directory, and a log file is generated to record the generation process.
[0009] Further, the four stages of parameter reading, dynamic instruction calling, instruction code word generation and process recording are specifically included.
[0010] Further, the parameter reading is specifically as follows:
[0011] The autonomous task instruction code and parameters are input in an xlsx file, the first worksheet of the xlsx file is a task information worksheet, public parameters and some specific matter descriptions of the task are filled in the worksheet, and specific instruction information is not included; the worksheet is named as a task name, each row in an instruction information worksheet is an instruction, and instruction codes, parameter numbers, parameter 1 types, parameter 1 values, parameter 2 types and parameter 2 values are sequentially filled in, numerical values can be directly filled or calculated through xlsx formulas and other tables, and instruction code words are generated by extracting instruction information row by row; the last worksheet of the xlsx file is post-processing information, which is called after all instruction code words are generated, and functions of instruction file packaging and code word statistics are performed.
[0012] Further, the dynamic instruction calling is specifically as follows:
[0013] Lua script language is used to write dynamic instructions, and instruction code words are generated through the method of inputting parameters; the process of calling Lua dynamic instructions is as follows:
[0014] S21, a Lua virtual machine, that is, a lua_State pointer, is created, which is used to manage the running environment and stack of Lua;
[0015] S22, a Lua dynamic instruction script file is loaded, and the dynamic instruction script is compiled into bytecode and pressed into the top of the stack through the luaL_loadfile function;
[0016] S23, using the lua_getglobal function, obtaining the dynamic instruction reference according to the instruction code, and pressing into the top of the stack;
[0017] S24, using the lua_push series function, the instruction parameters are pressed into the stack in turn from left to right;
[0018] S25, calling the lua_call function to obtain the return value, that is, the instruction code word;
[0019] For the obtained instruction code word information, the autonomous task one-key generation software is stored in the form of timestamp+instruction name to the file, which is used for subsequent instruction uploading operation.
[0020] Further, the instruction code word is generated as follows:
[0021] The Lua function name, parameter number, parameter type and parameter value are read from the xlsx file row by row, according to the parameter type, the parameter value is converted into the corresponding function parameter type by forced type conversion; then the function name and parameter value are pressed into the Lua running stack in order, the Lua calling function is executed, and the binary file is generated.
[0022] Beneficial effects:
[0023] 1. The application uses a structured table as the generation condition of the task instruction, which avoids the ambiguity of general text language and reduces the high threshold of directly making binary code word instructions.
[0024] 2. The application uses xlsx format as the table carrier (parameter reading module) and uses OXIsx library for reading, which can effectively utilize the rich formulas provided by xlsx, further reduce the input threshold, realize the logical association between instruction inputs, and ensure the legality of the task instruction.
[0025] 3. The application uses the instruction generation module based on the lua script, which can quickly add, modify and generate rules according to user demand, and reduces the difficulty of debugging and secondary development. DETAILED DESCRIPTION
[0026] Figure 1 The task one-key generation system of the application is shown in the figure.
[0027] Figure 2 The autonomous task design file task information table.
[0028] Figure 3 The autonomous task design file instruction information table.
[0029] Figure 4 Instruction generation process information.
[0030] Figure 5Satellite autonomous mission instruction generation process.
[0031] Figure 6 Satellite autonomous mission instruction generation process error information.
[0032] Figure 7 Satellite autonomous mission instruction generation result.
[0033] Figure 8 Satellite autonomous mission instruction generation information archive. DETAILED DESCRIPTION
[0034] The application will be described in detail below with reference to the accompanying drawings and embodiments.
[0035] The application provides a task instruction one-key generation method based on Qxlsx. The application converts engineering values into Chinese with high readability, separates task arrangement function and instruction generation function, is easy to configure and call verified instruction library of different models, designs self-task design file arrangement based on xlsx format, task instruction information reading based on Qxlsx and process information recording based on glog, so that the task instruction generation problem can be solved in one key. Specifically, as shown in the figure, Figure 1 The application includes the following four steps:
[0036] Step one, parameter reading
[0037] (1) input autonomous task instruction code and parameters in the xlsx file, the first worksheet of the xlsx file is a task information worksheet, fill in the public parameters and some specific matters of this type of task, and do not contain specific instruction information. The worksheet is not directly read when generating instruction code. Fill in, for example, as shown in the figure. Figure 2
[0038] (2) as shown in the figure, Figure 3 The worksheet name can be named as the task name, each line in the instruction information worksheet is an instruction, and the instruction code, parameter number, parameter 1 type, parameter 1 value, parameter 2 type and parameter 2 value are filled in turn. The values can be directly filled in or calculated through xlsx formula and other tables. The instruction code will be extracted line by line when generating the instruction code.
[0039] (3) the last worksheet of the xlsx file is post-processing information, which will be called after all instruction codes are generated, and functions such as instruction file packaging and code word statistics will be performed.
[0040] Step two, dynamic instruction calling
[0041] Use Lua script language to write dynamic instructions, and generate instruction code by inputting parameters. The process of calling Lua dynamic instructions is as follows:
[0042] (1) Create a Lua virtual machine, that is, a lua_State pointer, to manage the running environment and stack of Lua.
[0043] (2) Load the Lua dynamic instruction script file, compile the dynamic instruction script into bytecode through the luaL_loadfile function, and push it to the top of the stack.
[0044] (3) Use the lua_getglobal function to obtain the dynamic instruction reference according to the instruction code, and push it to the top of the stack.
[0045] (4) Use the lua_push series of functions to push the instruction parameters into the stack in left-to-right order.
[0046] (5) Call the lua_call function to obtain the return value, that is, the instruction code.
[0047] For the obtained instruction code information, the autonomous task one-key generation software stores it in the form of timestamp + instruction name in a file, which is used for subsequent instruction uploading operations.
[0048] Step three, generating instruction code
[0049] Read the Lua function name, parameter number, parameter type and parameter value from the xlsx file line by line, convert the parameter value to the corresponding function parameter type according to the parameter type using type coercion, and then push the function name and parameter value into the Lua running stack in order. Execute the Lua call function to generate a binary file.
[0050] Step four, record the generation process
[0051] At the same time of generating the instruction code, the task one-key generation system uses the glog library to record the generation information for proofreading, Figure 4 The process information of a certain generation is shown, and the log records the instruction name, parameter type, value and generated instruction code in detail.
[0052] After completing a generation, on-orbit test personnel can obtain the task instruction code written in the autonomous task file in a specific folder, and quickly confirm the accuracy of the parameter filling through the proofreading generation log.
[0053] Embodiment
[0054] The embodiment of the application designs a satellite autonomous task and one-key outputs autonomous task instructions.
[0055] Dragging the autonomous task design file to the software page can start the generation process, and the software page will display the generated instruction code in real time during the generation process, as shown in Figure 5 .
[0056] When the instruction information is wrong, a red prompt will be given for the error parameter, as shown in Figure 6 .
[0057] The ground total control system can obtain the generated result, as shown in Figure 7 , and the task generation information archive log can be viewed under the log directory, as shown in Figure 8 .
[0058] To sum up, the above is only a preferred embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1.A method for one-key generation of Qxlsx-based task instructions, characterized in that, The instruction code sequence and parameters of each task are obtained by reading the autonomous task design file, the instruction key generation software loads the dynamic instruction library, and the corresponding dynamic instruction is called through instruction code matching, finally the instruction code is generated to a specific directory, and a log file is generated to record the generation process; The method specifically comprises four stages of parameter reading, dynamic instruction calling, instruction code generation and process recording; The parameter reading specifically comprises: The autonomous task instruction code and parameters are input in the xlsx file, the first worksheet of the xlsx file is a task information worksheet, the public parameters and some specific matter descriptions of the task are filled in, and no specific instruction information is included; the worksheet name is named as the task name, each row in the instruction information worksheet is an instruction, and the instruction code, the parameter number, the parameter 1 type, the parameter 1 value, the parameter 2 type and the parameter 2 value are sequentially filled in, the numerical value can be directly filled in or calculated through the xlsx formula and other tables, and the instruction code is extracted row by row during the instruction code generation; the last worksheet of the xlsx file is a post-processing information, which is called after all the instruction codes are generated, and functions of instruction file packaging and code word statistics are performed; The dynamic instruction calling specifically comprises: The Lua script language is used to write the dynamic instruction, and the instruction code is generated through the input parameter method; the process of calling the Lua dynamic instruction comprises the following steps: S21, a Lua virtual machine, that is, a lua_State pointer, is created, which is used to manage the running environment and stack of Lua; S22, a Lua dynamic instruction script file is loaded, the dynamic instruction script is compiled into bytecode through the luaL_loadfile function and is pressed into the top of the stack; S23, the lua_getglobal function is used to obtain the dynamic instruction reference according to the instruction code and press it into the top of the stack; S24, the lua_push series function is used to press the instruction parameters into the stack in the order from left to right; S25, the lua_call function is called to obtain the return value, that is, the instruction code; For the obtained instruction code information, the autonomous task one-key generation software stores the information in the form of time stamp + instruction name into the file, which is used for subsequent instruction uploading operation; The instruction code generation specifically comprises: The Lua function name, the parameter number, the parameter type and the parameter value are read from the xlsx file row by row, the parameter value is converted into the corresponding function parameter type through forced type conversion according to the parameter type, then the function name and the parameter value are pressed into the Lua running stack in the order, the Lua calling function is executed, and a binary file is generated.
Citation Information
Patent Citations
A rapid test and verification system and method for spacecraft remote control based on Lua scripts
CN109976306B
A spacecraft effective load uploading instruction generation method and system
CN109885817A
Spacecraft remote control rapid test verification system and method based on Lua script
CN109976306A