Intelligent lighting-oriented heterogeneous large model output analysis and security control method

By receiving user commands and model outputs in an intelligent lighting system, extracting candidate control structure fragments, performing format hypothesis scoring and unit disambiguation, and generating deterministic repair decisions, this method solves the compatibility and security issues of open-source large language model outputs in intelligent lighting systems, and achieves auditable parameter conversion and security control.

CN123185745APending Publication Date: 2026-11-27ZHUHAI SHENGCHANG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611697364.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In intelligent lighting systems, non-standard or slightly corrupted control commands output by open-source large language models cannot be directly converted into target protocols, resulting in insufficient format compatibility and security risks. Existing technologies cannot effectively verify whether model values ​​conflict with user original text, device capabilities, or current state.

Method used

By receiving user instructions, model output, target protocol, device capabilities, and current state, the parsing context is frozen, candidate control structure fragments are extracted, multiple format hypothesis scoring is performed, normalization is achieved into a unified control intermediate representation, and unit disambiguation is performed in conjunction with user constraints and device capabilities. Deterministic repair and decision-making are then performed, generating three-level decisions: execute, clarify, or reject to ensure safety.

Benefits of technology

It achieves compatibility with multiple open-source model outputs without retraining the model, reduces the risk of misjudgment, ensures that syntax repair does not replace semantic verification, provides an auditable parameter conversion process, reduces the risk of old state write-back and concurrency control, and supports upgrades to new model formats and target schemas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185745A_ABST
    Figure CN123185745A_ABST
Patent Text Reader

Abstract

The application provides a heterogeneous large model output analysis and safety control method for intelligent lighting, which sets a deterministic analysis layer between a model and an executor, receives a user instruction U, a model original output R, a target protocol T, a device capability C, a current state S and a state version V0; performs candidate extraction, multi-format hypothesis scoring and adapter normalization on R to construct a unified control intermediate representation CIR with field sources and transformation tracks; performs unit and semantic disambiguation in combination with U, C, S and T; performs state completion only when the semantics is explicitly maintained and reviews V1=V0 before delivery; performs constraint checking and deterministic repair on CIR; and outputs three-level decisions of execute, clarify or reject. The application can be compatible with multiple heterogeneous outputs without retraining the model, avoids bypassing device safety constraints through syntax repair, reduces the risk of old state write-back, and realizes auditable parameter sources and transformation processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence and Internet of Things (IoT) device control technology, specifically to a heterogeneous large model output parsing and security control method for smart lighting. This method can convert heterogeneous, non-standard, or slightly damaged outputs generated by different large language models into smart lighting target control protocols, and combine user-generated semantics, device capabilities, and device status to implement constraint verification and security decisions. Background Technology

[0002] Smart lighting systems typically require control commands to conform to a fixed structure, such as `action` representing actions and `parameters` representing parameters like brightness, color temperature, or breathing frequency. However, open-source large language models, influenced by their training data, often output Home Assistant service calls, YAML, tool calls, field aliases, Markdown fences, or JSON with explanatory text. While such output may correctly convey the user's control intent, it may fail target schema tests due to formatting or field path discrepancies.

[0003] In existing technologies, prompt word constraints and retries rely on the model's own format compliance capabilities, resulting in insufficient stability and increased latency. General JSON repair can only fix syntax issues such as quotation marks and parentheses, and cannot determine whether a value represents a percentage, device level, Kelvin or miked, nor can it verify whether the model value conflicts with the user's original text, device capabilities, or current state. If the repaired structure is directly distributed, it may send syntactically parsable but semantically incorrect commands to the real device, posing a security risk.

[0004] Therefore, a deterministic parsing layer needs to be set up between the model and the actuator to ensure that format compatibility and security gating are completed in the same processing chain, and to form auditable evidence of the source and transformation of each parameter. Summary of the Invention

[0005] To address the aforementioned issues, the present invention aims to provide a heterogeneous large model output parsing and security control method for smart lighting. This method recovers candidate control objects from various fences, structural fragments, and trailing text without executing the code provided by the model. It maps Home Assistant, tool calls, generic JSON / YAML, and target protocols to a unified semantics. It eliminates ambiguity in units such as percentages, device levels, Kelvin, and miked by utilizing user original text and device capabilities. It only completes the state for explicit semantics such as "keep current value" and prevents old values ​​from being written back due to state changes during parsing. It distinguishes between cases that can be repaired and cases that require clarification or rejection, and avoids bypassing device security constraints due to format compatibility.

[0006] The present invention achieves the above objectives through the following technical solutions: A heterogeneous large-scale model output analysis and security control method for smart lighting includes: Step S1: Receive user instruction U, raw output R of large language model, target protocol T, device capability C, current state S and current state version V0, and freeze the current parsing context; Step S2: Perform candidate extraction on the original output R, extract one or more candidate control structure segments from the original output R, and retain the original segments and offset positions of each candidate segment; Step S3: For the same candidate, multiple format hypotheses are established in parallel. The hypotheses are scored based on at least one of explicit clues, syntactic validity, feature fields, target schema similarity and repair cost. The top N format hypotheses that reach the threshold are retained. Step S4: Normalize the retained format assumptions into a unified control intermediate representation (CIR) using an adapter; Step S5: Extract user constraints from user instruction U, and combine U, C, S and T to perform unit and semantic disambiguation on the model values ​​in CIR to obtain the standardized values ​​and units; Step S6: When the user instruction U contains explicit preservation semantics, perform state completion on the corresponding field based on the current state S and record V0; when it does not contain explicit preservation semantics, do not perform state completion. Step S7: Perform device capability constraints, parameter ranges, step sizes, mutual exclusion relationships, and target schema verification on the CIR. Perform deterministic repair only on repairs that have unique and verifiable results. Step S8: Generate a three-level decision of execute, clarify, or reject based on the verification and disambiguation results; under the execute decision, reread the current state version V1 before issuing, generate the target command K and send it to the smart lighting actuator only if V1 equals V0, otherwise output clarify or trigger re-parsing; and do not execute R as code.

[0007] According to the present invention, a heterogeneous large model output parsing and security control method for smart lighting is provided. In step S2, candidate extraction is performed on the original output R, including: Scan R and identify candidate control structure boundaries, which include at least one of the following: KVW structure, HomeAssistant JSON / YAML structure, tool call structure, generic JSON / YAML document structure, Markdown fence content, slightly corrupted JSON fragments, and trailing text; wherein, for tool call structures, only parse their arguments field without executing the tool call. Based on the identified candidate control structure boundaries, extract one or more candidate control structure segments from R, and retain the original segment and offset position in R for each candidate control structure segment; For slightly corrupted JSON fragments extracted from candidate control structures, only at least one of the following limited repairs is performed within the preset repair budget: missing quotes, trailing commas, fence stripping, and / or trailing text truncation. The repair cost, repairCost, is recorded, but numerical units, field semantics, or device control meanings are not repaired. Slightly corrupted JSON fragments include at least one of missing quotes, trailing commas, Markdown fence wrapping, and trailing explanatory text. The preset repair budget includes at least one of the following: maximum number of characters to repair, maximum number of repairs, maximum nesting depth, and parsing time limit.

