Single lamp control instruction generation method and device based on large model

Through the single-light control instruction generation method based on the big model, the vector database and the big model are used to perform intelligent semantic understanding to generate a single-light control intelligent body, which solves the lack of flexibility, cumbersome operation and expansion of the traditional lighting system control instruction generation method. and poor compatibility, the efficient and economical single-light control effect is achieved.

CN119473392APending Publication Date: 2025-02-18TAIHUA WISDOM IND GRP CO LTD +1

Patent Information

Application Number
CN202411488978.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The control instruction generation method of traditional lighting systems has problems such as insufficient flexibility, cumbersome operation, poor expansion and compatibility, making it difficult to achieve efficient and accurate single-light control.

Method used

Using a single-light control instruction generation method based on a large model, users input task commands, use vector databases and large models to perform intelligent semantic understanding, generate single-light control intelligent bodies, and perform optimization verification to automatically respond to diverse user needs .

Benefits of technology

It improves the efficiency and cost-effectiveness of single-light control, reduces operational complexity and difficulty, enhances user interaction experience, has good maintainability and upgradeability, and can be easily expanded to cope with more complex scenarios and needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473392A_ABST
    Figure CN119473392A_ABST
Patent Text Reader

Abstract

The invention provides a single lamp control instruction generation method and device based on a large model, and the method comprises the steps: a user inputs a question to a main controller through a client, the client generates a session, the main controller calls the large model, achieves the intelligent semantic understanding through the large model, and transmits the session to a vector database. A vector database searches corresponding agent information, the agent information is enhanced according to a session and a single lamp control system, a single lamp control agent is generated, a large model generates instruction information, optimization verification is carried out, and diversified user requirements can be automatically met; the method is based on an existing architecture, can be easily expanded to cope with more complex scenes and requirements, and has good maintainability and upgradability; various technologies and platforms are integrated, the efficiency and the cost effectiveness are greatly improved, the device can achieve efficient and intelligent instruction generation and execution by applying the method, and the overall reliability of user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart lighting technology, and more specifically, to a method and device for generating single-lamp control instructions based on a large model. Background Art

[0002] With the development of artificial intelligence technology, especially the progress of large-scale pre-trained models in the field of natural language processing, urban lighting systems are becoming more and more intelligent and convenient. Against this background, the study of "generation of single-lamp control instructions based on large models" came into being. This study aims to explore how to use advanced language models to understand the user's natural language instructions and convert them into precise control signals for the lighting system. The traditional method of generating control instructions for lighting systems has some potential drawbacks:

[0003] 1. Fixed command set limits flexibility

[0004] Traditional lighting systems usually rely on a set of preset commands to achieve basic control of lighting equipment, such as turning lights on / off, adjusting brightness, etc. This means that users need to remember these specific command vocabularies and cannot interact with the system using more natural language. This model limits the user's freedom of expression and reduces the usability of the system.

[0005] 2. Graphical user interface operation is cumbersome

[0006] For lighting control systems that use a graphical user interface (GUI), users need to select different function options through a touch screen or various function menus. Although this operation method is intuitive, it may be cumbersome in actual use, especially when multiple steps are required.

[0007] 3. Scalability and compatibility

[0008] As the smart city ecosystem continues to develop, new single-lamp devices emerge in an endless stream. However, traditional lighting control systems may not support these new devices, making it difficult for users to achieve seamless connection and unified management between various devices within the city. In addition, due to the lack of standardized interfaces, there may be compatibility issues between products of different brands, further limiting the system's scalability.

[0009] The prior art (publication number: CN110767227A, publication date: 2020.02.07) discloses a voice recognition system and method for single lamp control, which discloses that natural voice information is collected through an acquisition module, and the collected natural voice information is converted into text information. A semantic analysis module is used to judge the semantics of the text information. An instruction generation module generates machine language instructions according to the semantics and sends them to a cloud platform and a device for executing the instructions. It is easy to make errors when directly generating instructions from the information after recognition and analysis, resulting in failures in the control process.

