A method and system for updating device instructions for intelligent scientific experiments based on AI for Science

By recording device capability terms during the compilation process, establishing a reverse index, and verifying state consistency, the problems of excessive recompilation scope and interruption of state continuity caused by changes in device capabilities are solved, ensuring the stable execution of AI for Science experiments.

CN123113455APending Publication Date: 2026-11-17UESTC (SHENZHEN) ADVANCED RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611255609.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The existing technology lacks a reverse positioning mechanism and a replacement segment boundary state verification mechanism after the equipment capability terms are updated, resulting in an excessively large recompilation scope and interruption of the continuity of the physical experiment process.

Method used

By recording the device capability terms actually read by the device instructions during the compilation process, an inverse index is established to locate the affected instruction set, determine the reentrancy and continuation boundaries, recompile candidate fragments, and perform interface equivalence checks to ensure state consistency.

Benefits of technology

This enables precise location of affected instructions after changes in equipment capability terms, narrowing the scope of recompilation, reducing the risk of experimental process interruption, and maintaining the continuity of experimental plans and physical execution processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123113455A_ABST
    Figure CN123113455A_ABST
Patent Text Reader

Abstract

This invention relates to the fields of artificial intelligence-assisted scientific research, embodied science intelligence, and automated experimental control technology. It provides a method and system for updating instructions in AI for Science intelligent experimental facilities, addressing the problems of excessive recompilation scope and experimental process interruption caused by the lack of reverse location and boundary state verification mechanisms after clause updates. The method includes: recording the capability clauses for instruction reading during compilation and establishing a reverse index from clauses to instructions; locating affected instructions based on the index during clause updates; determining reentrancy and continuation boundaries based on their positions, and selecting instructions between the two boundaries as candidate segments; recompiling the candidate segments using the updated clauses; performing interface equivalence verification on the original segments and candidate segments, including four criteria: entry state, exit state, resource occupancy, and pending events; if successful, replacing and updating the reverse index with an atomic transaction; if unsuccessful, expanding the boundaries according to the failure type and recompiling for verification until successful or expanded to the complete process boundary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence-assisted scientific research, embodied science intelligence, and automated experimental control technology, specifically to a method for updating instructions for AI for Science intelligent experimental facilities. Background Technology

[0002] Embodied scientific intelligence refers to the technology that translates the operational intentions in an experimental protocol into physical actions that can be performed by physical devices such as pipettes, reaction vessels, heaters, robotic arms, and detectors, and continuously adjusts subsequent actions based on the status of the equipment, samples, and the environment. Automation of scientific knowledge refers to the process of organizing literature knowledge, historical experimental data, domain rules, and model reasoning results into machine-processable knowledge representations, and using these representations to form candidate experimental protocols, experimental parameters, or operational sequences.

[0003] AI for Science refers to the use of artificial intelligence methods to process literature, data, and domain knowledge in scientific research, assisting in the understanding of scientific problems, the generation of experimental protocols, and scientific discovery. In this application, the AI ​​for Science module is mainly supported by a large scientific model, outputting candidate experimental knowledge, parameter suggestions, or operational suggestions. Automation of scientific knowledge is a downstream step of AI for Science, used to integrate the output of the large model with domain rules, historical experimental records, etc., to form structured experimental knowledge that can be read and called by computers, including experimental operations, parameters, sequence, conditions, and expected states. The AI ​​for Science intelligent experimental facility refers to the hardware and software execution environment that receives the structured experimental knowledge, converts it into device instructions, and drives scientifically embodied intelligent devices to complete physical experiments, including an experimental protocol compilation layer and a device execution layer.

[0004] In actual operation, firmware upgrades, interface template adjustments, parameter range changes, device shutdowns, or changes in mutual exclusion rules can all cause some instructions in the original instruction sequence to become invalid. Changes in device capabilities do not only affect individual commands but may also disrupt the continuity of the experimental plan when mapped to the physical experimental process. Existing technologies typically employ either complete workflow recompilation or continuing planning from the point where an anomaly was detected. The former will repeatedly process unaffected instructions; the latter, if the status of samples, containers, equipment, and resources at the segment boundaries is not verified, may prevent the new segment from safely rejoining the original experimental flow.

[0005] Furthermore, ordinary execution logs typically only record which device a particular instruction invoked, and cannot trace back to all instructions referencing a specific capability clause from a specific capability clause; they also lack unified verification of the entry and exit states and resource usage of replacement fragments. As a result, the experimental intent generated by the upper-layer AI for Science may not be stably transmitted to the physical execution process of the lower-layer scientific embodied intelligent device after changes in device capabilities. Summary of the Invention

[0006] The purpose of this invention is to solve the technical problem of excessive recompilation scope and interruption of physical experiment process state caused by the lack of a reverse positioning mechanism from clause to instruction and a replacement fragment boundary state verification mechanism after the equipment capability clause is updated.

[0007] To achieve the above objectives, the present invention employs the following technical means:

[0008] This invention provides a method for updating instructions in AI for Science intelligent experimental facilities, comprising the following steps:

[0009] Step 1: During the process of compiling the structured experimental scheme into a sequence of device instructions, record the device capability clauses actually read by each device instruction during the compilation process, and establish a reverse index from device capability clauses to device instructions based on the recording results;

[0010] Step 2: Before the original device instruction sequence is sent to the device execution layer, when the device capability terms are updated, locate the set of affected instructions that reference the changed terms based on the reverse index;

[0011] Step 3: Based on the position of the affected instruction set in the original device instruction sequence, determine the reentrant boundary and the continuable boundary; the reentrant boundary is the position where, when executed according to the original device instruction sequence, the state formed by the preceding device instruction can be clearly represented by the instruction trace record, and there is no incomplete asynchronous operation crossing this position; the continuable boundary is the position where the state required by subsequent device instructions can be clearly represented by the state at the boundary; the continuous device instructions between the reentrant boundary and the continuable boundary are selected as candidate segments;

[0012] Step 4: Recompile the operation records corresponding to the candidate fragments using the updated device capability terms to generate candidate instruction fragments;

[0013] Step 5: Perform an interface equivalence check on the original fragment and the candidate instruction fragment. The interface equivalence check includes the following four determinations:

[0014] Can the state required for the candidate instruction fragment entry be provided by the original fragment entry? Can the state of the candidate instruction fragment exit meet the input conditions of the original subsequent device instruction? Does the candidate instruction fragment exit have any new resource occupation compared to the original fragment exit? Does the candidate instruction fragment exit have any new pending events compared to the original fragment exit?

[0015] Step 6: When all four criteria of the interface equivalence check pass, replace the original fragment with the candidate instruction fragment and update the reverse index using an atomic transaction. When any one of the four criteria of the interface equivalence check fails, determine the expansion direction based on the failure field type corresponding to the failed criteria, expand the boundary of the candidate fragment according to the expansion direction, return to step 4 to recompile, and return to step 5 to re-verify, until all four criteria pass or the expansion reaches the boundary of the complete experimental process.

[0016] In the above scheme, step 1 includes:

[0017] Step 1.1: Express the equipment capability clause as follows:

[0018] Terms record = <Term unique identifier, device identifier, capability identifier, terms type, constraint expression, command template, contract version number>;

[0019] The clause type includes at least parameter range, precondition, postcondition, resource usage, mutual exclusion conditions, and command template; the clause unique identifier remains unique across all device capability clauses;

[0020] Step 1.2: During compilation, the unique identifier of the clause actually read by the device instruction is written into the clause reference set field of the instruction trace record; the parameter source, conversion result, and template placeholder are written into the parameter binding field; the pre-compilation state is written into the input state field; the post-compilation state is written into the output state field; the increase or decrease of resource usage is written into the resource change amount field; and the creation or completion of asynchronous operations is written into the pending event change amount field. Device capability clauses that are not read are not written into the clause reference set field. The instruction trace record is represented as follows:

[0021] Trace log = <command identifier, operation identifier, term reference set, parameter binding, input status, output status, resource changes, pending event changes, compiler version>;

[0022] Step 1.3: Read the clause reference set field in the instruction trace record one by one. For each clause unique identifier in the clause reference set field, perform a write operation to add it to the set with the clause unique identifier as the key and the command identifier as the member, generating an inverted index Index[clause_id]→{command_id}, where clause_id represents the clause unique identifier and command_id represents the command identifier. When the same device capability clause is referenced by multiple device instructions, the index value of the inverted index is a set composed of multiple command identifiers. When a device instruction references multiple clauses, the command identifiers are written to multiple index entries respectively. Each index entry also stores the contract version number and compiler version used by the corresponding command identifier.

[0023] In the above scheme, step 2 includes:

[0024] Step 2.1: Using the device identifier and the clause unique identifier as the matching key, construct mapping tables for the device capability clause before the update and the device capability clause after the update, respectively. Compare the capability identifier, clause type, constraint expression, command template and contract version number item by item in the two mapping tables.

[0025] Clauses appearing only in the updated version are marked as new; clauses appearing only in the pre-update version are marked as deleted; clauses existing in both versions but differing in any of the following fields—capability identifier, clause type, constraint expression, command template, or contract version number—are marked as modified; the clause identifier, change type, old field value, and new field value are written to the difference record, and all difference records DiffItem form the change clause set ΔClause;

[0026] Step 2.2: For clauses marked as modified or deleted, query the reverse index using the clause unique identifier of the previous version to retrieve all command identifiers referencing clauses of the previous version; for clauses marked as added, the system searches for clauses with the same capability identifier in the previous version and queries the reverse index using the clause unique identifier of the old clause; for the queried command identifiers, use the new clause to reselect the command template. If the selection result is inconsistent with the command template used by the original device instruction, add the command identifier to the set of newly affected instructions AddedAffectedCmd;

[0027] Step 2.3: The set of affected instructions is determined by the following formula:

[0028] AffectedCmd=∪{Index[c]|c∈ΔClause_MD}∪AddedAffectedCmd.

[0029] Where ΔClause_MD is the set of clauses marked as modified or deleted in the set of changed clauses, Index[c] represents the set of device instructions corresponding to clause c in the reverse index, and AddedAffectedCmd represents the set of command identifiers obtained after reselecting the command template based on the added clauses;

[0030] Step 2.4: Using the command identifier obtained from the modification or deletion clause query, verify the clause reference set field in the instruction trace record, the contract version number in the inverted index, and the difference record DiffItem: If the contract version number recorded in the inverted index is equal to the version before the change, and the clause reference set field of the corresponding instruction trace record contains the clause unique identifier in DiffItem, then the corresponding device instruction is determined to be affected; otherwise, it is not included in the affected instruction set.

[0031] In the above scheme, step 3, determining the reentrant boundary and the continuable boundary, includes:

[0032] Step 3.1: Scan backward from each affected device instruction until the nearest reentrant boundary is found; the reentrant boundary satisfies the following conditions: when the original device instruction sequence is executed to this position, the sample position, container opening and closing state and related device state formed by the preceding device instructions can be clearly represented by the instruction tracking record, and there are no incomplete asynchronous operations or unreleased resource occupancy that cross this position;

[0033] Step 3.2: Scan backward from the same affected device instruction until the nearest connectable boundary is found; the connectable boundary satisfies the following condition: the sample state, container state, device state and resource state read by subsequent device instructions can all be clearly represented by the interface signature at the connectable boundary;

[0034] Step 3.3: Select consecutive device instructions between the reentrant boundary and the concatenable boundary as candidate segments; if multiple candidate segments overlap, or if the boundaries of multiple candidate segments share the same exclusive device, the same container, or the same incomplete event, then merge the multiple candidate segments into one candidate segment.

[0035] Step 3.4: The entry signature of the candidate segment is generated from the state after the reentrant boundary, and the exit signature of the candidate segment is generated from the state after the continuation boundary.

[0036] In the above scheme, step 4 includes:

[0037] Step 4.1: Use the sample state, container state, device state, and resource lock set in the candidate fragment entry signature as the unique available initial condition;

[0038] Step 4.2: Following the original operation identifier order, use the updated device capability terms to reselect the command template, bind parameters, convert execution units, and verify the prerequisite status and resource constraints;

[0039] Step 4.3: Output candidate instruction fragments and candidate instruction tracing records.

[0040] In the above scheme, step 5, interface equivalence verification, includes:

[0041] Step 5.1: The interface signature Sig for the fragment boundary is represented as:

[0042] Signature = <sample status, container status, device status, resource lock set, pending event set>;

