Data processing method, satellite device, computing device and readable storage medium

Through the disassembly and code generation methods of satellite missions, the problems of insufficient communication delay and processing capabilities in traditional satellite control mode are solved, local data processing of satellites is realized, and mission efficiency and reliability are improved.

CN119847535AInactive Publication Date: 2025-04-18ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510339133.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-04-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional satellite operation and control modes face problems such as communication delay, insufficient ground processing capabilities and interference from communication links, which affect mission efficiency and reliability.

Method used

By disassembling the target task, at least one subtask is determined, and function information is created based on the subtask, code sample information is generated for processing the target task, and the target code data used to process the target task is finally determined. This method enables satellites to perform data processing locally, reducing dependence on ground control.

Benefits of technology

It improves the efficiency and reliability of satellite mission processing, reduces dependence on ground control, and enhances the satellite's autonomous processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847535A_ABST
    Figure CN119847535A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, a satellite device, computing equipment and a computer readable storage medium, and the method comprises the steps: carrying out the disassembly of a target task, and determining at least one subtask; function information is correspondingly created according to the at least one subtask, and code example information used for processing the target task is generated based on the target task and the function information; and according to the at least one subtask, the code example information and the target task, generating target code data for processing the target task. Therefore, the target code data for processing the target task is correspondingly and automatically generated based on the at least one subtask, the code example information and the target task, so that a satellite can locally realize data processing, the dependence on ground control is reduced, and the task processing efficiency and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of satellite technology, and in particular to a data processing method, a satellite device, a computing device, and a readable storage medium. Background Art

[0002] With the rapid development of global aerospace technology, satellites have been widely used in earth observation, communication and navigation, deep space exploration and other fields, becoming an indispensable infrastructure in modern society.

[0003] However, the increasing complexity of satellite missions and the higher requirements for real-time and flexibility have made traditional satellite operation and control modes face increasing challenges. Existing satellites usually rely on ground control centers to plan and operate missions. This model has many limitations, such as communication delays, insufficient ground processing capabilities, and interference with communication links, which directly affect the efficiency and reliability of missions. Summary of the invention

[0004] The purpose of this application is to provide a data processing method, satellite device, computing equipment and computer-readable storage medium, which help the satellite to realize data processing locally, reduce dependence on ground control, and improve the efficiency and reliability of mission processing.

[0005] To achieve the above objectives: In a first aspect, an embodiment of the present application provides a data processing method, including: Break down the target task and determine at least one subtask; Creating function information corresponding to the at least one subtask, and generating code example information for processing the target task based on the target task and the function information; According to the at least one subtask, the code example information, and the target task, target code data for processing the target task is determined.

[0006] In one implementation, the target code data is tested according to the target task.

[0007] In one embodiment, the step of breaking down the target task to determine at least one subtask includes: Acquire local information, and determine corresponding response content according to the target template and the target task in the local information; Based on the preset identifier, a search is performed in the response content to determine at least one subtask of the target task.

[0008] In one embodiment, the determining, based on the at least one subtask, the code example information, and the target task, target code data for processing the target task includes: Acquire historical data in the local information, and parse the historical data, the at least one subtask, the code example information, and the target task to determine code prompt information of the target task; According to the code prompt information, target code data for processing the target task is generated.

[0009] In one embodiment, the parsing of the historical data, the at least one subtask, the code example information, and the target task to determine the code prompt information of the target task includes: Performing preliminary requirement analysis on the historical data, the at least one subtask, the code example information, and the target task, and determining at least one prompt word for prompting a function variable of the target task; According to the at least one prompt word and the target task, code prompt information of the target task is determined.

[0010] In one embodiment, after determining the target code data for processing the target task according to the at least one subtask, the code example information, and the target task, the method further includes: Defining the target code data and determining the corresponding function name; The target code data, the function name and the corresponding code example information and the code prompt information are saved in a designated directory.

[0011] In one embodiment, the testing of the target code data according to the target task includes: Obtain the target task, and determine the function name, the code sample information, and the code prompt information to be tested according to the specified directory; The target code data is run tested according to the function name, the code example information, and the code prompt information.

[0012] In one embodiment, the method further comprises: If the test passes, the target data is output and stored; If the test fails, the user is prompted to select a preset debugging method to debug the target code data, wherein the preset debugging method includes at least one of regenerating code for the target task, re-disassembling the target task, and self-examining the target code data.