[0010] The prior art (publication number: CN218888737U publication date: 2023.04.18) discloses a single lamp control system, which specifically discloses that the communication between the host computer and the MCU control unit is constructed through the CAT1 4G module. The host computer remotely outputs a signal to the MCU control unit, and then controls the power of the lamp through the digital potentiometer control unit. Its intelligence level is low, and it cannot be controlled by user voice, and its use has certain limitations.

[0011] The prior art (publication number: CN108551711A, publication date: 2018.09.18) discloses a single lamp control method based on narrowband Internet of Things, which divides single lamps into regions and manages them in a unified manner. Through the narrowband Internet of Things, managers can set the status information of each single lamp in the region and control the switch status and lighting brightness of each single lamp. However, specific values ​​such as the brightness need to be given during the setting process. The use process is less intelligent, and no verification and result feedback process is set. The operating efficiency and accuracy of the control process are unknown.

[0012] Therefore, it is very necessary to efficiently and accurately collect, respond to and process single-lamp control information, and provide a single-lamp control instruction generation method and device based on a large model that can improve the efficiency and cost-effectiveness of single-lamp control and reduce the complexity and difficulty of operation. Summary of the invention

[0013] In view of this, the present invention provides a method for generating a single lamp control instruction based on a large model, comprising the steps of:

[0014] The user inputs a task command to the main controller through the client, and the client generates a session task command as a single light control command;

[0015] The vector database stores the intelligent agent template, including: initializing the vector database client; creating a collection for storing the intelligent agent template; writing the intelligent agent information into the collection to generate the intelligent agent template; the intelligent agent information includes: variable information and fixed information; the variable information includes: lamp pole number and dimming value;

[0016] The master controller is connected to the vector database, and the client transmits the session to the vector database through the master controller;

[0017] The vector database searches for an agent template whose similarity with the content of the conversation exceeds a first threshold, calls the corresponding agent information, and writes the content of the conversation into the variable information;

[0018] The vector database performs enhanced processing on the agent information to generate a single-lamp control agent; the enhanced processing includes: obtaining the corresponding environmental state through the single-lamp control system according to the content of the conversation; aggregating the environmental state and variable information using a string concatenation method;

[0019] The vector database transmits the single-lamp control agent to the main controller, and the main controller transmits the single-lamp control agent to the large model. The large model generates instruction information. The large model is a language model based on a neural network.

[0020] The large model optimizes the single lamp control agent by calling the rule engine or optimization algorithm through the main controller, including: using regular expression matching to extract the lamp pole number and dimming value in the instruction information; if the extraction is successful, the data type of the dimming value is verified through the verification function;

[0021] The large model transmits the command information to the main controller, and the main controller transmits the command information to the single-lamp control system;

[0022] The single-lamp control system executes the command information and feeds the results back to the user through the client;

[0023] If the extraction is unsuccessful, locate the missing content and generate supplementary information; the large model feeds the supplementary information back to the main controller, and the main controller returns the supplementary information to the user through the client, and the user inputs questions to the main controller through the client, and the client generates a session and subsequent steps;

[0024] The extraction is unsuccessful, including: the command information does not include the lamp pole number, and\or the command information does not include the dimming value; among which, if the command information does not include the lamp pole number, the main controller will return the information that needs to be supplemented with the lamp pole number to the user through the client; if the command information does not include the dimming value, the main controller will generate a dimming suggestion value based on the environmental status, return the dimming suggestion value to the user through the client, and update the command information after the user confirms; if the command information does not include the lamp pole number and dimming value, the main controller will return the information that needs to be supplemented with the lamp pole number and dimming value to the user through the client.

[0025] Optionally, the single-lamp control system executes the instruction information and feeds back the result to the user through the client, including: the single-lamp control system executes the instruction information; feeds back the execution result to the main controller; the main controller feeds back the execution result to the user through the client and clears the session.

[0026] Optionally, the environmental status includes: current time, weather conditions, and sunrise and sunset times.

[0027] On the other hand, the present invention provides a single-lamp control instruction generation device based on a large model, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the single-lamp control instruction generation device based on the large model is applied to perform any of the single-lamp control instruction generation methods based on the large model as described above.