[0043] The sample status indicates the sample's location, shape, and key process status; the container status indicates the container identifier, open / closed status, and load-bearing relationship; the device status indicates the device's current operating status; the resource lock set indicates the set of devices, ports, or tools whose fragment boundaries are still occupied; and the pending event set indicates the set of asynchronous events that have been issued but not yet completed.

[0044] Step 5.2: Set the original fragment entry signature as... The original fragment's export signature is The entry signature of the candidate instruction fragment is The candidate instruction fragment exit signature is The substitution is allowed if all four of the following conditions are met simultaneously:

[0045] EntryEqual

[0046] StateEqual

[0047] ExtraLock

[0048] ExtraPending

[0049] in, This indicates that the sample state, container state, device state, and resource state required for the candidate instruction fragment can all be obtained from the original fragment entry point. supply;

[0050] Indicates the exit of candidate instruction fragments The status field read by the original subsequent device command and the original fragment exit The corresponding fields are consistent;

[0051] Indicates the exit of candidate instruction fragments Compared to the original segment export No new devices, ports, or tools were added to the system.

[0052] This indicates that the candidate exit does not have any more unfinished asynchronous actions than the original exit;

[0053] Step 5.3: When all four conditions are met, generate a replacement license; when any one of the four conditions is not met, output a verification failure record containing the failure field, comparison value, and related command identifier.

[0054] In the above scheme, step 6, determining the expansion direction based on the failure field type corresponding to the failed judgment and expanding the boundary of the candidate fragment according to the expansion direction, includes:

[0055] Step 6.1: If the failure field is sample status or container status, extend the candidate fragment boundary backward to after the device instruction that writes the sample status or container status, or after the device instruction that consumes the sample status or container status.

[0056] Step 6.2: If the failure field indicates an entry missing state, then extend the candidate segment boundary forward to before the device instruction that generated the missing state;

[0057] Step 6.3: If the failure field is a set of resource locks or a set of events to be completed, then extend the candidate fragment boundary to after the device instruction for releasing the corresponding resource or after the device instruction for completing the asynchronous event;

[0058] Step 6.4: Regenerate the candidate fragment boundary signature and candidate instruction trace record for each expansion, and return to Step 4 to recompile; if the expansion to the start or end of the complete experimental process still fails the interface equivalence check, do not replace the original fragment, and output a failure record containing the change clause, failure field and a suggested full-process recompile flag.

[0059] In the above scheme, step 6, which replaces the original fragment with the candidate instruction fragment and updates the inverted index using an atomic transaction, includes:

[0060] Step 6.5: In the same database transaction, perform the following write operations in sequence: write candidate instruction fragments and candidate instruction trace records; delete the old inverted index members corresponding to the original fragments, and write new inverted index entries according to the candidate instruction trace records; increment the experimental process version number and write the replacement license identifier;

[0061] Step 6.6: Before the database transaction is committed, the device execution layer continues to use the old version of the experimental process; it only switches to the new version of the experimental process after the candidate instruction, instruction trace record, reverse index and process version are all successfully written; if any write operation fails, the database transaction is rolled back, retaining the original device instruction, original instruction trace record, original reverse index and original process version.

[0062] This invention provides an instruction update system for AI for Science intelligent experimental facilities, applied to the experimental scheme compilation layer and device execution layer of AI for Science intelligent experimental facilities, including:

[0063] The capability terms management module is used to store equipment capability terms and contract versions;

[0064] The compilation tracing module is used to record the actual device capability terms read by each device instruction during the process of compiling the structured experiment scheme into a sequence of device instructions;

[0065] The reverse index module is used to build a reverse index from device capability terms to device instructions based on the records of the compiler tracing module;

[0066] The clause difference detection module is used to compare the equipment capability clauses before and after the update and generate a set of changed clauses;

[0067] The candidate fragment generation module is used to determine the reentrant boundary and the continuation boundary based on the position of the affected instruction set in the original device instruction sequence, and to generate candidate fragments.

[0068] The fragment recompilation module is used to recompile the operation records corresponding to the candidate fragments using the updated device capability terms, and generate candidate instruction fragments.

[0069] The interface equivalence verification module is used to perform interface equivalence verification between the original fragment and the candidate instruction fragment. The verification content includes whether the state required for the entry of the candidate instruction fragment can be provided by the entry of the original fragment, whether the exit state of the candidate instruction fragment can meet the input conditions of the original subsequent device instruction, whether there is any new resource occupation at the exit of the candidate instruction fragment relative to the exit of the original fragment, and whether there are any new pending events at the exit of the candidate instruction fragment relative to the exit of the original fragment.

[0070] The atomic replacement module is used to replace the original fragment with the candidate instruction fragment and update the reverse index in an atomic transaction manner when all four judgments of the interface equivalence check pass. When any one of the four judgments fails, the expansion direction is determined according to the failure field type corresponding to the failed judgment, the boundary of the candidate fragment is expanded according to the expansion direction, and the fragment recompilation module and the interface equivalence check module are triggered to re-execute.

[0071] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the instruction update method for AI for Science intelligent experimental facilities.

[0072] Because the present invention employs the above-mentioned technical means, it has the following beneficial effects:

[0073] (1) By recording the capability terms actually read by each instruction during compilation and establishing a reverse index accordingly, it is possible to directly locate the affected instructions after the device capability terms change, thus avoiding recompiling instructions that do not reference the changed terms.

[0074] (2) By uniformly comparing the entry state, exit state, resource lock and pending events of candidate fragments, it is possible to identify discontinuous sample states, inconsistent container states and resource conflicts before replacement, thereby reducing the risk of interruption of the experimental process caused by local updates.

[0075] (3) Combining clause-level reverse positioning with fragment-level interface verification enables the system to narrow the scope of recompilation while ensuring that the updated physical action fragments can be accessed in the original process, thereby maintaining the continuous correspondence between the AI ​​for Science experimental scheme and the execution process of the embodied intelligent autonomous experiment. Attached Figure Description

[0076] Figure 1 - Overall flowchart of device instruction update method;

[0077] Figure 2 -Diagram of the device instruction update system architecture. Detailed Implementation

[0078] The embodiments of the present invention will be described in detail below. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, any modifications or equivalent substitutions made to the present invention should be covered within the scope of the claims of the present invention.

[0079] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without these specific details.

