Task instruction one-key generation method based on Qxlsx
Through the Qxlsx-based task instruction generation method and combined with the Lua dynamic instruction generation module, the problems of low efficiency and complex methods of independent task instruction generation are solved, and efficient and safe task instruction generation are achieved.
Patent Information
- Application Number
- CN202411477242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-10-22
AI Technical Summary
The prior art is inefficient in the generation of autonomous task instructions and complex methods, which cannot meet the needs of high-quality and efficient autonomous task management testing.
The Qxlsx-based task instructions are used to generate one-click method. By reading the task instruction code and parameters in the xlsx file, the Lua dynamic instruction generation module is called, the instruction information is extracted line by line and the instruction codeword is generated.
It realizes efficient one-click generation of autonomous task instructions, reduces the complexity and manual error rate of instruction generation, and improves the efficiency and security of task management.
Smart Images

Figure CN119718453A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of satellite autonomous mission remote control instruction generation, and specifically relates to a one-key generation method of mission instructions based on Qxlsx. Background Art
[0002] Satellite autonomous task management, based on the guidance information, task scheduling information and task information sent by the satellite / forwarded between satellites, autonomously generates an orderly sequence of instructions through specific algorithms under the conditions of meeting time requirements and resource constraints, ultimately achieving the purpose of simplifying satellite-to-ground operations and shielding satellite design details that users do not care about. During satellite ground testing and on-orbit testing, the generation of instructions sent by the mission is closely related to whether the entire satellite mission can be correctly executed, and is a key link in verifying the function of the entire satellite.
[0003] There are many parameter items for the autonomous mission instructions, and the conversion from the engineering value of each parameter to the source code is complex and diverse. In addition, each autonomous mission requires multiple complex instructions to be entered. When making instructions on the ground, each information of each instruction needs to be filled in. Some parameters of these instructions are the same or related to each other, such as the mission start time. Multiple instructions share this information, and repeated filling is inefficient.
[0004] The commonly used method of generating autonomous mission instructions is to generate binary files according to the instruction codeword specification requirements, and then send the binary files to the satellite. This method is relatively cumbersome in the instruction production process, and requires manual conversion of engineering values (provided by demand) to binary source code, and filling in the binary source code byte by byte, which cannot meet the requirements of high-efficiency testing. The Beijing Space Vehicle General Design Department proposed a spacecraft remote control rapid test and verification system and method based on Lua scripts (authorization announcement number: CN109976306B), which can flexibly set parameter engineering values when sending, and generate binary files and send them to the satellite. However, when this method sends instructions, all parameter values need to be filled in one by one, and only one instruction can be generated and sent at a time, which is difficult to meet the needs of simple generation and batch generation of mission instructions.
[0005] In summary, satellite mission requirements are complex, and the conversion from software requirements to command codes is extremely complex, and the staff is not easily replaceable; the formats of mission instructions for different types of satellites vary greatly, the reusability of mission software is low, and the duplication rate is high; the mission instruction codes are lengthy and require manual multi-party review, and the safety needs to be improved. Existing methods cannot meet the needs of high-quality and efficient autonomous mission management testing. Summary of the invention
[0006] In view of this, the present invention provides a one-click generation method for task instructions based on Qxlsx, which is an unofficial Qt library for reading and writing Excel files (.xlsx). It does not rely on Microsoft Excel or COM automation, so it can run on platforms that do not support COM (such as Linux and macOS). The present invention can solve the problems of low efficiency and complex methods of autonomous task instruction generation in the prior art.
[0007] The technical solution for implementing the present invention is as follows:
[0008] A one-click generation method for task instructions based on Qxlsx. Parameter reading obtains the instruction code sequence and parameters of each task by reading the autonomous task design file. The one-click instruction generation software loads the dynamic instruction library and calls the corresponding dynamic instruction through instruction code matching. Finally, the instruction codeword is generated to a specific directory, and a log file is generated to record the generation process.
[0009] Furthermore, it specifically includes four stages: parameter reading, dynamic instruction calling, generating instruction codewords and recording the generation process.
[0010] Furthermore, the parameter reading is specifically as follows:
[0011] Enter the autonomous task instruction code and parameters in the xlsx file. The first worksheet of the xlsx file is the task information worksheet, which fills in the common parameters of this type of task and some specific matters, but does not contain specific instruction information; the worksheet is named the task name, and each line in the instruction information worksheet is an instruction. Fill in the instruction code, number of parameters, parameter 1 type, parameter 1 value, parameter 2 type, and parameter 2 value in sequence. You can directly fill in the numerical value or use the xlsx formula to associate and calculate with other tables. When the instruction code is generated, the instruction information will be extracted line by line; the last worksheet of the xlsx file is the post-processing information, which will be called after all the instruction code is generated to perform the functions of instruction file packaging and code word statistics.
[0012] Furthermore, the dynamic instruction call is specifically:
[0013] Use Lua scripting language to write dynamic instructions, and generate instruction code words by inputting parameters; the process of calling Lua dynamic instructions is:
[0014] S21. Create a Lua virtual machine, i.e., a lua_State pointer, for managing the Lua runtime environment and stack;
[0015] S22, 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;
[0016] S23, use lua_getglobal function to obtain dynamic instruction reference according to instruction code, and push it to the top of stack;
[0017] S24. Use the lua_push series of functions to push the instruction parameters into the stack in order from left to right;
[0018] S25, call the lua_call function to obtain the return value, i.e., the instruction code word;
[0019] For the obtained instruction codeword information, the autonomous task one-key generation software stores it in the file in the form of timestamp + instruction name for subsequent instruction annotation operations.
[0020] Further, generating the instruction codeword is specifically as follows;
[0021] Read the Lua function name, number of parameters, parameter type and parameter value from the xlsx file line by line. According to the parameter type, use forced type conversion to convert the parameter value to the corresponding function parameter type; then push the function name and parameter value into the Lua run stack in order, execute the Lua call function, and generate a binary file.
[0022] Beneficial effects:
[0023] 1. The present invention uses a structured table as a generation condition for task instructions, which not only avoids the ambiguity of general text language, but also reduces the high threshold for directly making binary codeword instructions.
[0024] 2. The present invention uses the xlsx format as a table carrier (parameter reading module) and uses the OXIsx library for reading, which can effectively utilize the rich formulas provided by xlsx, further lower the input threshold, and realize the logical association between instruction inputs to ensure the legitimacy of task instructions.
[0025] 3. The present invention uses a Lua script-based instruction generation module, which can quickly add and modify generation rules according to user needs, reducing the difficulty of debugging and secondary development. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Generate a system composition diagram for the task of the present invention in one click.
[0027] Figure 2 Autonomous Task Design Document Task Information Worksheet.
[0028] Figure 3 Autonomous task design document instruction information worksheet.
[0029] Figure 4 Instruction generation process information.
[0030] Figure 5Satellite autonomous mission command generation process.
[0031] Figure 6 Error information during the satellite autonomous mission command generation process.
[0032] Figure 7 Satellite autonomous mission command generation results.
[0033] Figure 8 Archive of information generated by satellite autonomous mission commands. DETAILED DESCRIPTION
[0034] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0035] The present invention provides a one-click generation method for task instructions based on Qxlsx. The present invention converts engineering values into highly readable Chinese, separates task arrangement functions and instruction generation functions for easy configuration of different models, calls a verified instruction library, designs autonomous task design file arrangement based on xlsx format, task instruction information reading based on Qxlsx, and process information recording based on glog, thereby solving the problem of task instruction generation with one click. Specifically, Figure 1 As shown, the present invention includes the following four steps:
[0036] Step 1: Parameter reading
[0037] (1) Enter the autonomous task instruction code and parameters in the xlsx file. The first worksheet of the xlsx file is the task information worksheet, which contains the common parameters of this type of task and some specific matters, but does not contain specific instruction information. This worksheet is not directly read when the instruction code is generated. Fill in the worksheet with, for example, Figure 2 shown.
[0038] (2) Figure 3 As shown, the worksheet name can be named as the task name. Each line in the instruction information worksheet is an instruction. Fill in the instruction code, number of parameters, parameter 1 type, parameter 1 value, parameter 2 type, and parameter 2 value in sequence. You can fill in the value directly or use the xlsx formula to associate and calculate with other tables. When the instruction code is generated, the instruction information will be extracted line by line.
[0039] (3) The last worksheet of the xlsx file is the post-processing information, which will be called after all instruction code words are generated to perform functions such as instruction file packaging and code word statistics.
[0040] Step 2: Dynamic instruction call
[0041] Use Lua scripting language to write dynamic instructions, and generate instruction code words by inputting parameters. The process of calling Lua dynamic instructions is:
[0042] (1) Create a Lua virtual machine, that is, a lua_State pointer, which is used to manage Lua's operating environment and stack.
[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 based on 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 order from left to right.
[0046] (5) Call the lua_call function to obtain the return value, that is, the instruction code word.
[0047] For the obtained instruction codeword information, the autonomous task one-key generation software stores it in the file in the form of timestamp + instruction name for subsequent instruction annotation operations.
[0048] Step 3: Generate instruction codeword
[0049] Read the Lua function name, number of parameters, parameter type and parameter value from the xlsx file line by line, and convert the parameter value to the corresponding function parameter type using forced type conversion according to the parameter type. Then push the function name and parameter value into the Lua run stack in order, execute the Lua call function, and generate a binary file.
[0050] Step 4: Record the generation process
[0051] While generating instruction codewords, the task one-key generation system uses the glog library to record generation information for proofreading. Figure 4 The log shows the process information of a certain generation. The log records the instruction name, parameter type, value and generated instruction code in detail.
[0052] After completing a generation, on-orbit testers can obtain the mission instruction code words written in the autonomous mission file in a specific folder, and quickly confirm the accuracy of the parameter filling by checking the generation log.
[0053] Example
[0054] The embodiment of the present invention is based on a satellite autonomous mission design and outputs autonomous mission instructions in a one-click manner.
[0055] Drag the autonomous task design file to the software page to start the generation process. During the generation process, the software page will display the generated instruction code in real time, such as Figure 5 shown.
[0056] When the instruction information is wrong, a red prompt will be given for the wrong parameter, such as Figure 6 shown.
[0057] The ground control system can obtain the generated results, such as Figure 7 As shown, the task generation information archive log can be viewed in the log directory, such as Figure 8 shown.
[0058] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A one-key generation method for task instructions based on Qxlsx, characterized in that: Parameter reading obtains the instruction code sequence and parameters of each task by reading the autonomous task design file. The one-click instruction generation software loads the dynamic instruction library, and calls the corresponding dynamic instructions through instruction code matching. Finally, the instruction code words are generated to a specific directory, and a log file is generated to record the generation process.
2. The one-key generation method of task instructions based on Qxlsx as claimed in claim 1, characterized in that: Specifically, it includes four stages: parameter reading, dynamic instruction calling, generating instruction codewords and recording the generation process.
3. The one-key generation method of task instructions based on Qxlsx as claimed in claim 2 is characterized in that: The specific parameter reading is: Enter the autonomous task instruction code and parameters in the xlsx file. The first worksheet of the xlsx file is the task information worksheet, which fills in the common parameters of this type of task and some specific matters, but does not contain specific instruction information; the worksheet is named the task name, and each line in the instruction information worksheet is an instruction. Fill in the instruction code, number of parameters, parameter 1 type, parameter 1 value, parameter 2 type, and parameter 2 value in turn. You can directly fill in the value or use the xlsx formula to associate and calculate with other tables. When the instruction code is generated, the instruction information will be extracted line by line; the last worksheet of the xlsx file is the post-processing information, which will be called after all the instruction code is generated to perform the functions of instruction file packaging and code word statistics.
4. The one-key generation method of task instructions based on Qxlsx as claimed in claim 2 or 3, characterized in that: The dynamic instruction call is as follows: Use Lua scripting language to write dynamic instructions, and generate instruction code words by inputting parameters; the process of calling Lua dynamic instructions is: S21. Create a Lua virtual machine, i.e., a lua_State pointer, for managing the Lua runtime environment and stack; S22, 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; S23, use lua_getglobal function to obtain dynamic instruction reference according to instruction code, and push it to the top of stack; S24. Use the lua_push series of functions to push the instruction parameters into the stack in order from left to right; S25, call the lua_call function to obtain the return value, i.e., the instruction code word; For the obtained instruction codeword information, the autonomous task one-key generation software stores it in the file in the form of timestamp + instruction name for subsequent instruction annotation operations.
5. The one-key generation method of task instructions based on Qxlsx as claimed in claim 4 is characterized in that: The specific instructions for generating the codeword are: Read the Lua function name, number of parameters, parameter type and parameter value from the xlsx file line by line. According to the parameter type, use forced type conversion to convert the parameter value to the corresponding function parameter type; then push the function name and parameter value into the Lua run stack in order, execute the Lua call function, and generate a binary file.
Citation Information
Patent Citations
A rapid test and verification system and method for spacecraft remote control based on Lua scripts
CN109976306B
Satellite test efficiency improving method based on satellite order code word intelligent construction
CN105512030A
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
Compilation and launch control method of satellite payload instruction chain
CN115757875A
Cited By
Static library reading and writing method and system based on ICD communication
CN120780769A