[0028] Compared with the prior art, the method and device for generating a single lamp control instruction based on a large model provided by the present invention achieve at least the following beneficial effects:

[0029] The present invention provides a method for generating a single-lamp control instruction based on a large model, comprising: a user inputs a question to a main controller through a client, the client generates a session, the main controller calls the large model, and uses the large model to realize intelligent semantic understanding, the main controller transmits the session to a vector database, the vector database searches for corresponding intelligent agent information, and enhances the intelligent agent information according to the session and the single-lamp control system to generate a single-lamp control intelligent agent, the large model generates instruction information and performs optimization verification, and can automatically respond to diverse user needs; the efficient use of the vector database and the large model platform enables rapid response when facing a large number of users, and real-time processing of user instructions and feedback; through clear intelligent agent templates and dynamic generation methods, the interactive experience of users during use is improved, and the complexity and difficulty of operation are reduced; based on the existing architecture, it can be easily expanded to cope with more complex scenarios and needs, and has good maintainability and upgradeability; integrating multiple technologies and platforms, greatly improving efficiency and cost-effectiveness, the single-lamp control instruction generation device based on the large model provided by the present invention uses the single-lamp control instruction generation method based on the large model provided by the present invention, which can not only realize efficient and intelligent instruction generation and execution, but also improve the overall reliability of user experience.

[0030] Of course, any product implementing the present invention does not necessarily need to achieve all of the technical effects described above at the same time.

[0031] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0033] Figure 1 It is a flow chart of a method for generating a single lamp control instruction based on a large model provided by the present invention;

[0034] Figure 2 A flow chart of another method for generating single lamp control instructions based on a large model provided by the present invention;

[0035] Figure 3 This is another flow chart of a method for generating a single lamp control instruction based on a large model provided by the present invention;

[0036] Figure 4 A flow chart of another method for generating single lamp control instructions based on a large model provided by the present invention;

[0037] Figure 5 A flow chart of another method for generating single lamp control instructions based on a large model provided by the present invention;

[0038] Figure 6 It is a schematic diagram of a single lamp control instruction generating device based on a large model provided by the present invention;

[0039] Figure 7 It is a schematic diagram of the user page of the client. DETAILED DESCRIPTION

[0040] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0041] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0042] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0043] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0044] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0045] Example 1

[0046] The present invention provides a method for generating a single lamp control instruction based on a large model, referring to Figure 1-Figure 5 , including the steps of:

[0047] S1: The user inputs a task command to the main controller through the client, and the client generates a session. The task command is a single light control command;

[0048] S2: vector database stores intelligent agent templates, including: S21: initializing vector database client; S22: creating a collection for storing intelligent agent templates; S23: writing intelligent agent information into the collection to generate intelligent agent templates; intelligent agent information includes: variable information and fixed information; variable information includes: lamp pole number and dimming value;

[0049] S3: The master controller is connected to the vector database, and the client transmits the session to the vector database through the master controller;

[0050] S4: the vector database searches for an agent template whose content similarity with the conversation exceeds a first threshold, calls the corresponding agent information, and writes the conversation into the variable information;

[0051] S5: the vector database performs enhancement processing on the agent information to generate a single-lamp control agent; the enhancement processing includes: S51: obtaining the corresponding environmental state through the single-lamp control system according to the content of the conversation; S52: aggregating the environmental state and the variable information using a string concatenation method;

[0052] S6: The vector database transmits the single-lamp control agent to the main controller, and the main controller transmits the single-lamp control agent to the large model, which generates instruction information. The large model is a language model based on a neural network.

[0053] S7: The large model optimizes the single lamp control agent by calling the rule engine or optimization algorithm through the main controller, including: S70: using regular expression matching to extract the lamp pole number and dimming value in the instruction information; S71: if the extraction is successful, verifying the data type of the dimming value through the verification function;

[0054] S8: The large model transmits the command information to the main controller, and the main controller transmits the command information to the single lamp control system;

[0055] S9: The single lamp control system executes the command information and feeds back the result to the user through the client;