[0008] According to the present invention, a heterogeneous large model output parsing and security control method for smart lighting is provided. When there are multiple candidate control structure fragments in R, each candidate control structure fragment is generated independently, and the contents of different Markdown fences or different candidate control structure fragments are not spliced ​​into a new control structure. When a candidate control structure fragment contains non-lighting control content, treat the non-lighting control content as text and do not execute it. The non-lighting control content contains at least one of shell_command, external URL, and script template. Furthermore, when no supported lighting structure exists in R, output a rejection decision or a NO_SUPPORTED_STRUCTURE reason code.

[0009] According to the present invention, a heterogeneous large model output parsing and security control method for smart lighting is provided. In step S3, multiple format interpretations are attempted in parallel for the same candidate control structure fragment. The format interpretations include at least two of the following: KVW structure, HomeAssistant JSON / YAML, tool call, general JSON / YAML, JSON / YAML extracted from Markdown fence, and pre-repaired slightly damaged JSON. For each format interpretation, calculate at least one of the following scoring factors: FormatEvidence represents the format evidence score for the format interpretation, determined based on at least one of explicit clues, syntactic validity, occurrence of feature fields, and similarity to the target schema; UserAgreement indicates the degree to which the control intent expressed by this format interpretation is consistent with the semantics of the user instruction U; CapabilityFit indicates the degree of matching between the parameters parsed by this format and the device capability C; StateAgreement indicates the degree of consistency between the parameters parsed by this format and the current state S; SchemaFit indicates the degree to which the structure parsed by this format adapts to the schema of the target protocol T; RepairCost represents the cost of repairing the format into a resolvable structure. ConflictPenalty represents the penalty for conflicts when inconsistent values ​​or conflicting actions occur in the same field. Calculate the overall score for each format interpretation using the following formula: Score=a×FormatEvidence + b×UserAgreement + c×CapabilityFit + d×StateAgreement + e×SchemaFit - r×RepairCost - x×ConflictPenalty; Among them, a, b, c, d, e, r, and x are preset weights, and UserAgreement and hard capability constraints have veto priority. That is, when a format interpretation violates the explicit user constraints or the hard capability constraints of the device, it will be directly eliminated regardless of its FormatEvidence score.

[0010] According to the present invention, a heterogeneous large model output parsing and security control method for smart lighting is provided. In step S4, the adapter unifies at least one intention among turn_on, set_brightness, and set_color_temp to set_light, unifies off or state:false to turn_off, and maps the field alias including frequency_hz to the target protocol field. The adapter is loaded via a controlled registry, which includes one or more entries. Each entry defines at least one of the following: format signature, action mapping, field alias, unit hint, and priority. When loading an adapter, the controlled registry verifies the adapter's format signature and / or version, and rejects adapters that are not registered, have mismatched signatures, or are incompatible with the version. After adapter normalization, the output is a unified control intermediate representation (CIR), instead of directly outputting the target protocol command; the CIR records at least the source format, source path, original value, canonical value, transformation process, and confidence level. When the same control intent corresponds to multiple adapters, the adapter is selected according to the priority in the registration item; when different adapters have inconsistent mapping results for the same field, the field conflict is marked in CIR and the subsequent three-level decision is entered, and one of the mapping results is not directly selected to generate the target command.

[0011] According to the heterogeneous large model output parsing and security control method for smart lighting provided by the present invention, in step S4, the CIR includes at least the following fields: intent, representing the unified control intent; target, representing the target entity or device; value / canonicalUnit, representing the canonical value and canonical unit; sourceFormat / sourcePath, representing the source format and source path; sourceKind, representing the source type; transform, representing the transformation process; confidence and warnings, representing the confidence level and alarms. When constructing a CIR, the candidate control structures after adapter normalization are grouped according to the target entity. Multiple service calls of the same entity or multiple field fragments of the same entity are merged into the same CIR entry. During merging, duplicate or consistent merging is performed on the same canonical values ​​of the same field, and different canonical values ​​of the same field are marked as field conflicts. For each field in the CIR, record the source format, source path, original value, canonical value, transformation process, and confidence level of that field; the transformation process includes at least one of the following: unit conversion, percentage to device level mapping, Kelvin to color temperature level mapping, miked to Kelvin conversion, step size alignment, range truncation, field alias mapping, and state completion; the source type includes at least one of the following: converted, state_completed, repaired, and inferred. When inconsistent values ​​appear in the same field, mark the field as conflicted, record the source of the conflict and the conflict value in the warnings, and mark the CIR as having an unresolved conflict.

[0012] According to the heterogeneous large model output parsing and security control method for smart lighting provided by the present invention, in step S5, actions, entities, explicit values, unit words and preservation semantics are extracted from U to form user constraints; preservation semantics include maintaining the current brightness, maintaining the current color temperature or equivalent explicit expressions; Instead of pre-binding unique units to model values ​​in CIR, multiple candidate unit interpretations are established based on field names, U, C, S, and T. Each candidate unit interpretation corresponds to a standard value and a standard unit. Each candidate unit interpretation is scored, and the scoring criteria include at least one of the following: consistency with explicit units or explicit values ​​in U, matching degree with field name, matching degree with device capability C, consistency with current state S, and adaptability to target protocol T. Select the candidate unit with the highest score as the normed value and normed unit; when the highest score does not reach the preset threshold, or the score difference between the two candidate unit explanations with the highest scores is less than the preset gap threshold, output the clarify decision or AMBIGUOUS_UNIT reason code, and do not forcibly select one of the candidate unit explanations to generate the target command. Brightness percentage is mapped to device class according to device capability range, satisfying the following formula: brightnessLevel = round(clamp(percent,0,100) × (Bmax - Bmin) / 100 +Bmin); Where percent is the brightness percentage, and Bmin and Bmax are the minimum and maximum values ​​of the device's brightness level, respectively; Color temperature is mapped to color temperature levels according to the device's color temperature range and warm / cool direction, satisfying the following formula: colorLevel=round((clamp(K,Kmin,Kmax)-Kmin)×(Cmax-Cmin) / (Kmax-Kmin)+Cmin); Where K is the Kelvin color temperature value, Kmin and Kmax are the minimum and maximum Kelvin color temperatures supported by the device, respectively, and Cmin and Cmax are the minimum and maximum color temperature levels of the device, respectively; when the device defines warmIsLow=false, the reverse mapping is used.