[0080] This invention addresses the issues of inaccurate instruction location, excessive recompilation scope, and inconsistent connection states between old and new instruction fragments in autonomous experiments conducted in collaboration between AI for Science and embodied scientific intelligence, after updates to device capability terms. The system establishes a reverse index from capability terms to target instructions, generates candidate replacement fragments after term changes, and uses state interface signatures and resource signatures to determine whether a candidate fragment can replace the original fragment, thus maintaining consistency between the AI ​​for Science experimental plan, device instructions, and the physical experimental state of embodied scientific intelligence.

[0081] 1. System Composition

[0082] See Figure 2 This system is applied to the experimental scheme compilation layer and equipment execution layer of the AI ​​for Science intelligent experimental facility. It includes a capability clause management module, a compilation tracing module, a clause-instruction reverse index module, a clause difference detection module, a candidate fragment generation module, a fragment recompilation module, an interface equivalence verification module, and an atomic replacement module. The capability clause management module stores the equipment capability clauses and their versions; the compilation tracing module records the clauses actually read during instruction generation; the reverse index module provides clause-to-instruction lookup; and the remaining modules sequentially complete difference identification, fragment generation, recompilation, verification, and replacement.

[0083] The capability terms management module is used to store the capability terms and their contract versions for each device. Each device's capability terms set describes the types of operations that the device can perform, parameter ranges, pre- and post-state constraints, resource usage rules, mutual exclusion conditions, and command communication templates. When a device's firmware is upgraded, its interface protocol is adjusted, or its parameter range changes, the capability terms management module receives and stores the new version of the terms set, while retaining the old version for comparison.

[0084] The compiler tracing module is used to record the actual device capability clauses read by each device instruction during the compilation process of compiling the structured experimental scheme into a sequence of device instructions. When the compiler performs template selection, parameter binding, unit conversion, and state transitions, the compiler tracing module synchronously captures the unique identifier of the read clause, the source of the parameters, the conversion result, the state before and after compilation, and the changes in resources, forming an instruction tracing record.

[0085] The reverse index module is used to build a reverse index from device capability clauses to device instructions based on the records of the compiler tracing module. This index uses the clause's unique identifier as the key and the set of command identifiers referencing the clause as the value, supporting the direct retrieval of all affected instructions based on clause changes.

[0086] The clause difference detection module is used to compare the equipment capability clauses before and after the update, identify newly added, deleted and modified clauses, and generate a set of changed clauses.

[0087] The candidate fragment generation module is used to determine the reentrancy boundary forward and the continuation boundary backward based on the position of the affected instruction set in the original device instruction sequence, and generate candidate fragments.

[0088] The fragment recompilation module is used to recompile the operation records corresponding to the candidate fragments using the updated device capability terms, and generate candidate instruction fragments.

[0089] The interface equivalence verification module is used to perform interface equivalence verification on the original fragment and the candidate instruction fragment, including four judgments: entry status, exit status, resource occupation, and pending events.

[0090] The atomic replacement module is used to replace the original fragment and update the reverse index with the candidate instruction fragment when all four judgments pass, in an atomic transaction manner (i.e., the updates of the candidate instruction fragment, the reverse index, and the process version are either all successfully committed or all are rolled back if any update fails); when any judgment fails, the expansion direction is determined according to the failure field type, the candidate fragment boundary is expanded, and the fragment recompilation module and the interface equivalence verification module are triggered to re-execute.

[0091] The scientifically embodied intelligent autonomous experimental equipment includes, but is not limited to, pipettes, reaction vessels, heaters, centrifuges, robotic arms, spectrometers, chromatographs, incubators, and combinations thereof. The device execution layer is responsible for driving the above equipment to complete physical experimental operations according to the instruction sequence.

[0092] 2. Data Structure

[0093] 2.1. The equipment capacity clause is expressed as follows:

[0094] Terms Record = <Term Unique Identifier, Device Identifier, Capability Identifier, Terms Type, Constraint Expression, Command Template, Contract Version Number>

[0095] Right now:

[0096] Clause= <clause_id,device_id,capability_id,clause_type,constraint_expression,command_template,contract_version> .

[0097] Here, `clause_id` is a unique identifier for the clause, ensuring its uniqueness across all device capability clauses, and serves as the key for reverse indexing; `device_id` is the device identifier, identifying the physical device or device type to which this clause belongs; `capability_id` is the capability identifier, identifying the specific capability category of the device, such as "temperature setting," "timekeeping," "door opening and closing," and "pipette aspiration"; `clause_type` is the clause type, which includes at least six types: Parameter Range, Precondition, Postcondition, Resource Occupancy, Mutual Exclusion, and Command Template; `constraint_expression` is the constraint expression, describing the constraint content of the clause using logical expressions or numerical ranges; `command_template` is the command template, defining the instruction format and placeholders for device communication; and `contract_version` is the contract version number, identifying the version of the clause.

[0098] For example, the temperature setting clause for a heater can be expressed as:

[0099] Clause = <K31, HEATER-01, TEMP_SET, ParameterRange, "20≤target_temperature≤200, unit=℃", NULL, V3.2>

[0100] Its command template clause can be expressed as:

[0101] Clause = <K32, HEATER-01, TEMP_SET, CommandTemplate, NULL, "SET_TEMPtarget={value} unit={unit}", V3.2>

[0102] 2.2. The instruction trace record is represented as follows:

[0103] Trace log = <command identifier, operation identifier, term reference set, parameter binding, input state, output state, resource changes, compiler version>

[0104] Right now:

[0105] Trace= <command_id,operation_id,clause_refs,parameter_bindings,input_state,output_state,resource_delta,pending_event_delta,compiler_version> .

[0106] Corresponding to: Track = <command identifier, operation identifier, clause reference, parameter binding, input state, output state, resource change, pending event change, compiler version>.

[0107] The clause_refs record the capability clauses that are actually read by the instruction.

[0108] 2.3. Inverted Index

[0109] The system builds an inverse index Index[clause_id]→{command_id} based on the Trace.

[0110] 2.4. The interface signature for fragment boundaries is represented as follows:

[0111] Signature = <sample state, container state, device state, resource lock set, pending event set>.

[0112] Right now:

[0113] Sig=<sample_state,container_state,device_state,resource_lockset,pending_eventset> .

[0114] sample_state represents the location, shape, and key process status of the sample; container_state represents the container identifier, open / closed status, and carrying relationship; resource_lockset represents the devices, ports, or tools whose fragment boundaries are still occupied; pending_eventset represents asynchronous events that have been issued but not yet completed.