[0056] S72: If the extraction is unsuccessful, locate the missing content and generate supplementary information. The large model feeds back the supplementary information to the main controller, and the main controller returns the supplementary information to the user through the client. The user inputs questions to the main controller through the client, and the client generates a session and subsequent steps.

[0057] Specifically, the present invention provides a method for generating a single lamp control instruction based on a large model, comprising the steps of:

[0058] S1: The user inputs a task command to the main controller through the client, and the client generates a session. The task command is a single light control command. It should be noted that the user can input questions to the main controller through the client by keyboard or voice input. The client is equipped with a voice-to-text function. Figure 7 , is a schematic diagram of the client interface used in this embodiment. When inputting task commands, voice or keyboard input mode can be selected in the input bar. The client is remotely connected to the main controller to realize interactive data transmission.

[0059] It should be noted that the main controller is equipped with the main control program of the single-lamp control instruction generation method based on the big model provided by the present invention, which belongs to the main controller of the method process and can interact with the vector database, rule engine, big model and data transmission and memory between the client.

[0060] S2: vector database stores intelligent agent templates, including: S21: initializing vector database client; S22: creating a collection for storing intelligent agent templates; S23: writing intelligent agent information into the collection to generate intelligent agent templates; intelligent agent information includes: variable information and fixed information; variable information includes: lamp pole number and dimming value;

[0061] It should be noted that the Python client provided by the vector database Chroma is used to store the agent template generated by the single light control instruction. For example, we store the following information in the agent template library:

[0062] {"command":"Single lamp dimming",

[0063] "content":"You are a dimming assistant, please answer the question using the following format: content

[0064] Question: Input question you must answer

[0065] Thought: You should always consider how to obtain the lamp pole number and dimming information input by the user

[0066] Action: Directly answer the questions that guide the user to enter, and extract the lamp pole number and dimming value (0-100) from the questions entered by the user

[0067] Observation: Waiting for user input

[0068] Thought: Now I know the final answer. The final answer is in a Json format.

[0069] Final Answer: No explanation is needed, just reply with the final answer

[0070] Begin!

[0071] Question: {query}

[0072] {context}"

[0073] }

[0074] {query} and {context} are two variable information in the agent information, the {query} variable is the question raised by the user, and the {context} variable is the conversation with the big model; in this embodiment, the replacement of variable information uses the format library provided by string processing in Python.

[0075] It should be noted that Chroma is an open source vector database that uses vector similarity search technology to quickly and efficiently store and retrieve large-scale high-dimensional vector data. Its application scenarios include recommendation systems, image and video search, natural language processing, etc., which can help users quickly find similar data and information; Chroma is an application embedded database, embedded in the code in the form of a package.

[0076] S3: The master controller is connected to the vector database, and the client transmits the session to the vector database through the master controller;

[0077] S4: the vector database searches for an agent template whose content similarity with the conversation exceeds a first threshold, calls the corresponding agent information, and writes the conversation into the variable information;

[0078] It should be noted that the Chroma vector database provides an interface for similarity retrieval and result acquisition. By calling the collection of stored agent templates, the agent template with the highest similarity can be obtained. By directly calling the interface in Python, the corresponding information can be returned. At the same time, the obtained template information can be saved to the session, and the session can be written into the variable information to obtain the content of the single lamp dimming required by the current user.

[0079] S5: the vector database performs enhancement processing on the agent information to generate a single-lamp control agent, the enhancement processing includes: S51: obtaining the corresponding environment state through the single-lamp control system according to the content of the conversation; S52: aggregating the environment state and the variable information;

[0080] It should be noted that in order to enable the large model to further understand the user's intention and the accuracy of command generation, S51: According to the content of the conversation, the vector database obtains the corresponding environmental status through the single light control system. The environmental status includes: current time, weather conditions, and sunrise and sunset times. Current time: {time}, weather conditions: {weather}, sunrise and sunset times: {begin Time}-{end Time}, and then the variables in the agent information are replaced using the format method to obtain complete environmental information: Current environmental reference information: Current time: 12:00, weather conditions: sunny and sunrise and sunset times: 5:40-18:20