[0013] According to the heterogeneous large model output parsing and security control method for smart lighting provided by the present invention, in step S6, it is determined whether the user instruction U contains explicit preservation semantics, which includes preserving the current brightness, preserving the current color temperature or equivalent explicit expressions; Status completion is performed on the corresponding missing fields in the CIR only when there is explicit preservation semantics in U; When performing state completion, the current value of the corresponding field is read from the current state S and the current value is completed in the corresponding field in CIR. At the same time, the source type of the completed field is recorded as state_completed in CIR, and the current state version V0 on which the completion is based is also recorded. Before generating the execute decision and preparing to issue the target command K, reread the current state version V1 of the smart lighting actuator; Compare V1 and V0: If V1 equals V0, then the target command K can be issued; if V1 does not equal V0, then the issuance of the target command K is stopped, and the state change reason code is output, or a re-parsing is triggered. When V1 is not equal to V0, the old state value read in the state completion field under V0 is not written back to the target command K to avoid the old value being written back due to state changes during parsing.

[0014] According to the present invention, a heterogeneous large model output parsing and security control method for smart lighting is provided. In step S7, the deterministic repair includes range truncation limited by device capabilities, step size alignment, controlled field alias mapping, and sequential correction of the minimum and maximum values ​​of the breathing effect when semantically unique. For situations that cannot be automatically repaired, automatic repair will not be performed, missing parameters will not be guessed, and default values ​​or current state values ​​will not be used to replace parameters explicitly requested by the user. Situations that cannot be automatically repaired include: multiple action conflicts; conflicts between model values ​​and user-explicit values; omission of user-explicitly requested fields; and actions not supported by the device. When a situation that cannot be automatically repaired is determined, the corresponding reason code is output according to the type of the situation; Based on the verification results and reason codes, the decision will be guided to execute, clarify, or reject: If there are no unrepairable situations and no repair is needed or the repair is successful, the execute decision will be allowed; if there are missing key parameters, field conflicts, or close candidates, the clarify decision will be output; if there is no supported structure, the action is unsupported, or the unrepairable hard constraint is violated, the reject decision will be output.

[0015] According to the heterogeneous large model output parsing and security control method for smart lighting provided by the present invention, in step S8, a three-level decision of execute, clarify, or reject is generated, including: The conditions for executing the decision include: the target schema is valid, the action is supported by the device capabilities, the user constraints are consistent, there are no unresolved conflicts, and V0=V1; Clarify decision conditions include missing key parameters, close unit candidates, field conflicts, or changes in status versions. The conditions for a reject decision include: the absence of a supported structure, the action not being supported by the device's capabilities, and a violation of an unrepairable hard constraint.

[0016] Therefore, compared with existing technologies, the heterogeneous large model output analysis and security control method and system for intelligent lighting proposed in this invention have the following beneficial effects: 1. This invention can be compatible with common outputs of multiple open-source models without retraining the model, reducing misjudgments caused solely by different expression formats.

[0017] 2. This invention uses joint verification of U, R, C, S and T to ensure that syntax repair cannot replace semantic and device security verification.

[0018] 3. This invention makes the original path, unit conversion, status completion, and repair process of each parameter auditable through CIR and field source records.

[0019] 4. This invention reduces the risks of writing back to old states and concurrency control by explicitly maintaining semantic and state version verification.

[0020] 5. This invention avoids guessing about key missing or conflicting parameters by using the three-state decision-making of execute, clarify, and reject.

[0021] 6. This invention decouples the target protocol projection from the adapter, making it easier to add new model formats or upgrade the target schema.

[0022] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0023] Figure 1 This is a flowchart of an embodiment of a heterogeneous large model output analysis and security control method for intelligent lighting according to the present invention.

[0024] Figure 2 This is a schematic diagram of the overall system processing link in an embodiment of the heterogeneous large model output parsing and security control method for intelligent lighting according to the present invention.

[0025] Figure 3 This is a flowchart of the main processing steps of the parsing layer in an embodiment of a heterogeneous large model output parsing and security control method for intelligent lighting according to the present invention.

[0026] Figure 4 This is a flowchart of state completion and state version security gating in an embodiment of a heterogeneous large model output parsing and security control system for intelligent lighting according to the present invention.

[0027] Figure 5 This is a schematic diagram of the isolation architecture of heterogeneous format projected onto the target protocol via CIR in an embodiment of a heterogeneous large model output parsing and security control system for intelligent lighting according to the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0030] An Example of a Heterogeneous Large Model Output Resolution and Security Control Method for Smart Lighting See Figure 1 This embodiment provides a heterogeneous large model output parsing and security control method for smart lighting, including: Step S1: Receive user instruction U, raw output R of large language model, target protocol T, device capability C, current state S and current state version V0, and freeze the current parsing context; Step S2: Perform candidate extraction on the original output R, extract one or more candidate control structure segments from the original output R, and retain the original segments and offset positions of each candidate segment; Step S3: For the same candidate, multiple format hypotheses are established in parallel. The hypotheses are scored based on at least one of explicit clues, syntactic validity, feature fields, target schema similarity and repair cost. The top N format hypotheses that reach the threshold are retained. Step S4: Normalize the retained format assumptions into a unified control intermediate representation (CIR) using an adapter; Step S5: Extract user constraints from user instruction U, and combine U, C, S and T to perform unit and semantic disambiguation on the model values ​​in CIR to obtain the standardized values ​​and units; Step S6: When the user instruction U contains explicit preservation semantics, perform state completion on the corresponding field based on the current state S and record V0; when it does not contain explicit preservation semantics, do not perform state completion. Step S7: Perform device capability constraints, parameter ranges, step sizes, mutual exclusion relationships, and target schema verification on the CIR. Perform deterministic repair only on repairs that have unique and verifiable results. Step S8: Generate a three-level decision of execute, clarify, or reject based on the verification and disambiguation results; under the execute decision, reread the current state version V1 before issuing, generate the target command K and send it to the smart lighting actuator only if V1 equals V0, otherwise output clarify or trigger re-parsing; and do not execute R as code.

[0031] In step S2, candidate extraction is performed on the original output R, including: Scan R and identify candidate control structure boundaries, which include at least one of the following: KVW structure, HomeAssistant JSON / YAML structure, tool call structure, generic JSON / YAML document structure, Markdown fence content, slightly corrupted JSON fragments, and trailing text; wherein, for tool call structures, only parse their arguments field without executing the tool call. Based on the identified candidate control structure boundaries, extract one or more candidate control structure segments from R, and retain the original segment and offset position in R for each candidate control structure segment; For slightly corrupted JSON fragments extracted from candidate control structures, only at least one of the following limited repairs is performed within the preset repair budget: missing quotes, trailing commas, fence stripping, and / or trailing text truncation. The repair cost, repairCost, is recorded, but numerical units, field semantics, or device control meanings are not repaired. Slightly corrupted JSON fragments include at least one of missing quotes, trailing commas, Markdown fence wrapping, and trailing explanatory text. The preset repair budget includes at least one of the following: maximum number of characters to repair, maximum number of repairs, maximum nesting depth, and parsing time limit.

