Method and apparatus for starting and stopping large model-based service, device, and storage medium
Patent Information
- Application Number
- CN202610904905.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-09-29
AI Technical Summary
[0004]然而,人工操作方式要求运维人员熟记各系统服务的命令语法及服务器地址,操作繁琐且易出错,尤其在紧急情况下逐台操作响应缓慢;集成平台方式虽然简化了界面操作,但仍然依赖预设的菜单和选项,无法理解用户以自然语言表达的运维意图,交互不灵活,缺乏智能化的意图识别与自动执行能力,难以适应复杂运维场景下对操作效率与易用性的要求
[0039]本申请实施例提供的基于大模型的服务启停控制方法、装置、设备及存储介质,通过获取用户自然语言输入,利用大模型进行意图识别生成结构化输出,进而生成并下发服务控制命令,解决了现有技术中操作效率低、无法处理自然语言交互的问题,具有提升运维效率,降低操作风险,并支持自然语言驱动的服务控制等优点。
Smart Images

Figure CN122845402A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a service start-stop control method, apparatus, device, and storage medium based on a large model. Background Technology
[0002] Controlling the start and stop of system services is one of the fundamental operations in service operation and maintenance management. As enterprise IT architecture continues to expand, operation and maintenance personnel need to frequently control the start and stop of various system services distributed across multiple servers to ensure the normal operation, version updates, and fault recovery of business systems.
[0003] Currently, the industry mainly uses the following two methods to control the start and stop of system services: The first is the traditional manual operation method, where maintenance personnel need to connect to the server one by one through remote login tools (such as SSH) and manually enter command line commands to control the start and stop of services; the second is the integrated platform service start and stop method, where maintenance personnel select the target service in the visual interface through a unified maintenance management platform, and the backend program calls the preset interface to complete the service start and stop control.
[0004] However, manual operation requires maintenance personnel to memorize the command syntax and server addresses of each system service, which is cumbersome and prone to errors, especially in emergency situations where the response is slow when operating one machine at a time. Although the integrated platform method simplifies the interface operation, it still relies on preset menus and options, cannot understand the maintenance intentions expressed by users in natural language, has inflexible interaction, lacks intelligent intent recognition and automatic execution capabilities, and is difficult to adapt to the requirements of operational efficiency and ease of use in complex maintenance scenarios. Summary of the Invention
[0005] This application provides a service start / stop control method, apparatus, device, and storage medium based on a large model, which has the advantages of improving operation and maintenance efficiency, reducing operational risks, and supporting natural language-driven service control.
[0006] In a first aspect, embodiments of this application provide a service start / stop control method based on a large model, the method comprising:
[0007] Obtain the service control request text in natural language form input by the user;
[0008] The service control request text is input into the large model, which then performs intent recognition on the service control request text and generates structured output text.
[0009] If the structured output text includes a service operation type and a service identifier, a service control command is generated based on the structured output text, and the service control command is sent to the corresponding target server for execution; wherein, the target server is the server that deploys the system service indicated by the service identifier.
[0010] In one possible implementation, the method further includes:
[0011] Obtain the execution result of the service control command;
[0012] The service control request text, the structured output text, and the execution result are used as the short-term memory context of the current session, and the short-term memory context is sent to the large model to control the large model to generate operation confirmation information based on the short-term memory context; wherein, the operation confirmation information includes result information related to the original intent;
[0013] Output the operation confirmation information.
[0014] In one possible implementation, the method further includes:
[0015] Save the short-term memory context;
[0016] When a new service control request text is obtained from user input, the short-term memory context and the new service control request text are input into the large model together, so that the large model can perform intent recognition in combination with the short-term memory context.
[0017] In one possible implementation, generating service control commands based on the structured output text includes:
[0018] The structured output text is parsed, and the service operation type and the service identifier are extracted according to the preset field identifiers;
[0019] Select the corresponding system service control command template according to the service operation type; wherein, the command template includes a start command template, a stop command template, or a restart command template;
[0020] The service identifier is entered into the command template to generate the service control command.
[0021] In one possible implementation, the method is applied to a cloud server, where the large model is deployed, and the acquisition of service control request text in natural language form input by the user includes:
[0022] Receive service control request information in natural language form, input by the user, sent by the operation and maintenance front-end platform via WebSocket;
[0023] If the service control request information is voice information, then the service control request information is subjected to voice recognition, and the service control request information is converted into text information, which is then used as the service control request text.
[0024] In one possible implementation, when the service control request text involves multiple services, the control of the large model to perform intent recognition on the service control request text further includes:
[0025] The large model is controlled to identify the service dependencies and / or execution order constraints of multiple services in the service control requirement text;
[0026] If service dependencies and / or execution order constraints are determined to exist between multiple services, a structured output text including a list of dependent services and execution order information is generated.
[0027] In one possible implementation, the step of generating service control commands based on the structured output text, generating service control commands based on the structured output text, and sending the service control commands to the corresponding target server for execution includes:
[0028] Extract the list of dependent services and the execution order information from the structured output text;
[0029] According to the execution order information, service control commands for each service in the dependent service list are generated sequentially and sent to the target server corresponding to each service for execution; wherein, the service control commands for subsequent services are executed only after the service control commands of the preceding services have been successfully executed.
[0030] Secondly, embodiments of this application provide a service start / stop control device based on a large model, the device comprising:
[0031] The first processing unit is used to obtain the service control request text in natural language form input by the user;
[0032] The second processing unit is used to input the service control request text into the large model, control the large model to perform intent recognition on the service control request text, and generate structured output text.
[0033] The third processing unit is configured to, if the structured output text includes a service operation type and a service identifier, generate a service control command based on the structured output text and send the service control command to the corresponding target server for execution; wherein the target server is the server that deploys the system service indicated by the service identifier.
[0034] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0035] The memory stores computer-executed instructions;
[0036] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0038] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0039] The service start / stop control method, apparatus, device, and storage medium based on a large model provided in this application obtain user natural language input, use a large model to perform intent recognition to generate structured output, and then generate and issue service control commands. This solves the problems of low operation efficiency and inability to handle natural language interaction in the prior art, and has the advantages of improving operation and maintenance efficiency, reducing operational risks, and supporting natural language-driven service control. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0041] Figure 1 A flowchart illustrating a service start / stop control method based on a large model, provided for an embodiment of this application;
[0042] Figure 2 A flowchart illustrating another service start / stop control method based on a large model provided in this application embodiment;
[0043] Figure 3 A flowchart illustrating another service start / stop control method based on a large model provided in this application embodiment;
[0044] Figure 4 A schematic diagram of a service start / stop control device based on a large model provided in this application embodiment;
[0045] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0048] Traditional methods for controlling the start and stop of system services, whether through manual SSH operations or button operations on integration platforms, suffer from low efficiency, repetitive tasks, lack of natural language semantic understanding, and high reliance on the operational proficiency and system knowledge of maintenance personnel. These methods are essentially rule-driven automation, which is ill-suited to handling complex and ever-changing service control needs.
[0049] To address this, this application provides a service start / stop control method based on a large model. By introducing the natural language semantic understanding capability of a large language model into the system service start / stop control link, and bridging the uncertain semantic output of the large model with deterministic control commands through a structured output mechanism, service control commands are automatically generated based on the structured output text and sent to the target server for execution. This solves the technical problems in the prior art, such as the need for maintenance personnel to memorize complex commands or rely on preset interface operations, resulting in cumbersome operations, easy errors, and inability to flexibly understand natural language intent.
[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0051] It should be noted that the execution subject of the service start-stop control method based on a large model provided in this application embodiment can be a service start-stop control device based on a large model. This service start-stop control device based on a large model can be deployed on electronic devices such as operation and maintenance servers and cloud servers. This embodiment of the present invention does not impose any restrictions.
[0052] Figure 1 This is a flowchart illustrating a service start / stop control method based on a large model, provided as an embodiment of this application. Figure 1 As shown in the embodiments of this application, the service start / stop control method based on a large model may include:
[0053] S101. Obtain the service control request text in natural language form input by the user.
[0054] For example, service control request text refers to text information input by operations and maintenance personnel in natural language form through an operations and maintenance platform (such as the front-end interface of a unified operations and maintenance management system) to express their intention to start, stop, or restart a certain system service. Natural language differs from traditional command-line syntax or preset options; users can directly input statements such as "restart database service" or "stop web server," which conform to everyday language habits. Optionally, if the user inputs via voice, the operations and maintenance platform can first call a speech recognition module to convert the speech into text, thereby obtaining the service control request text. The purpose of obtaining this service control request text is to use the user's unstructured, highly flexible natural language commands as input for subsequent large-scale model processing, reducing the operational threshold for users and avoiding the need to memorize complex commands.
[0055] S102. Input the service control requirement text into the large model, control the large model to perform intent recognition on the service control requirement text, and generate structured output text.
[0056] For example, a large model refers to a deep learning model with a huge number of parameters, trained on massive amounts of data, possessing powerful natural language understanding, generation, and reasoning capabilities. It can be any general-purpose model capable of achieving the objectives of this application. In this step, the large model is used to understand the natural language instructions input by the user and transform them into executable structured information, which can be invoked through API interfaces, local deployment, or cloud deployment. Intent recognition refers to the process by which the large model analyzes natural language text to determine the true purpose or intent expressed by the user. In this application, intent recognition aims to identify the service operation the user wants to perform and the service objects involved from the user's request text.
[0057] The service start / stop control device based on the large model sends the service control request text obtained in step S101 as a prompt to the large model and controls the large model to identify the user intent within it. During intent identification, it can determine whether the user text expresses an operational intent to start, stop, or restart the system service. If the identification is successful, at least the service operation type (start / stop / restart) and service identifier (wherein, the service identifier may include, but is not limited to, the service name, ID, code, abbreviation, etc., or a converted standard service name) are extracted from the text. The large model then generates the result according to a preset structured output format. For example, the output format can be: RestartService{status:{start / stop / restart},service:{server_name}}. This structured output text has a unified key-value pair structure, facilitating automatic parsing by subsequent programs. Optionally, if the large model cannot identify a valid operational intent, it can output a preset unrecognizable identifier or text, such as "Unable to recognize your operational intent," etc. By leveraging the semantic understanding capabilities of large models, this step can handle complex situations such as synonyms, fuzzy expressions, and multi-turn contexts, significantly improving the naturalness and robustness of operational interactions.
[0058] S103. If the structured output text includes a service operation type and a service identifier, then a service control command is generated based on the structured output text, and the service control command is sent to the corresponding target server for execution; wherein, the target server is the server that deploys the system service indicated by the service identifier.
[0059] For example, after receiving the structured output text from the large model, it can first determine whether the generated structured output text contains service operation types (such as start / stop / restart) and service identifiers (such as service names). For instance, it can determine whether the structured output contains the preset operation identifier "RestartService". If it does, it can further generate service control commands based on the structured output text. For example, the system can maintain a simple mapping table to directly map the identified service operation types (such as "start") and service names (such as "XX service") to a specific operating system command (such as "systemctl start XX service").
[0060] Optionally, in one possible embodiment, generating service control commands based on structured output text may include:
[0061] S1. Parse the structured output text and extract the service operation type and service identifier based on the preset field identifiers;
[0062] S2. Select the corresponding system service control command template according to the service operation type; the command template includes a start command template, a stop command template, or a restart command template;
[0063] S3. Fill in the service identifier into the command template to generate the service control command.
[0064] For example, when generating service control commands based on structured output text, the structured output text can be parsed first, and the service operation type and service identifier can be extracted according to preset field identifiers. These preset field identifiers are specific key names or tags agreed upon when designing the large model output format to represent the service operation type and service identifier. For instance, when the structured output text format is: RestartService{status:{start / stop / restart}, service:{server_name}, the "status" field represents the service operation type, and the "service" field represents the service identifier. Through these preset field identifiers, the core control parameters in the user's intent—that is, the service operation type and service identifier to be executed—can be accurately obtained from the structured text.
[0065] Furthermore, a corresponding system service control command template can be selected based on the service operation type. The command template is a predefined command string containing placeholders, used to generate service control commands for specific operations. These templates are typically adapted to the target server's operating system type, service management tools (such as systemd, service, sc, etc.), and the characteristics of the service itself, including but not limited to: the systemctl command template for systemd under Linux, and the sc or net command templates under Windows. For example, taking systemd management services in Linux as an example, the start command template could be systemctl start [service], the stop template could be systemctl stop [service], and the restart template could be systemctl restart [service]. In this embodiment, the command templates include at least a start command template, a stop command template, or a restart command template. These templates cover the most common operation types in service start-stop control, ensuring basic management capabilities for the service lifecycle. For example, the start command template is used to put the service into a running state, the stop command template is used to terminate the service's operation, and the restart command template typically includes logic for stopping before starting.
[0066] Finally, the extracted service name is entered into the corresponding command template to generate a complete service control command. The filling process refers to replacing the placeholders in the command template with the specific service identifiers extracted earlier. For example, if the extracted service name is "XX service" and the startup command template "systemctl start [service]" is selected, then the service control command generated after filling will be "systemctl start [XX service]".
[0067] The aforementioned optional technical solutions enable the accurate and efficient conversion of service operation types and service identifiers identified by the large model into executable service control commands through structured parsing and template matching. Specifically, service operation types and service identifiers are precisely extracted from the structured output text using preset field identifiers, avoiding ambiguity in information extraction and ensuring the accuracy of subsequent command generation. Furthermore, based on the extracted service operation type, the most matching system service control command template is selected from a predefined command template library, ensuring command standardization and compatibility, adapting to the needs of different operating systems and service management tools. Finally, the specific service name is filled into the selected command template, thereby generating a service control command that can be directly issued and executed for a specific service. This mechanism significantly improves the automation and accuracy of service control command generation, reduces the error rate that may be introduced by manual command construction, and enhances the efficiency and reliability of the entire service start-up and shutdown control process.
[0068] For example, after generating the service control command, the target server for deploying the service can be further determined based on the system service indicated by the service name. For instance, a mapping table between services and servers can be maintained in advance, and the control command can be sent to the corresponding target server via standard network protocols or remote execution channels (such as SSH, Agent, API, etc.). Upon receiving the command, the target server will execute it locally to control the start and stop of the corresponding service. This step achieves automatic conversion and execution from natural language to low-level system commands, eliminating the need for manual login to each server or manual command input, significantly improving the efficiency and accuracy of operation and maintenance.
[0069] The service start / stop control method based on a large model provided in this application introduces a large model to perform intent recognition on service control request text in natural language form. This allows operation and maintenance personnel to automatically complete the entire process of intent recognition, command generation, and remote execution simply by expressing their operational intent in natural language, achieving intelligent and automated control of system service start / stop. This solution effectively solves the problems of low efficiency, high operational threshold, error-proneness, inflexible interaction, repetitive work, and lack of natural language interaction capabilities in traditional manual operations. Operation and maintenance personnel can express service control requirements in a more intuitive and natural way, reducing reliance on operational proficiency and system knowledge, thereby improving operation and maintenance efficiency and system usability.
[0070] Figure 2 This is a flowchart illustrating another service start / stop control method based on a large model provided in this embodiment. Figure 1 Building upon the illustrated solution, further features such as execution result feedback, short-term memory mechanism, and operation confirmation information generation are introduced, thus forming a complete closed loop for operation and maintenance. For example... Figure 2 As shown, the service start / stop control method based on a large model provided in this embodiment may include:
[0071] S201. Obtain the service control request text in natural language form input by the user.
[0072] It should be noted that the specific implementation of step S201 can be referred to the description of step S101, and will not be repeated here.
[0073] S202. Input the service control requirement text into the large model, control the large model to perform intent recognition on the service control requirement text, and generate structured output text.
[0074] It should be noted that the specific implementation of step S202 can be referred to the description of step S102, and will not be repeated here.
[0075] S203. Determine whether the structured output text includes service operation type and service identifier.
[0076] If yes, proceed to step S204; otherwise, proceed to step S205.
[0077] For example, the service start / stop control device based on the large model parses the structured output text generated in step S202 to determine whether it contains service operation type (such as start, stop, restart) and service identifier (such as service name). This determination can be achieved through regular expression matching, field extraction, or identifier field (such as "RestartService") detection. Based on the determination result, if the above necessary information is contained, it indicates that the large model has successfully identified the user's operation and maintenance intention, and proceeds to step S204; if it is not contained, it indicates that the large model cannot identify the user's intention or the identification result is incomplete, and proceeds to step S205.
[0078] S204. Generate service control commands based on the structured output text, and send the service control commands to the corresponding target server for execution; wherein, the target server is the server that deploys the system service indicated by the service identifier.
[0079] It should be noted that the specific implementation of step S204 can be referred to the description of step S103, and will not be repeated here. The service start / stop control device based on the large model can extract the service operation type and service name from the structured output text, select the corresponding command template according to the operation type, fill in the service name to generate a complete service control command, and then send the command to the target server where the service is deployed for execution, thereby realizing the automatic conversion and remote execution from the large model recognition result to the underlying system command.
[0080] S205. Output a prompt message indicating an identification error.
[0081] For example, when step S203 determines that the structured output text does not contain a service operation type or service identifier, it indicates that the large model has failed to effectively understand the user's natural language input. In this case, an error message can be generated and output to the user through the front-end interface of the operations and maintenance platform. For example, the message could be natural language text such as "Unable to recognize your operation intent; please provide instructions related to starting, stopping, or restarting the service," to guide the user to re-enter the information or correct their expression. This step provides a user-friendly error handling mechanism, enhancing the system's robustness and user experience.
[0082] S206. Obtain the execution result of the service control command.
[0083] For example, after a command is issued, the target server executes the command, thereby generating an execution result. The execution result is status information indicating whether the command was successfully executed (such as a success flag, failure flag, error code, error description, etc.). In this embodiment, the service start / stop control device based on the large model can further determine whether the service control command was successfully executed, failed, or is in some intermediate state by monitoring the target server's response, parsing log files, querying the service status interface, or receiving execution reports actively sent by the target server. For example, after a service start command is issued, the service process status on the target server can be polled until the service status changes to "running" or "stopped," at which point the execution result is obtained.
[0084] S207. The service control request text, structured output text, and execution result are used as the short-term memory context of the current session, and the short-term memory context is sent to the large model. The large model is controlled to generate operation confirmation information based on the short-term memory context. The operation confirmation information includes result information related to the original intent.
[0085] For example, this step is one of the core improvements of this embodiment. The executing entity combines the three parts of information from this round of interaction—the service control request text in natural language form initially input by the user (i.e., the user's original intent), the structured output text generated after the large model intent recognition (i.e., the system's understanding and parsing of the user's intent), and the execution result of the service control command (i.e., the actual feedback of the operation)—to form the short-term memory context of the current session. This short-term memory context records the complete link information from the user's intent to the system's execution, together constituting the complete background of the current operation.
[0086] Based on this, the short-term memory context is sent to the large model, which then generates operation confirmation information based on this context. This operation confirmation information refers to the natural language feedback generated by the large model, combining the user's original intent, its own recognition results, and the actual execution result. The operation confirmation information includes at least result information related to the original intent; for example, if the execution is successful, it can generate "You requested to restart service XX, which has been successfully restarted"; if the execution fails, it can generate "You requested to restart service XX, but the service was not found in the system, and the restart operation failed," etc. In this way, the large model can not only confirm the operation result but also translate the technical execution status into natural language that is easy for the user to understand, while simultaneously indicating to the user that "the large model has understood your intent and completed the corresponding operation." This step achieves closed-loop feedback for operational operations, allowing users to intuitively understand whether the operation has achieved the expected results.
[0087] S208, Output operation confirmation information.
[0088] For example, this step aims to present the operation confirmation information generated by the large model, containing result information related to the original intent, to the user in a user-understandable form. The output method can be diverse, such as displaying it through the web interface of the operations and maintenance front-end platform, sending a message through instant messaging tools, or broadcasting it via voice. The goal is to ensure that users can clearly and promptly understand the processing results of their service control requests, thereby enhancing user trust in the system and operational transparency.
[0089] Understandably, through the technical solution in this example, the system can promptly obtain the execution results of the service control command after it is issued and executed. These execution results, along with the user's original service control request text and the structured output text parsed by the large model, are integrated into the short-term memory context of the current session. This short-term memory context is sent to the large model, enabling it to generate highly relevant and interpretable operation confirmation information based on the complete operational context. This operation confirmation information not only clearly informs the user whether the operation was successful or not, but also provides a more detailed description of the result based on the user's original intent, such as the current service status, possible anomalies, or subsequent suggestions. Ultimately, by outputting this operation confirmation information, users can clearly and promptly understand the actual processing status of their service control requests, effectively solving the problem of information asymmetry after operation execution, significantly improving user experience and operational efficiency, and avoiding repetitive operations or unnecessary troubleshooting caused by delayed or unclear information.
[0090] Optionally, in one possible embodiment, the service start / stop control method based on a large model provided in this application may further include:
[0091] S10. Preserve the short-term memory context;
[0092] S20. When a new service control request text is obtained from the user, the short-term memory context and the new service control request text are input into the large model together, so that the large model can combine the short-term memory context to perform intent recognition.
[0093] For example, short-term memory context can be used not only for immediate feedback in the current session, but also for intent recognition in subsequent dialogues in continuous or multi-turn dialogue scenarios, in order to improve the success rate and accuracy of intent recognition.
[0094] Specifically, a short-term memory context, including the user-inputted service control request text in natural language, the structured output text generated by the large model, and the execution results of the service control commands, can be stored in persistent storage media (such as databases, file systems, or distributed caching systems) and associated with a specific user session ID or user identity for accurate retrieval and loading when needed. For example, after the current session ends or in a subsequent independent session, when the system receives new service control request text from the user, it no longer treats it as an isolated request but first retrieves and loads the saved short-term memory context associated with the current user or session. Subsequently, this short-term memory context is integrated with the new service control request text to form a complete input sequence containing historical information and the current request. This integrated input sequence is submitted to the large model for intent recognition. By analyzing this richer contextual information, the large model can better understand the user's true intent in the current request, especially when the user expresses their needs through omissions, references, or implied meanings, such as "restart that service" or "stop all services."
[0095] This optional technical solution effectively addresses the issue of context loss in multi-turn dialogues or continuous operations. By saving and reusing short-term memory context, the large model can combine historical interaction information for intent recognition when processing new service control request text. This allows the large model to understand the user's references or supplements to previous operations in subsequent requests, thereby significantly improving the accuracy and robustness of intent recognition. Users do not need to repeatedly provide complete background information in every interaction, greatly improving the naturalness and fluency of user interaction with the system, optimizing the user experience, and enabling the service control system based on the large model to better support complex, multi-step operation and maintenance scenarios.
[0096] The service start / stop control method based on a large model provided in this application obtains the service control request text input by the user in natural language and uses the large model for intent recognition to generate structured output text. This accurately extracts the service operation type and service identifier, and automatically generates and sends service control commands to the corresponding server, significantly reducing the manual operation threshold and error probability, and improving operational efficiency. Simultaneously, it promptly outputs recognition anomaly prompts when key information is missing from the structured output, ensuring the system's robustness. Furthermore, by feeding back the service control request text, structured output text, and execution results as short-term memory context to the large model, it generates and outputs operation confirmation information containing result information related to the original intent. This allows users to intuitively understand the operation execution status and intent matching results, forming a complete closed-loop interactive experience. This not only allows users to intuitively trace whether the operation achieved the expected effect, but also enables the large model to perceive the consistency between its own recognition and execution results, effectively improving the intelligence level, interactivity, and operational traceability of service start / stop control.
[0097] Figure 3 This is a flowchart illustrating another service start / stop control method based on a large model provided in this application embodiment. This embodiment... Figure 2 Based on the proposed scheme, the specific architecture is further defined, with the execution entity being a cloud server and the large model deployed on the cloud server. The communication methods between the front-end and the cloud, the voice processing flow, and the mechanism for saving and reusing short-term memory context are also clarified. For example... Figure 3 As shown, the service start / stop control method based on a large model provided in this embodiment may include:
[0098] S301: Receive service control request information in natural language form, input by the user, sent by the operation and maintenance front-end platform via WebSocket.
[0099] For example, in this embodiment, the execution entity is a cloud server (or cloud-based operations and maintenance backend service). The operations and maintenance frontend platform refers to a graphical user interface running on the user side (such as a browser, desktop application, or mobile application), used to collect service control request information input by the user. WebSocket is a full-duplex communication protocol that can establish a persistent, bidirectional, real-time data channel over a single TCP connection. Compared to the traditional HTTP request-response model, WebSocket allows the cloud server and the operations and maintenance frontend platform to maintain a long-term connection, supports server-initiated message push, and has lower communication latency and less overhead.
[0100] In this step, the user inputs service control requests in natural language through the operations and maintenance front-end platform. The front-end platform encapsulates this information and sends it to the cloud server in real time via a WebSocket connection. Using WebSocket for data transmission meets the real-time and low-latency requirements of operations and maintenance scenarios, supports streaming transmission and continuous interaction, and provides the communication foundation for subsequent advanced functions such as multi-turn dialogue and real-time feedback.
[0101] S302. Determine whether the service control request information is voice information.
[0102] If yes, proceed to step S303; otherwise, if the service control requirement information is text information, proceed directly to step S304.
[0103] For example, to further enhance user experience and operational flexibility, this application supports both voice and text input. After receiving service control request information, the cloud server first determines whether the information is in text or voice format (such as an audio stream or audio file). This determination can be made based on the format identifier field, MIME type, or data characteristics carried in the information. If it is determined to be voice information, step S303 is executed for voice-to-text conversion; if it is determined to be text information, no conversion is needed, and step S304 is executed directly. The purpose of this step is to distinguish between different input modalities so that the corresponding processing module can be invoked for voice information.
[0104] S303. Perform speech recognition on the service control requirement information, convert the service control requirement information into text information, and use it as the service control requirement text.
[0105] For example, when step S302 determines that the service control request information is voice information, the cloud server calls the Automatic Speech Recognition (ASR) module to recognize and convert the voice information. The ASR module can be a third-party speech recognition service integrated into the cloud server, an open-source engine, or a self-developed model; its function is to convert audio signals into corresponding text strings. After conversion, the resulting text information is used as the service control request text for subsequent steps.
[0106] This step allows users to input maintenance commands via voice, eliminating the need for manual typing. This further lowers the barrier to entry and improves the convenience of maintenance, especially in emergency scenarios or when operating on mobile devices.
[0107] S304. Input the service control requirement text into the large model, control the large model to perform intent recognition on the service control requirement text, and generate structured output text.
[0108] S305. Determine whether the structured output text includes service operation type and service identifier.
[0109] If yes, proceed to step S306; otherwise, proceed to step S307.
[0110] S306. Generate service control commands based on the structured output text, and send the service control commands to the corresponding target servers for execution.
[0111] The target server is the server of the system service indicated by the deployment service identifier.
[0112] S307. Output a prompt message indicating an identification error.
[0113] S308. Obtain the execution result of the service control command.
[0114] S309. Use the service control request text, structured output text, and execution results as the short-term memory context of the current session, and save the short-term memory context.
[0115] The saved short-term memory context is used as auxiliary information for intent recognition when new service control request text input by the user is obtained, so as to improve the accuracy of intent recognition.
[0116] Optionally, the short-term memory context is stored in association with the session identifier of the current session. When the user logs out or the session times out (e.g., no interaction for more than 30 minutes), the short-term memory context can be cleared or archived to free up storage resources and protect user privacy.
[0117] S310. Send the short-term memory context to the large model and control the large model to generate operation confirmation information based on the short-term memory context.
[0118] The operation confirmation information includes result information related to the original intent.
[0119] S311, Output operation confirmation information.
[0120] For example, the cloud server can send the operation confirmation information generated in step S310 to the operation and maintenance front-end platform via a WebSocket connection. The front-end platform displays the information to the user in the form of text, voice, or pop-up window, so that the user can clearly understand the operation result.
[0121] It should be noted that the specific implementation of steps S304 to S310 can be referred to the description of other embodiments, and will not be repeated here. In this embodiment, steps S301 to S303 (WebSocket communication and speech recognition) are the specific implementation of the architecture layer, S309 (short-term memory storage) is the core support for multi-turn dialogue capability, and S310 to S311 complete the feedback loop. In practical applications, those skilled in the art can selectively combine these features as needed. For example, S302 to S303 can be omitted in scenarios where voice input is not required, and the storage logic of S309 can be simplified in scenarios where multi-turn dialogue is not required. These adjustments do not depart from the protection scope of this application. Subsequent embodiments will further describe advanced functions such as batch service start-up and shutdown, and service dependency handling.
[0122] The service start / stop control method based on a large model provided in this application receives natural language service control request information sent by the operation and maintenance front-end platform via WebSocket on a cloud server, achieving low-latency full-duplex communication and improving real-time interaction. It supports dual-modal input of voice and text, automatically recognizing and converting voice information into text, expanding the applicability of operation and maintenance scenarios. The large model is used to perform intent recognition on the service control request text, generating structured output, accurately extracting service operation types and service identifiers, and automatically generating and sending service control commands to the target server, significantly reducing the burden of manual operation and the risk of errors. If key information is missing from the structured output, an identification anomaly prompt is output, ensuring system fault tolerance. After obtaining the command execution result, the service control request text, structured output text, and execution result are saved as the short-term memory context of the current session. When a new service control request is received subsequently, this context is used as auxiliary information input to the large model to improve the accuracy of intent recognition, achieving context-aware continuous dialogue capability. Simultaneously, operation confirmation information containing result information related to the original intent is generated and output based on the short-term memory context, forming a complete closed loop from request input, intent recognition, command execution to result feedback and memory enhancement. In summary, this method effectively improves the intelligence level, interactivity, multimodal adaptability, and long-term operational stability of service start-up and shutdown control. It provides a practically deployable intelligent operation and maintenance solution with multi-turn dialogue capabilities, reducing the threshold for operation and maintenance and improving operational efficiency, accuracy, and user experience.
[0123] Optionally, in actual operation and maintenance scenarios, users also have the need to perform batch operations on multiple services. For example, simultaneously starting or stopping a group of services, some of which may have dependencies. If each service is processed independently without considering their service dependencies or specific execution order, it may lead to service operation failures, system instability, or even data corruption, failing to meet the fine-grained control requirements in complex operation and maintenance scenarios. Therefore, when the service control request text involves multiple services, in this embodiment of the application, the intent recognition of the service control request text by the control model may further include:
[0124] S100, Control the service dependencies and / or execution order constraints of multiple services in the control requirement text of the large model identification service;
[0125] S200. If it is determined that there are service dependencies and / or execution order constraints between multiple services, a structured output text including a list of dependent services and execution order information is generated.
[0126] For example, when the service control request text in natural language input by the user is no longer limited to operations on a single service, but covers management instructions for two or more system services, such as "start all services related to the order system" or "stop database service and application service," the large model used in this application has been further trained and configured to not only identify service operation types and service names, but also analyze and understand the possible interdependencies and specific execution order requirements between the multiple services involved from complex natural language descriptions. For example, service A must start after service B, or service D must be stopped before service C can be stopped. This recognition capability can be achieved through the knowledge graph within the large model, a preset rule base, or by learning from a large number of operation and maintenance logs and operation manuals; this application embodiment does not impose any limitations.
[0127] Once the large model successfully identifies dependencies or execution order constraints between multiple services, it generates a more detailed and complex structured output text. This text not only includes service operation types and service names, but also explicitly lists all involved dependent services and details the order in which these services should be executed. For example, the structured output text could be JSON-formatted data containing a list of services, each with its operation type, name, and dependencies on other services or its position within the overall operation sequence. This structured information provides the necessary and sufficient basis for the subsequent accurate generation and issuance of service control commands.
[0128] Through the aforementioned optional technical solutions, when users raise complex control requirements involving multiple services, the system no longer simply processes each service independently. Instead, it leverages the powerful semantic understanding capabilities of the large model to deeply identify the inherent dependencies between these services and / or user-specified execution order constraints. This capability enables the system to extract the complete logic of multi-service operations from natural language. This not only avoids service failures or system instability caused by improper service operation order but also provides clear guidance for the subsequent accurate and orderly generation and issuance of service control commands. This ensures the correctness and reliability of complex multi-service operations, significantly improving the level of operational automation and system stability, and effectively solving the limitations of traditional methods in handling multi-service dependencies and sequential operations.
[0129] Furthermore, when the service control request text involves multiple services, service control commands are generated based on the structured output text, and these commands are then sent to the corresponding target servers for execution. This may include:
[0130] S1000: Extract the list of dependent services and execution order information from the structured output text;
[0131] S2000: According to the execution order information, generate service control commands for each service in the dependent service list in sequence, and send them to the target server corresponding to each service for execution; wherein, the service control commands for the subsequent services are executed only after the service control commands of the preceding services have been successfully executed.
[0132] For example, after receiving the structured output text generated by the large model for the service control requirements involving multiple services, the system first needs to parse the structured output text to accurately extract the list of dependent services and execution order information contained therein, thereby obtaining the set of services that need to be operated on and the predetermined execution order among them, as the basis for subsequent precise control of multiple services, ensuring the accuracy and completeness of the operation.
[0133] After successfully extracting the list of dependent services and execution order information, the system will strictly follow the obtained execution order information to process each service in the list of dependent services one by one. For each service in the sequence, the system will combine its corresponding service operation type (e.g., start, stop, or restart), select a preset system service control command template, and fill in the name of the current service into the selected command template to generate a specific service control command for that service. After the command is generated, it will be sent to the target server corresponding to which the service is deployed for execution.
[0134] Furthermore, to ensure the reliability of multi-service operations and the consistency of system state, this application emphasizes strict control over the execution order: the service control command for a subsequent service can only be executed after the service control command for the preceding service has been successfully executed. In other words, after issuing the control command for a preceding service, the system continuously monitors the execution status of that command. Only when the execution result returned by the target server clearly indicates that the preceding service command has been successfully completed will the system continue to issue the control command for the next service in the execution sequence. If the preceding service command fails to execute, the system can handle it according to preset strategies (e.g., retry, alarm, or termination of the entire multi-service control process) and provide corresponding failure information to the user. This mechanism effectively avoids the problem of subsequent services failing to execute or the system state becoming chaotic due to abnormal execution of preceding services.
[0135] This optional implementation effectively solves the problem of inconsistent system states or operation interruptions caused by complex dependencies or failure of preceding services in multi-service control by introducing a mechanism that executes subsequent service commands only after the preceding service commands have been successfully executed. This greatly improves the reliability and automation level of multi-service operations, reduces operational risks, and ensures the stable operation of system services.
[0136] Figure 4 A schematic diagram of a service start / stop control device based on a large model provided in this application embodiment is shown below. Figure 4 As shown, the service start / stop control device 40 based on a large model provided in this embodiment includes: a first processing unit 401, a second processing unit 402, and a third processing unit 403.
[0137] The first processing unit 401 is used to obtain the service control request text in natural language form input by the user;
[0138] The second processing unit 402 is used to input the service control requirement text into the large model, control the large model to perform intent recognition on the service control requirement text, and generate structured output text.
[0139] The third processing unit 403 is configured to generate a service control command based on the structured output text if the structured output text includes a service operation type and a service identifier, and then send the service control command to the corresponding target server for execution; wherein the target server is the server that deploys the system service indicated by the service identifier.
[0140] In one possible implementation, the third processing unit 403 is further configured to:
[0141] Obtain the execution results of service control commands;
[0142] The service control request text, structured output text, and execution result are used as the short-term memory context of the current session. The short-term memory context is then sent to the large model, which generates operation confirmation information based on the short-term memory context. The operation confirmation information includes result information related to the original intent.
[0143] Output operation confirmation information.
[0144] In one possible implementation, the third processing unit 403 is further configured to:
[0145] Preserve short-term memory context;
[0146] When a new service control request text is obtained from the user, the short-term memory context is input into the large model along with the new service control request text, so that the large model can combine the short-term memory context to perform intent recognition.
[0147] In one possible implementation, the third processing unit 403 is specifically used for:
[0148] Parse the structured output text and extract the service operation type and service identifier based on the preset field identifiers;
[0149] Select the corresponding system service control command template based on the service operation type; the command templates include start command template, stop command template, or restart command template.
[0150] Enter the service identifier into the command template to generate the service control command.
[0151] In one possible implementation, the method provided in this application embodiment is applied to a cloud server, the large model is deployed on the cloud server, and the first processing unit 401 is specifically used for:
[0152] Receive service control request information in natural language form, input by the user, sent by the operation and maintenance front-end platform via WebSocket;
[0153] If the service control request information is in the form of voice information, then the service control request information is subjected to voice recognition, converted into text information, and used as the service control request text.
[0154] In one possible implementation, when the service control request text involves multiple services, the second processing unit 402 is further configured to:
[0155] Control the service dependencies and / or execution order constraints of multiple services in the control requirement text of the large model identification service;
[0156] If service dependencies and / or execution order constraints are determined to exist between multiple services, a structured output text including a list of dependent services and execution order information is generated.
[0157] In one possible implementation, the third processing unit 403 is specifically used for:
[0158] Extract the list of dependent services and execution order information from the structured output text;
[0159] According to the execution order information, service control commands for each service in the dependency service list are generated sequentially and sent to the target server corresponding to each service for execution; in particular, the service control commands for subsequent services are executed only after the service control commands of the preceding services have been successfully executed.
[0160] The apparatus provided in this application embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described in detail here.
[0161] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. These modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. Furthermore, they can be stored as program code in the device's memory, and the data processing modules can be called and executed by a specific processing element. The implementation of other modules is similar. These modules can be fully or partially integrated together, or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0162] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502.
[0163] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0164] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0165] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0166] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0167] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0168] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0169] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0170] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0171] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0172] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0173] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0174] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0175] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0176] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0177] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A service start / stop control method based on a large model, characterized in that, The method includes: Obtain the service control request text in natural language form input by the user; The service control request text is input into the large model, which then performs intent recognition on the service control request text and generates structured output text. If the structured output text includes a service operation type and a service identifier, a service control command is generated based on the structured output text, and the service control command is sent to the corresponding target server for execution; wherein, the target server is the server that deploys the system service indicated by the service identifier.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the execution result of the service control command; The service control request text, the structured output text, and the execution result are used as the short-term memory context of the current session, and the short-term memory context is sent to the large model to control the large model to generate operation confirmation information based on the short-term memory context; wherein, the operation confirmation information includes result information related to the original intent; Output the operation confirmation information.
3. The method according to claim 2, characterized in that, The method further includes: Save the short-term memory context; When a new service control request text is obtained from user input, the short-term memory context and the new service control request text are input into the large model together, so that the large model can perform intent recognition in combination with the short-term memory context.
4. The method according to claim 1, characterized in that, The step of generating service control commands based on the structured output text includes: The structured output text is parsed, and the service operation type and the service identifier are extracted according to the preset field identifiers; Select the corresponding system service control command template according to the service operation type; wherein, the command template includes a start command template, a stop command template, or a restart command template; The service identifier is entered into the command template to generate the service control command.
5. The method according to claim 1, characterized in that, The method is applied to a cloud server, the large model is deployed on the cloud server, and the acquisition of service control request text in natural language form input by the user includes: Receive service control request information in natural language form, input by the user, sent by the operation and maintenance front-end platform via WebSocket; If the service control request information is voice information, then the service control request information is subjected to voice recognition, and the service control request information is converted into text information, which is then used as the service control request text.
6. The method according to any one of claims 1-5, characterized in that, When the service control request text involves multiple services, the control of the large model to perform intent recognition on the service control request text also includes: The large model is controlled to identify the service dependencies and / or execution order constraints of multiple services in the service control requirement text; If service dependencies and / or execution order constraints are determined to exist between multiple services, a structured output text including a list of dependent services and execution order information is generated.
7. The method according to claim 6, characterized in that, The step of generating service control commands based on the structured output text and sending the service control commands to the corresponding target server for execution includes: Extract the list of dependent services and the execution order information from the structured output text; According to the execution order information, service control commands for each service in the dependent service list are generated sequentially and sent to the target server corresponding to each service for execution; wherein, the service control commands for subsequent services are executed only after the service control commands of the preceding services have been successfully executed.
8. A service start / stop control device based on a large model, characterized in that, The device includes: The first processing unit is used to obtain the service control request text in natural language form input by the user; The second processing unit is used to input the service control request text into the large model, control the large model to perform intent recognition on the service control request text, and generate structured output text. The third processing unit is configured to, if the structured output text includes a service operation type and a service identifier, generate a service control command based on the structured output text and send the service control command to the corresponding target server for execution; wherein the target server is the server that deploys the system service indicated by the service identifier.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.