[0081] S52: Aggregate the environment state and variable information using a string concatenation method, and perform aggregation based on the session and the environment state obtained in step S51. Aggregation uses a string concatenation method to obtain a single light control agent:

[0082] Current environment reference information:

[0083] Current time: 12:00

[0084] Weather conditions: Sunny

[0085] Sunrise and sunset time: 5:40-18:20

[0086] You are a dimming assistant, please answer the questions using the following format:

[0087] Question: Input question you must answer

[0088] Thought: You should always consider how to obtain the lamp pole number and dimming information entered by the user (give a suggested value if not provided)

[0089] Action: Directly answer the questions that guide the user to enter, and extract the lamp pole number and dimming value (0-100) from the questions entered by the user

[0090] Observation: Waiting for user input

[0091] Thought: Now I know the final answer. The final answer is in a Json format.

[0092] Final Answer: No explanation is needed, just reply with the final answer

[0093] Begin!

[0094] Question: Turn on the light on the pole numbered 201;

[0095] It should be noted that the single-lamp control system can be any existing single-lamp control system that can collect ambient environment status and number lamp poles.

[0096] S6: The vector database transmits the single-lamp control agent to the main controller, and the main controller transmits the single-lamp control agent to the large model, which generates instruction information. The large model is a language model based on a neural network.

[0097] The large model includes: a general language model that identifies the content of the conversation; a command parsing model that receives and parses the commands entered by the user to determine the type of task that needs to be performed; a state management model that tracks and manages the current state during the interaction process; an information gathering model that collects specific information from the user to complete the task through a series of questions; and an output formatting model that formats the collected information into a specific output format.

[0098] It should be noted that the large model used in this embodiment is Zhipu Qingyan Chat GLM, and the model selected is GLM-4. Chat GLM is a Chinese-English bilingual dialogue robot developed by Zhipu AI. It is based on the GLM130B trillion basic model and has powerful text generation and natural language processing capabilities. Chat GLM not only covers knowledge in multiple fields, but also has the ability to write code, common sense reasoning and practical application. It can interact with users through natural language to complete various tasks such as dialogue, question and answer, article creation, script writing, event information extraction and code generation. In addition, Chat GLM has been integrated with Tencent Light Union. Through the connection capabilities of Tencent Light Union, Chat GLM can also realize automatic interaction with multiple platforms such as IM system, financial system, OA system, etc., so that it can play a huge role in multiple scenarios. In this embodiment, Zhipu Qingyan can be connected with the vector database and the existing single-lamp control system to work together. S7: The large model calls the rule engine or optimization algorithm through the main controller to optimize the single-lamp control agent, including: S70: Use regular expression matching to extract the lamp pole number and dimming value in the instruction information;

[0099] S71: If the extraction is successful, verify the data type of the dimming value through a verification function;

[0100] It should be noted that a rule engine is a software system that is used to define, manage, and execute changeable business rules. In complex business logic, the rule engine can decouple business rules from program code, allowing non-technical personnel such as business analysts to independently manage and update these rules. The basic principle of the rule engine is to derive conclusions or perform corresponding actions by matching input data (facts) with predefined rules (rules). The main advantage of using a rule engine is that it can provide fast business iteration, support visual configuration, and has the ability to hot update. This means that changes in business rules can be quickly reflected in system behavior without tedious code modifications and redeployment.

[0101] There are many rule engines in the prior art. In this embodiment, any existing rule engine can be used. For example, Drools is based on Charles Forgy's RETE algorithm, which has the characteristics of easy access to enterprise policies, easy adjustment and easy management. Drools frees business rules from hard coding and stores them in files or databases in the form of rule scripts, which facilitates the change and management of business rules. It is widely used in enterprise-level business rule management and decision support systems. It is powerful and supports complex business rule expression and reasoning; it is easy to integrate with Java applications and is suitable for enterprise-level application development;