[0032] When there are multiple candidate control structure fragments in R, each candidate control structure fragment is generated independently, and the contents of different Markdown fences or different candidate control structure fragments are not spliced ​​into a new control structure. When a candidate control structure fragment contains non-lighting control content, treat the non-lighting control content as text and do not execute it. The non-lighting control content contains at least one of shell_command, external URL, and script template. Furthermore, when no supported lighting structure exists in R, output a rejection decision or a NO_SUPPORTED_STRUCTURE reason code.

[0033] In step S3, multiple format interpretations are attempted in parallel for the same candidate control structure fragment. The format interpretations include at least two of the following: KVW structure, Home Assistant JSON / YAML, tool call, generic JSON / YAML, JSON / YAML extracted from Markdown fence, and pre-repaired slightly corrupted JSON. For each format interpretation, calculate at least one of the following scoring factors: FormatEvidence represents the format evidence score for the format interpretation, determined based on at least one of explicit clues, syntactic validity, occurrence of feature fields, and similarity to the target schema; UserAgreement indicates the degree to which the control intent expressed by this format interpretation is consistent with the semantics of the user instruction U; CapabilityFit indicates the degree of matching between the parameters parsed by this format and the device capability C; StateAgreement indicates the degree of consistency between the parameters parsed by this format and the current state S; SchemaFit indicates the degree to which the structure parsed by this format adapts to the schema of the target protocol T; RepairCost represents the cost of repairing the format into a resolvable structure. ConflictPenalty represents the penalty for conflicts when inconsistent values ​​or conflicting actions occur in the same field. Calculate the overall score for each format interpretation using the following formula: Score=a×FormatEvidence + b×UserAgreement + c×CapabilityFit + d×StateAgreement + e×SchemaFit - r×RepairCost - x×ConflictPenalty; Among them, a, b, c, d, e, r, and x are preset weights, and UserAgreement and hard capability constraints have veto priority. That is, when a format interpretation violates the explicit user constraint or the hard capability constraint of the device, it will be directly eliminated regardless of its FormatEvidence score. The format interpretations are sorted by their comprehensive scores. The format hypotheses that reach the preset threshold are retained, and the top N format hypotheses are taken as the input for the subsequent adapter normalization, where N is a preset positive integer. When the overall score of all format interpretations fails to reach the preset threshold, or the difference between the overall scores of the two highest-ranked format interpretations is less than the preset gap threshold, a clarification decision or an AMBIGUOUS_FORMAT reason code is output, instead of forcibly selecting one of the format interpretations to generate a control command. Among them, at least one of the weights a, b, c, d, e, r, x and the preset threshold and preset gap threshold is determined through offline calibration, and the UserAgreement and hard capability constraints must not be covered by the format score.

[0034] In step S4, the adapter unifies at least one intent among turn_on, set_brightness, and set_color_temp to set_light, unifies off or state:false to turn_off, and maps field aliases including frequency_hz to target protocol fields; The adapter is loaded via a controlled registry, which includes one or more entries. Each entry defines at least one of the following: format signature, action mapping, field alias, unit hint, and priority. When loading an adapter, the controlled registry verifies the adapter's format signature and / or version, and rejects adapters that are not registered, have mismatched signatures, or are incompatible with the version. After adapter normalization, the output is a unified control intermediate representation (CIR), instead of directly outputting the target protocol command; the CIR records at least the source format, source path, original value, canonical value, transformation process, and confidence level. When the same control intent corresponds to multiple adapters, the adapter is selected according to the priority in the registration item; when different adapters have inconsistent mapping results for the same field, the field conflict is marked in CIR and the subsequent three-level decision is entered, and one of the mapping results is not directly selected to generate the target command. When a new adapter is registered, the controlled registry forces the new adapter to undergo CIR construction, device capability verification, target schema verification, and status version gating. No new adapter can bypass at least one of the unified CIR, device capability verification, target schema, and status version gating. Record the adapter version and registry version in the audit log to make the adapter normalization process traceable.

[0035] In step S4, the CIR includes at least the following fields: intent, representing the unified control intent; target, representing the target entity or device; value / canonicalUnit, representing the canonical value and canonical unit; sourceFormat / sourcePath, representing the source format and source path; sourceKind, representing the source type; transform, representing the transformation process; confidence and warnings, representing confidence level and warnings. When constructing a CIR, the candidate control structures after adapter normalization are grouped according to the target entity. Multiple service calls of the same entity or multiple field fragments of the same entity are merged into the same CIR entry. During merging, duplicate or consistent merging is performed on the same canonical values ​​of the same field, and different canonical values ​​of the same field are marked as field conflicts. For each field in the CIR, record the source format, source path, original value, canonical value, transformation process, and confidence level of that field; the transformation process includes at least one of the following: unit conversion, percentage to device level mapping, Kelvin to color temperature level mapping, miked to Kelvin conversion, step size alignment, range truncation, field alias mapping, and state completion; the source type includes at least one of the following: converted, state_completed, repaired, and inferred. When inconsistent values ​​appear in the same field, a conflict is marked on the field, and the source of the conflict and the conflict value are recorded in the warnings. The CIR is marked as having an unresolved conflict. Subsequent steps S7 and S8 perform checksum three-level decision based on the conflict, and do not directly use one of the values ​​to generate the target command. As an isolation layer between heterogeneous input formats and target protocols, the CIR applies security rules uniformly to the CIR. Adding a new input format only requires registering an adapter, and changes to the target schema only require adjusting the projection and verification of the CIR onto the target protocol, without changing the security rules and field source evidence already recorded in the CIR. Output at least one of intent, target, value / canonicalUnit, sourceKind, transform, confidence, and warnings from the CIR to the audit log, making the original path, unit conversion, state completion, and repair process for each parameter auditable.