[0013] In a second aspect, an embodiment of the present application provides a satellite device, including a data processing system, wherein the data processing system includes a task disassembly module and a code creation module, wherein: A task decomposition module is used to decompose the target task and determine at least one subtask; A code creation module, configured to create function information corresponding to the at least one subtask, and generate code example information for processing the target task based on the target task and the function information; The code creation module is used to generate target code data for processing the target task according to the at least one subtask, the code example information and the target task.

[0014] In a third aspect, an embodiment of the present application provides a computing device, specifically comprising: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to perform the data processing method as described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the instructions in the computer-readable storage medium are executed by a processor of a computing device, the computing device is enabled to implement the data processing method described in the first aspect.

[0016] A data processing method, satellite device, computing equipment and computer-readable storage medium provided by an embodiment of the present application include: decomposing a target task to determine at least one subtask; creating function information corresponding to the at least one subtask, and generating code example information for processing the target task based on the target task and the function information; generating target code data for processing the target task based on the at least one subtask, the code example information and the target task; and testing the target code data based on the target task. In this way, automatically generating target code data for processing the target task based on at least one subtask, the code example information and the target task helps the satellite to realize data processing locally, reduces dependence on ground control, and improves the efficiency and reliability of task processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a data processing method provided by an embodiment of the present invention.

[0018] Figure 2 A schematic diagram of the structure of a data processing system provided by an embodiment of the present invention.

[0019] Figure 3 A schematic diagram of a specific flow chart of a data processing method provided by an embodiment of the present invention.

[0020] Figure 4 A schematic diagram of the structure of a computing device provided in an embodiment of the present invention.

[0021] Processor 310 , memory 311 , network interface 312 , and bus system 313 . DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0023] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.

[0024] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.

[0025] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0026] It should be noted that, in this article, step codes such as S101, S102, etc. are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the sequence. When implementing the step, those skilled in the art may execute S102 first and then S101, etc., but these should all be within the scope of protection of this application.

[0027] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0029] See also Figure 1 , an embodiment of the present application provides a data processing method. In this embodiment, taking the application of the data processing method to a computing device as an example, the data processing method provided by this embodiment includes: Step S101: Decompose the target task to determine at least one subtask.

[0030] First, parse the complex requirements obtained or input by the user, identify the key tasks and subtasks, and use natural language processing technology to analyze the requirement string to extract the main tasks and related details. Then, through the specified large language model (such as GPT-3), further refine the task decomposition process.

[0031] In one implementation, the target task is broken down to determine at least one subtask, including: Obtain local information, and determine corresponding response content according to the target template and target task in the local information; Based on the preset identifier, a search is performed in the response content to determine at least one subtask of the target task.

[0032] Optionally, when decomposing the target task, one of the following may be included: decomposing the target task based on multiple task types included in the target task; decomposing the target task based on the task size of the target task; decomposing the target task based on a preset number of splits; decomposing the target task based on obtained user needs.

[0033] Specifically, first, initialize an empty target list, such as the list decompose_results, to store multiple subtasks after decomposition. Secondly, obtain local information, such as reading a JSON file based on the local path . / functions / testedfunctions / decompose_messages.json, and load the preset message template into the variable decompose_messages. In this way, through an external configuration file (such as decompose_messages.json), users can customize the decomposition logic and prompt information according to specific needs, enhancing the adaptability and flexibility of the module. Then, combine the target task with the local information in a specific format as the context for interacting with the large model. Further, obtain the data information in the variable decompose_messages through the large model, and generate corresponding content accordingly. Here, the response content generated by the large model is generally text information containing a numbered list. In this way, through the preset message template and a specific output format (such as a numbered list), it is ensured that the decomposition result has a unified structure, which is convenient for subsequent task management and execution. Finally, a regular expression is used to search in the response text based on the preset identifier. Here, the preset identifier includes one of a digital identifier, a symbolic identifier, a text identifier, and a format identifier, or it can also be determined by combining two or more of the digital identifier, the symbolic identifier, the text identifier, and the format identifier. For example, it can be a clause that starts with a number plus a dot (such as "1.", "2.") and ends with a period. In this way, the content of each matched subtask is extracted, determined as at least one subtask corresponding to the target task, and appended to the target list. Here, the target list decompose_results containing all subtasks is output as the return value of the function for use by subsequent modules or processes.