[0115] 2.5. Operation Log

[0116] The operation record in the structured experimental protocol is represented as follows:

[0117] Operation= <operation_id,operation_type,object_id,target_parameter,precondition,expected_postcondition>

[0118] Among them, operation_id is the unique identifier of the operation; operation_type is the operation type, such as "heating", "pipette", "mixing", "detection", etc.; object_id is the identifier of the operation object, such as sample number or container number; target_parameter is the target parameter, such as target temperature, target volume, etc.; precondition is the precondition; expected_postcondition is the expected postcondition.

[0119] 3. Method and Flow

[0120] Step S1: Obtain the structured experimental plan and current equipment capability terms, and generate the original equipment instruction sequence and a trace record for each instruction. Specifically, the experimental planning module outputs the operation record Operation=<operation_id,operation_type,object_id,target_parameter,precondition,expected_postcondition> The compiler selects the corresponding device and command template based on the operation_type, performs unit conversion and range verification on the target_parameter, and outputs the target instruction command_id. For structured experimental schemes and current device capability clauses, such as an experimental scheme of "placing the sample in a container, heating it at 90°C and holding it for 30 minutes," an operation record Operation= can be generated. <OP-003, HEAT_AND_HOLD, SAMPLE-01, {temperature:90℃,duration:30min},{container_id:V-01,lid_state:CLOSED, heater_state:IDLE}, {sample_state:HEATED_AND_HELD, lid_state:CLOSED}> This operation corresponds to the second and third steps in the experimental scheme. After compilation, it generates two device instructions: "Set the heating temperature to 90℃" and "Maintain for 30 minutes".

[0121] During template expansion, parameter validation, and state transitions, the compiler writes the actually read `clause_id` to the `clause_refs` field of the instruction; it writes the parameter source, conversion result, and template placeholders to the `parameter_bindings` field; and it writes the pre- and post-compilation states to the `input_state` and `output_state` fields, respectively. Capability clauses that are not read are not written to `clause_refs`. This results in `Trace=`. <command_id,operation_id,clause_refs,parameter_bindings,input_state,output_state,resource_delta,compiler_version> .

[0122] A reverse index of clauses and commands is built based on all generated trace records. Specifically, the system reads the clause_refs in the trace one by one, and performs a write operation on each clause_id to add it to the set with clause_id as the key and command_id as the member, generating Index[clause_id]→{command_id}.

[0123] Each index entry also stores the contract_version and compiler_version used by that command_id. When the same clause is referenced by multiple instructions, the index value is a set of multiple command_ids; when an instruction references multiple clauses, the command_id is written to multiple index entries respectively. This index is used for subsequent direct retrieval of affected instructions from changed clauses.

[0124] Step S2: Before the original device instruction sequence is sent to the device execution layer, the system receives the capability clause sets before and after the device update and generates a set of changed clauses ΔClause. Specifically, the system uses device_id and clause_id as matching keys to construct mapping tables for the old version clauses and the new version clauses respectively; and compares the capability_id, clause_type, constraint_expression, command_template, and contract_version item by item in the two mapping tables.

[0125] Clauses appearing only in the new version are marked as new; clauses appearing only in the old version are marked as deleted; clauses existing in both versions but differing in any of the above fields are marked as modified. The system writes the clause identifier, change type, old field value, and new field value into the difference record DiffItem, and forms ΔClause from all DiffItems.

[0126] The system locates the directly affected instruction set `AffectedCmd` based on `ΔClause`. For modified or deleted clauses, the system queries the index using the old version's `clause_id` and retrieves all `command_id`s referencing that clause. Deleted clauses retain their old version index entries until the update is complete, thus allowing them to be queried. For newly added clauses of type command template, the system searches for command template clauses with the same `capability_id` in the previous version, queries the index using the old clause's `clause_id`, and adds the retrieved `command_id` to `AddedAffectedCmd`.

[0127] The system deduplicates the query results and further verifies the clause_refs in the Trace against the difference records: if the contract_version of the Trace record is equal to the previous version and its clause field intersects with DiffItem, then the instruction is considered affected; otherwise, it is not included in AffectedCmd. This rule avoids mistakenly expanding the update scope simply because the device name is the same or the capability name is similar.

[0128] Step S3: Generate candidate fragments based on the position of AffectedCmd in the original instruction sequence. The system scans backward from each affected instruction until it finds the nearest reentrant boundary; the reentrant boundary satisfies the following conditions: when executing to that position according to the original device instruction sequence, the sample position, container opening / closing state, and related device states formed by the preceding device instructions can be clearly represented by the instruction trace record, and there are no incomplete asynchronous operations or unreleased resource occupancy crossing that position. The system scans backward from the same affected instruction until it finds the nearest continuation boundary; the continuation boundary satisfies the following condition: the sample state, container state, device state, and resource state read by subsequent instructions can all be clearly represented by the boundary signature.

[0129] Continuous instructions between two boundaries are considered candidate segments. If multiple candidate segments overlap, or their boundaries share the same exclusive device, container, or incomplete event, they are merged into a single candidate segment. The entry signature of a candidate segment is generated from the state after the previous boundary, and the exit signature is generated from the state after the subsequent boundary.

[0130] Step S4: Recompile the operation records corresponding to the candidate fragments using the new version of the capability terms. The entry signature is determined based on the original device instruction sequence and instruction trace records. Specifically, the compiler uses sample_state, container_state, device_state, and resource_lockset in the candidate fragment entry signature as the only available initial conditions, reselects the command template, binds parameters, converts the execution unit, and verifies the preceding state and resource constraints according to the original operation_id order, and outputs candidate instruction fragments and candidate traces.

[0131] For example, when the original command template is "SET_TEMP{value}" and the new command template is "TEMP.SETtarget={value}unit=K", the compiler first reads 90℃ from the original operation record, then calculates 363.15K according to the temperature conversion rule K=℃+273.15, and finally fills it into the new template to get "TEMP.SETtarget=363.15unit=K". The new template is the device communication format specified in the new version's capability clause, and is not a direct replacement of the original instruction text.

