Ground testing method and system for satellite-borne equipment, upper computer and lower computer
By combining a script interpreter and an instruction executor, the ground testing of spaceborne equipment was automated, solving the problem of low efficiency in manual calculation and improving the accuracy and reliability of the tests.
Patent Information
- Application Number
- CN202511423812.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-12-30
AI Technical Summary
Ground testing of spaceborne equipment relies on manual, step-by-step calculations and execution, which is inefficient and has poor repeatability, affecting the accuracy and reliability of the tests.
A script interpreter is used to convert control scripts into a sequence of control instructions, and an instruction executor is used to automatically execute the control instructions, thereby achieving automated execution of test cases.
It improves the efficiency and reliability of testing, reduces human error, and ensures the consistency and repeatability of testing.
Smart Images

Figure CN121233474A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment testing technology, and more specifically, to a ground testing method, system, host computer, and slave computer for spaceborne equipment. Background Technology
[0002] Spaceborne instruments are deployed on satellites to study the space environment of celestial bodies and their interaction with the solar wind. Data acquired through these instruments is of significant scientific value not only for studying the evolution and structure of the space environment and the mechanisms of interaction between the solar wind and the space environment, but also for providing reference data for related engineering practices.
[0003] Spaceborne equipment is difficult to maintain while in orbit, therefore ground testing is required before it can be put into operation. In related technologies, ground testing relies on manual calculation and execution of test cases step by step, which is inefficient and has poor repeatability. Summary of the Invention
[0004] In view of this, embodiments of this application provide a ground testing method, system, host computer, and slave computer for spaceborne equipment.
[0005] One aspect of this application provides a ground testing method for a spaceborne device, comprising: converting a control script into a sequence of control instructions using a script interpreter, wherein the control script is a script for ground testing of the spaceborne device, the sequence of control instructions includes a plurality of control instructions arranged in sequence, the control instructions including keywords, or the control instructions including keywords and parameters, the keywords being used to indicate an event type; obtaining a current control instruction from the plurality of control instructions included in the sequence of control instructions using an instruction executor, and executing the current control instruction according to the event type indicated by the keywords included in the current control instruction; and, in response to the event type being a write event or a time synchronization event, sending converted data corresponding to the parameters obtained from executing the current control instruction to a lower-level computer, so that the lower-level computer controls the spaceborne device to perform the action indicated by the converted data.
[0006] According to embodiments of this application, the script interpreter invokes at least one of the following: a generation function, a timing control function, or a flow control function. The plurality of control instructions include at least one of the following: a generation instruction, a timing control instruction, or a flow control instruction.
[0007] According to embodiments of this application, the above-mentioned generation class function includes at least one of the following: an engineering parameter conversion function, a parameter setting function, a power-on / off function, or a custom sending function. The above-mentioned generation class instruction includes at least one of the following: an engineering parameter control instruction, a power-on / off control instruction, or a custom sending control instruction. Specifically, the above-mentioned conversion of the control script into a sequence of control instructions using a script interpreter includes performing at least one of the following: using the script interpreter in response to the control script calling the engineering parameter conversion function, using the engineering parameter conversion function to dynamically check the engineering parameters, and in response to the dynamic check of the engineering parameters passing, converting the engineering parameters into valid data compatible with a predetermined communication protocol. The engineering parameters are the input parameters of the engineering parameter conversion function. Using the script interpreter in response to the control script calling the parameter setting function, using the parameter setting function to set a protocol header for the valid data to obtain the parameters of the engineering parameter control instruction, and using the parameter setting function to set the event type to a write event to obtain the keyword of the engineering parameter control instruction. The script interpreter responds to the control script's call to the power-on / off function, maps the power-on / off function identifier indicating the function to a predetermined power-on / off opcode compatible with a predetermined communication protocol, obtains the parameters of the power-on / off control instruction, and sets the event type to a write event to obtain the keyword of the power-on / off control instruction. Alternatively, the script interpreter responds to the control script's call to the custom send function, obtains the raw string as the input parameter of the custom send function, uses the raw string as the parameter of the custom send control instruction, sets the event type to a write event, and obtains the keyword of the custom send control instruction.
[0008] According to embodiments of this application, the timing control function includes at least one of the following: a timed transmission function, a delayed transmission function, or a time synchronization function. The timing control instruction includes at least one of the following: a timed transmission control instruction, a delayed transmission control instruction, or a time synchronization control instruction. The step of converting a control script into a sequence of control instructions using a script interpreter includes: using the script interpreter to call the timing control function in response to the control script, obtaining the timing control time as an input parameter of the timing control function; dynamically checking the timing control time using the timing control function, and converting the timing control time into a time string in response to the dynamic check passing, thus obtaining the parameter of the timing control instruction; and setting the event type to a target event using the timing control function, thus obtaining the keyword of the timing control instruction. Wherein, when the timing control function is the timed transmission function, the target event is a wake-up event. When the timing control function is the delayed transmission function, the target event is a delayed event. In the case where the aforementioned timing control function is the aforementioned time synchronization function, the aforementioned target event is a time synchronization event and the aforementioned timing control instruction does not include parameters.
[0009] According to embodiments of this application, the aforementioned flow control functions include a repeat sending function, which includes a loop header function and a loop tail function. The aforementioned flow control instructions include a repeat sending control instruction, which includes a loop header instruction and a loop tail instruction. Specifically, the process of converting a control script into a sequence of control instructions using a script interpreter includes: using the script interpreter to call the loop header function in response to the control script; using the loop header function to convert the loop count into a parameter of the loop header instruction; setting the event type to a loop header event; and obtaining the keyword of the loop header instruction. Similarly, using the script interpreter to call the loop tail function in response to the control script; setting the event type to a loop tail event; and obtaining the keyword of the loop tail instruction.
[0010] According to an embodiment of this application, the above-mentioned method of converting a control script into a control instruction sequence using a script interpreter includes: performing a static check on the control script using the script interpreter; and converting the control script into the control instruction sequence using the script interpreter in response to the static check of the control script passing.
[0011] According to an embodiment of this application, the above-described method of obtaining the current control instruction from a plurality of control instructions included in the control instruction sequence using an instruction executor, and executing the current control instruction according to the event type indicated by the keyword included in the current control instruction, includes performing at least one of the following: obtaining the current control instruction from a plurality of control instructions included in the control instruction sequence using the instruction executor; in response to the event type indicated by the keyword included in the current control instruction being a write event, converting the parameters included in the current control instruction into a first predetermined data format to obtain converted data corresponding to the parameters; in response to the event type indicated by the keyword included in the current control instruction being a wake-up event, determining the difference between the current time and the timing control duration indicated by the parameter included in the current control instruction to obtain converted data corresponding to the parameters; in response to the event type indicated by the keyword included in the current control instruction being a delay event, converting the parameters included in the current control instruction into a second predetermined data format to obtain converted data corresponding to the parameters. In response to the event type indicated by the keyword included in the current control instruction being a time synchronization event, the current time is converted into a third predetermined data format to obtain the converted current time. A time correction instruction is generated based on the converted current time, wherein the parameter of the time correction instruction is the converted current time and the time correction instruction is the converted data. Alternatively, in response to the event type indicated by the keyword included in the current control instruction being a loop header event, the parameters included in the current control instruction are converted into a fourth predetermined data format to obtain the loop count. Based on the loop count and the current control instruction line number, a combined structure is obtained and added to the loop control queue. In response to the event type indicated by the keyword included in the current control instruction being a loop tail event, a combined structure is retrieved from the loop control queue. Based on the combined structure, the loop count is obtained and decremented by one to obtain an updated loop count. In response to the updated loop count being greater than zero, an updated combined structure is obtained based on the updated loop count and the current control instruction line number included in the combined structure, and added to the loop control queue. The operation of converting the parameters included in the current control instruction into the fourth predetermined data format to obtain the updated loop count is repeated until the updated loop count is equal to zero.
[0012] Another aspect of this application provides a ground testing method for a spaceborne device, comprising: receiving converted data corresponding to parameters obtained from executing a current control command sent by a host computer; and controlling the spaceborne device to execute the action indicated by the converted data. The converted data is sent by the host computer when the event type indicated by a keyword in the current control command is a write event or a time synchronization event, using an instruction executor. The converted data is obtained by the host computer using the instruction executor to obtain the current control command from a plurality of control commands included in a control command sequence, and executing the current control command according to the event type indicated by the keyword included in the current control command. The control command sequence is obtained by the host computer using a script interpreter to convert a control script. The control script is a script for ground testing of the spaceborne device. The control command sequence includes a plurality of control commands arranged in sequence, the control commands include keywords, or the control commands include keywords and parameters, the keywords indicating the event type.
[0013] According to embodiments of this application, the aforementioned control of the spaceborne equipment to execute the actions indicated by the converted data includes performing at least one of the following: responding to determining that the control command is a power-on / off control command based on the converted data, controlling the on / off state of the switch control module based on the converted data, thereby controlling the working state of the spaceborne equipment. Alternatively, responding to determining that the control command is an engineering parameter control command, a custom transmission control command, or a time synchronization control command based on the converted data, sending the converted data to the spaceborne equipment to control the spaceborne equipment to execute the actions indicated by the converted data.
[0014] Another aspect of this application provides a host computer, including: a script interpreter for converting a control script into a sequence of control instructions. The control script is a script for ground-based testing of a spaceborne device, and the sequence of control instructions includes a plurality of control instructions arranged in sequence. Each control instruction includes a keyword, or a keyword and parameters, where the keyword indicates an event type. An instruction executor is used to obtain a current control instruction from the plurality of control instructions included in the current control instruction, and executes the control instruction according to the event type indicated by the keyword included in the current control instruction. In response to an event type of write event or time synchronization event, the instruction executor sends converted data corresponding to the parameters obtained from executing the current control instruction to a lower-level computer, so that the lower-level computer controls the spaceborne device to execute the action indicated by the converted data.
[0015] Another aspect of this application provides a lower-level machine, including: a communication module for receiving converted data corresponding to parameters obtained from executing a current control command sent by a host computer; and a control module for controlling the spaceborne equipment to execute the action indicated by the converted data. The converted data is sent by the host computer in response to a key indicating a write event or a time synchronization event in the current control command, using the instruction executor to obtain the current control command from a plurality of control commands included in the control command sequence, and executing the current control command according to the event type indicated by the key in the current control command. The control command sequence is obtained by the host computer converting a control script using a script interpreter. The control script is a script for ground testing of the spaceborne equipment. The control command sequence includes a plurality of control commands arranged in sequence, and the control commands include keys, or the control commands include keys and parameters, where the keys indicate the event type.
[0016] Another aspect of this application provides a ground testing system for a spaceborne device, comprising: a host computer, configured to convert a control script into a sequence of control instructions using a script interpreter. The control script is a script for ground testing of the spaceborne device, and the sequence of control instructions includes a plurality of control instructions arranged in sequence. Each control instruction includes a keyword, or a keyword and parameters, wherein the keyword indicates an event type. An instruction executor retrieves the current control instruction from the plurality of control instructions included in the sequence of control instructions, and executes the current control instruction according to the event type indicated by the keyword included in the current control instruction. In response to the event type being a write event or a time synchronization event, the instruction executor sends the converted data corresponding to the parameters obtained from executing the current control instruction to a slave computer. The slave computer controls the spaceborne device to execute the converted data.
[0017] According to embodiments of this application, control scripts are written to construct ground test cases for spaceborne equipment. A script interpreter converts the control scripts into a sequence of control instructions, generating control instructions including keywords or keywords and parameters. The control scripts written according to the test task are converted into machine-executable control signals, i.e., a sequence of control instructions. An instruction executor retrieves the current control instruction from the multiple control instructions included in the sequence. Based on the event type indicated by the keywords included in the current control instruction, the current control instruction is executed, transforming the control instruction into a specific test event. In response to a write event, the instruction executor sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level machine. This achieves automatic conversion of control instructions, transforming them into data that the spaceborne equipment can directly recognize, enabling the lower-level machine to control the spaceborne equipment to execute the actions indicated by the converted data. This achieves automatic execution of test cases, improving test reliability. Attached Figure Description
[0018] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments of this application with reference to the accompanying drawings, in which the accompanying drawings are shown.
[0019] Figure 1 A schematic diagram of the structure of a ground testing system for a spaceborne device according to an embodiment of this application is shown.
[0020] Figure 2 A flowchart illustrating a ground testing method for a spaceborne device applied to a host computer according to an embodiment of this application is shown.
[0021] Figure 3 A schematic diagram of the operation page of the host computer according to an embodiment of this application is shown.
[0022] Figure 4 A schematic diagram of the conversion control script in the host computer according to an embodiment of this application is shown.
[0023] Figure 5 A flowchart of the script interpreter according to an embodiment of this application is shown.
[0024] Figure 6 A flowchart of the operation of an instruction executor according to an embodiment of this application is shown.
[0025] Figure 7 A flowchart illustrating a ground testing method for a spaceborne device applied to a lower-level machine according to an embodiment of this application is shown.
[0026] Figure 8 A structural diagram of a lower-level machine according to an embodiment of this application is shown.
[0027] Figure 9A schematic diagram of a ground testing system for spaceborne equipment according to an embodiment of this application is shown. Detailed Implementation
[0028] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0031] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0032] Both the onboard equipment and the payload controller are deployed on the satellite. They exchange data using a master-slave handshake protocol, with the payload controller acting as the master and the onboard equipment as the slave. The payload controller can periodically send control commands to the onboard equipment, and the onboard equipment must send a response message to the payload controller within a specified time. If the payload controller does not receive a response message from the onboard equipment within the specified time or receives an incorrect response message, the communication fails, and it needs to attempt to communicate again. If the number of communication failures reaches the maximum number of communication failures, communication stops, but the master will still send control commands to the slave subsequently.
[0033] Because maintenance of spaceborne equipment is difficult during on-orbit operation, ground testing is necessary to ensure its smooth operation. The control commands sent by the payload controller and the response messages from the spaceborne equipment can include packet header identifiers, command types, data lengths, valid data, and data checksums. To conduct a complete ground test, the parameters of each control command must be manually calculated step-by-step. These parameters are then converted into valid hexadecimal character data according to the communication protocol. The packet header identifier, command type, data length, and valid data are then merged, and the checksum character of the merged data is determined. Finally, the checksum character and the merged data are combined to obtain the control command.
[0034] Obtaining control commands manually is inefficient, has limited test coverage, and is prone to human error. Manual testing also has poor repeatability, which affects the accuracy and reliability of ground testing of spaceborne equipment.
[0035] In view of this, embodiments of this application provide a ground testing method, system, host computer, and slave computer for spaceborne equipment. For ease of understanding, the ground testing system for spaceborne equipment provided in embodiments of this application will be described first below.
[0036] Figure 1 A schematic diagram of the structure of a ground testing system for a spaceborne device according to an embodiment of this application is shown.
[0037] like Figure 1 As shown, the ground testing system for spaceborne equipment can include a host computer, a slave computer, and the spaceborne equipment. The host computer and the slave computer can be connected via a serial bus to exchange data through serial communication. On one hand, the slave computer communicates with the spaceborne equipment via the serial bus for data transmission; on the other hand, the slave computer can also supply power to the spaceborne equipment.
[0038] The host computer can generate control scripts for ground testing of spaceborne equipment based on ground testing requirements. The host computer is equipped with a script interpreter and an instruction executor. The script interpreter converts the control scripts into a sequence of control instructions. This sequence can include multiple control instructions arranged in order. The instruction executor retrieves the current control instruction from the sequence and executes it based on the event type indicated by the keyword. If the event type indicated by the keyword in the current control instruction is a write event or a time synchronization event, the converted data corresponding to the parameters obtained from executing the current control instruction is sent to the lower-level computer.
[0039] In addition, the host computer can also receive data transmitted back from the satellite equipment by the slave computer via serial communication.
[0040] The lower-level machine can receive converted data corresponding to the parameters sent by the upper-level machine via serial communication. If the converted data indicates the control command is a power-on / off control command, the lower-level machine controls the on / off state of the onboard equipment by controlling the on / off state of the switch control module. If the converted data indicates the control command is an engineering parameter control command, a custom transmission control command, or a time synchronization control command, the lower-level machine sends the converted data to the onboard equipment via serial communication to control the onboard equipment to execute the actions indicated by the converted data.
[0041] The lower-level machine can also receive data sent by the on-board equipment via serial communication and send the data to the upper-level machine via serial communication.
[0042] In addition, the ground inspection board is equipped with a power management module, which can supply power to the onboard equipment.
[0043] The onboard equipment can perform corresponding operations based on the converted data sent by the lower-level machine. If the onboard equipment needs to send back data after performing the corresponding operation, it sends the data to be sent back to the lower-level machine via serial communication.
[0044] The following will be based on Figure 1 Taking the ground testing system shown as an example, the ground testing method for spaceborne equipment applied to a host computer, the ground testing method for spaceborne equipment applied to a slave computer, and the ground testing system described in the embodiments of this application will be further explained with reference to the accompanying drawings. Among them, Figure 2 , Figure 3 , Figure 4 , Figure 5 and Figure 6 This paper describes the ground testing methods and host computer used in the application of the host computer for spaceborne equipment testing. Specifically, Figure 2 This document provides an overview of the ground testing methods for spaceborne equipment used in host computers. Figure 3 Explanation of the operation interface of the host computer. Figure 4 This section explains how to convert control scripts in the host computer. Figure 5 The script interpreter in the host computer is described. Figure 6 The instruction executor in the host computer is described. Figure 7 and Figure 8 The ground testing methods and the lower-level machine used in spaceborne equipment are described. Specifically, Figure 7 This document provides an overview of the ground testing methods for spaceborne equipment applied to lower-level machines. Figure 8 The lower-level machine was explained. Figure 9 Further explanation of the ground testing system for spaceborne equipment.
[0045] Figure 2 A flowchart illustrating a ground testing method for a spaceborne device applied to a host computer according to an embodiment of this application is shown.
[0046] like Figure 2 As shown, the ground testing method for spaceborne equipment may include operations S210 to S230.
[0047] In operation S210, the script interpreter is used to convert the control script into a sequence of control instructions.
[0048] The control script can be a script used for ground testing of spaceborne equipment. A sequence of control commands can include multiple control commands arranged in order. Control commands can include keywords. Optionally, control commands can include keywords and parameters. Keywords can be used to indicate the event type.
[0049] In the host computer, the test actions that the onboard equipment needs to perform can be written into corresponding control scripts according to the test task requirements. The host computer can then use a script interpreter to convert the control scripts into a sequence of control instructions.
[0050] A control script can be text code edited by a user according to preset writing rules to define the test tasks for spaceborne equipment. It includes, but is not limited to, defining at least one of the following: test flow, parameter configuration, or instruction logic. By writing control scripts, test tasks are represented in a standardized input format. For example, control scripts can be written using programming language rules.
[0051] For example, a control script can be written as "delay()" to represent a delay, with the delay parameter to be set inside the parentheses; and "wake()" to represent a wake-up, with the wake-up time parameter to be set inside the parentheses. When writing the control script, write it line by line according to the order of instruction execution.
[0052] The script interpreter is built based on preset writing rules, including pre-defined conversion functions that can be called to convert user-written control scripts into control instructions. Control instructions instruct the instruction executor to perform corresponding operations; control instructions can be keywords or a combination of keywords and parameters. During the control script conversion process, the script interpreter converts the control script line by line according to its order, resulting in the corresponding sequence of control instructions.
[0053] For example, in the script interpreter, the control script "delay(1000)" is converted into the control instruction "DELAY 1000", where "DELAY" is a keyword indicating that the time type is a delayed event, and "1000" is the specific parameter for the delay. The above illustrates the form of control instructions consisting of keywords and parameters. Furthermore, control instructions can also consist of only parameters. For example, the control script corresponding to the time synchronization instruction is "setTimeStamp()", and the control instruction obtained after conversion by the script interpreter is "SETTIME". After converting the control script, the script interpreter obtains the corresponding sequence of control instructions.
[0054] In operation S220, the instruction executor obtains the current control instruction from multiple control instructions included in the control instruction sequence, and executes the current control instruction according to the event type indicated by the keyword included in the current control instruction.
[0055] According to embodiments of this application, the instruction executor executes control instructions sequentially according to the control instruction sequence, and executes the corresponding control instruction according to the keyword of the control instruction to process the corresponding event.
[0056] For example, when the instruction executor recognizes the "WAKE, DELAY, SETTIME" control instructions in sequence, the instruction executor will execute the wake-up operation, the delay operation, and the time synchronization operation in sequence.
[0057] During operation S230, the instruction executor, in response to a write event or time synchronization event, sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level computer. This allows the lower-level computer to control the onboard equipment to perform the actions indicated by the converted data.
[0058] According to an embodiment of this application, when the event type is a write event, the instruction executor controls the onboard equipment to perform the corresponding operation based on the keyword corresponding to the write event and the parameters after the keyword. When the event type is a time synchronization event, the instruction executor generates the corresponding instruction based on the current time to control the onboard equipment to perform time synchronization.
[0059] According to embodiments of this application, control scripts are written to construct ground test cases for spaceborne equipment. A script interpreter converts the control scripts into a sequence of control instructions, generating control instructions including keywords or keywords and parameters. The control scripts written according to the test task are converted into machine-executable control signals, i.e., a sequence of control instructions. An instruction executor retrieves the current control instruction from the multiple control instructions included in the sequence. Based on the event type indicated by the keywords included in the current control instruction, the current control instruction is executed, transforming the control instruction into a specific test event. In response to events of type write or time synchronization, the instruction executor sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level machine. This achieves automatic conversion of control instructions, transforming them into data that the spaceborne equipment can directly recognize, enabling the lower-level machine to control the spaceborne equipment to execute the actions indicated by the converted data. This achieves automatic execution of test cases, improving test reliability.
[0060] An operation page is also provided in the host computer. The operation page of the host computer in this embodiment will be further described below.
[0061] Figure 3 A schematic diagram of the operation page of the host computer according to an embodiment of this application is shown.
[0062] like Figure 3 As shown, in the host computer, users can write corresponding control scripts according to testing requirements. These control scripts are written using preset scripting language rules. The host computer operation page includes three blocks: a script editing area, a command generation area, and a command execution area. Control scripts are written in the script editing area, and can also be saved to a file or imported from pre-saved scripts. The preset scripting language uses a custom symbolic language, for example, a combination of events and parameters.
[0063] After completing the control script editing, click the "Generate Instructions" button. The system will invoke the script interpreter and display the execution results in the instruction generation area. The script interpreter checks the data type, number of parameters, parameter range, and function call method entered in the control script. If the control script does not meet the requirements, an error will be reported during code conversion, and a correct example will be provided. If the control script does not encounter any execution errors, the generated executed instructions can be saved to a file. Import the sequence of control instructions to be executed into the instruction execution area. Click "Execute Instruction," and the system will invoke the instruction executor to run the instructions in sequence. The instruction executor identifies the keywords of the current control instruction line by line and enters the corresponding conditional structure to handle the event.
[0064] In the host computer's operation page, users can quickly write test cases. In addition, it also supports saving and importing control scripts, which facilitates test reproduction and maintenance upgrades.
[0065] Figure 4 A schematic diagram of the conversion control script in the host computer according to an embodiment of this application is shown.
[0066] like Figure 4 As shown, the host computer may include a script interpreter and an instruction executor.
[0067] The host computer can edit control scripts for ground-based testing of spaceborne equipment. The script interpreter converts the control scripts into a sequence of control commands. The command executor executes the control commands.
[0068] The script interpreter can call functions to convert control scripts into sequences of control instructions. Specifically, the script interpreter can call at least one of the following: generation functions, timing control functions, or flow control functions. Generation functions can be engineering parameter conversion functions, parameter setting functions, power on / off functions, or user-defined sending functions; timing control functions can be timed sending functions, delayed sending functions, or time synchronization functions; flow control functions can be repetitive sending functions, which include loop start functions and loop end functions.
[0069] A control instruction sequence consists of multiple control instructions arranged in sequence. The control instructions may include keywords, or they may include keywords and parameters. The keywords are used to indicate the event type.
[0070] Specifically, control instructions can be generation instructions, timing control instructions, or flow control instructions. Among them, generation instructions can be engineering parameter control instructions, power on / off control instructions, or custom sending control instructions; timing control instructions can be timed sending control instructions, delayed sending control instructions, or time synchronization control instructions; flow control instructions can be loop start instructions and loop end instructions.
[0071] The instruction executor can be used to obtain the current control instruction from multiple control instructions, execute the current control instruction according to the event type indicated by the keywords included in the current control instruction, and obtain the converted data. In response to a write event or a time synchronization event, the instruction executor sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level computer, so that the lower-level computer can control the onboard equipment to perform the actions indicated by the converted data.
[0072] As one implementation method, the script interpreter first checks the writing rules of the control script. Specifically, it may perform at least one of the following checks: data type check, parameter quantity check, parameter range check, or function call check. If the control script conforms to the preset writing rules, the input control script is converted into a sequence of control instructions. Control instruction event types include: write, wake-up, power on, power off, delay, loop, and time synchronization. Loop events include loop header instructions and loop tail instructions, which need to be used together. Specifically, write, wake-up, delay, and loop header instructions include keywords and parameters, while time synchronization and loop tail instructions only contain keywords.
[0073] In the instruction executor, the sequence of control instructions is executed sequentially, and the corresponding control instruction event is executed according to the keyword of the current control instruction. When the instruction executor responds to a write event, it sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level computer.
[0074] According to an embodiment of this application, the host computer checks the writing rules of the control script. If the check passes, the control script is converted into a sequence of control instructions, reducing errors caused by human calculation. The instruction executor executes the sequence of control instructions sequentially, obtains the converted data, and sends the converted data to the lower-level computer. This eliminates the need for tedious manual calculations, achieving consistency and repeatability in testing and improving testing efficiency.
[0075] The script interpreter can call functions to convert control scripts into sequences of control instructions. The script interpreter of this application embodiment will be further described below.
[0076] The script interpreter calls at least one of the following: a generation function, a timing control function, or a flow control function; multiple control instructions include at least one of the following: a generation instruction, a timing control instruction, or a flow control instruction.
[0077] In the embodiments of this application, the script interpreter has a pre-set script conversion function. By calling at least one pre-set script conversion function, the test actions described in the control script are converted into control instructions according to the input order, so as to obtain a sequence of control instructions that the instruction executor can execute.
[0078] According to an embodiment of this application, the control script is converted into control instructions by a preset script conversion function configured in the script interpreter, thereby realizing the automatic conversion of control actions and physical parameters.
[0079] The following section will further explain the process by which the script interpreter calls generation functions to convert the control script into generation instructions.
[0080] The generated functions include at least one of the following: engineering parameter conversion function, parameter setting function, power on / off function, or custom sending function; the generated instructions include at least one of the following: engineering parameter control instruction, power on / off control instruction, or custom sending control instruction.
[0081] The process involves using a script interpreter to convert a control script into a sequence of control instructions, including executing at least one of the following: using the script interpreter to call an engineering parameter conversion function in response to the control script; using the engineering parameter conversion function to dynamically check the engineering parameters; and, in response to the successful dynamic check, converting the engineering parameters into valid data compatible with a predetermined communication protocol. Here, the engineering parameters are the input parameters of the engineering parameter conversion function. The script interpreter also calls a parameter setting function in response to the control script; using the parameter setting function to set the protocol header for the valid data, obtaining the parameters of the engineering parameter control instructions; and using the parameter setting function to set the event type to a write event, obtaining the keywords of the engineering parameter control instructions.
[0082] The script interpreter responds to the control script's call to the power-on / off function. The power-on / off function is used to map the power-on / off function identifier that indicates the power-on / off function to a predetermined power-on / off opcode that is compatible with a predetermined communication protocol, thereby obtaining the parameters of the power-on / off control command. The power-on / off function is then used to set the event type to a write event, thereby obtaining the keyword of the power-on / off control command.
[0083] The script interpreter responds to the control script's call to a custom send function, obtaining the raw string as the input parameter of the custom send function. This raw string is then used as the parameter of a custom send control command, with the event type set to write event, to obtain the keyword of the custom send control command.
[0084] As one embodiment, the engineering parameters can be at least one of the following: the operating mode of the spaceborne equipment, filtering parameters, firmware number, proportional coefficient, voltage, or current. Valid data conforming to a predetermined communication protocol can be calculated using the engineering parameter conversion function.
[0085] Before performing parameter conversion, the engineering parameter conversion function checks whether the input parameters conform to preset rules, such as whether the input parameters are within a specified range. If the input parameters are not within the range, i.e. do not conform to the preset rules, an error message will be given.
[0086] After the input parameters are checked to meet the preset rules, the engineering parameter conversion function calculates the parameters, adds parameter identifiers and parameter length information, calculates the check byte according to the predetermined communication protocol, and finally merges the converted parameters, parameter identifiers, parameter length information and check byte into complete valid data. The complete valid data is part of the control command.
[0087] Use the parameter setting function to set the protocol header for the valid data, including header identifier, command type, data length, and data checksum. Combine the valid data with the protocol header to form complete control command parameters, and use the parameter setting function to set the event type to a write event.
[0088] The control script can also be used to instruct the onboard equipment to power on or off. When the control script is used to control the onboard equipment to power on or off, the script interpreter calls the power-on / off function, maps the power-on / off function identifier that instructs the power-on / off function to a predetermined power-on / off opcode that is compatible with the predetermined communication protocol, obtains the corresponding parameters, and sets the event type to write event through the power-on / off function.
[0089] The control script can also be used to send custom characters to onboard equipment. When the control script is not used to send custom characters, the script interpreter calls the custom sending function, reads the raw string of the input parameter of the custom sending function, uses the raw string as the parameter of the custom sending control command, and sets the event type to write event through the custom sending function.
[0090] According to an embodiment of this application, in the script interpreter, a generation class function is called to automatically convert the input parameters in the control instructions into data corresponding to the control instructions, and the data is combined into control instructions according to a preset communication protocol, which reduces human calculation errors and ensures test consistency and repeatability.
[0091] The following section will further explain the process by which the script interpreter calls timing control functions to convert the control script into timing control instructions.
[0092] Timing control functions include at least one of the following: timed send function, delayed send function, or time synchronization function; timing control instructions include at least one of the following: timed send control instruction, delayed send control instruction, or time synchronization control instruction.
[0093] The process involves using a script interpreter to convert a control script into a sequence of control instructions. This includes: the script interpreter responding to the control script's call to a timing control function to obtain the timing control time as an input parameter for the timing control function; the timing control function dynamically checks the timing control time; and upon successful dynamic checking, converts the timing control time into a time string to obtain the parameters for the timing control instructions; and the timing control function sets the event type to the target event to obtain the keyword for the timing control instructions. Specifically, when the timing control function is a timed send function, the target event is a wake-up event. When the timing control function is a delayed send function, the target event is a delayed event. When the timing control function is a time synchronization function, the target event is a time synchronization event, and the timing control instructions do not include parameters.
[0094] According to an embodiment of this application, the input to the timed sending function is the start time of instruction execution. In the timed sending function of the script interpreter, it first checks whether the input start time parameter conforms to a preset rule. If it does, the input start time parameter is converted into a time string, and the event type is set to a wake-up event using the timed sending function. If the input start time does not conform to the preset rule, an error message is given.
[0095] According to an embodiment of this application, the input to the delayed sending function is the delay time for instruction execution. In the delayed sending function of the script interpreter, it first checks whether the input delay time parameter conforms to a preset rule. If it conforms, the input delay time parameter is converted into a time string, and the event type is set to a wake-up event using the delayed sending function. If the input delay time does not conform to the preset rule, an error message is given.
[0096] According to an embodiment of this application, the input to the time synchronization function is a time synchronization command. In the time synchronization function of the script interpreter, it first checks whether the input time synchronization command conforms to preset rules. If it conforms, the current time is converted into a time string, and the event type is set to a wake-up event using the time synchronization function. If the input time synchronization command does not conform to preset rules, an error message is given.
[0097] According to embodiments of this application, timing control functions can precisely control the execution time of instructions and execute them automatically, with an execution time error of less than milliseconds. This eliminates the need for manual control of instruction sending times, thus improving the accuracy of instruction execution. Furthermore, using time synchronization functions for system time synchronization eliminates the need to pre-calculate corresponding instructions and wait for the appropriate time to send them, thereby improving the time synchronization accuracy of onboard equipment.
[0098] The following section will further explain the process by which the script interpreter calls flow control class functions to convert the control script into flow control class instructions.
[0099] Flow control functions include repetitive sending functions, which include loop header functions and loop tail functions. Flow control instructions include repetitive sending control instructions, which include loop header instructions and loop tail instructions. Specifically, the script interpreter converts the control script into a sequence of control instructions, including: the script interpreter responding to the control script by calling the loop header function; using the loop header function to convert the loop count into a parameter for the loop header instruction; setting the event type to the loop header event; and using the script interpreter responding to the control script by calling the loop tail function; setting the event type to the loop tail event; and setting the loop tail instruction keyword.
[0100] In the embodiments of this application, the repeated transmission control script consists of a loop header control script and a loop tail control script. When using it, the loop header control script and the loop tail control script need to correspond one-to-one. Between the loop header control script and the loop tail control script are control scripts that need to be executed repeatedly to form a complete repeated transmission test process.
[0101] For example, the loop header control script can be "loop(5)", and the corresponding loop tail control script can be "endloop()". The "5" in the loop header control script is a parameter, indicating that the repetitive sending control script needs to be executed 5 times. The loop tail control script has no parameters and is used to indicate the end of the repetitive sending control script. The repetitive sending function consists of a loop header function and a loop tail function. In the script interpreter, it checks whether the loop header function and the loop tail function appear in pairs and whether the order of each pair of loop header function and loop tail function is correct. If the check passes, the repetitive sending control script is converted into a repetitive sending instruction consisting of a loop header instruction and a loop tail instruction. The loop header instruction includes a loop header keyword and a parameter, and the loop tail instruction has no parameter. The parameter of the loop header keyword is used to indicate the number of times the repetitive sending instruction is executed. The script interpreter checks the control script to ensure that the loop header instruction comes before the loop tail instruction and appears in pairs. It also supports multi-level nested loops.
[0102] According to embodiments of this application, by repeatedly sending control scripts to construct repetitive test tasks, high-frequency, periodic test tasks can be performed, enabling the repetitive test tasks to run stably in multiple repetitions.
[0103] The following will further explain, with reference to the accompanying drawings, the process by which the script interpreter converts the control script into a sequence of control instructions.
[0104] Figure 5 A flowchart of the script interpreter according to an embodiment of this application is shown.
[0105] like Figure 5 As shown, after the script interpreter starts converting the control script, it first traverses the entire control script, finds the loop start control script and the loop end control script, calls the loop start function and the loop end function, and determines whether the loop start function and the loop end function appear in pairs and are correctly nested.
[0106] When the loop header and loop tail functions appear in pairs and are correctly nested, the control script writing rules are checked. For example, the engineering parameter conversion function is called to check whether the engineering parameters of the engineering parameter control script are correct, including checking whether the parameter type, value range, format, and quantity are correct. If the check is correct, the script interpreter uses the engineering parameter conversion function to generate the corresponding engineering parameters from the input engineering parameter control script parameters, and inputs the generated engineering parameters into the parameter setting function. Then, the parameter setting function is called to check whether the header identifier, command code, parameter type, data length, and data validation of the parameter setting function are correct. The delayed send function is called to check the non-negativity of the parameters of the delayed send control script. The timed send function is called to check whether the number of parameters of the timed send control script is correct and the time is valid. The repeated send function is called to check whether the parameters of the repeated send control script are greater than zero. The custom send function is called to check whether the parameters of the custom send control script are predetermined characters. If any of the above checks pass, the script interpreter generates the corresponding control instructions according to the function input parameters, determines whether the script has finished executing, and ends the conversion process. If the script has not finished executing, the above process continues. If any of the above checks fail, an error message is displayed, and the conversion process ends.
[0107] For example, a control script written by the user is:
[0108] wake([2024,4,15,0,0,0])
[0109] delay(1000)
[0110] turnon()
[0111] delay(2000)
[0112] setTimeStamp([2024,4,1,14,30,0])
[0113] The control instruction sequence obtained by the script interpreter after the above control script is converted is as follows:
[0114] WAKE 20240415000000
[0115] DELAY 1000
[0116] WRITE EB90050100010007
[0117] DELAY 2000
[0118] WRITEEB900105660A546800000132
[0119] Converting a control script into a sequence of control instructions using a script interpreter includes: performing a static check on the control script using the script interpreter; and converting the control script into a sequence of control instructions in response to the static check of the control script passing.
[0120] According to embodiments of this application, the script interpreter performs a static check on the control script based on preset writing rules. For example, it checks at least one of the following: the data type, number of parameters, parameter range, or function call method of the control script. If all writing rules of the control script conform to the preset rules, the script interpreter calls the corresponding function to convert the control script into a sequence of control instructions. This achieves automatic checking of the control script, ensuring the correct execution of subsequent test tasks.
[0121] The following will further explain the process by which the instruction executor executes the current control instruction.
[0122] The instruction executor retrieves the current control instruction from a sequence of control instructions, and executes the current control instruction based on the event type indicated by a keyword included in the current control instruction, including executing at least one of the following:
[0123] The current control instruction is obtained from multiple control instructions included in the control instruction sequence using the instruction executor. In response to the event type indicated by the keyword included in the current control instruction being a write event, the parameters included in the current control instruction are converted into a first predetermined data format to obtain the converted data corresponding to the parameters.
[0124] In the embodiments of this application, the instruction executor first identifies the keyword of the current control instruction. If the write keyword is identified, the parameters included in the control instruction indicated by the write keyword are converted into a first predetermined data format (e.g., hexadecimal characters) and sent to the lower-level machine.
[0125] In response to the event type indicated by the keyword included in the current control command being a wake-up event, the difference between the current time and the timing control duration indicated by the parameters included in the current control command is determined, and the converted data corresponding to the parameters is obtained.
[0126] As one embodiment, when the instruction executor recognizes the wake-up keyword, it first determines the current time and the parameters included in the current control instruction, calculates the difference between the timing control duration corresponding to the current time and the parameters included in the wake-up keyword, obtains the instruction execution time parameter, and then assigns the instruction execution time parameter to the waiting module. After the corresponding time is reached, the instruction executor performs subsequent operations.
[0127] In response to the event type indicated by the keyword included in the current control command being a delayed event, the parameters included in the current control command are converted into a second predetermined data format to obtain the converted data corresponding to the parameters.
[0128] As one embodiment, when the instruction executor recognizes the delay keyword, it converts the parameters included in the delay instruction into parameters that the waiting module can recognize, namely the second predetermined data format, and assigns the parameters to the waiting module, in which the delay operation corresponding to the duration is performed.
[0129] In response to the event type indicated by the keyword included in the current control command being a time synchronization event, the current time is converted into a third predetermined data format to obtain the converted current time. A time correction command is generated based on the converted current time, with the converted current time as the parameter and the converted data as the time correction command.
[0130] As one embodiment, when the instruction executor recognizes the time synchronization keyword, it reads the parameters of the time module in the instruction executor, converts them into a third predetermined data format, converts the parameters of the third predetermined data format into a time correction instruction conforming to the communication protocol, and sends it to the lower-level computer.
[0131] In response to the event type indicated by the keyword included in the current control instruction being a loop header event, the parameters included in the current control instruction are converted into a fourth predetermined data format to obtain the loop count. Based on the loop count and the current control instruction line number, a combined structure is obtained and added to the loop control queue. In response to the event type indicated by the keyword included in the current control instruction being a loop tail event, the combined structure is retrieved from the loop control queue. Based on the combined structure, the loop count is obtained and decremented by one to obtain the updated loop count. In response to the updated loop count being greater than zero, based on the updated loop count and the current control instruction line number included in the combined structure, an updated combined structure is obtained and added to the loop control queue. The operation of converting the parameters included in the current control instruction into the fourth predetermined data format to obtain the updated loop count is repeated until the updated loop count is equal to zero.
[0132] In one embodiment, when the instruction executor recognizes a loop header keyword, it converts the parameters of the loop header instruction into a fourth predetermined data format to obtain the loop count. Based on the loop count and the current control instruction line number, it obtains a combination structure. The instruction executor adds the combination structure to the loop control queue and executes the instructions included in the combination structure line by line. When the loop tail keyword is recognized, the loop count corresponding to the combination structure is decremented by one to obtain an updated loop count. If the updated loop count is greater than zero, an updated combination structure is obtained based on the updated loop count and the current control instruction line number included in the combination structure. The updated combination structure is then added to the loop control queue. The operation of converting the loop count parameter into the fourth predetermined data format to obtain the updated loop count is repeated until the updated loop count is equal to zero.
[0133] As one example, in the instruction executor, the parameters written in the instruction can be converted into hexadecimal character form. For example, a converted data entry could be: EB 90 05 01 00 01 00 07.
[0134] As one implementation, in the instruction executor, the control instruction sequence is first converted into a two-dimensional string array, with each row of the one-dimensional array representing one control instruction. During execution, a shift register is used to store the line number of the next instruction, indicating the offset of the instruction to be executed. Except for the test event corresponding to the loop tail keyword, the stored line number is automatically incremented by one after the execution of other test events.
[0135] The following will further explain the process of the instruction executor executing a sequence of control instructions, with reference to the accompanying drawings.
[0136] Figure 6 A flowchart of the operation of an instruction executor according to an embodiment of this application is shown.
[0137] like Figure 6 As shown, when the instruction executor starts executing the control instruction sequence, it first obtains the current control instruction from the multiple control instructions included in the control instruction sequence. After obtaining the current control instruction, it assigns the line number of the instruction to be executed to zero, and then reads the keyword of the current control instruction.
[0138] Upon reading the current control instruction keyword, it is determined whether the currently executed instruction is empty. If not empty, different test events are executed according to the keyword indication type. For example, if the write keyword is read, the parameters are converted into a first predetermined data format and written to the serial port. The first predetermined data format can be hexadecimal characters. If the time synchronization keyword is read, the system time is obtained, and the system time parameter is converted into a third predetermined data format. A time code instruction conforming to the communication protocol is generated based on the system time parameter in the third predetermined data format, and the time code instruction is written to the serial port. If the wake-up keyword is read, the delay time is first calculated and it is determined whether the delay time is greater than zero. If the delay time is zero, subsequent operations are executed directly. If the delay time is not zero, the difference between the current time and the timing control duration indicated by the parameters included in the current control instruction is determined to obtain the delay time. The delay time is assigned to the waiting module, and subsequent operations are executed after the delay time is reached. If a delay instruction is read, the delay time is assigned to the waiting module, and subsequent operations are executed after the delay time is reached.
[0139] Upon reading the loop header keyword, the current control instruction line number and the remaining loop count are popped from the stack. The parameters included in the current control instruction are converted to a fourth predetermined data format to obtain the loop count. Based on the loop count and the current control instruction line number, a combination structure is obtained. In the instruction executor, the combination structure is added to the loop control queue, and the instructions included in the combination structure are executed line by line. After any of the above instructions has been executed, the instruction line number is incremented by one, and the line number is assigned to the next instruction to be executed.
[0140] If the loop tail keyword is read, the loop count corresponding to the combined structure is decremented by one to obtain the updated loop count. Then, it is checked whether the remaining loop count is greater than zero. If the loop count is greater than zero, the remaining loop count is decremented by one to obtain the updated loop count. Then, the current line number and loop count are pushed onto the stack. Based on the updated loop count and the line number of the current control instruction included in the combined structure, the updated combined structure is obtained and added to the loop control queue. The line number is assigned to the next control instruction to be executed. The operation of converting the loop count parameter to the fourth predetermined data format to obtain the updated loop count is repeated until the updated loop count is equal to zero. If the loop count is zero, the line number is assigned to the next instruction to be executed.
[0141] According to embodiments of this application, the instruction executor sequentially identifies the keywords of the control instructions according to the sequence of control instructions, processes the corresponding test events according to the keyword indication type, and converts the parameters in the control instructions into data that the onboard equipment can recognize, avoiding the tedious steps of manual calculation. By controlling the instruction waiting time through a waiting module, precise control of the instruction execution time is achieved. By acquiring the system time and performing time synchronization based on the acquired system time parameters, there is no need to calculate the instructions in advance, and the time synchronization instructions can be sent at the corresponding time, improving time synchronization accuracy.
[0142] The ground testing method for spaceborne equipment applied to a lower-level machine according to embodiments of this application will be further described below with reference to the accompanying drawings.
[0143] Figure 7 A flowchart illustrating a ground testing method for a spaceborne device applied to a lower-level machine according to an embodiment of this application is shown.
[0144] like Figure 7 As shown, the ground testing method for spaceborne equipment applied to a lower-level machine according to the embodiments of this application includes operations S710 to S720.
[0145] When operating the S710, it receives the converted data corresponding to the parameters obtained from executing the current control command sent by the host computer.
[0146] The S720 controls the onboard equipment to perform actions indicated by the converted data.
[0147] The converted data is sent by the host computer when the event type indicated by the keyword of the current control command is a write event or a time synchronization event, as responded to by the instruction executor. The converted data is obtained by the host computer using the instruction executor to retrieve the current control command from multiple control commands included in the control command sequence, and executing the current control command according to the event type indicated by the keyword included in the current control command. The control command sequence is obtained by the host computer using a script interpreter to convert the control script. The control script is a script used for ground testing of spaceborne equipment. The control command sequence includes multiple control commands arranged in sequence. The control commands include keywords, or the control commands include keywords and parameters. The keywords are used to indicate the event type.
[0148] The above operations can be performed in the lower-level machine. The lower-level machine can receive the converted data corresponding to the parameters obtained from the execution of the current control command sent by the upper-level machine, and control the spaceborne equipment to perform different actions through different modules in the lower-level machine according to the converted data corresponding to different control commands.
[0149] According to the embodiments of this application, the lower-level machine receives the converted data sent by the upper-level machine, controls the spaceborne equipment to perform corresponding actions, completes the automated ground testing of the spaceborne equipment, and reduces manual intervention.
[0150] Controlling the onboard equipment to execute actions indicated by the converted data includes performing at least one of the following: In response to determining that the control command is a power-on / off control command based on the converted data, controlling the on / off state of the onboard equipment by controlling the on / off state of the switch control module. In response to determining that the control command is an engineering parameter control command, a custom transmission control command, or a time synchronization control command based on the converted data, sending the converted data to the onboard equipment to control the onboard equipment to execute the actions indicated by the converted data.
[0151] According to an embodiment of this application, in the lower-level machine, control commands can be sent to the spaceborne equipment via serial communication, and the power on or off of the spaceborne equipment can be controlled by switching the control module on and off. During ground testing of the spaceborne equipment, the lower-level machine sends the converted data corresponding to the parameters obtained from executing the current control command to the spaceborne equipment to verify the functionality of the spaceborne equipment and complete the ground testing of the spaceborne equipment.
[0152] The lower-level machine of the embodiments of this application will be further described below.
[0153] A lower-level machine includes a communication module and a control module.
[0154] The communication module is used to receive the converted data corresponding to the parameters obtained from the execution of the current control command sent by the host computer.
[0155] The control module controls the onboard equipment to execute actions indicated by the converted data. The converted data is sent by the host computer in response to a write event or time synchronization event indicated by a keyword in the current control command, using the instruction executor. The converted data is obtained by the host computer retrieving the current control command from a sequence of multiple control commands using the instruction executor, and executing the current control command based on the event type indicated by its keyword. The control command sequence is obtained by the host computer converting a control script using a script interpreter. The control script is used for ground testing of the onboard equipment; the control command sequence includes multiple sequentially arranged control commands, each including a keyword, or both a keyword and parameters. The keyword indicates the event type.
[0156] According to an embodiment of this application, the lower-level machine uses a communication module to receive converted data corresponding to the parameters obtained from the current control command sent by the upper-level machine. Based on the converted data, the control module controls the onboard equipment to execute the actions indicated by the converted data. By using the lower-level machine to control the onboard equipment to execute the corresponding actions, manual intervention is reduced, and automated ground testing of the onboard equipment is achieved.
[0157] Figure 8 A schematic diagram of the lower-level machine according to an embodiment of this application is shown.
[0158] like Figure 8 As shown, the lower-level machine includes a control module, a power management module, a communication module, and a switch control module.
[0159] The main control chip of the control module receives 3.3V, 1.8V, 1.5V, and 1V power from the power management module. An external crystal oscillator provides a 33.33MHz clock input to the PS (Processing System) side and a 50MHz clock input to the PL (Programmable Logic) side of the main control chip. Two DDR3 (double-data-rate 3 synchronous dynamic RAM) chips are connected to the memory interface on the PS side as main memory. A FLASH chip is connected to the GPIO (General Purpose Input Output) port on the PS side to store the system boot image.
[0160] The power management module uses a 28V DC power supply to power the onboard equipment, control module, communication module, and switch control module. The power management module uses a linearly adjustable voltage converter chip to provide a slightly adjustable 28V power supply voltage to the onboard equipment. A first voltage converter converts the 28V power to 3.3V, a second voltage converter converts it to 1.8V, a third voltage converter converts it to 1.5V, and a fourth voltage converter converts it to 1V; these four power supplies power the control module. The 3.3V power obtained from the first voltage converter also powers the communication module and the switch control module.
[0161] The communication module includes a first serial communication module and a second serial communication module. Both modules use a serial port transmitting chip as the transmitter and a serial port receiving chip as the receiver. The first serial communication module communicates with the host computer, and the second serial communication module communicates with the onboard equipment.
[0162] The switch control module consists of an optocoupler isolation module and a driver circuit, used to control the power-on and power-off of the onboard equipment. The control signal output from the main control chip is output to the driver circuit through the optocoupler isolator. The Darlington transistor in the driver circuit drives the chip to output switch control signals, thereby controlling the power-on and power-off of the onboard equipment.
[0163] This application also provides a ground testing system for spaceborne equipment. The following will further describe the ground testing system for spaceborne equipment according to the embodiments of this application with reference to the accompanying drawings.
[0164] Figure 9 A schematic diagram of a ground testing system for spaceborne equipment according to an embodiment of this application is shown.
[0165] like Figure 9 As shown, the ground testing system for spaceborne equipment includes a host computer and a slave computer.
[0166] The host computer uses a script interpreter to convert a control script into a sequence of control instructions. The control script is a script used for ground testing of the spaceborne equipment. The sequence of control instructions includes multiple control instructions arranged in sequence. Each control instruction includes a keyword, or a keyword and parameters. The keyword indicates the event type. The host computer uses an instruction executor to obtain the current control instruction from the multiple control instructions in the sequence of control instructions. Based on the event type indicated by the keyword in the current control instruction, the host computer executes the current control instruction. In response to an event type of write event or time synchronization event, the host computer sends the converted data corresponding to the parameters obtained from executing the current control instruction to the lower-level computer.
[0167] The host computer and the slave computer can be connected via a serial bus, and data can be transmitted between them through serial communication.
[0168] The lower-level machine is used to control the onboard equipment to execute the converted data.
[0169] The lower-level device can be a ground detection board, which is also connected to a power supply. The ground detection board is used to send converted data to the onboard equipment via serial communication, thereby controlling the onboard equipment to execute the converted data. The ground detection board can also supply power to the onboard equipment.
[0170] In the embodiments of this application, the host computer can send converted data to the slave computer via serial communication. The slave computer can then send the converted data to the spaceborne equipment via serial communication to control the spaceborne equipment to execute the converted data, thereby enabling ground testing of the spaceborne equipment.
[0171] It should be noted that the data processing system part in the embodiments of this application corresponds to the data processing method part in the embodiments of this application. The specific description of the data processing system part is referred to in the data processing method part, and will not be repeated here.
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this application can be combined and / or combined in various ways, even if such combinations or combinations are not expressly stated in this application. In particular, the various embodiments and / or features described in the claims of this application may be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
[0173] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this application is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this application, and all such substitutions and modifications should fall within the scope of this application.
Claims
1. A ground test method of a spaceborne device, comprising: converting a control script into a control instruction sequence by a script interpreter, wherein the control script is a script for ground testing the spaceborne device, the control instruction sequence comprises a plurality of control instructions arranged in sequence, the control instruction comprises a keyword, or the control instruction comprises a keyword and a parameter, and the keyword is used to indicate an event type; obtaining a current control instruction from the plurality of control instructions comprised in the control instruction sequence by an instruction executor, and executing the current control instruction according to the event type indicated by the keyword comprised in the current control instruction; and sending converted data corresponding to the parameter obtained by executing the current control instruction to a lower machine by the instruction executor in response to the event type being a write event or a time setting event, so that the lower machine controls the spaceborne device to execute an action indicated by the converted data.
2. The method of claim 1, wherein, The script interpreter invokes at least one of a generation class function, a timing control class function or a flow control class function; and the plurality of control instructions comprise at least one of a generation class instruction, a timing control class instruction or a flow control class instruction.
3. The method of claim 2, wherein, The generation class function comprises at least one of an engineering parameter conversion function, a parameter setting function, a power-on / off function or a custom sending function; and the generation class instruction comprises at least one of an engineering parameter control instruction, a power-on / off control instruction or a custom sending control instruction. The converting the control script into the control instruction sequence by the script interpreter comprises performing at least one of the following: In response to the control script invoking the engineering parameter conversion function by the script interpreter, performing dynamic checking on an engineering parameter by the engineering parameter conversion function, converting the engineering parameter into valid data compatible with a predetermined communication protocol in response to the dynamic checking on the engineering parameter being passed, wherein the engineering parameter is an input parameter of the engineering parameter conversion function; in response to the control script invoking the parameter setting function by the script interpreter, setting a protocol header for the valid data by the parameter setting function to obtain a parameter of the engineering parameter control instruction, and setting an event type as a write event by the parameter setting function to obtain a keyword of the engineering parameter control instruction; In response to the control script invoking the power-on / off function by the script interpreter, mapping a power-on / off function identifier indicating the power-on / off function into a predetermined power-on / off operation code compatible with a predetermined communication protocol by the power-on / off function to obtain a parameter of the power-on / off control instruction, and setting an event type as a write event by the power-on / off function to obtain a keyword of the power-on / off control instruction; or In response to the control script invoking the custom sending function by the script interpreter, obtaining an original string as an input parameter of the custom sending function, taking the original string as a parameter of a custom sending control instruction, setting an event type as a write event to obtain a keyword of the custom sending control instruction.
4. The method of claim 2 or 3, wherein, The timing control class function includes at least one of a timing sending function, a delay sending function, or a time setting function; and the timing control class instruction includes at least one of a timing sending control instruction, a delay sending control instruction, or a time setting control instruction. The converting the control script into the control instruction sequence by the script interpreter includes: The script interpreter invokes the timing control class function in response to the control script, and obtains a timing control time as an input parameter of the timing control class function; The timing control class function dynamically checks the timing control time, and converts the timing control time into a time string to obtain a parameter of the timing control class instruction in response to a dynamic check of the timing control time being passed; and The timing control class function sets an event type as a target event to obtain a keyword of the timing control class instruction, wherein the target event is a wake-up event when the timing control class function is the timing sending function, the target event is a delay event when the timing control class function is the delay sending function, and the target event is a time setting event and the timing control class instruction does not include the parameter when the timing control class function is the time setting function.
5. The method of claim 2 or 3, wherein, The flow control class function includes a repeated sending function, and the repeated sending function includes a loop head function and a loop tail function; the flow control class instruction includes a repeated sending control instruction, and the repeated sending control instruction includes a loop head instruction and a loop tail instruction; The converting the control script into the control instruction sequence by the script interpreter includes: The script interpreter invokes the loop head function in response to the control script, and the loop head function converts a loop number of the loop head function into a parameter of the loop head instruction and sets an event type as a loop head event to obtain a keyword of the loop head instruction; The script interpreter invokes the loop tail function in response to the control script, and the loop tail function sets an event type as a loop tail event to obtain a keyword of the loop tail instruction.
6. The method of any one of claims 1-3, wherein, The converting the control script into the control instruction sequence by the script interpreter includes: The script interpreter performs a static check on the control script; and The script interpreter converts the control script into the control instruction sequence in response to the control script passing the static check.
7. The method of any one of claims 2-5, wherein, The instruction executor acquires a current control instruction from a plurality of control instructions included in the control instruction sequence, and executes the current control instruction according to an event type indicated by a keyword included in the current control instruction, including at least one of: The instruction executor acquires the current control instruction from the plurality of control instructions included in the control instruction sequence, in response to the event type indicated by the keyword included in the current control instruction being a write event, converts a parameter included in the current control instruction into a first predetermined data format to obtain converted data corresponding to the parameter; and in response to the event type indicated by the keyword included in the current control instruction being a read event, converts the converted data into a second predetermined data format to obtain the parameter. in response to the event type indicated by the keyword included in the current control instruction being a wake-up event, determining a difference between a current time and a time duration indicated by a parameter included in the current control instruction, to obtain converted data corresponding to the parameter; in response to the event type indicated by the keyword included in the current control instruction being a delay event, converting the parameter included in the current control instruction into a second predetermined data format, to obtain converted data corresponding to the parameter; in response to the event type indicated by the keyword included in the current control instruction being a time setting event, converting the current time into a third predetermined data format, to obtain converted current time, and generating a time correction instruction according to the converted current time, a parameter of the time correction instruction being the converted current time, the time correction instruction being the converted data; or in response to the event type indicated by the keyword included in the current control instruction being a loop head event, converting the parameter included in the current control instruction into a fourth predetermined data format, to obtain a loop number, obtaining a combined structure according to the loop number and a current control instruction line number, and adding the combined structure to a loop control queue, in response to the event type indicated by the keyword included in the current control instruction being a loop tail event, obtaining a combined structure from the loop control queue, obtaining a loop number according to the combined structure, and obtaining an updated loop number by subtracting one from the loop number, in response to the updated loop number being greater than zero, obtaining an updated combined structure according to the updated loop number and a current control instruction line number included in the combined structure, and adding the updated combined structure to the loop control queue, and repeating the operations of converting the parameter included in the current control instruction into the fourth predetermined data format to obtaining the updated loop number until the updated loop number is equal to zero.
8. A ground test method of a spaceborne device, comprising: receiving converted data corresponding to a parameter obtained by executing a current control instruction from a host computer; and controlling the spaceborne device to perform an action indicated by the converted data; wherein the converted data is sent by the host computer in response to an event type indicated by a keyword of the current control instruction being a write event or a time setting event, the converted data is obtained by the host computer using an instruction executor to obtain a current control instruction from a plurality of control instructions included in a control instruction sequence according to an event type indicated by a keyword of the current control instruction, the control instruction sequence is obtained by the host computer using a script interpreter to convert a control script, the control script is a script for ground testing the spaceborne device, the control instruction sequence includes a plurality of control instructions arranged in sequence, the control instruction includes a keyword, or the control instruction includes a keyword and a parameter, and the keyword is used to indicate an event type.
9. The method of claim 8, wherein, the controlling the spaceborne device to perform the action indicated by the converted data includes performing at least one of the following: in response to determining, according to the converted data, that the control instruction is a power-on / off control instruction, controlling the on / off of the switch control module according to the converted data, and controlling the working state of the spaceborne device by controlling the on / off of the switch control module; or in response to determining, according to the converted data, that the control instruction is an engineering parameter control instruction, a self-defined sending control instruction or a time setting control instruction, sending the converted data to the spaceborne device to control the spaceborne device to perform an action indicated by the converted data.
10. An upper computer, comprising: a script interpreter configured to convert a control script into a control instruction sequence, wherein the control script is a script for testing a spaceborne device on the ground, the control instruction sequence comprises a plurality of control instructions arranged in sequence, and each control instruction comprises a keyword or a keyword and a parameter, and the keyword is used to indicate an event type; and an instruction executor configured to obtain a current control instruction from the plurality of control instructions, and execute the current control instruction according to an event type indicated by a keyword included in the current control instruction; and in response to the event type being a write event or a time setting event, send converted data corresponding to the parameter obtained by executing the current control instruction to a lower computer, so that the lower computer controls the spaceborne device to perform an action indicated by the converted data.
11. A lower computer, comprising: a communication module configured to receive converted data corresponding to a parameter obtained by executing a current control instruction sent by an upper computer; and a control module configured to control the spaceborne device to perform an action indicated by the converted data; wherein the converted data is sent by the upper computer in response to the event type indicated by a keyword of the current control instruction being a write event or a time setting event, the converted data is obtained by the upper computer using the instruction executor from the plurality of control instructions included in the control instruction sequence, and the control instruction sequence is obtained by the upper computer using the script interpreter from a control script for testing the spaceborne device on the ground, the control instruction sequence comprises a plurality of control instructions arranged in sequence, and each control instruction comprises a keyword or a keyword and a parameter, and the keyword is used to indicate an event type.
12. A ground testing system for a spaceborne device, comprising: an upper computer configured to: convert a control script into a control instruction sequence using a script interpreter, wherein the control script is a script for testing the spaceborne device on the ground, the control instruction sequence comprises a plurality of control instructions arranged in sequence, and each control instruction comprises a keyword or a keyword and a parameter, and the keyword is used to indicate an event type; and The instruction executor is used to acquire a current control instruction from a plurality of control instructions included in the control instruction sequence, and execute the current control instruction according to an event type indicated by a keyword included in the current control instruction; The instruction executor is used to send, in response to the event type being a write event or a time calibration event, converted data corresponding to a parameter obtained by executing the current control instruction to a lower-level machine; and The lower-level machine is used to control the spaceborne device to execute the converted data.