[0034] Among them, the large model, also known as the Large Language Model (LLM), is an artificial intelligence-based model that can understand and generate natural language text. It learns the structure, grammar, semantics, and context of the language through a large amount of data training, so that it can perform tasks such as answering questions, writing articles, and translating languages. Common large models include OpenAI's GPT series (such as GPT-3, GPT-4) and other similar models.

[0035] In this way, with the help of advanced large language models, the module has powerful natural language understanding and generation capabilities, can intelligently parse complex requirements and generate reasonable sub-tasks. At the same time, through automated processes, it can quickly disassemble complex tasks and improve work efficiency and accuracy.

[0036] In other implementations, at least one of the following may be included: the ability to capture and process possible exceptions in file reading, API calls, etc. to ensure the robustness of data processing; before parsing the response, the ability to verify whether the response format meets expectations to prevent parsing errors caused by changes in the output format of the large model; key operations and error information in the data processing process may be recorded in the form of logs to facilitate debugging and maintenance; for high-frequency calling scenarios, consideration may be given to optimizing the efficiency of file reading and API calls, such as caching preset message templates.

[0037] Step S102: creating function information corresponding to at least one subtask, and generating code example information for processing the target task based on the target task and the function information.

[0038] Optionally, the function information created corresponding to at least one subtask may be a sample function generated to process the subtask, so as to serve as a reference for subsequent data processing based on the sample function. Here, code sample information refers to a pre-set text when interacting with the LLM, which is used to guide the behavior and response of the model. It usually contains rules, task descriptions or codes of conduct that the model needs to follow. In this way, the code sample information can ensure that the large model meets specific requirements and standards when generating responses. For example, the code sample information can instruct the large model to answer questions in a formal tone, or limit the large model from providing certain types of information.

[0039] In one embodiment, for each subtask, a corresponding function code is generated. The subtask description information, the generated corresponding function code, and the original task information are determined and combined into "new system prompt information" to determine the code sample information for processing the target task for the next step of optimization processing.

[0040] Step S103: Determine target code data for processing the target task according to at least one subtask, code sample information, and the target task.

[0041] Optionally, based on the acquired user requirements, target code data for processing the target task is generated, which can intelligently and automatically convert the user's natural language requirements into callable function codes. This not only greatly improves the efficiency of code development, but also reduces the error rate of manually written code. At the same time, it ensures its adaptability and flexibility in different scenarios, making it a powerful auxiliary tool in the development process.

[0042] In one embodiment, determining target code data for processing the target task according to at least one subtask, code example information, and the target task includes: Obtain historical data in local information, and parse the historical data, at least one subtask, code sample information, and target task to determine code prompt information of the target task; According to the code prompt information, target code data for processing the target task is generated.

[0043] Optionally, the code prompt information of the target task can be determined based on the first LTM prompt, i.e., least-to-most-prompting. Specifically, the large model is prompted to identify the key factors in the task and determine which ones need to be used as function variables. For example: identify the input, output, logical constraints, etc. in the task, clarify which are dynamic task parameters, and output the corresponding results containing function variables and task refinement information, providing a more complete foundation for the next stage.

[0044] Optionally, based on the second LTM prompt, the large model can be prompted how to generate "function code prompt words that can complete the task" based on the results of the first stage (more complete task description and identified function variables). For example: using the identified function variables and the improved task description to generate a clear prompt template, the large model outputs more specific function code, and the output prompt words can directly guide the large model to generate executable code and determine the target code data for processing the target task.

[0045] In one embodiment, historical data, at least one subtask, code example information, and a target task are parsed to determine code prompt information of the target task, including: Performing preliminary requirement analysis on historical data, at least one subtask, code sample information, and target task, and determining at least one prompt word for prompting a function variable of the target task; According to at least one prompt word and the target task, code prompt information of the target task is determined.

[0046] Among them, the prompt words are specific questions, instructions or information input by the user when interacting with the LLM. These prompt words directly affect the response content generated by the model. In this way, at least one prompt word can be used to guide the model to generate answers related to user needs or perform specific tasks. For example, the prompt word may be "Please write a business plan for me" or "Explain the basic concepts of quantum physics". Optionally, processing user needs and determining a preliminary demand analysis specifically includes: first, taking the target task as the first analysis link, that is, the user input of the CD link, appended to few_shot_messages_CD. Secondly, call OpenAI's ChatCompletion API, pass in the large model and few_shot_messages_CD, and obtain the preliminary demand analysis results generated by the model, that is, at least one prompt word of the function variable of the target task.