[0036] In step S5, actions, entities, explicit values, unit words, and preserved semantics are extracted from U to form user constraints; preserved semantics include preserving the current brightness, preserving the current color temperature, or equivalent explicit statements; Instead of pre-binding unique units to model values ​​in CIR, multiple candidate unit interpretations are established based on field names, U, C, S, and T. Each candidate unit interpretation corresponds to a standard value and a standard unit. Each candidate unit interpretation is scored, and the scoring criteria include at least one of the following: consistency with explicit units or explicit values ​​in U, matching degree with field name, matching degree with device capability C, consistency with current state S, and adaptability to target protocol T. Select the candidate unit with the highest score as the normed value and normed unit; when the highest score does not reach the preset threshold, or the score difference between the two candidate unit explanations with the highest scores is less than the preset gap threshold, output the clarify decision or AMBIGUOUS_UNIT reason code, and do not forcibly select one of the candidate unit explanations to generate the target command. Brightness percentage is mapped to device class according to device capability range, satisfying the following: brightnessLevel = round(clamp(percent,0,100) × (Bmax - Bmin) / 100 +Bmin); Where percent is the brightness percentage, and Bmin and Bmax are the minimum and maximum values ​​of the device's brightness level, respectively; Color temperature is mapped to color temperature levels according to the device's color temperature range and warm / cool direction, satisfying the following: colorLevel=round((clamp(K,Kmin,Kmax)-Kmin)×(Cmax-Cmin) / (Kmax - Kmin)+ Cmin); Where K is the Kelvin color temperature value, Kmin and Kmax are the minimum and maximum Kelvin color temperatures supported by the device, respectively, and Cmin and Cmax are the minimum and maximum color temperature levels of the device, respectively; when the device defines warmIsLow=false, reverse mapping is used; the results are aligned according to the device step size; The mired value is first converted to a Kelvin value using K = 1,000,000 / mired, and then the color temperature level is mapped. When U explicitly includes "4000Kelvin" and the device's Kelvin color temperature range is 2000 to 6500, the Kelvin interpretation is preferred; the miked interpretation is only used when the user does not provide a unit and the value falls within the device's miked range. Among them, UserAgreement and hard capability constraints must not be overridden by format scores, and the unit disambiguation results and the mapping formula used are recorded in the transform and confidence fields of CIR.

[0037] In step S6, it is determined whether the user instruction U contains explicit hold semantics. Explicit hold semantics include hold current brightness, hold current color temperature, or equivalent explicit statements. State completion is performed on the corresponding missing fields in CIR only when there is an explicit preservation semantic in U; ​​when there is no explicit preservation semantic in U, state completion is not performed on the corresponding fields, nor are the values ​​in the current state S used to replace parameters not explicitly requested by the user. When performing state completion, the current value of the corresponding field is read from the current state S and the current value is completed in the corresponding field in CIR. At the same time, the source type of the completed field is recorded as state_completed in CIR, and the current state version V0 on which the completion is based is also recorded. Before generating the execute decision and preparing to issue the target command K, reread the current state version V1 of the smart lighting actuator; Compare V1 and V0: If V1 equals V0, then the target command K can be issued; if V1 does not equal V0, then the issuance of the target command K is stopped, and the state change reason code is output, or a re-parsing is triggered; among which, the state change reason code includes DEVICE_STATE_CHANGED; When V1 is not equal to V0, the old state value read under V0 in the state completion field is not written back to the target command K to avoid the old value being written back due to state changes during parsing; Record at least one of the following in the audit log: the status completion field, the V0 on which the completion was based, the V1 that was reread before execution, the comparison result, and the final decision.

[0038] In step S7, the deterministic repair includes range truncation limited by device capabilities, step size alignment, controlled field alias mapping, and sequential correction of the minimum and maximum values ​​of the breathing effect when semantically unique; For situations that cannot be automatically repaired, automatic repair will not be performed, missing parameters will not be guessed, and default values ​​or current state values ​​will not be used to replace parameters explicitly requested by the user. Situations that cannot be automatically repaired include: multiple action conflicts; conflicts between model values ​​and user-explicit values; omission of user-explicitly requested fields; and actions not supported by the device. When a situation that cannot be automatically repaired is determined, the corresponding cause code is output according to the type of the situation. The cause code includes at least one of the following: AMBIGUOUS_ACTION, AMBIGUOUS_FORMAT, AMBIGUOUS_UNIT, FIELD_CONFLICT, MODEL_USER_CONFLICT, MISSING_REQUIRED_PARAMETER, MISSING_REQUIRED_CONTEXT, DEVICE_STATE_CHANGED, UNSUPPORTED_DEVICE_CAPABILITY, CONSTRAINT_VIOLATION, NO_SUPPORTED_STRUCTURE, and PARSER_RESOURCE_LIMIT. Based on the verification results and reason codes, the decision will be guided to execute, clarify, or reject: If there are no unrepairable situations and no repair is needed or the repair is successful, the execute decision will be allowed; if there are missing key parameters, field conflicts, or close candidates, the clarify decision will be output; if there is no supported structure, the action is unsupported, or the unrepairable hard constraint is violated, the reject decision will be output. Record at least one of the following in the audit log: the type of deterministic repair, the value before repair, the value after repair, the basis for repair, the cause code, and the final decision, so that the constraint repair process is traceable and cannot bypass the equipment safety constraints.

[0039] In step S8, a three-level decision is generated: execute, clarify, or reject, including: The conditions for executing the decision include: the target schema is valid, the action is supported by the device capabilities, the user constraints are consistent, there are no unresolved conflicts, and V0=V1; Clarify decision conditions include missing key parameters, close unit candidates, field conflicts, or changes in status versions. The conditions for a reject decision include: the absence of a supported structure, the action not being supported by the device's capabilities, and a violation of an unrepairable hard constraint.

[0040] Specifically, after completing constraint verification, deterministic repair, and state version review, a three-level decision-making process is conducted in a deterministic order prioritizing safety. First, determine whether the rejection decision condition is met. If any rejection decision condition is met, generate a rejection decision, refuse to generate the target command, and output the reason code corresponding to the rejection decision condition. The reason code includes at least one of NO_SUPPORTED_STRUCTURE, UNSUPPORTED_DEVICE_CAPABILITY, and CONSTRAINT_VIOLATION. If the reject decision condition is not met, then it is determined whether the clarify decision condition is met. If any clarify decision condition is met, then a clarify decision is generated, and the reason for the missing or conflicting result is returned. The parameters are not guessed, the default value or the current state value is not used to replace the parameters explicitly requested by the user, and the target command is not generated. If the clarify decision condition is not met, then determine whether the execute decision condition is met. If all execute decision conditions are met, then generate the execute decision, generate the target command K and send it to the intelligent lighting actuator. Before generating the execute decision, if the current state version V1 is not equal to V0, then even if all other execute decision conditions are met, the execute decision will not be generated. Instead, a clarify decision will be generated or a re-parse will be triggered, and the DEVICE_STATE_CHANGED reason code will be output. When the rejection decision condition, the clarify decision condition, and the execute decision condition are not met, a clarify decision or a rejection decision is generated, and the reason code corresponding to the unmet condition is output. The reason code includes at least one of MISSING_REQUIRED_PARAMETER, MISSING_REQUIRED_CONTEXT, AMBIGUOUS_ACTION, AMBIGUOUS_FORMAT, AMBIGUOUS_UNIT, FIELD_CONFLICT, MODEL_USER_CONFLICT, and PARSER_RESOURCE_LIMIT. Record at least one of the following in the audit log: final decision D, target command K, field source P, transformation trajectory L, and reason code E. Neither the reject decision nor the clarify decision will generate a target command to be issued to the smart lighting actuator.

