Equipment control method and system and storage medium
By setting up the intelligent proxy layer and development adaptation layer in OpenHarmony, using large language models to analyze and convert user control instructions, the problems of low accuracy of instruction recognition between devices and low control efficiency are solved, and the accuracy and efficiency of the target device are achieved. control.
Patent Information
- Application Number
- CN202411413226.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the accuracy of command recognition and low control efficiency during equipment control operation or information transmission, resulting in poor coordination among equipment and low information transmission efficiency.
Set up an intelligent proxy layer within the application framework layer of OpenHarmony, and set up a development adaptation layer between the system service layer and the kernel layer. Use a large language model to analyze user control instructions, convert them into standard commands, and develop adaptation layer Convert it into device control instructions adapted to the communication protocol of the target device to achieve accurate control of the target device.
Through the accurate instruction identification of the intelligent proxy layer and the development of protocol conversion of the adapter layer, the accuracy and efficiency of device control are improved and efficient control of the target control device is achieved.
Smart Images

Figure CN118972430A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to an OpenHarmony-based device control method, system and storage medium. Background Art
[0002] With the development of electronic intelligence, users can remotely control devices through the Internet, and smart devices can also interconnect information through the Internet. However, in the current Internet of Things, due to the different operating logic and operating interfaces between devices, when remotely controlling the device or when obtaining information from another connected device, the steps of information transmission between devices are complicated, resulting in low command recognition accuracy and low information transmission efficiency.
[0003] Therefore, the methods in the prior art need to be further improved. Summary of the invention
[0004] In view of the deficiencies in the above-mentioned related technologies, the object of the present invention is to provide a device control method, system and storage medium based on OpenHarmony, so as to overcome the defects of low instruction recognition accuracy and low control efficiency during device control operations or information transmission in the prior art.
[0005] The technical solution adopted by the present invention to solve the technical problem is as follows: In a first aspect, this embodiment discloses a device control method based on OpenHarmony, wherein the OpenHarmony is provided with an intelligent proxy layer located in an application framework layer and a development adaptation layer provided between a system service layer and a kernel layer; a large language model module is provided in the intelligent proxy layer; The device control method comprises: The intelligent proxy layer obtains user control instructions, calls a large language model to analyze the user control instructions to obtain standard commands, and sends the standard commands to the development adaptation layer; The development adaptation layer receives the standard command, converts the standard command into a device control instruction compatible with the communication protocol of the target control device, and sends the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction.
[0006] Optionally, the step of the intelligent agent layer acquiring a user control instruction and calling a large language model to analyze the user control instruction to obtain a standard command includes: receiving a user control instruction, inputting the user control instruction into a large language model, and obtaining word information extracted from the user control instruction by the large language model; Determining semantic information corresponding to the user control instruction according to the extracted word information; The semantic information is mapped to a predefined operation set to obtain one or more operation instructions, and the one or more operation instructions are created into a standard command.
[0007] Optionally, the step of determining semantic information corresponding to the user control instruction according to the extracted word information includes: Obtaining semantic information corresponding to historical user control instructions and operating status information of the current target control device; The semantic information corresponding to the user control instruction is determined according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information.
[0008] Optionally, the step of determining the semantic information corresponding to the user control instruction according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information comprises: The semantic information corresponding to the historical user control instructions, the operating status information of the current target control device and the word information are synchronously input into the instruction prediction model to obtain the semantic information corresponding to the user control instructions output by the instruction prediction model; the instruction prediction model is obtained by training a preset network model based on the semantic information sample data corresponding to the historical control instructions and the status sample data corresponding to the operating status information of the target control device.
[0009] Optionally, the step of the development adaptation layer receiving the standard command and converting the standard command into a device control instruction adapted to a communication protocol of a target control device comprises: Parsing the received standard command to obtain command line parameters corresponding to the standard command, and decomposing the command line parameters into identifiable components; The standard command is subjected to protocol conversion according to the identifiable component, and the standard command is converted into a device control instruction adapted to the communication protocol of the target control device.
[0010] Optionally, before the step of developing the adaptation layer to receive the standard command, the method further includes: Automatically detect and identify newly connected target control devices; The driver of the target control device is loaded, and the target control device is controlled to run in OpenHarmony.
[0011] Optionally, after the step of sending the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction, the method further includes: The device control instruction is sent to the target control device through the device driver, and the command execution result fed back by the target control device is received.
[0012] Optionally, before the step of automatically detecting and identifying a newly connected target control device, the method further includes: Set up a unified operation interface corresponding to different types of devices.
[0013] In a second aspect, this embodiment discloses a device control system based on OpenHarmony, wherein the OpenHarmony is provided with an intelligent proxy layer located in the application framework layer and a development adaptation layer provided between the system service layer and the kernel layer; the intelligent proxy layer is provided with a large language model module; The intelligent proxy layer is used to obtain user control instructions, call the large language model to analyze the user control instructions to obtain standard commands, and send the standard commands to the development adaptation layer; The development adaptation layer is used to receive the standard command, convert the standard command into a device control instruction that is compatible with the communication protocol of the target control device, and send the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction.
[0014] In a third aspect, this embodiment discloses a computer storage medium, wherein an OpenHarmony-based device control program is stored on the computer-readable storage medium, and when the OpenHarmony-based device control program is executed by a processor, the steps of the OpenHarmony-based device control method are implemented.
[0015] Beneficial effects: The present embodiment discloses a device control method, system and storage medium based on OpenHarmony, by setting an intelligent proxy layer in the application framework layer of OpenHarmony and setting a development adaptation layer between the system service layer and the kernel layer; using the intelligent proxy layer to obtain user control instructions, calling a large language model to analyze the user control instructions to obtain standard commands, and sending the standard commands to the development adaptation layer; the development adaptation layer receives the standard commands, converts the standard commands into device control instructions that are compatible with the communication protocol of the target control device, and sends the device control instructions to the target control device, so that the target control device performs corresponding control operations according to the received device control instructions. The method and system disclosed in the present embodiment use the intelligent proxy layer to realize accurate recognition of received instructions, use the development adaptation layer to convert instructions and protocols, and then realize accurate control of the target control device, thereby improving control efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flowchart of the steps of the device control method based on OpenHarmony according to an embodiment of the present invention; Figure 2 It is a system architecture diagram of OpenHarmony in the prior art; Figure 3 It is a system architecture diagram of the equipment control system in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] With the improvement of device intelligence, the operation of information transmission and intelligent control between devices based on network connection is becoming more and more common, especially the control and management of multiple smart devices under the Internet of Things technology. However, current smart devices include multiple brands, and each smart device is often equipped with a dedicated protocol. Therefore, information exchange cannot be achieved between smart devices. Moreover, the voice control system contained in each smart device in the existing technology cannot accurately identify complex commands. Therefore, in the current smart device control process, there is a common problem of poor collaboration between devices and deviations in command understanding, resulting in low control efficiency.
[0019] In order to overcome the above problems in the prior art, the present invention discloses a device control method, system and storage medium based on OpenHarmony. OpenHarmony (Open Source Hongmeng) is an open source distributed operating system that can provide a unified software platform for various devices. Since the various functions and services of the system are divided into independent service units, the operating system can be made more flexible and efficient. Based on the structural characteristics of the OpenHarmony system, the present invention sets an intelligent proxy layer in OpenHarmony, adds a large model language model to the intelligent proxy layer, uses the large model language model to analyze the received user control instructions, and converts them to obtain standard instructions, and then uses the development adaptation layer to convert the standard instructions into control instructions corresponding to the target control device, so as to realize the control operation of the target control device. The method of this embodiment can not only analyze and obtain the semantic information corresponding to the user control instruction, but also determine the accurate instruction information according to the semantic information, realize the accurate identification of the instruction, and realize the forwarding of the control identification instruction protocol based on the development adaptation layer, thereby realizing the efficient execution of the instruction.
[0020] The following further describes an OpenHarmony-based device control method, system, and storage medium disclosed in this embodiment in conjunction with the accompanying drawings.
[0021] like Figure 1 As shown, this embodiment discloses a device control method based on OpenHarmony, and the device control method includes: Step S1, the intelligent agent layer obtains user control instructions, calls the large language model to analyze the user control instructions to obtain standard commands, and sends the standard commands to the development adaptation layer; wherein, the OpenHarmony is provided with an intelligent agent layer located in the application framework layer and a development adaptation layer located between the system service layer and the kernel layer; a large language model module is provided in the intelligent agent layer.
[0022] In this step, OpenHarmony (open source Hongmeng) adopts a layered hierarchical design, such as Figure 2 As shown, from bottom to top, they are the kernel layer, system service layer, application framework layer and application layer. This hierarchical design enables OpenHarmony to adapt to the needs of different devices, and in multi-device deployment scenarios, it can tailor or add corresponding subsystems or functions according to actual needs.
[0023] The application framework layer of OpenHarmony is used to provide multi-language support and rich API interfaces for applications installed on the system. In order to more accurately identify received user control instructions, the method of this embodiment adds an intelligent proxy layer in the application framework layer to accurately analyze received user control instructions.
[0024] Combination Figure 3 As shown, the intelligent proxy layer is set in the application framework layer. The intelligent proxy layer receives and analyzes the information input by the user, and analyzes the information input by the user in combination with the large language model, and then converts it into a control command for the target control device. The target control device can be a sensor or actuator, a mechanical device, a computer or a communication device.
[0025] Specifically, the steps of the intelligent agent layer obtaining a user control instruction and calling a large language model to analyze the user control instruction to obtain a standard command include: Step S11: receiving a user control instruction, inputting the user control instruction into a large language model, and obtaining word information extracted from the user control instruction by the large language model.
[0026] When OpenHarmony receives user control instructions, it inputs the user control instructions into the large language model, and analyzes the user control instructions through the large language model. Since the Large Language Model (LLM) is an artificial intelligence model built based on deep learning technology, it can use self-supervised learning methods to train massive data to achieve accurate analysis of input information. In one implementation, the large language model can be OpenAI's GPT-3 and GPT-4, Google's BARD, etc. Since the large language model can build natural language processing and achieve natural and fluent conversations with users, it can accurately obtain the word information corresponding to the user control instructions.
[0027] In specific implementation, the large language model can be run as an independent module in OpenHarmony, so that the large language model can be shared by multiple applications to maintain the modularity and flexibility of the system.
[0028] Step S12: Determine semantic information corresponding to the user control instruction based on the extracted word information.
[0029] The extracted word information is analyzed to obtain accurate semantic information. Specifically, in this step, the received historical user control instructions and the current operating state of the target control device can be comprehensively considered to achieve more accurate recognition of the semantic information.
[0030] Specifically, the step of determining semantic information corresponding to the user control instruction according to the extracted word information includes: Acquire semantic information corresponding to historical user control instructions and operating status information of the current target control device; determine the semantic information corresponding to the user control instruction according to the semantic information corresponding to the historical user control instructions, the operating status information of the current target control device and the word information.
[0031] When recognizing word information, if the context and historical control instructions issued by the user, including the previous control instruction, can be considered, and combined with the operating status information of the current target control device and the environmental status of the target control device, accurate analysis of the word information can be achieved to obtain the corresponding semantic information.
[0032] In one implementation, the step of determining the semantic information corresponding to the user control instruction based on the semantic information corresponding to the historical user control instruction, the operating status information of the current target control device and the word information includes: synchronously inputting the semantic information corresponding to the historical user control instruction, the operating status information of the current target control device and the word information into the instruction prediction model to obtain the semantic information corresponding to the user control instruction output by the instruction prediction model; the instruction prediction model is obtained by training a preset network model based on the semantic information sample data corresponding to the historical control instruction and the state sample data corresponding to the operating status information of the target control device. The preset network model is a machine learning prediction model, which can be a support vector machine (SVM), a neural network (such as LSTM) or a random forest or a decision tree, etc.
[0033] The trained instruction prediction model is used to analyze the input word information to obtain accurate semantic information. The instruction prediction model is obtained by deep learning based on the semantic information sample data corresponding to the historical control instructions and the operating status information of the target control device. The semantic information sample data corresponding to the historical control instructions is obtained by collecting a large amount of historical data. It can be randomly extracted from a large amount of collected historical data, or it can be generated based on a large amount of historical data using an adversarial network model to generate a large number of new data instances, or it can be directly obtained based on an existing sample library.
[0034] Step S13: Map the semantic information to a predefined operation set to obtain one or more operation instructions, and create the one or more operation instructions into a standard command.
[0035] The semantic information obtained in the above step S12 is mapped to a predefined operation set, which is a pre-saved set of operations corresponding to various standard instructions. Therefore, various operations contained in the semantic information can be mapped based on the predefined operation set. For example, if the semantic information contains the content of opening music, and the predefined operation set contains the operation of opening the music player, then the operation of "opening the music player and playing the first music on the program" can be mapped from the predefined operation set. If the semantic information contains multiple operation information, the operation instructions corresponding to the multiple operation information can be obtained based on the predefined operation set.
[0036] After mapping one or more operations in the predefined operation set, the corresponding standard instructions can be obtained based on the multiple operations. For example, when the operations of turning on the music player and playing the first music on the program list are mapped based on turning on the music, the standard commands corresponding to the above two operations can be obtained: the instruction to turn on the music player and the instruction to play the first music on the program list. Therefore, if multiple operations are obtained based on the semantic information mapping, multiple standard commands corresponding to the operations can be obtained.
[0037] Step S2: The development adaptation layer receives the standard command, converts the standard command into a device control instruction compatible with the communication protocol of the target control device, and sends the device control instruction to the target control device, so that the target control device performs a corresponding control operation according to the received device control instruction.
[0038] Combination Figure 3 As shown, the development adaptation layer is set between the system service layer and the kernel layer, and is used to provide a unified operation interface for different types of smart devices when they are connected to OpenHarmony, and convert the above-mentioned standard instructions into instructions that can be recognized by the target control device, and issue the converted instructions that can be recognized by the target control device through the device driver, and receive the execution status information of the target control device after receiving the instruction, and feedback the execution status information to OpenHarmony.
[0039] Specifically, the development adaptation layer receives the standard command, and the step of converting the standard command into a device control instruction adapted to the communication protocol of the target control device includes: Step S21: parse the received standard command to obtain command line parameters corresponding to the standard command, and decompose the command line parameters into identifiable components.
[0040] The adaptation layer is developed to receive the standard commands pushed by the intelligent proxy layer, and parse the standard commands to obtain command line parameters. Specifically, the command line parameters are the independent words or "tokens" divided into standard commands. These "tokens" can be commands, parameters, options, or redirection symbols, etc. In the specific implementation, the command line parameters obtained can be parsed using the command line parameter parsing library to obtain recognizable components. Specifically, the appropriate command line parameter parsing library is selected as needed in different programming languages and scenarios. For example: the command line parameter parsing library corresponding to the Java language is CommonsCLI, and the command line parameter parsing library corresponding to the C language is argp_parse.
[0041] Step S22: Perform protocol conversion on the standard command according to the identifiable component, and convert the standard command into a device control instruction compatible with the communication protocol of the target control device.
[0042] When the identifiable components have been obtained according to the standard commands in the above steps, the standard commands are converted into protocols according to the identifiable components, and then the standard commands are converted into control instructions matching the target control device, so that the target control device can smoothly execute the control instructions issued by the user.
[0043] In order to accurately transmit the converted device control instruction to the target control device, before the step of developing the adaptation layer to receive the standard command, the step further includes: Automatically detect and identify a newly connected target control device; load the driver of the target control device, and control the target control device to run in OpenHarmony.
[0044] Automatically detect the newly connected device, receive the registration information of the new device, complete the new device registration, and load the driver of the target control device to realize information transmission with the target control device.
[0045] Furthermore, after the step of sending the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction, the method further includes: The device control instruction is sent to the target control device through the device driver, and the command execution result fed back by the target control device is received.
[0046] When the communication connection with the target control device is established, the device driver will parse the received device control instructions and convert the device control instructions into device-specific control signals. After the device controller of the target control device receives the control signal sent by the device driver, it performs the corresponding operation.
[0047] Furthermore, before the step of automatically detecting and identifying the newly connected target control device, the method further includes: Set up a unified operation interface corresponding to different types of devices.
[0048] In order to establish communication connections with different types of devices for information exchange, the adaptation layer needs to provide a unified operation interface before automatically detecting and identifying the target control device. This unified operation interface is used to provide connections for different types of devices so that different types of devices can be connected to OpenHarmony to achieve control of different types of devices.
[0049] The method of the present invention is further explained below by taking the specific application of the method of this embodiment in the Internet of Things as an example.
[0050] The user issues a control instruction to a smart device in the Internet of Things to intelligently control the target control device connected to it. The smart device that receives the user's control instruction is a device with OpenHarmony, which is equipped with an intelligent proxy layer and a development adaptation layer.
[0051] When the user issues an operation instruction through the interactive interface of the OpenHarmony device, the OpenHarmony smart device receives the control instruction and sends the control instruction to the intelligent agent layer. The intelligent agent layer understands and analyzes the received control instruction to obtain the corresponding standard command. Its workflow mainly includes: analyzing the control instruction through a large language model, extracting the word information containing key information, and then through context management, considering the historical control instructions, the environmental status of the current target control device and the operating status of the current target control device, to obtain the analyzed semantic information, mapping multiple operations from the predefined operation set based on the semantic information, and then planning tasks based on the mapped multiple operations to obtain the operation sequence, and creating a standardized device control command based on the operation sequence. After the standardized device control command is created, the legality and security of the command are also checked, and when the standardized device control command meets the legality and security, the standardized device control command is sent to the device management service, and the execution result is received and user feedback is generated.
[0052] In OpenHarmony, a development adaptation layer is also set up, which enables different types of IoT devices to access the smart devices of OpenHarmony and respond to the control instructions transmitted by the smart proxy layer. The development adaptation layer is mainly used to provide a unified operation interface for different types of devices, convert system standard commands into specific device protocols and device discovery.
[0053] Specifically, when implementing device discovery, it is necessary to first automatically detect and identify newly connected devices for device registration, load the corresponding device driver to drive the device's system to adapt to OpenHarmony, map device-specific functions to standardized operation interfaces to implement interface mapping, parse control commands from the intelligent agent layer, and convert standard commands into device-specific protocols, and then send commands and receive results through the device driver.
[0054] The method disclosed in this embodiment receives and analyzes user control instructions through the intelligent proxy layer set up. When the control instructions issued by the user are continuously received, the large language model is used to analyze multiple rounds of dialogue, thereby improving the recognition rate of complex instructions in multiple rounds of dialogue, thereby improving the accuracy of instruction execution. In addition, if the user issues continuous control instructions, the intelligent proxy layer can also predict the control instructions that may be issued next, actively generate corresponding control instructions, and execute corresponding operations to improve the intelligence of device control.
[0055] This embodiment discloses a device control system based on OpenHarmony, such as Figure 3As shown, the OpenHarmony is provided with an intelligent proxy layer located in the application framework layer and a development adaptation layer located between the system service layer and the kernel layer; a large language model module is provided in the intelligent proxy layer.
[0056] The intelligent proxy layer is used to obtain user control instructions, call the large language model to analyze the user control instructions to obtain standard commands, and send the standard commands to the development adaptation layer.
[0057] The development adaptation layer is used to receive the standard command, convert the standard command into a device control instruction that is compatible with the communication protocol of the target control device, and send the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction.
[0058] The intelligent agent layer includes: an instruction parsing unit; the instruction parsing unit is used to receive user control instructions, input the user control instructions into a large language model, and obtain word information extracted by the large language model from the user control instructions; determine semantic information corresponding to the user control instructions based on the extracted word information; map the semantic information to a predefined operation set to obtain one or more operation instructions, and create the one or more operation instructions into a standard command.
[0059] Specifically, the step of determining the semantic information corresponding to the user control instruction according to the extracted word information includes: Obtaining semantic information corresponding to historical user control instructions and operating status information of the current target control device; The semantic information corresponding to the user control instruction is determined according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information.
[0060] Specifically, the step of determining the semantic information corresponding to the user control instruction according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information includes: The semantic information corresponding to the historical user control instructions, the operating status information of the current target control device and the word information are synchronously input into the instruction prediction model to obtain the semantic information corresponding to the user control instructions output by the instruction prediction model; the instruction prediction model is obtained by training a preset network model based on the semantic information sample data corresponding to the historical control instructions and the status sample data corresponding to the operating status information of the target control device.
[0061] The development adaptation layer includes: a command conversion unit, which is used to parse the received standard command, obtain command line parameters corresponding to the standard command, and decompose the command line parameters into identifiable components; perform protocol conversion on the standard command according to the identifiable components, and convert the standard command into a device control instruction that is compatible with the communication protocol of the target control device.
[0062] Furthermore, the development adaptation layer also includes: a device identification unit; the device identification unit is used to automatically detect and identify a newly connected target control device; load the driver of the target control device, and control the target control device to run in OpenHarmony.
[0063] Furthermore, after the step of sending the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction, the method further includes: The device control instruction is sent to the target control device through the device driver, and the command execution result fed back by the target control device is received.
[0064] Furthermore, the device identification unit is also used to set a unified operation interface corresponding to different types of devices.
[0065] This embodiment discloses a computer storage medium, wherein an OpenHarmony-based device control program is stored on the computer-readable storage medium. When the OpenHarmony-based device control program is executed by a processor, the steps of the OpenHarmony-based device control method are implemented.
[0066] The present embodiment discloses a device control method, system and storage medium based on OpenHarmony, by setting an intelligent proxy layer in the application framework layer of OpenHarmony and setting a development adaptation layer between the system service layer and the kernel layer; using the intelligent proxy layer to obtain user control instructions, calling a large language model to analyze the user control instructions to obtain standard commands, and sending the standard commands to the development adaptation layer; the development adaptation layer receives the standard commands, converts the standard commands into device control instructions that are compatible with the communication protocol of the target control device, and sends the device control instructions to the target control device, so that the target control device performs corresponding control operations according to the received device control instructions. The method and system disclosed in the present embodiment use the intelligent proxy layer to realize accurate recognition of received instructions, use the development adaptation layer to convert instructions and protocols, and then realize accurate control of the target control device, thereby improving control efficiency.
[0067] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0068] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A device control method based on OpenHarmony, characterized in that: The OpenHarmony is provided with an intelligent proxy layer located in the application framework layer and a development adaptation layer arranged between the system service layer and the kernel layer; the intelligent proxy layer is provided with a large language model module; The device control method comprises: The intelligent proxy layer obtains user control instructions, calls a large language model to analyze the user control instructions to obtain standard commands, and sends the standard commands to the development adaptation layer; The development adaptation layer receives the standard command, converts the standard command into a device control instruction compatible with the communication protocol of the target control device, and sends the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction.
2. The device control method based on OpenHarmony according to claim 1, characterized in that: The steps of the intelligent agent layer acquiring the user control instruction and calling the large language model to analyze the user control instruction to obtain the standard command include: receiving a user control instruction, inputting the user control instruction into a large language model, and obtaining word information extracted from the user control instruction by the large language model; Determining semantic information corresponding to the user control instruction according to the extracted word information; The semantic information is mapped to a predefined operation set to obtain one or more operation instructions, and the one or more operation instructions are created into a standard command.
3. The device control method based on OpenHarmony according to claim 2, characterized in that: The step of determining semantic information corresponding to the user control instruction according to the extracted word information comprises: Obtaining semantic information corresponding to historical user control instructions and operating status information of the current target control device; The semantic information corresponding to the user control instruction is determined according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information.
4. The device control method based on OpenHarmony according to claim 3, characterized in that: The step of determining the semantic information corresponding to the user control instruction according to the semantic information corresponding to the historical user control instruction, the operation state information of the current target control device and the word information comprises: The semantic information corresponding to the historical user control instructions, the operating status information of the current target control device and the word information are synchronously input into the instruction prediction model to obtain the semantic information corresponding to the user control instructions output by the instruction prediction model; the instruction prediction model is obtained by training a preset network model based on the semantic information sample data corresponding to the historical control instructions and the status sample data corresponding to the operating status information of the target control device.
5. The device control method based on OpenHarmony according to claim 1, characterized in that: The step of the development adaptation layer receiving the standard command and converting the standard command into a device control instruction adapted to the communication protocol of the target control device comprises: Parsing the received standard command to obtain command line parameters corresponding to the standard command, and decomposing the command line parameters into identifiable components; The standard command is subjected to protocol conversion according to the identifiable component, and the standard command is converted into a device control instruction adapted to the communication protocol of the target control device.
6. The device control method based on OpenHarmony according to claim 5, characterized in that: Before the step of developing the adaptation layer to receive the standard command, the method further includes: Automatically detect and identify newly connected target control devices; The driver of the target control device is loaded, and the target control device is controlled to run in OpenHarmony.
7. The device control method based on OpenHarmony according to claim 6, characterized in that: After the step of sending the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction, the method further includes: The device control instruction is sent to the target control device through the device driver, and the command execution result fed back by the target control device is received.
8. The device control method based on OpenHarmony according to claim 6, characterized in that: Before the step of automatically detecting and identifying the newly connected target control device, the method further includes: Set up a unified operation interface corresponding to different types of devices.
9. An OpenHarmony-based device control system, characterized in that: The OpenHarmony is provided with an intelligent proxy layer located in the application framework layer and a development adaptation layer arranged between the system service layer and the kernel layer; the intelligent proxy layer is provided with a large language model module; The intelligent proxy layer is used to obtain user control instructions, call the large language model to analyze the user control instructions to obtain standard commands, and send the standard commands to the development adaptation layer; The development adaptation layer is used to receive the standard command, convert the standard command into a device control instruction that is compatible with the communication protocol of the target control device, and send the device control instruction to the target control device so that the target control device performs a corresponding control operation according to the received device control instruction.
10. A computer storage medium, characterized in that: The computer-readable storage medium stores an OpenHarmony-based device control program, and when the OpenHarmony-based device control program is executed by the processor, the steps of the OpenHarmony-based device control method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Intelligent equipment control method and device, storage medium and electronic equipment
CN113921004A
Equipment control system, method and device, computer equipment and storage medium
CN116760872A
Smart home control system and method
CN116931441A
Driving architecture of Internet of Things equipment, control method and controller
CN117880252A
Adaptation method, system and equipment of electric power Internet of Things operating system and electric power system, and medium
CN118174449A
Cited By
Cross-platform smart home control method and device, equipment and storage medium
CN119644785A