[0047] Optionally, based on the output of the CD phase, further generating detailed code description information specifically includes: first, combining at least one prompt word output by the CD phase with the target task to form a detailed requirement description new_req_description. Then, calling the ChatCompletion API, passing in the large model and few_shot_messages_CM, to obtain a detailed requirement description.

[0048] In one embodiment, after determining the target code data for processing the target task according to at least one subtask, the code example information, and the target task, the method further includes: Define the target code data and determine the corresponding function name; Save the target code data, function name, corresponding code example information, and code prompt information to the specified directory.

[0049] Optionally, extract the generated target code data and define it in the current running environment so that it can be called directly. Optionally, save the generated function code and related prompt examples to a specified directory for subsequent use and debugging. Optionally, return the newly created function name for users or other modules to call.

[0050] In other implementations, at least one of the following may also be included: adding exception capture and processing logic in key steps such as file reading, API calling, and code extraction to ensure the robustness of the module; verifying the format and validity of the response content before parsing the model response to prevent errors caused by model output exceptions; recording key operations and error information to facilitate debugging and maintenance; for high-frequency calling scenarios, consider caching preset prompt information and few-shot examples to reduce delays in file reading and API calling.

[0051] In summary, in the data processing method provided in the above embodiment, target code data for processing the target task is automatically generated based on at least one subtask, code example information, and target task correspondence, which helps the satellite to realize data processing locally, reduces dependence on ground control, and improves the efficiency and reliability of task processing.

[0052] In one embodiment, when the automatically generated function code is fully tested and verified, not only can the target code data be automatically run and feedback collected, but flexible debugging options can also be provided based on the user's real-time feedback to ensure that the target code data finally generated meets the expected needs and functional requirements. At the same time, it can be adapted to different types of functions and complex requirements, becoming an important part of the automated development process.

[0053] In one embodiment, after determining the target code data for processing the target task according to at least one subtask, the code example information, and the target task, the method further includes: Get the target task, and determine the function name, code sample information, and code prompt information to be tested according to the specified directory; Run the target code data according to the function name, code sample information, and code prompt information.

[0054] Optionally, based on the function name, code sample information, and code prompt information, design detailed test cases. The test cases should cover various normal and abnormal input conditions, as well as test various possible paths and branches of the function. For example, for a function that calculates the division of two numbers, in addition to testing the normal division operation, abnormal conditions such as the divisor is zero, the dividend and the divisor are negative should also be considered. When executing the test case, deploy the target code data to the test environment, follow the designed test steps, and record the function's input parameters, actual output results, and any errors or exceptions that occur. For example, when testing a file upload function, upload files of different types (such as pictures, documents, videos) and different sizes (from small files to large files that exceed the system limit) to observe whether the system correctly handles the file upload process, whether it returns the correct upload result information, and whether it can properly handle abnormal conditions such as unsupported file format or file size exceeding the limit.

[0055] In one embodiment, it further comprises: If the test passes, the target data is output and stored; If the test fails, the user is prompted to select a preset debugging method to debug the target code data, and the preset debugging method includes at least one of regenerating code for the target task, re-disassembling the target task, and self-examining the target code data.

[0056] When the test fails, specific technical issues with the target code data can be considered, including: data error problems in the code itself and technical problems that the code information does not meet the requirements. Among them, data error problems in the code itself refer to the most common basic error types in the code writing process, including syntax errors, logical errors, object-oriented errors (for object-oriented programming languages), data type errors, etc.

[0057] Optionally, when regenerating the code for the target task, the automatic code creation module is called to regenerate the function code according to the user's needs. Optionally, when re-decomposing the target task, the target task or user needs are re-decomposed to generate a new subtask list, and the code is regenerated based on the new task list. Optionally, when self-reviewing the target code data, the existing function code is reviewed and optimized. According to the debugging method selected by the user, the corresponding debugging steps are executed. In this way, after debugging is completed, the test process is run again until the test passes.

[0058] In this way, during the testing process, the debugging method is automatically selected according to the test results, including rewriting the code using the automatic code creation module, re-disassembling the task using the automatic task disassembly module, or reviewing using the self-review module, and testing again after debugging until it passes. Through the preset debugging options, the test and debugging strategies are dynamically adjusted to ensure that the function ultimately meets user needs.