[0102] Aviator is a high-performance, lightweight scripting language designed for the Java platform. It supports basic types such as numbers, strings, regular expressions, Boolean values, and can use all Java operators for operations. Aviator also provides built-in bigint and decimal types for processing very large integers and high-precision operations, and is suitable for a variety of scenarios such as rule judgment, formula calculation, and dynamic script control. The syntax is concise and easy to learn and use; it has excellent performance and supports ASM mode to directly translate scripts into JVM bytecode; it has strong scalability and can easily call Java methods and libraries.

[0103] QLExpress is a lightweight rule engine that supports weakly typed scripting languages. It has the characteristics of thread safety, efficient execution, and security control. The script compilation process of QLExpress can be cached on the local machine, which improves execution efficiency; it supports complex business logic judgments and expression calculations, and the compilation process is lightweight and flexible; thread safety is guaranteed by threadLocal at runtime; script compilation results can be cached to improve execution efficiency.

[0104] EasyRules is a simple and powerful Java rule engine that provides a lightweight framework and an easy-to-learn API. It is based on POJO development and annotated programming models, supports the ability to create combined rules from simple rules, and is suitable for application scenarios that require simple rule management and execution. It is easy to learn and use; supports combined rules and expression languages; and the annotation-based programming model reduces the difficulty of development.

[0105] URule is a full-featured rule engine that implements rule management through interface configuration. It may support rule definition and execution in a variety of business scenarios, provides flexible configuration options and powerful rule management capabilities, and is suitable for application scenarios that require complex rule management and configuration. It is comprehensive and supports complex rule configuration and management; it has a user-friendly interface, is easy to operate and maintain; and is highly flexible and adaptable to the needs of different business scenarios. It should be noted that S70: Use regular expression matching to extract the pole number and dimming value in the instruction information; the extraction method generally uses regular expression matching. Here, Python's re module is used to extract the pole number and dimming value.

[0106] It should be noted that after successful extraction, the dimming value must be a numeric type and cannot contain characters, and the data must be between 0 and 100. Define a verification function and pass the dimming value in the command information to the verification function for verification.

[0107] S8: The large model transmits the command information to the main controller, and the main controller transmits the command information to the single lamp control system;

[0108] S9: The single lamp control system executes the command information and feeds back the result to the user through the client.

[0109] It should be noted that S9: the single-lamp control system executes the instruction information and feeds back the result to the user through the client, including: S91: the single-lamp control system executes the instruction information; feeds back the execution result to the main controller; S92: the main controller feeds back the execution result to the user through the client and clears the session.

[0110] S72: If the extraction is unsuccessful, locate the missing content, generate supplementary information, the large model feeds the supplementary information back to the main controller, the main controller returns the supplementary information to the user through the client, and the user inputs questions to the main controller through the client, and the client generates a session and subsequent steps are executed;

[0111] The extraction is unsuccessful, including: the command information does not include the lamp pole number, and\or the command information does not include the dimming value; among them, if the command information does not include the lamp pole number, the large model will feed back the supplementary information to the main controller, and the main controller will return the information that needs to be supplemented with the lamp pole number to the user through the client; if the command information does not include the dimming value, the large model will generate a dimming suggestion value through the environmental state, and feed back the supplementary information of the dimming suggestion value to the main controller, and the main controller will return it to the user through the client, and update the command information after the user confirms; if the command information does not include the lamp pole number and dimming value, the large model will feed back the supplementary information to the main controller, and the main controller will return the information that needs to be supplemented with the lamp pole number and dimming value to the user through the client;

[0112] It should be noted that there are two situations for the instruction information generated by the large model. In one situation, the information entered by the user can generate the instruction information, and the instruction information is directly generated. The instruction information is as follows: Final Answer: {"code":"201","dimmingValue":100}; In the other situation, the information entered by the user is not enough to generate the instruction information, and the user needs to provide further supplementary information. The returned information example is as follows:

[0113] Thought: The user's input question includes the pole number, but does not mention the dimming value. The current time is 12 noon, the weather is sunny, and there is plenty of light. Normally, a higher dimming value is not required.

[0114] Action: Please provide the dimming value (0-100) of lamp pole number 201. The recommended range is 50-70.