[0041] In this embodiment, the method further includes generating an audit log, which includes at least one of the following: model identifier, prompt word version, user instruction, target schema version, device capability version, current status and version, original response summary, candidate offset, format score, adapter version, field source, unit transformation, repair trajectory, final decision, and cause code; and / or, the target protocol T includes a key-value KVW structure, JSON schema, function call structure, or device vendor protocol, and the device level and color temperature range are provided by the device capability C.

[0042] This embodiment also provides a heterogeneous large model output resolution and security control system for smart lighting, including: The system is configured to execute the following modules: candidate extraction module, format assumption module, adapter module, CIR construction module, semantic and unit disambiguation module, state completion module, constraint and schema verification module, three-level decision module, state version review module, and audit module.

[0043] In practical applications, such as Figure 2 As shown, this invention is logically positioned between the large language model and the intelligent lighting actuator, forming a deterministic parsing and security control layer. This parsing layer receives user commands U, the model's original output R, the target protocol T, device capabilities C, the current state S, and the current state version V0. U is used to extract explicit values, units, and preserve semantics; R is the model's original string; T specifies the target action and fields; C specifies the action's supported range, parameter upper and lower limits, step size, color temperature range, and warm / cool direction; S provides the current brightness and color temperature; and V0 is used for concurrent verification before execution. The processing results include a decision D, a target command K, field source P, transformation trajectory L, and a reason code E.

[0044] In this embodiment, the parsing layer can be deployed in a model gateway, smart lighting cloud service, edge gateway, or local controller. The original model output R is not executed as code.

[0045] like Figure 3 As shown, the main processing steps of the parsing layer include: S101: Receive and freeze the context. Record the request identifier, U, R digest, T version, C version, S and V0, and set the input length, number of candidates, nesting depth and parsing time limit.

[0046] S102: Candidate Extraction. Extract at least one of the following from R: KVW structure, Home Assistant JSON / YAML, tool call arguments, generic JSON / YAML document, Markdown fence content, slightly corrupted JSON fragments, and trailing text, preserving the original fragments and offset positions.

[0047] S103: Establish format hypotheses. For the same candidate, try multiple format interpretations in parallel, and retain the top N hypotheses that reach the threshold based on explicit clues, syntactic validity, feature fields, schema similarity, and repair cost.

[0048] S104: Adapter Normalization. Unify intents such as turn_on, set_brightness, and set_color_temp to set_light, unify off or state:false to turn_off, and map aliases such as frequency_hz to target fields.

[0049] S105: Construct CIR and merge multiple services of the same entity. Each field records the source format, source path, original value, canonical value, transformation, and confidence level; inconsistent values ​​in the same field are marked as conflicting.

[0050] S106: Extract user constraints and perform unit disambiguation. Establish multiple candidate unit interpretations for the model values, combining U, C, S, and T scores; output clarification if the highest score does not reach the threshold or the difference between the first two is too small.

[0051] S107: Complete the semantic execution state by explicitly maintaining it, and then perform range, step size, mutual exclusion relationship and target schema verification; only fixes where the execution result is unique and verifiable.

[0052] S108: Make a decision on execute, clarify, or reject; the execute command rereads V1 before being issued, and stops execution if V1 is not equal to V0.

[0053] like Figure 5As shown, CIR is used to isolate heterogeneous input formats and target protocols. Adding a new input format only requires registering an adapter; changes in the target schema only require adjusting the projection and verification of CIR onto the target protocol; security rules apply uniformly to CIR, regardless of the specific model or output format.

[0054] Examples of CIR fields are shown in Table 1: Table 1: CIR Fields

[0055] When constructing a CIR, multiple services for the same entity are merged; conflicts are marked when inconsistent values ​​appear in the same field; and the source format, source path, original value, canonical value, transformation process, and confidence level of each field are recorded.

[0056] Format compatibility is shown in Table 2: Table 2: Format Adaptation

[0057] The adapter is loaded through a controlled registry, and the registry entries define the format signature, action mapping, field aliases, unit hints and priorities; any new adapter cannot bypass the unified CIR, device capability verification, target schema and status version gating.

[0058] The parsing layer first extracts actions, entities, explicit values, unit words, and semantically preserved terms from U to form UserConstraint. Model values ​​are not pre-bound to unique units; instead, candidate interpretations are built based on the field name, U, and C. For example, with color_temp:4000, when U explicitly contains "4000Kelvin" and the device's Kelvin range is 2000 to 6500, the Kelvin interpretation is prioritized; the miked interpretation is only used when the user does not provide a unit and the value falls within the device's miked range.

[0059] like Figure 4 As shown, state completion only occurs when the user command contains explicit semantics such as "maintain current brightness," "maintain current color temperature," or equivalent meanings. The parsing layer reads the current value of the corresponding field from S and completes it into the CIR, recording the source type as state_completed, and recording the current state version V0 on which the completion was based. Before generating the execute decision and preparing to issue the target command K, the current state version V1 of the smart lighting actuator is read again. If V1 equals V0, the issuance is allowed; if V1 does not equal V0, the issuance of the target command K is stopped, and the DEVICE_STATE_CHANGED reason code is output, or a re-parsing is triggered. When V1 does not equal V0, the old state value read under V0 in the state completion field is not written back to the target command K.

[0060] The fixes include range truncation limited by device capabilities, step size alignment, controlled field alias mapping, and ordering correction of the minimum and maximum values ​​of the breathing effect when semantically unique. Automatic fixes are not possible for situations such as multiple action conflicts, conflicts between model values ​​and explicitly specified user values, omissions of explicitly requested user fields, and actions not supported by the target device.

[0061] The three-level decision-making process is shown in Table 3: Table 3: Three-Level Decision Making

[0062] Audit logs must include at least the model identifier, prompt word version, user instruction, target schema version, device capability version, current status and version, raw response summary, candidate offset, format score, adapter version, field source, unit transformation, repair trajectory, final decision, and cause code. Raw model output is not executed as code.

[0063] The user command is "Turn the living room light to 60%, maintaining the current color temperature." The current state is brightness=120, color_temperature=90, and V0=v17. The model output uses Home Assistant YAML, where brightness_pct=60, but the color temperature is not specified. The parsing layer identifies the turn_on service and maps 60% to 153 based on the device range of 0 to 255. Because the user explicitly requests maintaining the color temperature, it completes the value from S to 90 and records state_completed and V0=v17. When V1 remains v17 and the schema validation passes, the output is: {"action":"set_light","parameters":{"brightness":153,"color_temperature":90}}.

[0064] The user instruction is "Set color temperature to 4000 Kelvin, maintain current brightness". The model output uses color_temp:250. The parsing layer establishes device level, Kelvin, and mired candidates; 250mired is converted to 4000K, consistent with the user's original instruction, therefore mired is used for interpretation, and then mapped to levels 0 to 255 according to device 2000 to 6500K, resulting in approximately 113. The current brightness is only completed from S when the user explicitly maintains it.

