Heterogeneous object model conversion method and device based on large language model
Through the heterogeneous object model conversion method based on the large language model, the problem of inconsistent object model specifications on different IoT platforms is solved, the interconnection between devices is realized, and the accuracy and universality of object model conversion are improved.
Patent Information
- Application Number
- CN202411316863.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The inconsistent specifications of the object model of different IoT platforms have resulted in the inability to achieve interoperability and interconnection of the devices, and the existing object model conversion technology is difficult to deal with the complexity and differences between different devices.
Adopt the method of album model conversion method based on large language models, through the combination of device model parser, object model maper, model converter and LLM-Agent, to realize the transformation of the source model to the target material model, and perform the necessary. Check and test.
Realize the conversion between the heterogeneous model, enhance the semantic understanding of the material model, solve the complexity and universal problems of the model conversion, and ensure the accuracy and integrity of the conversion.
Smart Images

Figure CN119358534A_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a method and device for converting heterogeneous object models based on a large language model. Aiming at the problem that different IoT platforms cannot be interconnected due to inconsistent object model specifications, we propose a heterogeneous object model conversion framework based on a large language model. The framework uses the code understanding and generation capabilities of the large language model to convert the source object model into the target object model, and performs necessity checks to achieve conversion between heterogeneous object models. Technical Background
[0002] The object model is an abstract description method that aims to carefully define the properties of a device (such as color, size, etc.) and to describe in detail the functions or services provided by the device (such as lighting, cooling, etc.). The object model uses a unified language to describe, control, and understand the functions of the device, and is the basis for realizing the interconnection between IoT devices.
[0003] At present, all major IoT platforms have customized object model specifications. Due to the inconsistency of object model specifications on different platforms, the devices of different platform manufacturers cannot be interconnected. In order to solve the problems caused by the inconsistency of object model specifications, each platform hopes to build object model conversion capabilities so that customized object models can be interconnected with industry standard object models. At present, the difficulty of object model conversion technology lies in ensuring broad universality and the inability to handle the complexity and differences between different devices at the same time. This not only includes the correct abstraction of the functions of various devices, unified data format definition, and the realization of cross-platform interoperability, but also needs to support multiple languages and fast debugging while ensuring security. Summary of the invention
[0004] In order to overcome the shortcoming that the devices of various platform manufacturers cannot be interconnected due to the differences between object models and provide universal conversion, the present invention provides a heterogeneous object model conversion method and device based on a large language model.
[0005] The present invention utilizes the powerful code understanding and code generation capabilities of the large language model to solve the differences and complexity problems in the conversion process of different object models. Generally speaking, the heterogeneous object model conversion technology framework based on the large language model includes a device model parser, a object model mapper, a object model converter and an LLM-agent. The device model parser performs parsing based on the object model and profile file of the source device to obtain the object model type and core functional data of the source device. The object model mapper contains a model mapping dictionary between different object models, providing a macro conversion framework for the object model converter. The object model converter fills the macro conversion framework with data based on the core functional data of the device object model obtained by parsing, and performs a trusted conversion test on the converted target object model and profile file. Once the test is passed, the final heterogeneous object model conversion is completed. The LLM-agent mainly provides an interface that supports large language models to assist in completing various complex tasks.
[0006] (1) A heterogeneous object model conversion method based on a large language model includes the following steps: a device model parser is responsible for loading and parsing the object model file and profile file of the device to obtain the object model type of the device and the core function data of the device. The main steps are as follows:
[0007] Step (1.1): First, obtain the physical model file and profile file of the current device, and load them into the device model parser.
[0008] Step (1.2): LLM-agent uses the large language model to parse the device's physical model file and profile file to obtain the device's physical model type and core function data. At this point, the device model parser completes the parsing of the device's physical model and profile files.
[0009] (2) The physical model mapper plays a vital role in the physical model conversion process. By learning the relationship between different device physical models and fine-tuning the relevant model mapping rules, the model mapping dictionary between different physical models is obtained. The main steps are as follows:
[0010] Step (2.1): First, obtain the physical model files and profile files of different devices from different manufacturers and platforms, including the device's attributes, commands, events and other descriptive information, as the large model pre-training dataset.
[0011] Step (2.2): LLM-agent pre-trains the large language model based on the data set, and finds the intrinsic mapping relationship between different object models by learning the intrinsic connections between different object models.
[0012] Step (2.3): Fine-tune the pre-trained large model based on relevant model mapping rules to strengthen the mapping relationship logic between different object models.
[0013] Step (2.4): Based on the parsing result of the device model parser, the source device object model type is obtained, and combined with the object model type of the target device, a source device-target device model mapping dictionary is obtained, and provided to the object model converter.
[0014] (3) The physical model converter converts the physical model macro framework based on the model mapping dictionary, and converts the core functional data of the source device physical model in the device model parser into the core functional data of the target physical model, and fills it into the physical model and profile file of the target device. In order to ensure the correctness of the conversion, the converted target physical model file and profile file are converted and tested based on the large model. The main steps are as follows:
[0015] Step (3.1): The object model converter converts the framework of the source device object model file and profile file into the framework of the target device object model file and profile file based on the model mapping dictionary.
[0016] Step (3.2): LLM-agent extracts the core functional data of the source device object model file and profile file parsed by the model parser, and completes the filling of the core data of the source device-target device object model file and profile file based on the large language model.
[0017] Step (3.3): In order to ensure the credibility of the conversion, the conversion of the completed target device model file and profile file needs to be tested. LLM-agent uses the powerful code understanding and analysis capabilities of the large language model to test the syntax rules, core data conversion integrity and accuracy of the converted target device model file and profile file. If the expected detection requirements cannot be met, return to step 3.2 for re-conversion.
[0018] The second aspect of the present invention relates to a heterogeneous model conversion device based on a large language model, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement a heterogeneous model conversion method based on a large language model of the present invention.
[0019] A third aspect of the present invention relates to a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a heterogeneous object model conversion method based on a large language model of the present invention.
[0020] The working principle of the present invention is:
[0021] (1) The present invention utilizes large language model technology to parse and identify the structures of different object models to obtain the corresponding object model types and core function data.
[0022] (2) Construct corresponding semantic and grammatical mapping rules at the semantic and grammatical layers to realize the conversion between different object model structures and code languages, ensuring the semantic consistency and interoperability between different models.
[0023] (3) After completing the conversion of the basic object model framework, fill in the corresponding functional information and perform necessary conversion detection to ensure the accuracy and completeness of the conversion.
[0024] The advantages of the present invention are:
[0025] (1) The present invention adopts the large language model method to enhance the semantic understanding ability of the object model, and by utilizing the rich semantic knowledge of the large language model (LLM), it can more deeply process the conversion between object models and parse the functional data information in the object model.
[0026] (2) The present invention effectively solves the complexity and universality problems between physical model conversions based on the large language model method. It can automatically convert based on different physical model frameworks without setting complex and unified conversion rules, which facilitates improving the generalization ability of model conversion.
[0027] (3) The present invention adds a model conversion detection module to evaluate the accuracy and completeness of the model conversion based on the existing code evaluation large language model to ensure the completeness and accuracy of the converted object model. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a framework diagram of the method of the present invention.
[0029] Figure 2 It is a conversion flow chart of the present invention. DETAILED DESCRIPTION
[0030] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings.
[0031] Example 1
[0032] This embodiment relates to a method for interconnecting devices between Internet platforms based on a heterogeneous object model conversion method of a large language model, comprising the following steps:
[0033] Step 1: Implement the parsing function of the device model parser. Figure 2The device model parser in the present invention completes device parsing based on a large language model. The parsing is divided into two parts: (1) parsing the object model and profile file to obtain the corresponding device object model type. (2) parsing the object model and profile file to extract the core functional data of the device.
[0034] (1) First, the object model device files of different manufacturers' platforms are used as the data set for training the large language model. Then, the model is fine-tuned and learned through the specifications of the relevant object models. Finally, the large language model can be parsed to obtain the device's object model type through the device's object model and profile file.
[0035] (2) The large language model has powerful text understanding capabilities. Therefore, the large language model can extract core functional data from the device object model and the description information such as attributes, events, and services in the profile file by obtaining the object model type and corresponding format.
[0036] Step 2: Implement model mapping of the object model and obtain the model mapping dictionary. First, obtain the object model files and profile files of different devices from different manufacturers and platforms, including the device's attributes, commands, events and other description information, as the large model pre-training data set. Then LLM-agent pre-trains and fine-tunes the large language model based on the data set and related model mapping rules, and by learning the intrinsic connections between different object models, finds the intrinsic mapping relationship between different object models, and finally obtains the model mapping dictionary database of different source devices and target devices.
[0037] Step 3: Implement physical model conversion and conversion detection.
[0038] (1) Object model conversion is based on the model mapping dictionary and the parsed core functional data for code conversion. The model mapping dictionary provides a macro framework for object model conversion. The parsed core functional data is converted into target code based on the code of the large language model and filled into the target object model and profile file.
[0039] (2) Conversion detection is to ensure the credibility of physical model conversion. Based on the CodeFuseEval large language model, the physical model conversion file is comprehensively evaluated for syntax, functional correctness, and completeness.
[0040] (2.1) Syntax correctness detection: The CodeFuseEval large language model performs syntax detection based on the converted object model and profile file, and provides the syntax evaluation index α 1 .
[0041] (2.2) Functional correctness and integrity testing: The CodeFuseEval large language model performs functional correctness and integrity testing by comparing the source device model, profile file, and target file. Using the text understanding ability of the large language model, the code language meaning between the source file and the target file is compared to obtain the functional correctness index α 2 And the evaluation index of completion α 3 .
[0042] (2.3) Based on the grammar evaluation index α 1 Determine the correctness of the grammatical rules of the physical model and profile file. 1 If it is higher than 0.9, the syntax is considered correct and a credibility evaluation of 2.4 is performed. Otherwise, the physical model conversion step is repeated.
[0043] (2.4) Based on the functional completion and correctness evaluation indicators, the F1-score is obtained as the credibility of the physical model conversion, F1-score = 2 (α 2 +α 3 ) / α 2 ×α 3 If the credibility is higher than the preset threshold value K, it is considered that the physical model conversion is basically successful; otherwise, the physical model conversion step is repeated.
[0044] Step 4: Implement device conversion and use. For example, the present invention implements the device APP of a Huawei mobile phone to control the Xiaomi device light to switch on and off. When the Huawei mobile phone issues a control instruction, the physical model converter can convert the physical model of the Huawei device into the physical model structure of the Xiaomi device, and fill in the data information of the corresponding operation (such as attributes, commands, event lights), so that the physical model is compatible with the Xiaomi device, and the Huawei mobile phone device APP controls the switch of the Xiaomi light, completing the conversion between different heterogeneous physical model devices.
[0045] Example 2
[0046] The present embodiment relates to a heterogeneous model conversion device based on a large language model, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement a heterogeneous model conversion method based on a large language model of embodiment 1.
[0047] Example 3
[0048] This embodiment relates to a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a heterogeneous object model conversion method based on a large language model of embodiment 1 is implemented.
[0049] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A heterogeneous model conversion method based on a large language model, characterized by: The steps include: (1) The device model parser is responsible for loading and parsing the physical model file and profile file of the device to obtain the physical model type of the device and the core function data of the device; (2) The physical model mapper plays a vital role in the physical model conversion process. It obtains the model mapping dictionary between different physical models by learning the connections between different device physical models and fine-tuning the relevant model mapping rules. (3) The physical model converter converts the physical model macro framework based on the model mapping dictionary, and converts the core functional data of the source device physical model in the device model parser into the core functional data of the target physical model, and fills it into the physical model and profile file of the target device; in order to ensure the correctness of the conversion, the converted target physical model file and profile file are converted and tested based on the large model.
2. The method for converting heterogeneous models based on a large language model as claimed in claim 1, characterized in that: Step (1) specifically includes: Step (1.1): First, obtain the physical model file and profile file of the current device and load them into the device model parser; Step (1.2): LLM-agent uses the large language model to parse the device's physical model file and profile file to obtain the device's physical model type and core function data; at this point, the device model parser completes the parsing of the device's physical model and profile files.
3. The method for converting heterogeneous models based on a large language model as claimed in claim 1, characterized in that: Step (2) specifically includes: Step (2.1): First, obtain the physical model files and profile files of different devices from different manufacturers and platforms, including the description information of the device's attributes, commands, and events, as the large model pre-training dataset; Step (2.2): LLM-agent pre-trains the large language model based on the data set, and finds the intrinsic mapping relationship between different object models by learning the intrinsic connections between different object models; Step (2.3): Fine-tune the pre-trained large model based on relevant model mapping rules to strengthen the mapping relationship logic between different object models; Step (2.4): Based on the parsing result of the device model parser, the source device object model type is obtained, and combined with the object model type of the target device, a source device-target device model mapping dictionary is obtained, and provided to the object model converter.
4. The method for converting heterogeneous models based on a large language model as claimed in claim 1, characterized in that: Step (3) specifically includes: Step (3.1): The object model converter converts the framework of the source device object model file and the profile file into the framework of the target device object model file and the profile file based on the model mapping dictionary; Step (3.2): LLM-agent extracts the core functional data of the object model file and profile file of the source device parsed by the model parser, and completes the filling of the core data of the object model file and profile file of the source device-target device based on the large language model; Step (3.3): In order to ensure the credibility of the conversion, the conversion of the completed target device model file and profile file needs to be tested; LLM-agent uses the powerful code understanding and analysis capabilities of the large language model to test the grammatical rules, core data conversion integrity and accuracy of the converted target device model file and profile file; if the expected detection requirements cannot be met, return to step (3.2) for re-conversion.
5. A heterogeneous model conversion device based on a large language model, characterized in that: It comprises a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement a heterogeneous model conversion method based on a large language model as described in any one of claims 1-4.
6. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, a heterogeneous model conversion method based on a large language model as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Equipment operation management method and device, equipment and storage medium
CN114896751A
Data processing method and device based on object model and electronic equipment
CN116319892A
Heterogeneous binary data format conversion method and system based on model driving
CN116384332A
Smart-gateway adaptation system based on thing model, and operation method therefor
WO2023245985A1
Cited By
Equipment agent processing program conversion method and device based on cooperation of large model and small model
CN121578774A
LLM Compiler-Based Interoperation System and Method for Heterogeneous Manufacturing Equipment
KR103015680B1