[0059] Based on the same inventive concept as the above embodiments, a satellite device is provided below, including a data processing system, referring to Figure 2 ,The data processing system includes a task disassembly module, a code creation module and a test module, among which, A task decomposition module is used to decompose the target task and determine at least one subtask; A code creation module, used to create function information corresponding to at least one subtask, and generate code example information for processing the target task based on the target task and the function information; A code creation module, used to determine target code data for processing the target task according to at least one subtask, code sample information, and the target task; The test module is used to test the target code data according to the target task.

[0060] Specifically, the core function of the task decomposition module is to parse and decompose the complex requirements provided by the user and output a list containing multiple subtasks. These subtasks are more specific and actionable, which facilitates the subsequent task allocation and execution. Specific functions include: 1. Receive user requirements: accept complex requirements entered by users in the form of strings.

[0061] 2. Load preset message template: Load the preset message template from the local JSON file as the context for interacting with the large model.

[0062] 3. Interact with the big model: Send user needs and preset messages to the big language model to obtain the disassembled response.

[0063] 4. Parse the model response: Extract each subtask in the numbered list generated by the model through regular expressions.

[0064] 5. Output subtask list: Arrange the parsed subtasks into a list and return it for subsequent use.

[0065] In one embodiment, the core function of the code creation module is to automatically convert and determine the callable target code data according to the target task. The specific functions include: 1. Receive user requirements: accept the requirement description entered by the user in the form of a string.

[0066] 2. Select Few-shot examples: Select appropriate Few-shot examples based on user input, which can be all examples or specified parts of examples, to improve the accuracy of code generation.

[0067] 3. Load system prompts and stage prompts: Load system-level prompt information and prompt templates for each stage from the local JSON file as the context for interacting with the large model.

[0068] 4. Interact with the large model in stages: The first phase of CD: process user needs and generate preliminary demand analysis.

[0069] The first phase of CM: Generate a detailed requirement description based on the output of the CD phase.

[0070] Phase 2: Generate specific target code data based on detailed requirements description.

[0071] 5. Code extraction and execution: The generated target code data is extracted and defined in the current running environment so that it can be called directly.

[0072] 6. Save the generated results: Save the generated target code data and related prompt examples to the specified directory for subsequent use and debugging.

[0073] 7. Return result: Return the name of the newly created function for users or other modules to call.

[0074] In one embodiment, the core function of the test module is to perform automated testing on the automatically generated code functions, verify their functional correctness, and perform corresponding processing based on the test results. Specific functions include: 1. Receive test requests: accept parameters such as the name of the function to be tested, user requirement description, and Few-shot examples.

[0075] 2. Run function test: call the function to be tested in the specified running environment, pass in user requirements as input, and obtain the execution result of the function.

[0076] 3. Feedback collection and processing: Pass the test: If the function output meets the requirements, the target code data is automatically moved to the "tested" folder and the test pass status is recorded.

[0077] Failed test: The user is prompted to select a preset debugging method, including regenerating code, re-disassembling the target task, or performing self-review, and executes the corresponding debugging steps based on the selection.

[0078] 4. Exception handling: Capture and handle possible exceptions during function execution and provide corresponding debugging options.

[0079] 5. Debugging support: According to the debugging scheme selected by the user, the corresponding modules (automatic code creation module, automatic task disassembly module, self-review module) are automatically called to continuously optimize function performance.

[0080] 6. Log recording: record key operations and error information during the test process to facilitate subsequent analysis and maintenance.

[0081] See also Figure 3 , when data processing is performed based on the data processing system, the following steps are specifically included: Step S201, receiving the target task.

[0082] Step S202: Task decomposition module.

[0083] In one embodiment, the task decomposition module receives two parameters, including: req (complex requirements input by the user, in string form) and model (specified large language model to be used). At the same time, an empty list decompose_results is initialized to store the decomposed subtasks.

[0084] In one implementation, a preset message template is loaded, a JSON file is read from a local path . / functions / testedfunctions / decompose_messages.json, and the preset message template is loaded into a variable decompose_messages. Then, the user's requirement req is appended to decompose_messages in a specific format (with the role "user") as a context for interacting with the large model.

[0085] In one embodiment, the Chat Completion API of Open AI is called, and the specified model and messages (including preset messages and user requirements) are passed in. Optionally, the response content res generated by the model is obtained, which is usually a text containing a numbered list.

[0086] In one embodiment, the model response is parsed, that is, the regular expression r'\d\.(.*?。)' is used to search for clauses starting with a number plus a dot (such as "1.", "2.") and ending with a period in the response text. Optionally, each matched subtask content is extracted and appended to the decompose_results list.