[0065] The user explicitly requested a color temperature of 5000K, but the model output only included luminance. Although the output could be parsed and the action was supported by the device, the parsing layer detected MISSING_REQUIRED_PARAMETER, and instead of using the default color temperature or the current color temperature as a substitute, outputted "clarify" indicating the missing field.

[0066] The user requests to modify the brightness while maintaining the current color temperature. At the start of the parsing process, V0=v17, and the parsing layer completes the color temperature from S. Before the command is submitted, V1=v18 is read. The parsing layer outputs "clarify" or triggers a re-parsing, without issuing commands containing the old color temperature.

[0067] When a response contains both a broken JSON fragment and a complete YAML fence, the parsing layer generates and scores candidates separately, without concatenating the two fences into a new structure. Complete YAML scores higher due to explicit tags, valid syntax, and characteristic fields. If the response contains a shell command, an external URL, or a script template, the parsing layer treats it as text only, does not execute it, and outputs "reject" if no supported lighting structure exists.

[0068] The following data is used to demonstrate the feasibility of the solution and to verify the processing link. The accuracy of the protocol construction sample is not confused with that of the real model sample.

[0069] In the protocol consistency regression verification, 351 test representations were constructed according to preset semantic and format conversion rules. These representations included strict KVW, Markdown fences, tool calls, common field aliases, slightly corrupted JSON, HomeAssistant JSON, and Home Assistant YAML. Of these, 204 were directly parsable JSON instances, and 57 originally satisfied the target schema. After parsing, all 351 instances formed the expected target semantics. Seven negative security test cases were also set, covering mutually exclusive actions, missing states, unsupported actions, state version changes, unknown shell commands, illegal frequencies, and definitive parameter repair. All seven cases yielded the expected clarification, rejection, or controlled execution results.

[0070] In the sampling validation of real local model output, one original output was collected for each of the three models llama3.2:3b, phi3:mini, and qwen3.8-4b for six preset scenarios, totaling 18 outputs. Of the original outputs, two were directly parsable JSON, and zero directly satisfied the target schema. After parsing, 17 outputs were processed by the parsing layer and entered the execute stage, while one entered the clarify stage. All 17 outputs were precisely consistent with the preset target semantics. The above results are prototype validation results with a limited sample and are only used to illustrate the adaptability of this method to the listed heterogeneous outputs. They should not be considered as statistical conclusions regarding the overall accuracy of unknown models or actual deployments.

[0071] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0072] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A heterogeneous large-scale model output analysis and security control method for intelligent lighting, characterized in that, include: Step S1: Receive user instruction U, raw output R of large language model, target protocol T, device capability C, current state S and current state version V0, and freeze the current parsing context; Step S2: Perform candidate extraction on the original output R, extract one or more candidate control structure segments from the original output R, and retain the original segments and offset positions of each candidate segment; Step S3: For the same candidate, multiple format hypotheses are established in parallel. The hypotheses are scored based on at least one of explicit clues, syntactic validity, feature fields, target schema similarity and repair cost. The top N format hypotheses that reach the threshold are retained. Step S4: Normalize the retained format assumptions into a unified control intermediate representation (CIR) using an adapter; Step S5: Extract user constraints from user instruction U, and perform unit and semantic disambiguation on the model values ​​in CIR to obtain the standardized values ​​and units; Step S6: When the user instruction U contains explicit preserve semantics, perform state completion on the corresponding field based on the current state S and record V0; Step S7: Perform device capability constraints, parameter ranges, step sizes, mutual exclusion relationships, and target schema verification on the CIR. Perform deterministic repair only on repairs that have unique and verifiable results. Step S8: Generate a three-level decision of execute, clarify, or reject based on the verification and disambiguation results; under the execute decision, reread the current state version V1 before issuing, and generate the target command K and send it to the smart lighting actuator only when V1 equals V0.

2. The method according to claim 1, characterized in that, In step S2, candidate extraction is performed on the original output R, including: Scan R and identify candidate control structure boundaries, which include at least one of the following: target key-value control structure, HomeAssistant JSON / YAML structure, tool call structure, general JSON / YAML document structure, Markdown fence content, slightly corrupted JSON fragments, and trailing text; wherein, for tool call structures, only parse their arguments field without executing the tool call; Based on the identified candidate control structure boundaries, extract one or more candidate control structure segments from R, and retain the original segment and offset position in R for each candidate control structure segment; For slightly corrupted JSON fragments in the extracted candidate control structure, only at least one limited repair is performed within the preset repair budget, including missing quotes, trailing commas, fence stripping, and / or trailing text truncation. The repair cost, repairCost, is recorded, but numerical units, field semantics, or device control meanings are not repaired. Slightly corrupted JSON fragments include at least one of missing quotes, trailing commas, Markdown fence wrapping, and trailing explanatory text. The preset repair budget includes at least one of the following: maximum number of characters to repair, maximum number of repairs, maximum nesting depth, and parsing time limit.

3. The method according to claim 2, characterized in that: When there are multiple candidate control structure fragments in R, each candidate control structure fragment is generated independently, and the contents of different Markdown fences or different candidate control structure fragments are not spliced ​​into a new control structure. When a candidate control structure fragment contains non-lighting control content, treat the non-lighting control content as text and do not execute it. The non-lighting control content contains at least one of shell_command, external URL, and script template. Furthermore, when no supported lighting structure exists in R, output a rejection decision or a NO_SUPPORTED_STRUCTURE reason code.

4. The method according to claim 1, characterized in that: In step S3, multiple format interpretations are attempted in parallel for the same candidate control structure fragment. The format interpretations include at least two of the following: KVW structure, Home Assistant JSON / YAML, tool call, generic JSON / YAML, JSON / YAML extracted from Markdown fence, and pre-repaired slightly corrupted JSON. For each format interpretation, calculate at least one of the following scoring factors: FormatEvidence represents the format evidence score for the format interpretation, determined based on at least one of explicit clues, syntactic validity, occurrence of feature fields, and similarity to the target schema; UserAgreement indicates the degree to which the control intent expressed by this format interpretation is consistent with the semantics of the user instruction U; CapabilityFit indicates the degree of matching between the parameters parsed by this format and the device capability C; StateAgreement indicates the degree of consistency between the parameters parsed by this format and the current state S; SchemaFit indicates the degree to which the structure parsed by this format adapts to the schema of the target protocol T; RepairCost represents the cost of repairing the format into a resolvable structure. ConflictPenalty represents the penalty for conflicts when inconsistent values ​​or conflicting actions occur in the same field. Calculate the overall score for each format interpretation using the following formula: Score=a×FormatEvidence+b×UserAgreement+c×CapabilityFit+ d×StateAgreement + e×SchemaFit - r×RepairCost - x×ConflictPenalty; Among them, a, b, c, d, e, r, and x are preset weights, and UserAgreement and hard capability constraints have veto priority. That is, when a format interpretation violates the explicit user constraints or the hard capability constraints of the device, it will be directly eliminated regardless of its FormatEvidence score.