[0132] Step S5: Perform interface equivalence verification on the original fragment and the candidate fragment. Both the entry signature and the exit signature are status signatures determined based on instruction tracking records. The system reads the entry and exit signatures of both; compares the sample position, container status, device status, resource lock set, and pending event set of the entry segment field by field to confirm that the candidate fragment does not require a status or resource that the original entry cannot provide; compares the sample_state, container_state, and container_state actually read by subsequent instructions in the exit segment field by field to confirm that the input conditions of the original subsequent instructions can still be satisfied after the candidate fragment is completed.

[0133] Simultaneously, the system calculates the additional resource locks and pending events added to the candidate exit compared to the original exit. A ReplacePermit is generated only if the entry point can be provided by the original entry point, the subsequent required states are consistent, and there are no additional resource locks or pending events; otherwise, a verification failure record containing a failure field, a comparison value, and the relevant command_id is output.

[0134] Step S6: When step S5 fails, expand the fragment boundary based on the failure field (referring to the specific state or resource item that does not meet the requirements in the interface equivalence check, including sample state, container state, candidate fragment entry missing state, resource lock set, and pending event set) and then execute steps S4 and S5 again. If the failure field is sample state or container state, it means that the candidate exit cannot meet the needs of subsequent instructions, and the system extends backward to after the instruction to write or consume the state; if the failure field is entry missing state, it means that the candidate fragment depends on an earlier preparation action, and the system extends forward to before the instruction that generated the state; if the failure field is resource lock or pending event, the system extends in the original device instruction sequence to after the position where the corresponding resource is released or the asynchronous operation ends.

[0135] Each expansion regenerates the candidate fragment boundary signature and candidate trace. If the expansion fails to pass verification even after reaching the start or end point of the complete experimental process, the system does not replace the original fragment and outputs a failure record containing the changed terms, failure fields, and a suggested full-process recompile flag.

[0136] When step S5 passes, the replacement is completed within the same database transaction. Specifically, the system first writes candidate instruction fragments and candidate traces; secondly, it deletes the old index members corresponding to the original fragments and writes new index entries based on the candidate traces; finally, it increments the experimental process version number and writes the ReplacePermit flag.

[0137] Before a transaction is committed, the device execution layer continues to use the old version of the process; it only switches to the new version after the candidate instructions, traces, indexes, and process versions have all been successfully written. If any write operation fails, the transaction is rolled back, preserving the original instructions, traces, indexes, and process versions, thereby avoiding inconsistencies between instructions and trace information.

[0138] 4. Core Judgment Rules

[0139] The directives affecting the changes are:

[0140] AffectedCmd=∪{Index[c]|c∈ΔClause_MD}∪AddedAffectedCmd.

[0141] In this formula, ΔClause_MD is the set of clauses marked as modified or deleted in the change clause set ΔClause, c is a single clause in ΔClause_MD, Index[c] represents the set of device instructions corresponding to clause c in the reverse index, AddedAffectedCmd represents the set of command identifiers determined by the newly added command template clause, and ∪ represents taking the union of the results of each part and removing duplicates.

[0142] Let the original fragment's entry and exit signatures be Sig_in and Sig_out, respectively, and the candidate fragments' corresponding signatures be Sig'_in and Sig'_out. The conditions for allowing replacement are:

[0143] EntryEqual(Sig_in,Sig'_in)=1;

[0144] StateEqual(Sig_out,Sig'_out)=1;

[0145] ExtraLock(Sig_out,Sig'_out)=∅;

[0146] ExtraPending(Sig_out,Sig'_out)=∅.

[0147] Among them, EntryEqual=1 indicates that the sample, container, equipment and resource status required by the candidate fragment can be provided by the original fragment entry; StateEqual=1 indicates that the status field read by the original subsequent instruction in the candidate fragment exit is consistent with the corresponding field of the original exit; ExtraLock=∅ indicates that the candidate exit does not occupy more equipment, ports or tools than the original exit; ExtraPending=∅ indicates that the candidate exit does not leave more unfinished asynchronous actions than the original exit.

[0148] ReplacePermit is generated when all four conditions are met.

[0149] Example 1

[0150] Case Study

[0151] In a science-embodied intelligent autonomous experimental platform, the AI ​​for Science experimental planning module generates the original equipment instruction flow based on a structured experimental plan. This flow includes C1 "Place in container", C2 "Close hatch", C3 "Set heating temperature", C4 "Maintain for 30 minutes", C5 "Open hatch", C6 "Remove container", and C7 "Send to testing equipment". C3 and C4 together achieve the experimental plan's intention to "heat at 90°C in a sealed container and maintain for 30 minutes".

[0152] C3 references temperature range clause K31 and command template clause K32; C4 references timing clause K41; C5 references safety door opening clause K51. After the system is compiled, Index[K31]={C3}, Index[K32]={C3}, Index[K41]={C4}, and Index[K51]={C5} are created respectively. For example, Index[K32]={C3} means that command template clause K32 is actually read by instruction C3. If K32 changes, the system can directly obtain the C3 that needs to be checked from the index.

[0153] After the device firmware upgrade, K32 changed from "SET_TEMP{value}" to "TEMP.SETtarget={value}unit=K". The difference detection module compared the old and new command_template fields of K32, confirmed that it was a modified clause, and obtained ΔClause={K32}. The system queried Index[K32] and obtained AffectedCmd={C3}. After verifying that the trace of C3 did indeed record the old version of K32, only C3 was located, and C1, C2, and C5 to C7, which did not reference K32, were not located.

[0154] The candidate fragment generation module checks the state after C2: the container has been placed, the hatch is closed, the heater is idle and there are no pending events, satisfying the reentrancy condition; then it checks the state after C4: the heating holding action has been completed, there are no unclosed timing operations, and subsequent C5 can continue from this state, satisfying the continuation condition. Therefore, candidate fragments {C3, C4} are obtained.

[0155] During recompilation, the compiler obtains the target temperature of 90℃ from the corresponding operation record in C3, converts it to 363.15K according to K=℃+273.15, and generates "TEMP.SETtarget=363.15unit=K" according to the new template; the timing clause in C4 remains unchanged, and continues to generate the original instruction to maintain for 30 minutes. The candidate fragment entry is "container has been placed, hatch is closed, heater is idle", and the exit is "sample has completed heating to 90℃ and maintained for 30 minutes, hatch is closed, no incomplete timing events".

[0156] The system compares the entry and exit signatures of the new and old segments, confirms that the candidate segment does not require additional resources, and that the status read by C5, such as "door closed, heating completed, no events to be completed", is consistent with the original segment's exit, and generates a ReplacePermit.

[0157] In a transaction, the system writes the candidate traces and new Index[K32] version records corresponding to the new C3 and new C4, deletes the index reference of the old C3 to the old K32 version, and increments the process version from V8 to V9. After the transaction is committed, C1, C2, and C5 to C7 retain their original version content; if any record write fails, it rolls back to V8, and the original process remains available.

Claims

1. A method for updating instructions in an AI for Science intelligent experimental facility, characterized in that, Includes the following steps: Step 1: During the process of compiling the structured experimental scheme into a sequence of device instructions, record the device capability clauses actually read by each device instruction during the compilation process, and establish a reverse index from device capability clauses to device instructions based on the recording results; Step 2: Before the original device instruction sequence is sent to the device execution layer, when the device capability terms are updated, locate the set of affected instructions that reference the changed terms based on the reverse index; Step 3: Based on the position of the affected instruction set in the original device instruction sequence, determine the reentrant boundary and the continuable boundary; the reentrant boundary is the position where, when executed according to the original device instruction sequence, the state formed by the preceding device instruction can be clearly represented by the instruction trace record, and there is no incomplete asynchronous operation crossing this position; the continuable boundary is the position where the state required by subsequent device instructions can be clearly represented by the state at the boundary; the continuous device instructions between the reentrant boundary and the continuable boundary are selected as candidate segments; Step 4: Recompile the operation records corresponding to the candidate fragments using the updated device capability terms to generate candidate instruction fragments; Step 5: Perform an interface equivalence check on the original fragment and the candidate instruction fragment. The interface equivalence check includes the following four determinations: Can the state required for the candidate instruction fragment entry be provided by the original fragment entry? Can the state of the candidate instruction fragment exit meet the input conditions of the original subsequent device instruction? Does the candidate instruction fragment exit have any new resource occupation compared to the original fragment exit? Does the candidate instruction fragment exit have any new pending events compared to the original fragment exit? Step 6: When all four criteria of the interface equivalence check pass, replace the original fragment with the candidate instruction fragment and update the reverse index using an atomic transaction. When any one of the four criteria of the interface equivalence check fails, determine the expansion direction based on the failure field type corresponding to the failed criteria, expand the boundary of the candidate fragment according to the expansion direction, return to step 4 to recompile, and return to step 5 to re-verify, until all four criteria pass or the expansion reaches the boundary of the complete experimental process.

2. The method according to claim 1, characterized in that, Step 1 includes: Step 1.1: Express the equipment capability clause as follows: Terms record = <Term unique identifier, device identifier, capability identifier, terms type, constraint expression, command template, contract version number>; The clause type includes at least parameter range, preconditions, postconditions, resource usage, mutual exclusion conditions, and command templates; the clause unique identifier remains unique within the same device capability clause; Step 1.2: During compilation, the unique identifier of the clause actually read by the device instruction is written into the clause reference set field of the instruction trace record; the parameter source, conversion result, and template placeholder are written into the parameter binding field; the pre-compilation state is written into the input state field; and the post-compilation state is written into the output state field. Device capability clauses that are not read are not written into the clause reference set field. The instruction trace record is represented as follows: Trace log = <command identifier, operation identifier, term reference set, parameter binding, input state, output state, resource changes, compiler version>; Step 1.3: Read the clause reference set field in the instruction trace record one by one. For each clause unique identifier in the clause reference set field, perform a write operation to add it to the set with the clause unique identifier as the key and the command identifier as the member, generating an inverted index Index[clause_id]→{command_id}, where clause_id represents the clause unique identifier and command_id represents the command identifier. When the same device capability clause is referenced by multiple device instructions, the index value of the inverted index is a set composed of multiple command identifiers. When a device instruction references multiple clauses, the command identifiers are written to multiple index entries respectively. Each index entry also stores the contract version number and compiler version used by the corresponding command identifier.

3. The method according to claim 1, characterized in that, Step 2 includes: Step 2.1: Using the device identifier and the clause unique identifier as the matching key, construct mapping tables for the device capability clause before the update and the device capability clause after the update, respectively. Compare the capability identifier, clause type, constraint expression, command template and contract version number item by item in the two mapping tables. Clauses that appear only in the updated version are marked as new; clauses that appear only in the pre-update version are marked as deleted; clauses that exist in both versions but differ in any field of constraint expression, command template, or contract version number are marked as modified; the clause identifier, change type, old field value, and new field value are written to the difference record, and the change clause set ΔClause is formed by all difference records DiffItem; Step 2.2: For clauses marked as modified or deleted, query the reverse index using the clause unique identifier of the previous version to retrieve all command identifiers referencing that clause; for clauses marked as added, the system searches for clauses with the same capability identifier in the previous version and queries the reverse index using the clause unique identifier of the old clause; for the queried command identifiers, use the new clause to reselect the command template. If the selection result is inconsistent with the command template used by the original device instruction, add the command identifier to the newly added affected instruction set AddedAffectedCmd; Step 2.3: The set of affected instructions is determined by the following formula: AffectedCmd=∪{Index[c]|c∈ΔClause_MD}∪AddedAffectedCmd Where ΔClause_MD is the set of clauses marked as modified or deleted in the set of changed clauses, Index[c] represents the set of device instructions corresponding to clause c in the reverse index, and AddedAffectedCmd represents the set of command identifiers obtained after reselecting the command template based on the added clauses; Step 2.4: Verify the Clause Reference Set field in the instruction tracking record with the Difference Record DiffItem: If the contract version number recorded in the instruction tracking record is equal to the version before the change and there is an intersection between the Clause Reference Set field and the Difference Record DiffItem, then the corresponding device instruction is determined to be affected; otherwise, it is not included in the affected instruction set.

4. The method according to claim 1, characterized in that, Step 3, determining the reentrant boundary and the continuable boundary, includes: Step 3.1: Scan backward from each affected device instruction until the nearest reentrant boundary is found; the reentrant boundary satisfies the following conditions: when the original device instruction sequence is executed to this position, the sample position, container opening and closing state and related device state formed by the preceding device instructions can be clearly represented by the instruction tracking record, and there are no incomplete asynchronous operations or unreleased resource occupancy that cross this position; Step 3.2: Scan backward from the same affected device instruction until the nearest connectable boundary is found; the connectable boundary satisfies the following condition: the sample state, container state, device state and resource state read by subsequent device instructions can all be clearly represented by the interface signature at the connectable boundary; Step 3.3: Select consecutive device instructions between the reentrant boundary and the concatenable boundary as candidate segments; if multiple candidate segments overlap, or if the boundaries of multiple candidate segments share the same exclusive device, the same container, or the same incomplete event, then merge the multiple candidate segments into one candidate segment. Step 3.4: The entry signature of the candidate segment is generated from the state after the reentrant boundary, and the exit signature of the candidate segment is generated from the state after the continuation boundary.

5. The method according to claim 1, characterized in that, Step 4 includes: Step 4.1: Use the sample state, container state, device state, and resource lock set in the candidate fragment entry signature as the unique available initial condition; Step 4.2: Following the original operation identifier order, use the updated device capability terms to reselect the command template, bind parameters, convert execution units, and verify the prerequisite status and resource constraints; Step 4.3: Output candidate instruction fragments and candidate instruction tracing records.

6. The method according to claim 1, characterized in that, Step 5, interface equivalence verification, includes: Step 5.1: The interface signature Sig for the fragment boundary is represented as: Signature = <sample status, container status, device status, resource lock set, pending event set>; The sample status indicates the sample's location, shape, and key process status; the container status indicates the container identifier, open / closed status, and load-bearing relationship; the device status indicates the device's current operating status; the resource lock set indicates the set of devices, ports, or tools whose fragment boundaries are still occupied; and the pending event set indicates the set of asynchronous events that have been issued but not yet completed. Step 5.2: Set the original fragment entry signature as... The original fragment's export signature is The entry signature of the candidate instruction fragment is The candidate instruction fragment exit signature is The substitution is allowed if all four of the following conditions are met simultaneously: EntryEqual StateEqual ExtraLock ExtraPending in, Indicates the entry point of the candidate instruction fragment The required sample status, container status, equipment status, and resource status can all be obtained from the original fragment entry point. supply; StateEqual represents the candidate instruction fragment output. The status field read by the original subsequent device command and the original fragment exit The corresponding fields are consistent; Indicates the exit of candidate instruction fragments Compared to the original segment export No new devices, ports, or tools were added to the system. ExtraLock indicates the exit point of the candidate segment. Compared to the original fragment output The newly added set of devices, ports, or tools; ExtraPending represents the collection of asynchronous events that have been issued but not yet completed, which are newly added to the candidate fragment exit relative to the original fragment exit. Step 5.3: When all four conditions are met, generate a replacement license; when any one of the four conditions is not met, output a verification failure record containing the failure field, comparison value, and related command identifier.

7. The method according to claim 1, characterized in that, Step 6, which involves determining the expansion direction based on the failure field type corresponding to the failed judgment and expanding the boundary of the candidate fragment according to the expansion direction, includes: Step 6.1: If the failure field is sample status or container status, extend the candidate fragment boundary backward to after the device instruction that writes the sample status or container status, or after the device instruction that consumes the sample status or container status. Step 6.2: If the failure field indicates an entry missing state, then extend the candidate segment boundary forward to before the device instruction that generated the missing state; Step 6.3: If the failure field is a set of resource locks or a set of events to be completed, then extend the candidate fragment boundary to after the device instruction for releasing the corresponding resource or after the device instruction for completing the asynchronous event; Step 6.4: Regenerate the candidate fragment boundary signature and candidate instruction trace record for each expansion, and return to Step 4 to recompile; if the expansion to the start or end of the complete experimental process still fails the interface equivalence check, do not replace the original fragment, and output a failure record containing the change clause, failure field and a suggested full-process recompile flag.

8. The method according to claim 1, characterized in that, Step 6, which involves replacing the original fragment with the candidate instruction fragment and updating the inverted index using an atomic transaction, includes: Step 6.5: In the same database transaction, perform the following write operations in sequence: write candidate instruction fragments and candidate instruction trace records; delete the old inverted index members corresponding to the original fragments, and write new inverted index entries according to the candidate instruction trace records; increment the experimental process version number and write the replacement license identifier; Step 6.6: Before the database transaction is committed, the device execution layer continues to use the old version of the experimental process; it only switches to the new version of the experimental process after the candidate instruction, instruction trace record, reverse index and process version are all successfully written; if any write operation fails, the database transaction is rolled back, retaining the original device instruction, original instruction trace record, original reverse index and original process version.

9. An instruction update system for AI for Science intelligent experimental facilities, applied to the experimental scheme compilation layer and device execution layer of AI for Science intelligent experimental facilities, implementing the method as described in any one of claims 1-8, characterized in that, include: The capability terms management module is used to store equipment capability terms and contract versions; The compilation tracing module is used to record the actual device capability terms read by each device instruction during the process of compiling the structured experiment scheme into a sequence of device instructions; The reverse index module is used to build a reverse index from device capability terms to device instructions based on the records of the compiler tracing module; The clause difference detection module is used to compare the equipment capability clauses before and after the update and generate a set of changed clauses; The candidate fragment generation module is used to determine the reentrant boundary and the continuation boundary based on the position of the affected instruction set in the original device instruction sequence, and to generate candidate fragments. The fragment recompilation module is used to recompile the operation records corresponding to the candidate fragments using the updated device capability terms, and generate candidate instruction fragments. The interface equivalence verification module is used to perform interface equivalence verification between the original fragment and the candidate instruction fragment. The verification content includes whether the state required for the entry of the candidate instruction fragment can be provided by the entry of the original fragment, whether the exit state of the candidate instruction fragment can meet the input conditions of the original subsequent device instruction, whether there is any new resource occupation at the exit of the candidate instruction fragment relative to the exit of the original fragment, and whether there are any new pending events at the exit of the candidate instruction fragment relative to the exit of the original fragment. The atomic replacement module is used to replace the original fragment with the candidate instruction fragment and update the reverse index in an atomic transaction manner when all four judgments of the interface equivalence check pass. When any one of the four judgments fails, the expansion direction is determined according to the failure field type corresponding to the failed judgment, the boundary of the candidate fragment is expanded according to the expansion direction, and the fragment recompilation module and the interface equivalence check module are triggered to re-execute.

10. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the device instruction update method according to any one of claims 1 to 8.