[0087] In one implementation, a list decompose_results containing all subtasks is output as a return value of the function for use by subsequent modules or processes.

[0088] In one embodiment, at least one of the following may also be performed: in actual applications, possible exceptions such as file reading and API calls should be captured and processed to ensure the robustness of the module; before parsing the response, verify whether the response format meets expectations to prevent parsing errors caused by changes in the model output format; record key operations and error information for easy debugging and maintenance; for high-frequency calling scenarios, consider optimizing the efficiency of file reading and API calls, such as caching preset message templates.

[0089] Step S203: determine subtask 1, subtask 2, ..., subtask n.

[0090] Step S204: code creation module.

[0091] In one embodiment, the selection strategy of the few-shot examples is 'all' by default, indicating that all preset examples are used; it can also be a specified function name list. Optionally, an empty list is initialized to store the selected few-shot example function names.

[0092] For example, if few_shot is 'all', call show_functions(tested=True) to get all the tested function names. If few_shot is a list, use the function names in the list directly. In this way, you get the function name list few_shot_functions_name that needs to be used as a few-shot example.

[0093] Step S205: Create function 1, function 2, ..., function n based on the multiple subtasks.

[0094] In one implementation, system-level prompt information is read from . / functions / tested functions / system_messages.json and loaded into few_shot_messages_CD, few_shot_messages_CM, and few_shot_messages, respectively.

[0095] Step S206: Determine code prompt information.

[0096] Step S207: Obtain local data information.

[0097] Step S208: First stage LTM prompt.

[0098] In one implementation, in the first phase CD phase, the user's demand req is used as the user input of the CD phase and appended to few_shot_messages_CD. Optionally, the ChatCompletion API of OpenAI is called, and the model and few_shot_messages_CD are passed in to obtain the preliminary demand analysis new_req_pi generated by the model.

[0099] In one implementation, in the first phase CM phase, the output new_req_pi of the CD phase is combined with the original requirement new_req_CD_input to form a detailed requirement description new_req_description.

[0100] In one implementation, the ChatCompletion API is called, and the model and few_shot_messages_CM are passed in to obtain detailed code description information.

[0101] Step S209: Second stage LTM prompt.

[0102] In one embodiment, in the second phase of code generation, the detailed requirement description new_req_description is appended to few_shot_messages to prepare for code generation. Optionally, the ChatCompletion API is called, passing in the model and few_shot_messages to obtain the generated target code data.

[0103] Step S210: output the target code data of the original task.

[0104] Step S211: Extracting and saving target code data.

[0105] In one embodiment, the generated target code data is extracted using the extract_function_code function, and the function is defined in the current running environment. Optionally, the generated target code data is saved in . / functions / untested functions / {function_name} / {function_name}_module.py.

[0106] In one embodiment, a prompt example is constructed, including: new_req_messages_CD includes user requirements and the output of the CD phase; new_req_messages_CM includes a detailed requirement description and the output of the CM phase; new_req_messages includes a detailed requirement description and the generated function code. Optionally, the above prompt example is saved to . / functions / untested functions / {function_name} / {function_name}_prompt.json.

[0107] In one implementation, the newly created function name function_name is used as a return value for users or other modules to call.

[0108] In one implementation, at least one of the following is also included: adding exception capture and processing logic in key steps such as file reading, API calling, and code extraction to ensure the robustness of the module; verifying the format and validity of the response content before parsing the model response to prevent errors caused by model output exceptions; recording key operations and error information to facilitate debugging and maintenance; for high-frequency calling scenarios, consider caching preset prompt information and few-shot examples to reduce delays in file reading and API calling.

[0109] Step S212: test module.

[0110] In one embodiment, parameters such as the name of the function to be tested, the user requirement description, and a few-shot example are accepted. Optionally, the function to be tested is called in a specified operating environment, and the user requirement is passed in as input to obtain the execution result of the function.

[0111] Step S213: When the test passes, the target code data and the corresponding code prompt information are stored in the local data.

[0112] In one implementation, if the function output meets the requirements, the function is automatically moved to a "tested" folder and the test pass status is recorded.

[0113] Step S214: When the test fails, debug the target code data.

[0114] In one embodiment, if the test fails, the user is prompted to select a preset debugging method, including regenerating code, re-disassembling tasks, or performing self-examination, and executing corresponding debugging steps according to the selection.