5. The method according to claim 1, characterized in that: In step S4, the adapter unifies at least one intent among turn_on, set_brightness, and set_color_temp to set_light, unifies off or state:false to turn_off, and maps field aliases including frequency_hz to target protocol fields; The adapter is loaded via a controlled registry, which includes one or more entries, each defining at least one of the following: format signature, action mapping, field alias, unit hint, and priority. The controlled registry verifies the adapter's format signature and / or version when the adapter is loaded, and rejects adapters that are not registered, have mismatched signatures, or are incompatible with the version. After adapter normalization, the output is a unified control intermediate representation (CIR), instead of directly outputting the target protocol command; the CIR records at least the source format, source path, original value, canonical value, transformation process, and confidence level. When the same control intent corresponds to multiple adapters, the adapter is selected according to the priority in the registration item; When different adapters have inconsistent mapping results for the same field, the field conflict is marked in the CIR and the process proceeds to the subsequent three-level decision-making stage. Instead of directly selecting one of the mapping results to generate the target command, the conflict is not resolved.

6. The method according to claim 1, characterized in that: In step S4, the CIR includes at least the following field: intent, which indicates the unified control intent; target represents the target entity or device; value / canonicalUnit represents the canonical value and canonical unit; sourceFormat / sourcePath represents the source format and source path; sourceKind represents the source type; transform represents the transformation process; confidence and warnings represent confidence level and warnings. When constructing a CIR, the candidate control structures after adapter normalization are grouped according to the target entity. Multiple service calls of the same entity or multiple field fragments of the same entity are merged into the same CIR entry. During merging, duplicate or consistent merging is performed on the same canonical values ​​of the same field, and different canonical values ​​of the same field are marked as field conflicts. For each field in the CIR, record the source format, source path, original value, canonical value, transformation process, and confidence level of that field; the transformation process includes at least one of the following: unit conversion, percentage to device level mapping, Kelvin to color temperature level mapping, miked to Kelvin conversion, step size alignment, range truncation, field alias mapping, and state completion; the source type includes at least one of the following: converted, state_completed, repaired, and inferred. When inconsistent values ​​appear in the same field, mark the field as conflicted, record the source of the conflict and the conflict value in the warnings, and mark the CIR as having an unresolved conflict.

7. The method according to claim 1, characterized in that: In step S5, actions, entities, explicit values, unit words, and preserved semantics are extracted from U to form user constraints; preserved semantics include preserving the current brightness, preserving the current color temperature, or equivalent explicit statements; Instead of pre-binding unique units to model values ​​in CIR, multiple candidate unit interpretations are established based on field names, U, C, S, and T. Each candidate unit interpretation corresponds to a standard value and a standard unit. Each candidate unit interpretation is scored, and the scoring criteria include at least one of the following: consistency with explicit units or explicit values ​​in U, matching degree with field name, matching degree with device capability C, consistency with current state S, and adaptability to target protocol T. Select the candidate unit with the highest score as the normed value and normed unit; when the highest score does not reach the preset threshold, or the score difference between the two candidate unit explanations with the highest scores is less than the preset gap threshold, output the clarify decision or AMBIGUOUS_UNIT reason code, and do not forcibly select one of the candidate unit explanations to generate the target command. Brightness percentage is mapped to device class according to device capability range, satisfying the following formula: brightnessLevel = round(clamp(percent,0,100) × (Bmax - Bmin) / 100 +Bmin); Where percent is the brightness percentage, and Bmin and Bmax are the minimum and maximum values ​​of the device's brightness level, respectively; Color temperature is mapped to color temperature levels according to the device's color temperature range and warm / cool direction, satisfying the following formula: colorLevel=round((clamp(K,Kmin,Kmax)-Kmin)×(Cmax-Cmin) / (Kmax-Kmin)+Cmin); Where K is the Kelvin color temperature value, Kmin and Kmax are the minimum and maximum Kelvin color temperatures supported by the device, respectively, and Cmin and Cmax are the minimum and maximum color temperature levels of the device, respectively; when the device defines warmIsLow=false, inverse mapping is used.

8. The method according to claim 1, characterized in that: In step S6, it is determined whether the user instruction U contains explicit hold semantics. Explicit hold semantics include hold current brightness, hold current color temperature, or equivalent explicit statements. Status completion is performed on the corresponding missing fields in the CIR only when there is explicit preservation semantics in U; When performing state completion, the current value of the corresponding field is read from the current state S and the current value is completed in the corresponding field in CIR. At the same time, the source type of the completed field is recorded as state_completed in CIR, and the current state version V0 on which the completion is based is also recorded. Before generating the execute decision and preparing to issue the target command K, reread the current state version V1 of the smart lighting actuator; Compare V1 with V0: If V1 equals V0, then the target command K can be issued; If V1 is not equal to V0, stop issuing the target command K and output the state change reason code, or trigger re-parsing; When V1 is not equal to V0, the old state value read in the state completion field under V0 is not written back to the target command K to avoid the old value being written back due to state changes during parsing.

9. The method according to claim 1, characterized in that: In step S7, the deterministic repair includes range truncation limited by device capabilities, step size alignment, controlled field alias mapping, and sequential correction of the minimum and maximum values ​​of the breathing effect when semantically unique; For situations that cannot be automatically repaired, automatic repair will not be performed, missing parameters will not be guessed, and default values ​​or current state values ​​will not be used to replace parameters explicitly requested by the user. Situations that cannot be automatically repaired include: multiple action conflicts; conflicts between model values ​​and user-explicit values; omission of user-explicitly requested fields; and actions not supported by the device. When a situation that cannot be automatically repaired is determined, the corresponding reason code is output according to the type of the situation; Based on the verification results and reason codes, the decision will be guided to execute, clarify, or reject: If there are no unrepairable situations and no repair is needed or the repair is successful, the execute decision will be allowed; if there are missing key parameters, field conflicts, or close candidates, the clarify decision will be output; if there is no supported structure, the action is unsupported, or the unrepairable hard constraint is violated, the reject decision will be output.

10. The method according to claim 1, characterized in that, In step S8, a three-level decision is generated: execute, clarify, or reject, including: The conditions for executing the decision include: the target schema is valid, the action is supported by the device capabilities, the user constraints are consistent, there are no unresolved conflicts, and V0=V1; Clarify decision conditions include missing key parameters, close unit candidates, field conflicts, or status version changes. The conditions for a reject decision include: the absence of a supported structure, the action not being supported by the device's capabilities, and a violation of an unrepairable hard constraint.