Script-based relay satellite control method and device and computer equipment
By performing multi-layered verification and parsing of the remote control script, a script task object is generated. Combined with the task scheduling algorithm, the problem of traditional relay satellite control relying on manual intervention is solved, achieving efficient and reliable automated management and improving the relay satellite's operating efficiency and system stability.
Patent Information
- Application Number
- CN202511895453.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-01-20
Smart Images

Figure CN121367534A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic control, and in particular to a relay satellite control method and device based on scripts, a computer device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the rapid development of satellite communication, deep space exploration and ground long-distance communication network, relay satellites (relay communication satellites) as key information forwarding nodes play an irreplaceable role in ensuring communication link stability, expanding coverage range and improving overall system reliability. In actual operation, the relay satellite needs to dynamically adjust its working mode according to task requirements, environmental changes and equipment state, such as timing start-stop, channel switching, power management, antenna pointing control and fault emergency handling.
[0003] In the traditional technology, such control operations are highly dependent on manual intervention, and the operation and maintenance personnel need to manually issue instructions through the ground station or execute limited automatic tasks according to the preset fixed schedule. The manual intervention control method is not only inefficient but also prone to errors. SUMMARY
[0004] Therefore, it is necessary to provide a relay satellite control method and device based on scripts, a computer device, a computer readable storage medium and a computer program product to solve the above technical problems.
[0005] In a first aspect, the present application provides a relay satellite control method based on scripts, which comprises: obtaining a remote control script for controlling a relay satellite, and performing multi-layer verification on the remote control script; the remote control script comprises a priority identifier, a time trigger condition, an execution action and an exception handling logic; in a case where it is determined that the multi-layer verification of the remote control script is passed, performing analysis and semantic mapping on the remote control script, generating a corresponding script task object, and injecting runtime context information into the script task object, including a task submission timestamp, a resource lock key and an execution timeout threshold; adding the script task object to a scheduling queue, and determining the position of the script task object in the scheduling queue based on a preset task scheduling algorithm; serializing the script task object according to its position in the scheduling queue, and publishing it to a scheduling message queue; in a case where it is detected that the script task object in the scheduling message queue starts to execute, recording an execution log, and generating a state feedback according to an execution state.
[0006] In one of the embodiments, the multi-layer verification on the remote control script comprises: format legality verification on the remote control script based on a preset structured syntax specification; parameter integrity and correctness verification on the remote control script in a case where the format legality verification is determined to pass; security verification on the remote control script in a case where the parameter integrity and correctness verification is determined to pass; and multi-layer verification pass of the remote control script in a case where the security verification is determined to pass.
[0007] In one of the embodiments, the remote control script for controlling the relay satellite is obtained by: in response to a script editing instruction, obtaining edited script information in a JSON format, the script information comprising an execution action for controlling the relay satellite, and priority identification, a time trigger condition, and exception handling logic of the script information; and generating a corresponding remote control script according to the script information.
[0008] In one of the embodiments, the position of the script task object in the scheduling queue is determined based on a preset task scheduling algorithm by: first sorting the script task objects in the scheduling queue according to the priority identification in a descending order of priority to determine a first order of the script task objects in the scheduling queue; second sorting a plurality of script task objects with the same priority identification according to the time trigger condition to determine a second order of the script task objects in the scheduling queue in a case where the plurality of script task objects exist; and determining the position of the script task object in the scheduling queue according to the first order or the second order.
[0009] In one of the embodiments, after detecting that the script task object in the scheduling message queue starts execution, the method further comprises: in a case where an execution instruction for a specified script task object is received, pausing execution of the script task object that has started execution, and executing the specified script task object; the priority of the specified script task object is higher than the priority of the script task object that has started execution; and continuing execution of the script task object that has started execution in a case where it is determined that the specified script task object has completed execution.
[0010] In one of the embodiments, after detecting that the script task object in the scheduling message queue starts execution, the method further comprises: in a case where an exception is monitored, determining target handling logic corresponding to the exception from the exception handling logic of the script task object; and performing exception handling based on the target handling logic.
[0011] In a second aspect, the application further provides a relay satellite control device based on a script, the device comprising: A script verification module is configured to acquire a remote control script for controlling a relay satellite, and perform multi-layer verification on the remote control script; the remote control script includes a priority identifier, a time trigger condition, an execution action, and an exception handling logic. A script analysis module is configured to, in a case where it is determined that the multi-layer verification on the remote control script is passed, analyze and semantically map the remote control script, generate a corresponding script task object, and inject runtime context information into the script task object, including a task submission timestamp, a resource lock key, and an execution timeout threshold. A script scheduling module is configured to add the script task object to a scheduling queue, and determine a position of the script task object in the scheduling queue based on a preset task scheduling algorithm. A script publishing module is configured to, according to the position of the script task object in the scheduling queue, serialize and publish the script task object to a scheduling message queue. A script execution module is configured to, in a case where it is detected that the script task object in the scheduling message queue starts to be executed, record an execution log, and according to an execution result, generate a state feedback after the script task object is executed.
[0012] In a third aspect, the present application further provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in the first aspect when executing the computer program.
[0013] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method in the first aspect when executed by a processor.
[0014] In a fifth aspect, the present application further provides a computer program product, including a computer program, and the computer program implements the steps of the method in the first aspect when executed by a processor.
[0015] The script-based relay satellite control method, device, computer equipment, computer readable storage medium and computer program product described above, by obtaining a remote control script for controlling a relay satellite, performing multi-layer verification on the remote control script, in the case where it is determined that the multi-layer verification of the remote control script is passed, performing analysis and semantic mapping on the remote control script, generating a corresponding script task object, and adding the script task object to a scheduling queue, determining the position of the script task object in the scheduling queue based on a preset task scheduling algorithm, serializing the script task object according to the position of the script task object in the scheduling queue and publishing the script task object to a scheduling message queue, in the case where it is detected that the script task object in the scheduling message queue starts to execute, recording an execution log, and generating a state feedback according to the execution state. Through the standardized script language, intelligent scheduling and real-time monitoring feedback closed loop, an efficient, reliable and scalable relay automatic management system is realized. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor.
[0017] Figure 1 A flowchart of a script-based relay satellite control method in an embodiment; Figure 2 A flowchart of a multi-layer verification step in an embodiment; Figure 3 A flowchart of a position determination step in an embodiment; Figure 4 A flowchart of a script-based relay satellite control method in another embodiment; Figure 5 A structural block diagram of a script-based relay satellite control device in an embodiment; Figure 6 An internal structure diagram of a computer equipment in an embodiment. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0019] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "a plurality of" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of the options.
[0020] In an exemplary embodiment, as shown in Figure 1 A script-based relay satellite control method is provided, which is deployed in an automatic operation and maintenance platform of a ground TT&C center, and is used for remotely and intelligently controlling a relay satellite in a low earth orbit or a geosynchronous orbit with high reliability. Specifically, the method can include the following steps: In step 102, a remote control script for controlling the relay satellite is obtained, and the remote control script is verified in multiple layers.
[0021] The remote control script can be a script information in JSON format for controlling the relay satellite, which is edited through a front-end interface. The remote control script can include a priority identifier, a time trigger condition, an execution action, and an exception handling logic. The priority identifier is used to represent the priority of the corresponding remote control script, the time trigger condition is used to represent the time condition for triggering the corresponding remote control script, the execution action is used to represent the action to be executed by the corresponding remote control script, such as signal forwarding, spectrum allocation, system restart, etc., and the exception handling logic is used to represent the processing logic of the corresponding remote control script in an abnormal scenario, such as different processing for different abnormal situations. Thus, the specified relay satellite can execute specific tasks at different times and in different situations, so as to reduce manual intervention and improve operation efficiency.
[0022] Specifically, in the script editing phase, a user can send script editing instructions to a backend server through a customized front-end interface (such as a web browser or other terminal interface supporting HTTP (Hypertext Transfer Protocol) requests). The front-end interface not only provides graphical operations, but also supports API (Application Programming Interface) calls to meet the needs of different user groups. The backend server responds to the script editing instructions and obtains the script information in JSON format edited by the user through the front-end interface, which includes the execution actions for controlling the relay satellite, as well as the priority identification, time trigger condition, and exception handling logic of the script information. Then, the corresponding remote control script is generated according to the script information. Based on different control targets, different remote control scripts can be designed, and each remote control script is relatively independent, thereby being easy to understand and maintain. Compared with the traditional independent software solution, this modular remote control script design can greatly simplify the system structure, reduce the coupling degree and complexity, and adapt to changing needs, thereby improving the scalability and flexibility of the script.
[0023] In one scenario, the remote control script can be submitted to the automated operation and maintenance platform in the form of a RESTful API (a web service architecture style based on the HTTP protocol, whose core is to realize data interaction through resource identifiers and standard methods), thereby ensuring cross-platform compatibility and security. Each API request carries necessary parameters (such as script information) for specifying the task to be executed and related configuration information.
[0024] Multi-layer verification can be a process of verifying the remote control script based on different dimensions. It includes, but is not limited to, format legality verification, security verification, and parameter integrity and correctness verification of the remote control script, to prevent illegal or incorrect scripts from affecting the normal operation of the system.
[0025] In this embodiment, after obtaining the remote control script for controlling the relay satellite, the automated operation and maintenance platform can perform multi-layer verification on the remote control script to ensure that the subsequently called remote control script is legal, safe, and feasible.
[0026] Step 104, in the case where the multi-layer verification of the remote control script is passed, the remote control script is parsed and semantically mapped to generate a corresponding script task object.
[0027] The parsing and semantic mapping refer to mapping the remote control script in JSON format to a Java object model. Specifically, the remote control script in JSON format can be parsed using the org.json (JSON parsing and generation toolkit in Java) library, and the JSON fields are mapped to the attributes of the task object to obtain the corresponding script task object. Information not explicitly declared in the supplementary script but necessary for execution, such as injecting a runtime context into the script task object, including the task submission timestamp, resource lock key, and execution timeout threshold, etc.
[0028] In one scenario, since each remote control script is independent of each other, multiple remote control scripts can be processed in parallel to improve the parsing efficiency.
[0029] In step 106, the script task object is added to the scheduling queue, and the position of the script task object in the scheduling queue is determined based on a preset task scheduling algorithm.
[0030] The task scheduling algorithm can be a scheduling mechanism that considers the task priority and the task trigger time to determine when the task is executed, in what order the task is executed, and how to avoid conflicts. The scheduling queue is a storage queue for storing script task objects with a certain execution order.
[0031] Specifically, after parsing and semantic mapping of the remote control script based on the above steps and generating the corresponding script task object, the script task object can be added to the scheduling queue, and the dependency relationship between the script task objects can be identified. According to the dependency relationship, the priority identifier of each script task object, and the time trigger condition, the optimal task execution order is generated, i.e., the position of each script task object in the scheduling queue is determined.
[0032] In one scenario, the scheduling queue can adopt a hierarchical queue structure, which can specifically include a delay queue and a priority ready queue. For example, all tasks that have not reached the execution time (i.e., the task trigger time) can be placed in the delay queue first; after reaching the task trigger time, they are automatically moved to the ready queue. The tasks that have reached the execution time are sorted by priority and entered into the ready queue.
[0033] In step 108, the script task object is serialized and published to the scheduling message queue according to the position of the script task object in the scheduling queue.
[0034] Specifically, the script task object can be serialized and published to the scheduling message queue (i.e., the MQ queue) according to the position of the script task object in the scheduling queue determined in the above steps, and then the script task object can be consumed from the scheduling message queue.
[0035] Step 110, in the case of detecting that the script task object in the scheduling message queue starts to execute, record the execution log, and generate state feedback according to the execution state.
[0036] Specifically, after the script task object is serialized and published to the scheduling message queue based on the above steps, the script task object can be consumed from the scheduling message queue. For example, a worker node (a computing node responsible for running an application) can obtain the task from the scheduling message queue and execute it.
[0037] In this embodiment, in the case of detecting that the script task object in the scheduling message queue starts to execute, the execution log can also be recorded. The log can specifically include the executed script task identifier, start time, end time, execution state, return value, error code, and the like. Thus, data analysis, problem tracing and positioning, performance tuning, and the like are facilitated.
[0038] The execution state can be the specific state of the script task object during execution, for example, the execution state can include an executing state, a paused state, a stopped state, an interrupted state, and a completed execution state, and the like. Then, during the execution of the script task object, state feedback can also be generated according to the execution state. For example, real-time state updates such as "task T001 has been executed completed" and "task T002 has been paused" can be pushed to the user end through the WebSocket protocol (a network protocol for full-duplex communication on a single TCP connection). Thus, the user is reminded in real time, the user interaction experience is improved, and the waiting anxiety is reduced.
[0039] In one scenario, the above execution log and state feedback can also be stored persistently, not only being able to monitor the state change of the task in real time, but also being used for subsequent data analysis.
[0040] In the above script-based relay satellite control method, by obtaining a remote control script for controlling the relay satellite, the remote control script is subjected to multi-layer verification, in the case where the multi-layer verification of the remote control script is determined to be passed, the remote control script is parsed and semantically mapped to generate a corresponding script task object, and the script task object is added to a scheduling queue, a position of the script task object in the scheduling queue is determined based on a preset task scheduling algorithm, the script task object is serialized and published to a scheduling message queue according to the position of the script task object in the scheduling queue, in the case where the script task object in the scheduling message queue is detected to start to execute, an execution log is recorded, and state feedback is generated according to an execution state. Through the standardized script language, intelligent scheduling, and real-time monitoring feedback loop, an efficient, reliable, and scalable relay automatic management system is realized.
[0041] In one exemplary embodiment, as Figure 2As shown, in step 102, multi-layer verification is performed on the remote control script, which can specifically include: In step 202, format legality verification is performed on the remote control script based on a preset structured syntax specification.
[0042] The format legality verification is a verification process for confirming whether the remote control script uploaded by the user is a valid JSON object. For example, a standard library (such as org.json.JSONObject or Jackson of Java) can be used to attempt to parse the input stream, and if an exception (such as JSONException) is thrown, it is determined that the script is invalid, i.e., the format legality verification of the remote control script fails, and the verification result is returned. If no exception is thrown, it is determined that the script is valid, i.e., the format legality verification of the remote control script passes, and the subsequent steps are continued, thereby avoiding program crashes or injection attacks due to format errors.
[0043] In step 204, parameter integrity and correctness verification is performed on the remote control script in a case where the format legality verification passes.
[0044] The parameter integrity and correctness verification is a verification process for verifying whether all required fields of the remote control script exist and whether the values conform to the expected types and ranges. Specifically, the fields of the remote control script can be verified based on preset required fields to determine whether all required fields of the remote control script exist, thereby achieving parameter integrity verification of the remote control script. The parameter correctness of the fields of the remote control script can be verified based on the expected types and value ranges of the fields (such as priority identifier, time trigger condition, etc.) to determine whether the parameter types and values of the fields of the remote control script meet the expectations, thereby achieving parameter correctness verification of the remote control script. For example, Java Bean Validation (a declarative validation framework for defining and executing validation rules on JavaBeans or method parameters to ensure data legality) annotations or custom validators can be used for parameter integrity and correctness verification, and if any field verification fails, it is determined that the script is invalid, and the verification result is returned. Only if all fields pass the verification, it is determined that the parameter integrity and correctness verification of the remote control script passes, and the subsequent steps are continued, thereby avoiding tasks from being unable to be executed correctly due to incomplete or incorrect parameters of the remote control script.
[0045] In step 206, security verification is performed on the remote control script in a case where the parameter integrity and correctness verification passes.
[0046] Security verification is designed to prevent users from uploading scripts containing malicious instructions. Specifically, it can be based on whitelist mechanisms, access control, or sensitive word filtering to perform security verification on remote control scripts, preventing risks such as injection, unauthorized access, or remote execution, thus enhancing script security. For example, using a whitelist mechanism, only remote control scripts are allowed to execute predefined actions listed in the whitelist, while other actions are prohibited. Security verification is then performed based on this. If the remote control script contains actions not listed in the whitelist, the security verification fails; if the remote control script only includes executing predefined actions from the whitelist, the security verification passes.
[0047] Taking sensitive word filtering as an example, the script content can be checked to see if it contains keywords (such as preset sensitive words), thereby preventing misuse or attacks. If the remote script contains sensitive words, the security check will fail; if the remote script does not contain sensitive words, the security check will pass.
[0048] Step 208: If the security verification is successful, confirm that the multi-level verification of the remote control script is successful.
[0049] Specifically, for a given remote control script, if all the verifications in the above dimensions pass, then the script can be considered to have passed multi-level verification. This ensures that only legitimate, safe, and feasible scripts can enter the scheduling queue, thereby improving the security of relay satellite control.
[0050] In one exemplary embodiment, such as Figure 3 As shown, in step 106, the position of the script task object in the scheduling queue is determined based on a preset task scheduling algorithm, which may specifically include: Step 302: Sort the script task objects in the scheduling queue in descending order of priority according to the priority identifier to determine the first order of the script task objects in the scheduling queue.
[0051] Since the priority identifier is used to represent the priority of the corresponding remote control script, the script task objects in the scheduling queue can be sorted in descending order of priority according to the priority identifier, thereby determining the first order of each script task object in the scheduling queue.
[0052] Step 304: Determine the position of the script task object in the scheduling queue according to the first order.
[0053] Specifically, the position of each script task object in the scheduling queue can be determined based on its first order in the scheduling queue.
[0054] In one scenario, after the script task objects in the scheduling queue are first sorted according to the priority identifiers in descending order of priority, if there are multiple script task objects with the same priority identifier, the multiple script task objects can be second sorted according to the time trigger conditions to determine the second order of each script task object in the scheduling queue. Then the position of the script task object in the scheduling queue is determined according to the second order. For example, if there are script task objects A1 and A2 with the priority identifier "A", the script task objects A1 and A2 are further second sorted according to the time trigger conditions of the script task objects A1 and A2. If the time trigger condition of A1 is to trigger execution at 8:00 Beijing time every day, and the time trigger condition of A2 is to trigger execution at 10:00 Beijing time every day, since 8:00 is earlier than 10:00, the script task object A1 is sorted in the front. Based on this, the second order of the script task objects A1 and A2 can be determined as A1 in the front and A2 in the back. Then the second order of the script task objects A1 and A2 in the scheduling queue can be determined. The execution order of each task is determined by priority and time trigger condition, so as to realize effective scheduling and management of each task.
[0055] In one exemplary embodiment, after detecting that the script task object in the scheduling message queue starts execution in step 110, the above method can further include: in the case of receiving an execution instruction for a specified script task object, pausing the execution of the script task object that has started execution, and executing the specified script task object; wherein the priority of the specified script task object is higher than the priority of the script task object that has started execution; after determining that the specified script task object is executed, continuing to execute the script task object that has started execution.
[0056] The specified script task object can be a script task object specified based on a burst situation, or a script task object with a higher priority in a resource conflict in which multiple scripts attempt to operate the same relay star at the same time. For example, if script A is being executed, and script C needs to be executed when a burst situation occurs, the priority of script C is higher than that of script A. If a burst situation occurs, the currently normally executed script A is paused, and script C is executed first. After script C is processed, script A is continued to be executed, so as to ensure that each task is executed in order according to the intended plan, and the overall efficiency and performance of the communication system are improved.
[0057] In one scenario, if multiple scripts attempt to operate the same relay star at the same time, and a resource conflict occurs, the scripts can be scheduled according to priority, that is, a low-priority script is forcibly interrupted according to the priority of the multiple scripts, the interrupted script enters a "pause state", and the execution is resumed after the high-priority script is completed.
[0058] In another scenario, the scripts can also be scheduled in a staggered manner according to the delay tolerance time of each script. For example, for scripts B1 and B2 that have a resource conflict, if B1 has a delay tolerance time t, B2 can be executed first within the delay tolerance time t, and B1 can be executed after B2 is completed. In this way, the execution time of the scripts is automatically adjusted to avoid the conflict window.
[0059] In an exemplary embodiment, after detecting that the script task object in the scheduling message queue starts execution in step 110, the above method can further include: in the case of monitoring an exception, determining the target processing logic corresponding to the exception from the exception handling logic of the script task object; and performing exception handling based on the target processing logic.
[0060] The exception includes but is not limited to signal loss, device failure, and other abnormal situations. Specifically, during the execution of the script task object, the script task object can monitor an exception based on the current received telemetry information, and in the case of monitoring an exception, determine the target processing logic corresponding to the current monitored exception from the exception handling logic of the script task object; and perform exception handling based on the target processing logic. For example, when a device failure is monitored, the target processing logic corresponding to the current exception can be determined from the pre-written exception handling logic. If the target processing logic corresponding to the current exception, i.e., the device failure, is to restart the system, the script task object can perform the operation of restarting the system, thereby ensuring the reliability of the system. If the target processing logic corresponding to the current exception is to switch to a backup channel, power on, or flip the solar panel, the script task object can perform the corresponding operation, thereby ensuring the stability and reliability of the system.
[0061] In an exemplary embodiment, when the task execution fails (such as network interruption, hardware failure, etc.), automatic diagnosis can also be triggered. For example, it can be checked whether it is a temporary failure (such as a short-term network interruption), and if it is recoverable, a retry can be attempted (the maximum number of retries can be configured, such as 3 times); if it still fails, the executed part can be rolled back or an alternative solution can be selected according to the pre-set exception handling logic. For serious errors, a detailed error report can also be generated, and the administrator can be notified by email or SMS, so as to intervene in time, thereby improving the reliability of the system.
[0062] In an exemplary embodiment, when all tasks are completed, the execution results of the tasks can also be summarized into a report. This report can not only include the success / failure status of the tasks, execution time statistics, generated output data, and other information, but also can be visually displayed through charts and graphs (such as bar charts and line charts), thereby facilitating user understanding and decision-making.
[0063] In one scenario, the execution result can also be returned to the user in a structured form (JSON). If there is an error, a detailed error description and a solution such as "suggest restarting relay satellite module X" can also be attached, helping the user to quickly solve the problem.
[0064] In one exemplary embodiment, subsequent maintenance and optimization strategies are also provided. For example, through built-in performance monitoring tools, the resource utilization of the system such as CPU, memory, network bandwidth, etc. can be monitored in real time. These data are not only used for daily maintenance, but also used as training samples for machine learning models to predict future performance trends and issue early warnings. Based on automated tuning tools, parameter adjustments can be made according to actual running conditions to further improve system performance. And with the development of technology and changes in user needs, the above control methods can be continuously improved and perfected, and continuous integration and delivery (CI / CD) processes can be used to ensure smooth transition with each update and not affect the stability of existing services, to achieve version iteration and continuous integration.
[0065] In one exemplary embodiment, as shown in Figure 4 The above script-based relay satellite control method is further described below, which can specifically include: 1) Create a script A JSON-formatted script can be created through a front-end interface such as a web browser or other terminal interface that supports HTTP requests. Based on the JSON format, the script is defined in a structured manner, allowing users to define different types of scripts flexibly and better adapt to different task requirements. Compared with traditional static configuration methods, this flexibility greatly improves user convenience and also provides more space for future functional expansion.
[0066] 2) Add to the scheduling thread pool After multiple layers of verification, parsing, and semantic mapping of the script, a script task object is generated and added to the scheduling thread pool (i.e., the scheduling queue).
[0067] 3) Schedule mq Based on the preset task scheduling algorithm, the position of the script task object in the scheduling queue is determined, and the script task object is serialized and published to the scheduling mq (i.e., the scheduling message queue), which is consumed and executed by the Worker node.
[0068] 4) Task execution The Worker node obtains the task from the mq, loads the specified script, and executes it concurrently in the local thread pool. During execution, the thread pool size can be dynamically adjusted based on real-time performance indicators to optimize task allocation, response speed, and resource utilization.
[0069] and the script log is recorded and outputted during the execution by parsing the script, locking, subscribing information required by the script to execute the script. Meanwhile, the script state is fed back, such as execution, pause, stop, interruption or completion, etc. For example, the script line to be executed is displayed as being executed, and the script line that has been executed is changed to execution completion. Thus, the user experience is enhanced, and the user can grasp the task progress at any time.
[0070] If the execution is successful and there is a subsequent chain task, a new script task is generated and re-delivered to the scheduling mq; if the execution fails, the related operation in the exception handling logic is performed for processing. Thus, the abnormal situation is automatically handled, the downtime is reduced, and the reliability and stability are improved.
[0071] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps. It can be understood that each step in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination all belong to the scope of protection of the present application.
[0072] Based on the same inventive concept, the embodiments of the present application also provide a script-based relay satellite control device for implementing the above-mentioned script-based relay satellite control method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more script-based relay satellite control device embodiments provided below can refer to the limitations of the script-based relay satellite control method in the foregoing, which will not be described here again.
[0073] In one exemplary embodiment, as shown in Figure 5 A script-based relay satellite control device is provided, including a script verification module 502, a script parsing module 504, a script scheduling module 506, a script publishing module 508 and a script execution module 510, wherein: The script verification module 502 is configured to obtain a remote control script for controlling a relay satellite, and perform multi-layer verification on the remote control script; the remote control script includes a priority identifier, a time trigger condition, an execution action and an exception handling logic. The script parsing module 504 is configured to, in a case where it is determined that the multi-layer verification of the remote control script is passed, parse and semantically map the remote control script, generate a corresponding script task object, and inject runtime context information, including a task submission timestamp, a resource lock key, and an execution timeout threshold, into the script task object; The script scheduling module 506 is configured to add the script task object to a scheduling queue and determine a position of the script task object in the scheduling queue based on a preset task scheduling algorithm. The script publishing module 508 is configured to serialize and publish the script task object to a scheduling message queue according to the position of the script task object in the scheduling queue. The script execution module 510 is configured to, in a case where it is detected that the script task object in the scheduling message queue starts to be executed, record an execution log, and generate a state feedback according to an execution result after the script task object is executed.
[0074] In an example embodiment, the script verification module is specifically configured to: perform format legality verification on the remote control script based on a preset structured syntax specification; in a case where it is determined that the format legality verification is passed, perform parameter integrity and correctness verification on the remote control script; in a case where it is determined that the parameter integrity and correctness verification is passed, perform security verification on the remote control script; and in a case where it is determined that the security verification is passed, determine that the multi-layer verification of the remote control script is passed.
[0075] In an example embodiment, the script acquisition module is further configured to: in response to a script editing instruction, acquire edited script information in a JSON format, the script information including an execution action for controlling a relay star, and a priority identifier, a time trigger condition, and an exception handling logic of the script information; and generate a corresponding remote control script according to the script information.
[0076] In an example embodiment, the script scheduling module is further configured to: perform first sorting on script task objects in the scheduling queue according to the priority identifiers in a descending order of priority, to determine a first order of the script task objects in the scheduling queue; in a case where there are a plurality of script task objects with the same priority identifier, perform second sorting on the plurality of script task objects according to the time trigger conditions, to determine a second order of the script task objects in the scheduling queue; and determine the position of the script task object in the scheduling queue according to the first order or the second order.
[0077] In an example embodiment, the script execution module is further configured to, in response to receiving an execution instruction of a specified script task object, pause execution of the script task object that has started execution, and execute the specified script task object; the specified script task object has a higher priority than the script task object that has started execution; and continue execution of the script task object that has started execution after determining that the specified script task object has completed execution.
[0078] In an example embodiment, the script execution module is further configured to, in response to monitoring an exception, determine target processing logic corresponding to the exception from exception handling logic of the script task object; and perform exception handling based on the target processing logic.
[0079] The above-mentioned various modules in the script-based relay satellite control device can be implemented by software, hardware, and combinations thereof, in whole or in part. The above-mentioned various modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above-mentioned various modules.
[0080] In an example embodiment, a computer device is provided, and an internal structure diagram thereof can be as shown in Figure 6 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals, and the wireless communication can be achieved through WIFI, mobile cellular network, near field communication (NFC), or other technologies. The computer program is executed by the processor to implement a script-based relay satellite control method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball, or a touchpad arranged on the shell of the computer device, or can be an external keyboard, a touchpad, a mouse, or the like.
[0081] Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0082] In an exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.
[0083] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.
[0084] In an embodiment, a computer program product is provided, including a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.
[0085] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0086] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0087] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0088] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A script-based relay satellite control method, characterized by, The method comprises: acquiring a remote control script for controlling a relay satellite, and performing multi-layer verification on the remote control script; the remote control script comprises a priority identifier, a time trigger condition, an execution action, and exception handling logic; in a case where it is determined that the multi-layer verification on the remote control script is passed, performing parsing and semantic mapping on the remote control script, generating a corresponding script task object, and injecting runtime context information into the script task object, including a task submission timestamp, a resource lock key, and an execution timeout threshold; adding the script task object to a scheduling queue, and determining the position of the script task object in the scheduling queue based on a preset task scheduling algorithm; serializing the script task object according to the position of the script task object in the scheduling queue, and publishing the script task object to a scheduling message queue; in a case where it is detected that the script task object in the scheduling message queue starts to execute, recording an execution log, and generating a state feedback according to an execution state.
2. The method of claim 1, wherein, The multi-layer verification on the remote control script comprises: performing format legality verification on the remote control script based on a preset structured syntax specification; in a case where it is determined that the format legality verification is passed, performing parameter integrity and correctness verification on the remote control script; in a case where it is determined that the parameter integrity and correctness verification is passed, performing security verification on the remote control script; in a case where it is determined that the security verification is passed, determining that the multi-layer verification on the remote control script is passed.
3. The method of claim 1, wherein, The acquisition of the remote control script for controlling the relay satellite comprises: in response to a script editing instruction, acquiring edited script information in a JSON format, the script information comprising an execution action for controlling the relay satellite, and a priority identifier, a time trigger condition, and exception handling logic of the script information; generating a corresponding remote control script according to the script information.
4. The method of claim 1, wherein, The determination of the position of the script task object in the scheduling queue based on the preset task scheduling algorithm comprises: performing first sorting on script task objects in the scheduling queue according to the priority identifier in a descending order of priority, to determine a first order of the script task objects in the scheduling queue; if there are multiple script task objects with the same priority identifier, performing second sorting on the multiple script task objects according to the time trigger condition, to determine a second order of the script task objects in the scheduling queue; determining the position of the script task object in the scheduling queue according to the first order or the second order.
5. The method according to any one of claims 1 to 4, characterized in that, After it is detected that the script task object in the scheduling message queue starts to execute, the method further comprises: in a case where an execution instruction for a specified script task object is received, pausing the execution of the script task object that has started to execute, and executing the specified script task object; the priority of the specified script task object is higher than that of the script task object that has started to execute; after it is determined that the execution of the specified script task object is completed, continuing the execution of the script task object that has started to execute.
6. The method according to any one of claims 1 to 4, characterized in that, The method further comprises, after detecting that the script task object in the scheduling message queue starts to execute: In the case of monitoring an exception, determining target processing logic corresponding to the exception from the exception processing logic of the script task object; Performing exception processing based on the target processing logic.
7. A script-based relay star control apparatus, characterized by, The device comprises: A script verification module configured to obtain a remote control script for controlling a relay satellite, and perform multi-layer verification on the remote control script; the remote control script comprises a priority identifier, a time trigger condition, an execution action, and exception processing logic; A script analysis module configured to, in the case of determining that the multi-layer verification on the remote control script is passed, analyze and semantically map the remote control script, generate a corresponding script task object, and inject runtime context information into the script task object, including a task submission timestamp, a resource lock key, and an execution timeout threshold; A script scheduling module configured to add the script task object to a scheduling queue, and determine a position of the script task object in the scheduling queue based on a preset task scheduling algorithm; A script publishing module configured to, according to the position of the script task object in the scheduling queue, serialize and publish the script task object to a scheduling message queue; A script execution module configured to, in the case of detecting that the script task object in the scheduling message queue starts to execute, record an execution log, and, after the script task object is executed, generate a state feedback according to an execution result.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Spacecraft control script writing method and device
CN112732358A
Embedded satellite task scheduling management method and system and electronic equipment
CN114968533A
Shell script scheduling management method and device, equipment and storage medium
CN117112177A
Graphical-based satellite remote control operation script editing method and system
CN118012413A
Byte code storage method and device of Android huller and computer equipment
CN119720289A