[0115] Step S215: rewrite the target code data.

[0116] In one implementation, a code creation module may be called to regenerate function codes according to user requirements.

[0117] Step S216: re-disassemble the target task.

[0118] In one implementation, the task decomposition module may be called to re-decompose the user requirements, generate a new subtask list, and regenerate the code based on the new task list.

[0119] Step S217: self-examine the target code data.

[0120] In one embodiment, the test module can be called to review and optimize the existing function code. In this way, according to the debugging method selected by the user, the corresponding debugging steps are executed. After the debugging is completed, the module runs the test process again until the test passes.

[0121] In summary, the data processing method provided by the above embodiment automatically generates target code data for processing a target task based on at least one subtask, code example information, and the corresponding target task, which helps the satellite to realize data processing locally, reduces dependence on ground control, and improves the efficiency and reliability of task processing.

[0122] Based on the same inventive concept as the above embodiments, an embodiment of the present invention provides a computing device, such as Figure 4 As shown, the computing device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 4 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 4 The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In practical applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the above data processing method is implemented.

[0123] The computing device may also include: at least one network interface 312. The various components in the computing device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 313 is not used in the example above. Figure 4 Various buses are labeled as bus system 313.

[0124] The memory 311 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 311 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memories.

[0125] The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the computing device. Examples of these data include: any computer program used to operate on the computing device, such as an operating system and an application; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program may include various applications, such as a media player, a browser, etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention may be included in the application program.

[0126] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer-readable storage medium may be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it may also be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is executed by the processor, the data processing method applied to the above-mentioned computing device is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to Figure 1 The description of the illustrated embodiment will not be repeated here.

[0127] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0128] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.

[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A data processing method, characterized in that: include: Break down the target task and determine at least one subtask; Creating function information corresponding to the at least one subtask, and generating code example information for processing the target task based on the target task and the function information; According to the at least one subtask, the code example information, and the target task, target code data for processing the target task is determined.

2. The method according to claim 1, characterized in that The step of breaking down the target task to determine at least one subtask includes: Acquire local information, and determine corresponding response content according to the target template and the target task in the local information; Based on the preset identifier, a search is performed in the response content to determine at least one subtask of the target task.

3. The method according to claim 1, characterized in that The determining, according to the at least one subtask, the code example information, and the target task, target code data for processing the target task includes: Acquire historical data in the local information, and parse the historical data, the at least one subtask, the code example information, and the target task to determine code prompt information of the target task; According to the code prompt information, target code data for processing the target task is generated.

4. The method according to claim 3, characterized in that The parsing of the historical data, the at least one subtask, the code example information, and the target task to determine the code prompt information of the target task includes: Performing preliminary requirement analysis on the historical data, the at least one subtask, the code example information, and the target task, and determining at least one prompt word for prompting a function variable of the target task; According to the at least one prompt word and the target task, code prompt information of the target task is determined.

5. The method according to claim 3, characterized in that: After determining the target code data for processing the target task according to the at least one subtask, the code example information, and the target task, the method further includes: Defining the target code data and determining the corresponding function name; The target code data, the function name and the corresponding code example information and the code prompt information are saved in a designated directory.

6. The method according to claim 5, characterized in that After determining the target code data for processing the target task according to the at least one subtask, the code example information, and the target task, the method further includes: Obtain the target task, and determine the function name, the code sample information, and the code prompt information to be tested according to the specified directory; The target code data is run tested according to the function name, the code example information, and the code prompt information.

7. The method according to claim 6, characterized in that The method further comprises: If the test passes, the target data is output and stored; If the test fails, the user is prompted to select a preset debugging method to debug the target code data, wherein the preset debugging method includes at least one of regenerating code for the target task, re-disassembling the target task, and self-examining the target code data.

8. A satellite device, characterized in that: It includes a data processing system, which includes a task decomposition module and a code creation module, wherein: A task decomposition module is used to decompose the target task and determine at least one subtask; A code creation module, configured to create function information corresponding to the at least one subtask, and generate code example information for processing the target task based on the target task and the function information; The code creation module is used to determine target code data for processing the target task according to the at least one subtask, the code example information, and the target task.

9. A computing device, characterized in that include: A processor and a memory for storing executable instructions; wherein the processor is configured to execute the instructions to implement the data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Autonomous operation and control system of agile imaging satellite, and operation process of system

    CN106516175A