[0115] In this case, the Action information needs to be fed back to the main controller, which sends it to the user side through the client. The user returns to step S1 again based on the first generated session. The vector database replaces the {context} variable and transmits it to the large model again. The {context} variable replacement example is:

[0116] Action: Please provide the dimming value (0-100) of lamp pole number 201. The recommended range is 50-70.

[0117] Observation: Dimming value 70.

[0118] It can be understood that the present invention provides a method for generating single-lamp control instructions based on a large model, including: the user inputs a question to the main controller through the client, the client generates a session, the main controller calls the large model, and uses the large model to realize intelligent semantic understanding. The main controller transmits the session to the vector database, the vector database searches for the corresponding intelligent agent information, and enhances the intelligent agent information according to the session and the single-lamp control system to generate a single-lamp control intelligent agent. The large model generates instruction information and optimizes and verifies it, which can automatically respond to diverse user needs; the efficient use of the vector database and the large model platform enables rapid response when facing a large number of users, and real-time processing of user instructions and feedback; through clear intelligent agent templates and dynamic generation methods, the user's interactive experience is improved, and the complexity and difficulty of operation are reduced; based on the existing architecture, it can be easily expanded to cope with more complex scenarios and needs, and has good maintainability and upgradeability; integrating multiple technologies and platforms greatly improves efficiency and cost-effectiveness.

[0119] Example 2

[0120] Based on the same inventive concept, the present invention also provides a single lamp control instruction generation device based on a large model, referring to Figure 6 , including: a processor 11 and a memory 12, the memory 12 is used to store computer program code, the computer program code includes computer instructions, when the processor 11 executes the computer instructions, the single lamp control instruction generation device based on the large model is used to perform the single lamp control instruction generation method based on the large model of any one of the method processes shown in the above method embodiments.

[0121] Specifically, Figure 6 As shown, the large model-based single-lamp control instruction generation device may include: at least one processor 11, a memory 12, a communication interface 13 and a communication bus 14.

[0122] The processor 11 is the control center of the single lamp control instruction generating device based on the large model, which can be a CPU, a microprocessing unit, or one or more integrated circuits for controlling the execution of the program of the embodiment of the present invention.

[0123] As an embodiment, the processor 11 may include one or more CPUs, such as Figure 6 Furthermore, as an embodiment, the single lamp control instruction generating device based on the large model may include multiple processors, such as Figure 6 The processor 11 and the processor 15 shown in FIG. Each of these processors can be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU).

[0124] The memory 12 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 12 may exist independently and be connected to the processor 11 via the communication bus 14. The memory 12 may also be integrated with the processor 11.

[0125] In a specific implementation, the memory 12 is used to store the data in the present invention and execute the software program of the present invention. The processor 11 can execute various functions of the single lamp control instruction generation device based on the large model by running or executing the software program stored in the memory 12 and calling the data stored in the memory 12.

[0126] The communication interface 13 uses any transceiver or other device for communicating with other devices or communication networks, such as radio access networks (RAN), wireless local area networks (WLAN), etc. The communication interface 13 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.

[0127] The communication bus 14 may include a pathway for transmitting information between the above-mentioned components.

[0128] It should be pointed out that Figure 6 The structure shown in the figure does not constitute a limitation on the single lamp control instruction generating device based on the large model, except Figure 6 In addition to the components shown, the large model-based single-lamp control instruction generating device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0129] It can be seen from the above embodiments that the method and device for generating a single lamp control instruction based on a large model provided by the present invention at least achieve the following beneficial effects:

[0130] The present invention provides a method for generating a single-lamp control instruction based on a large model, comprising: a user inputs a question to a main controller through a client, the client generates a session, the main controller calls the large model, and uses the large model to realize intelligent semantic understanding, the main controller transmits the session to a vector database, the vector database searches for corresponding intelligent agent information, and enhances the intelligent agent information according to the session and the single-lamp control system to generate a single-lamp control intelligent agent, the large model generates instruction information and performs optimization verification, and can automatically respond to diverse user needs; the efficient use of the vector database and the large model platform enables rapid response when facing a large number of users, and real-time processing of user instructions and feedback; through clear intelligent agent templates and dynamic generation methods, the interactive experience of users during use is improved, and the complexity and difficulty of operation are reduced; based on the existing architecture, it can be easily expanded to cope with more complex scenarios and needs, and has good maintainability and upgradeability; integrating multiple technologies and platforms, greatly improving efficiency and cost-effectiveness, the single-lamp control instruction generation device based on a large model provided by the present invention uses the single-lamp control instruction generation method based on a large model provided by the present invention can not only realize efficient and intelligent instruction generation and execution, but also improve the overall reliability of user experience.

[0131] Although some specific embodiments of the present invention have been described in detail through examples, those skilled in the art should understand that the above examples are only for illustration rather than for limiting the scope of the present invention.

[0132] It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A method for generating single lamp control instructions based on a large model, characterized in that: Includes steps: The user inputs a task command to the main controller through the client, and the client generates a session. The task command is a single lamp control command; The vector database stores the intelligent agent template, including: initializing the vector database client; creating a collection for storing the intelligent agent template; writing intelligent agent information into the collection to generate the intelligent agent template; the intelligent agent information includes: variable information and fixed information; the variable information includes: lamp pole number and dimming value; The main controller is connected to the vector database, and the client transmits the session to the vector database through the main controller; The vector database searches for the agent template whose similarity with the content of the conversation exceeds a first threshold, calls the corresponding agent information, and writes the content of the conversation into the variable information; The vector database performs enhancement processing on the agent information to generate a single-lamp control agent; the enhancement processing includes: obtaining the corresponding environmental state through the single-lamp control system according to the content of the conversation; aggregating the environmental state and the variable information using a string concatenation method; The vector database transmits the single-lamp control agent to the main controller, and the main controller transmits the single-lamp control agent to the large model, and the large model generates instruction information, and the large model is a language model based on a neural network; The large model optimizes the single lamp control agent by calling a rule engine or an optimization algorithm through the main controller, including: using regular expression matching to extract the lamp pole number and dimming value in the instruction information; if the extraction is successful, verifying the data type of the dimming value through a verification function; The large model transmits the command information to the main controller, and the main controller transmits the command information to the single lamp control system; The single lamp control system executes the instruction information and feeds back the result to the user through the client; If the extraction is unsuccessful, locate the missing content and generate supplementary information; the large model feeds back the supplementary information to the main controller, and the main controller returns the supplementary information to the user through the client, and the user inputs questions to the main controller through the client, and the client generates a session and the following steps are executed; The extraction is unsuccessful, including: the instruction information does not include the lamp pole number, and\or the instruction information does not include the dimming value; wherein, if the instruction information does not include the lamp pole number, the main controller will return the information that needs to be supplemented with the lamp pole number to the user through the client; if the instruction information does not include the dimming value, the main controller generates a dimming recommendation value through the environmental status, returns the dimming recommendation value to the user through the client, and updates the instruction information after the user confirms; if the instruction information does not include the lamp pole number and the dimming value, the main controller will return the information that needs to be supplemented with the lamp pole number and the dimming value to the user through the client.

2. The method for generating single lamp control instructions based on a large model according to claim 1, characterized in that: The single-lamp control system executes the instruction information and feeds back the result to the user through the client, including: the single-lamp control system executes the instruction information; feeds back the execution result to the main controller; the main controller feeds back the execution result to the user through the client and clears the session.

3. The method for generating single lamp control instructions based on a large model according to claim 1, characterized in that: The environmental status includes: current time, weather conditions, and sunrise and sunset times.

4. A single lamp control instruction generation device based on a large model, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the single-lamp control instruction generation device based on the large model executes the single-lamp control instruction generation method based on the large model as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Narrowband internet of things-based single lamp control method

    CN108551711A

  • Voice recognition system and method for single-lamp control

    CN110767227A

  • Single lamp control system

    CN218888737U

Cited By

  • Software definition method of programmable lighting controller

    CN120540741A