Internet of Things simulation method and system supporting virtual-real interaction in browser

By using a virtual-real interaction method within the browser and an adaptive graph partitioning algorithm, simulation tasks are distributed to the user's browser, solving the problems of high fidelity, high scalability, and large-scale concurrent access by IoT simulation tools, thus achieving efficient IoT development and verification.

CN120874367APending Publication Date: 2025-10-31ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510987808.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing IoT simulation tools struggle to balance high fidelity and high scalability, and centralized architectures cannot support large-scale concurrent user access, resulting in enormous server load and high costs.

Method used

Employing a browser-based virtual-real interaction method, the simulation task is distributed to the user's browser through a discretization execution mechanism and an adaptive graph partitioning algorithm. Combined with cloud-based collaborative work, it achieves high fidelity and large-scale node expansion, and supports rapid verification and migration through the virtual-real interaction method.

Benefits of technology

While ensuring instruction-level simulation accuracy, it achieves high-efficiency simulation speed and large-scale node expansion capability, supports concurrent access by a large number of users, and improves the efficiency and flexibility of IoT development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120874367A_ABST
    Figure CN120874367A_ABST
Patent Text Reader

Abstract

The invention discloses an Internet of Things simulation method and system supporting virtual-real interaction in a browser, and the method comprises the steps: (1) a discretization execution method, which accurately avoids the performance overhead related to millisecond-level large-scale instruction-level simulation, and provides strong scalability under the condition of not influencing the function correctness; (2) in the execution process of the virtual equipment, whether cloud edge migration of the virtual equipment needs to be carried out or not is determined according to the execution state, so that the overall simulation efficiency is improved; (3) a function redirection function is realized during compiling, and compiling services are transformed, so that a compiling library has a virtual-real interaction function, and binary firmware with a virtual-real interaction capability is supported to be output; and (4) a simulation system architecture based on a browser side end, wherein simulation requirements of each layer expected by a user are established through atomized equipment and components. According to the invention, on the premise of ensuring instruction-level simulation precision, high simulation speed and large-scale node expansion capability are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) simulation technology, and more specifically, to an IoT simulation method and system that supports virtual-real interaction within a browser. Background Technology

[0002] The Internet of Things (IoT) technology is being widely applied in various fields such as agriculture, military, smart homes, healthcare, and smart cities. However, the development and deployment of modern IoT systems face many challenges, mainly due to device heterogeneity, protocol diversity, limited computing power of terminal devices, and the complexity of large-scale deployment. Therefore, comprehensive testing of IoT applications before actual deployment is crucial.

[0003] Currently, testing of IoT applications mainly relies on physical test platforms and software simulators. While physical test platforms, such as FIT IoT-LAB, can provide a realistic device environment, their scale is limited, making it difficult to support large-scale deployment testing or handle the concurrent access demands of a large number of users.

[0004] Software simulators aim to address scalability issues, but often face a trade-off between fidelity and efficiency. Functional-level simulators, such as ns-3, offer good device scalability but lack instruction-level runtime details, resulting in insufficient fidelity. Instruction-level simulators, such as Avrora and Avr8js, provide high-fidelity simulations, but their simulation speed is slower, making it difficult to support the simulation of large-scale nodes.

[0005] Furthermore, most existing simulators employ a centralized server architecture, where all simulation tasks are executed on the server side. This architecture puts immense pressure on the server load when facing high-concurrency user scenarios such as online education and virtual exhibitions, and building a powerful server cluster incurs high costs. Effectively distributing the simulation overhead to the user's browser is a solution that can effectively reduce server load, support synchronous real-time simulation tasks, and offer cross-platform compatibility.

[0006] Therefore, the industry urgently needs a new IoT simulation solution that can simultaneously meet the requirements of high fidelity (instruction-level accuracy), high scalability (supporting a large number of devices and users), and support for collaborative work between virtual and real devices. Summary of the Invention

[0007] To address the issues mentioned in the background section regarding the difficulty of existing IoT simulation tools in achieving both high fidelity and high scalability, and the difficulty of their centralized architecture in supporting large-scale concurrent user access, this invention provides an IoT simulation method and system that supports virtual-real interaction within a browser.

[0008] In a first aspect, the present invention provides an Internet of Things (IoT) simulation method supporting virtual-real interaction within a browser, comprising the following steps:

[0009] Step 1: In the web-based integrated development environment, obtain the user-written code and binary firmware, and manage the interaction of the IoT simulator;

[0010] Step 2: Inject the binary firmware into the virtual device and run it through a discretization execution mechanism;

[0011] Step 3: During the execution of the virtual device, an adaptive graph partitioning algorithm is used to dynamically partition and deploy the virtual device on the cloud or browser based on the network communication status, so as to reduce cross-platform communication latency.

[0012] Step 4: Modify the cloud compilation service to generate binary firmware that supports virtual-real interaction, and establish a data interaction path between the real device and the virtual device to enable them to work together.

[0013] Preferably, the discretization execution mechanism in step two specifically includes:

[0014] Step 2.1: Redirect the pause function set in the user code to a jump function. The jump function triggers a pause signal by modifying the register value in the virtual device. The hook function in the virtual device pauses the execution of the virtual device's central processing unit by checking the register value.

[0015] Step 2.2: After the set pause time is reached, a callback function is triggered to convert the virtual device from a paused state (never running) to a logical running state; when the virtual device resumes execution from the logical running state, the clock cycle is calibrated according to the following formula:

[0016]

[0017] Where Δc represents the difference in calibration clock cycles, t r The timestamp at the time of wake-up, t s The timestamps represent the timestamps during sleep, both accurate to milliseconds, F. m This indicates the clock frequency of the motherboard's core.

[0018] Preferably, the adaptive graph partitioning algorithm in step three specifically includes:

[0019] Step 3.1: This algorithm uses a trigger-based decision-making mechanism. When the ratio of cross-network node communication to the total number of node communications within a time window exceeds an empirical value, or when the periodic timer exceeds a predetermined timing threshold, a trigger decision is made to ensure the dynamic network is updated. The formula is as follows:

[0020]

[0021] Where r represents cross-network node communication within a time window, e represents the total number of node communications within a time window, α represents an empirical value, timer is a periodic timer, and t s The specified timing threshold is used. Step 3.2: In the decision-making process, a greedy graph partitioning algorithm is first used to identify the current high-frequency links, thereby constructing a set of nodes connected by the edges with the highest weights. The formula is expressed as:

[0022] ∑N s =GraphGreedy(G s ,pk) (3)

[0023] Where, ∑N s To determine which node is placed in the browser within a short time window, G s Let p be the communication graph within a short time window, p be the maximum number of virtual nodes running in the browser to maintain efficiency, and k be the core degree in the KCore algorithm.

[0024] Step 3.3: To address the latency caused by sudden changes in network topology, the core subgraphs of the network are further identified based on the K-Core algorithm to provide resilience to changes in network conditions. The formula is expressed as follows:

[0025] ∑N l =KCore(G l ,k) (4)

[0026] Where, ∑N l To determine which node is placed in the browser within a long window, G l This represents the communication graph over a long window, where k is the core degree in the KCore algorithm.

[0027] Step 3.4: Merge the two types of nodes obtained in Step 3.2 and Step 3.3 to obtain all the nodes finally deployed in the browser, expressed by the formula:

[0028] ∑N=∑N s ∪∑N l (5)

[0029] Where ∑N represents all nodes deployed in the browser, ∑N l With ∑N s These are the node sets obtained from the aforementioned steps.

[0030] Preferably, step four, establishing a data interaction path between the real device and the virtual device, specifically includes:

[0031] Step 4.1: The compilation service redirects specific library functions during compilation to implement virtual-physical interaction functionality in the firmware;

[0032] Step 4.2: The real device requests virtual data from the cloud through a data exchange frame, which includes a plaintext prefix for service identification, encryption type, and a message transmitted in ciphertext; the cloud generates data from the virtual sensing model according to the request and responds.

[0033] Step 4.3: The virtual device obtains real data forwarded from the real device via the cloud by listening to its general input / output interfaces.

[0034] Furthermore, in step 4.2, the virtual data in the cloud response originates from at least one of the following methods:

[0035] a) Data generated by other virtual motherboard devices within the simulation system;

[0036] b) Data input by the user through the front-end interactive interface;

[0037] c) The data obtained through the linear virtual sensing model is calculated as follows:

[0038]

[0039] Where d represents the output data, t r To request a timestamp, t0 creates or updates a timestamp, f is the rate of change coefficient, and D... max With D min These represent the maximum and minimum values ​​of the data, respectively.

[0040] d) The data obtained through the random virtual sensing model is calculated as follows:

[0041] d = r N +C (7)

[0042] Where r N Let C represent a random number, and C is a constant used to limit the minimum value of the generated sensor data.

[0043] Secondly, the present invention provides an Internet of Things (IoT) simulation system that supports virtual-real interaction within a browser, used to implement the above-mentioned method, characterized in that it includes a cloud and a browser; the cloud includes a compilation service, a cloud interactor, and a cloud scheduler; the browser includes multiple virtual devices and a worker manager.

[0044] Compared with existing technologies, the advantages of this invention are as follows: by using a discretization execution mechanism and an adaptive graph partitioning algorithm, it achieves high simulation speed and large-scale node expansion capability while ensuring instruction-level simulation accuracy; by distributing the main simulation tasks to the user's browser in a distributed architecture, it effectively supports concurrent access by a large number of users; and by using a virtual-real interaction method, it achieves seamless integration between the simulation environment and real physical devices, supports rapid verification and migration of IoT applications, and greatly improves the efficiency and flexibility of IoT development. Attached Figure Description

[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below.

[0046] Figure 1 This is a schematic diagram illustrating one implementation of the discrete execution jumpboard function in an embodiment of the present invention.

[0047] Figure 2 This is a schematic diagram of the lifecycle of a virtual device node under the discretized execution mechanism in this embodiment of the invention.

[0048] Figure 3 This is a schematic diagram of the cloud-edge collaborative system architecture in an embodiment of the present invention.

[0049] Figure 4 This is an example diagram of node networking decision-making for the adaptive graph partitioning algorithm in an embodiment of the present invention.

[0050] Figure 5 This is a schematic diagram of the data exchange frame format used in the virtual-real interaction method in this embodiment of the invention.

[0051] Figure 6 This is a diagram of the browser-based simulation system architecture provided by the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0053] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0054] Example 1

[0055] This embodiment discloses an IoT simulation method that supports virtual-real interaction within a browser, such as... Figures 1 to 6 As shown, the specific steps of this method include:

[0056] Step 1: User interaction and firmware management;

[0057] Users operate through a web-based integrated development environment, including writing application code, managing compiled binary firmware, and interacting with the simulation system to obtain simulation information.

[0058] Step 2: Discretization of virtual devices;

[0059] User-provided binary firmware is injected into a specified virtual device and executed through a discretized execution mechanism to improve the execution efficiency of large-scale simulations while maintaining high fidelity. This discretized execution mechanism specifically includes:

[0060] Step 2.1: Redirect the pause function set in the user code to a jump function. The jump function triggers a pause signal by modifying the register value in the virtual device. The hook function in the virtual device pauses the execution of the virtual device's central processing unit by checking the register value.

[0061] Step 2.2: When the set pause time is reached, a callback function is triggered to convert the virtual device from a paused state to a logical running state; when the virtual device resumes execution from the logical running state, the clock cycle is calibrated according to formula (1).

[0062]

[0063] Where Δc represents the difference in calibration clock cycles, t r The timestamp at the time of wake-up, t s The timestamps represent the timestamps during sleep, both accurate to milliseconds, F. m This indicates the clock frequency of the motherboard's core.

[0064] Reference Figure 2 Under this mechanism, the node's lifecycle includes states such as running, suspended, and partially dormant. Its core idea is to leverage periodic behaviors commonly found in IoT applications and protocols, such as periodic pauses implemented through functions like `delay()`. This invention redirects these pause functions to a "jump function," thereby achieving a logical "suspension" without consuming CPU simulation resources, and transitioning to a "partially dormant" state that can be woken up after a specified time.

[0065] Reference Figure 1As shown, this demonstrates an example implementation of a jumper function. To trigger and transmit the pause signal, this function sends a signal to the hook function by modifying specific registers within the virtual device (such as the DDRB and PORTB registers in an Arduino). The hook function continuously checks the register value in the simulation's main loop, and once a match is found, it pauses the execution of the virtual CPU. To ensure the atomicity of the operation, the entire process is protected by enabling or disabling interrupts.

[0066] Before a virtual device resumes execution from a partially dormant state, fidelity compensation is required. In the time dimension, the clock cycle needs to be calibrated, and the calibration formula is shown in (1).

[0067] Step 3: Adaptive graph partitioning and cloud-edge migration;

[0068] In multi-node simulation, to reduce cross-end (browser and cloud) communication latency caused by improper node deployment, this invention employs an adaptive graph partitioning algorithm to dynamically deploy virtual devices in the cloud or browser. The implementation of this algorithm corresponds to the content of claim 3.

[0069] Reference Figure 3 The paper demonstrates the cloud-edge collaborative system architecture that supports the algorithm. The algorithm is triggered by a decision mechanism that initiates the partitioning and migration process when any of the following conditions are met. The decision formula is shown in (2).

[0070]

[0071] Where r represents cross-network node communication within a time window, e represents the total number of node communications within a time window, α represents an empirical value, timer is a periodic timer, and t s The specified timing threshold.

[0072] The greedy maximum communication segmentation algorithm is used to identify the most frequent high-frequency links within a short time window and prioritize placing the nodes connected to these links on the browser side to cope with communication under a stable network topology. Its formula is shown in (3).

[0073] ∑N s =GraphGreedy(G s ,pk) (3)

[0074] Where, ∑N s To determine which node is placed in the browser within a short time window, G s Let p be the communication graph within a short time window, p be the maximum number of virtual nodes running in the browser to maintain efficiency, and k be the core degree in the KCore algorithm.

[0075] K-Core Algorithm: To address the communication path changes that may result from network topology mutations (such as node failures), this algorithm is used to identify the core subgraph of the network within a long time window and provides a more flexible node placement strategy to enhance system robustness. Its formula is shown in (4).

[0076] ∑N l =KCore(G l ,k) (4)

[0077] Where, ∑N l To determine which node is placed in the browser within a long window, G l This represents the communication graph over a long window, where k is the core degree in the KCore algorithm.

[0078] Reference Figure 4 The example demonstrates a decision-making process. A purely greedy algorithm might choose nodes v1, v2, v4, v5, and v6, but when v4 fails, the communication path must detour through v3, leading to a significant increase in network overhead. However, the adaptive algorithm combined with K-Core anticipates this risk and includes v3 in the browser deployment, effectively reducing sudden network overhead.

[0079] The final set of nodes deployed on the browser is the union of the node sets obtained by the two strategies mentioned above. Its formula is shown in (5).

[0080] ∑N=∑N s ∪∑N l (5)

[0081] Where ∑N represents all nodes deployed in the browser, ∑N l With ∑N S These are the node sets obtained from the aforementioned steps.

[0082] Step 4: Virtual-Real Interaction;

[0083] To achieve seamless integration between the simulated world and the physical world, this invention provides a virtual-real interaction method that supports real devices acquiring virtual data and virtual devices acquiring real data.

[0084] Establishing a data interaction path between real devices and virtual devices specifically includes:

[0085] Step 4.1: The compilation service redirects specific library functions during compilation to implement virtual-physical interaction functionality in the firmware;

[0086] Step 4.2: The real device requests virtual data from the cloud through a data exchange frame, which includes a plaintext prefix for service identification, encryption type, and a message transmitted in ciphertext; the cloud generates data from the virtual sensing model according to the request and responds.

[0087] Step 4.3: The virtual device obtains real data forwarded from the real device via the cloud by listening to its general input / output interfaces.

[0088] This method first modifies the cloud-based compilation service to achieve function redirection. When the user's compilation configuration includes specific parameters, the compilation service redirects calls to low-level library functions (such as functions that read sensor data) to a new function that contains virtual-real interaction logic. The resulting binary firmware then possesses the ability to interact with the simulation system while remaining transparent to the user's code.

[0089] When a physical device acquires virtual information, it sends a standardized data exchange frame to the cloud service. (See reference...) Figure 5 The data frame consists of three parts: a plaintext prefix for service identification, bytes specifying the encryption type, and the actual message payload transmitted in an encrypted manner. This design encapsulates complex underlying IoT protocols into simple communication requests and protects against malicious attacks.

[0090] After receiving the request, the cloud generates data from the corresponding virtual data source based on the request content and returns it. As described in step 4.2, the virtual data source can come from at least one of the following methods:

[0091] a) Data generated by other virtual motherboard devices within the simulation system;

[0092] b) Data input by the user in real time through the front-end interactive interface;

[0093] c) Data calculated using a linear virtual sensing model. The calculation method is shown in (6);

[0094]

[0095] Where d represents the output data, t r To request a timestamp, t0 creates or updates a timestamp, f is the rate of change coefficient, and D... max With D min These represent the maximum and minimum values ​​of the data, respectively.

[0096] d) Data obtained through a random virtual sensing model. The calculation method is shown in (7):

[0097] d = r N +C (7)

[0098] Where r N Let C represent a random number, and C is a constant used to limit the minimum value of the generated sensor data.

[0099] When a virtual device acquires real information, the process is the reverse. Data collected by the real device is forwarded through the cloud and ultimately applied directly to the virtual device's corresponding general input / output interfaces. The virtual device can then obtain real-world data by listening to these interfaces.

[0100] Furthermore, to reduce the engineering costs of adding virtual-to-real interaction functionality to new devices or protocols, this invention also introduces an auxiliary tool based on a large language model. This tool utilizes a small number of samples for training and a thought chain strategy to automatically generate the required new dependency library code based on user input, main program code, and target device type, significantly improving the adaptation efficiency for heterogeneous devices and protocols.

[0101] Example 2

[0102] This embodiment discloses an Internet of Things (IoT) simulation system that supports virtual-real interaction within a browser. This system is used to execute the method described in Embodiment 1, including both cloud and browser interfaces.

[0103] The cloud includes:

[0104] The compilation service unit is used to redirect specific library functions during compilation to implement virtual-physical interaction functionality in the firmware;

[0105] A cloud-based interoperator is used to perform data transmission and reception between real and virtual devices: the real device requests virtual data from the cloud through a data exchange frame, the data exchange frame containing a plaintext prefix for service identification, an encryption type, and a message transmitted in ciphertext; the cloud generates data from the virtual sensing model according to the request and responds; the virtual device obtains real data forwarded by the real device via the cloud by listening to its general input / output interface;

[0106] A cloud-based scheduler is used to execute adaptive graph partitioning algorithms, specifically including:

[0107] Step 3.1: The algorithm adopts a trigger decision. When the ratio of cross-network node communication to the total number of node communication within a time window is greater than the empirical value, or the periodic timer is greater than the specified timing threshold, a trigger decision is made to ensure the update of the dynamic network. The formula is shown in (2).

[0108]

[0109] Where r represents cross-network node communication within a time window, e represents the total number of node communications within a time window, α represents an empirical value, timer is a periodic timer, and t s The specified timing threshold.

[0110] Step 3.2: In the decision-making process, the current high-frequency link is first identified by a greedy graph partitioning algorithm, so as to construct a set of nodes connected by the edge with the highest weight, as shown in (3).

[0111] ∑N s =GraphGreedy(G s ,pk) (3)

[0112] Where, ∑N s To determine which node is placed in the browser within a short time window, G s Let p be the communication graph within a short time window, p be the maximum number of virtual nodes running in the browser to maintain efficiency, and k be the core degree in the KCore algorithm.

[0113] Step 3.3: To address the delay caused by network topology mutations, the core subgraphs of the network are further identified based on the K-Core algorithm to provide resilience to changes in network conditions. The formula is shown in (4).

[0114] ∑N l =KCore(G l ,k) (4)

[0115] Where, ∑N l To determine which node is placed in the browser within a long window, G l This represents the communication graph over a long window, where k is the core degree in the KCore algorithm.

[0116] Step 3.4: Combine the two types of nodes obtained in Step 3.2 and Step 3.3 to obtain all the nodes finally deployed in the browser, as shown in formula (5).

[0117] ∑N=∑N s ∪∑N l (5)

[0118] Where ∑N represents all nodes deployed in the browser, ∑N l With ∑N s These are the node sets obtained from the aforementioned steps.

[0119] The browser includes:

[0120] Multiple virtual devices are used to execute the discretization execution mechanism, specifically including:

[0121] Step 2.1: Redirect the pause function set in the user code to a jump function. The jump function triggers a pause signal by modifying the register value in the virtual device. The hook function in the virtual device pauses the execution of the virtual device's central processing unit by checking the register value.

[0122] Step 2.2: When the set pause time is reached, a callback function is triggered to convert the virtual device from a paused state to a logical running state; when the virtual device resumes execution from the logical running state, the clock cycle is calibrated according to formula (1).

[0123]

[0124] Where Δc represents the difference in calibration clock cycles, t r The timestamp at the time of wake-up, t s The timestamps represent the timestamps during sleep, both accurate to milliseconds, F. m This indicates the clock frequency of the motherboard's core.

[0125] The worker manager is used to manage the activation and placement of the virtual devices.

[0126] Figure 6 This is a diagram illustrating the simulation system architecture provided by the present invention. The system adopts a layered design, primarily consisting of a cloud platform and a browser-based interface. Unlike centralized simulators, this system distributes a large number of simulation tasks to client browsers, thereby supporting large-scale user concurrency.

[0127] In addition, the system includes other management and functional components, such as an execution controller that oversees the lifecycle of the virtual device (from registration to termination) and performs fidelity compensation; and an emulation component that serves as a collection of simple IoT peripherals (such as LEDs and sensors) that interact with the virtual device's interface at specified times.

[0128] Those skilled in the art will understand that the above embodiments are specific examples of implementing this disclosure, and in practical applications, various changes can be made in form and detail without departing from the spirit and scope of the invention.

Claims

1. A browser-based IoT simulation method supporting virtual-real interaction, characterized in that, Includes the following steps: Step 1: In the web-based integrated development environment, obtain the user-written code and binary firmware, and manage the interaction of the IoT simulator; Step 2: Inject the binary firmware into the virtual device and run it through a discretization execution mechanism; Step 3: During the execution of the virtual device, an adaptive graph partitioning algorithm is used to dynamically partition and deploy the virtual device on the cloud or browser based on the network communication status, so as to reduce cross-platform communication latency. Step 4: Modify the cloud compilation service to generate binary firmware that supports virtual-real interaction, and establish a data interaction path between the real device and the virtual device to enable them to work together.

2. The method according to claim 1, characterized in that, The discretization execution mechanism in step two specifically includes: Step 2.1: Redirect the pause function set in the user code to a jump function. The jump function triggers a pause signal by modifying the register value in the virtual device. The hook function in the virtual device pauses the execution of the virtual device's central processing unit by checking the register value. Step 2.2: After the set pause time is reached, a callback function is triggered to convert the virtual device from a paused state (never running) to a logical running state; when the virtual device resumes execution from the logical running state, the clock cycle is calibrated according to the following formula: Where Δc represents the difference in calibration clock cycles, t r The timestamp at the time of wake-up, t s The timestamps represent the timestamps during sleep, both accurate to milliseconds, F. m This indicates the clock frequency of the motherboard's core.

3. The method according to claim 1, characterized in that, The adaptive graph partitioning algorithm in step three specifically includes: Step 3.1: This algorithm uses a trigger-based decision-making mechanism. When the ratio of cross-network node communication to the total number of node communications within a time window exceeds an empirical value, or when the periodic timer exceeds a predetermined timing threshold, a trigger decision is made to ensure the dynamic network is updated. The formula is as follows: Where r represents cross-network node communication within a time window, e represents the total number of node communications within a time window, α represents an empirical value, timer is a periodic timer, and t s The specified timing threshold; Step 3.2: In the decision-making process, a greedy graph partitioning algorithm is first used to identify the current high-frequency links, thereby constructing a set of nodes connected by the edges with the highest weights. The formula is expressed as: ∑N s =GraphGreedy(G s ,p-k) (3) Where, ∑N s To determine which node is placed in the browser within a short time window, G s For a short time window, p is the maximum number of virtual nodes running in the browser to maintain efficiency, and k is the core degree in the KCore algorithm; Step 3.3: To address the latency caused by sudden changes in network topology, the core subgraphs of the network are further identified based on the K-Core algorithm to provide resilience to changes in network conditions. The formula is expressed as follows: ∑N l =KCore(G l ,k) (4) Where, ∑N l To determine which node is placed in the browser within a long window, G l For the communication graph within a long window, k is the core degree in the KCore algorithm; Step 3.4: Merge the two types of nodes obtained in Step 3.2 and Step 3.3 to obtain all the nodes finally deployed in the browser, expressed by the formula: ∑N=∑N s ∪∑N l (5) Where ∑N represents all nodes deployed in the browser, ∑N l With ∑N s These are the node sets obtained from the aforementioned steps.

4. The method according to claim 1, characterized in that, Step four, which establishes a data interaction path between the real device and the virtual device, specifically includes: Step 4.1: The compilation service redirects specific library functions during compilation to implement virtual-physical interaction functionality in the firmware; Step 4.2: The real device requests virtual data from the cloud through a data exchange frame, which includes a plaintext prefix for service identification, encryption type, and a message transmitted in ciphertext; the cloud generates data from the virtual sensing model according to the request and responds. Step 4.3: The virtual device obtains real data forwarded from the real device via the cloud by listening to its general input / output interfaces.

5. The method according to claim 4, characterized in that, In step 4.2, the virtual data in the cloud response comes from at least one of the following methods: a) Data generated by other virtual motherboard devices within the simulation system; b) Data input by the user through the front-end interactive interface; c) The data obtained through the linear virtual sensing model is calculated as follows: Where d represents the output data, t r To request a timestamp, t0 creates or updates a timestamp, f is the rate of change coefficient, and D... max With D min These represent the maximum and minimum values ​​of the data, respectively. d) The data obtained through the random virtual sensing model is calculated as follows: d=r N +C (7) Where r N Let C represent a random number, and C is a constant used to limit the minimum value of the generated sensor data.

6. A browser-based IoT simulation system supporting virtual-real interaction, implementing the method described in claim 1, characterized in that, Including cloud and browser-based; The cloud includes: The compilation service unit is used to redirect specific library functions during compilation to implement virtual-physical interaction functionality in the firmware; A cloud-based interoperator is used to perform data transmission and reception between real and virtual devices: the real device requests virtual data from the cloud through a data exchange frame, the data exchange frame containing a plaintext prefix for service identification, an encryption type, and a message transmitted in ciphertext; the cloud generates data from the virtual sensing model according to the request and responds; the virtual device obtains real data forwarded by the real device via the cloud by listening to its general input / output interface; A cloud-based scheduler is used to execute adaptive graph partitioning algorithms, specifically including: Step 3.1: The algorithm adopts a trigger decision. When the ratio of cross-network node communication to the total number of node communication within a time window is greater than the empirical value, or the periodic timer is greater than the specified timing threshold, a trigger decision is made to ensure the update of the dynamic network. The formula is shown in (2). Where r represents cross-network node communication within a time window, e represents the total number of node communications within a time window, α represents an empirical value, timer is a periodic timer, and t s The specified timing threshold; Step 3.2: In the decision-making process, the current high-frequency link is first identified by a greedy graph partitioning algorithm, so as to construct a set of nodes connected by the edge with the highest weight, as shown in (3); ∑N s =FraphGreedy(G s ,p-k) (3) Where, ∑N s To determine which node is placed in the browser within a short time window, G s For a short time window, p is the maximum number of virtual nodes running in the browser to maintain efficiency, and k is the core degree in the KCore algorithm; Step 3.3: To address the delay caused by network topology changes, the core subgraph of the network is further identified based on the K-Core algorithm to provide resilience to changes in network conditions. The formula is shown in (4). ∑N l =KCore(G l ,k) (4) Where, ∑N l To determine which node is placed in the browser within a long window, G l For the communication graph within a long window, k is the core degree in the KCore algorithm; Step 3.4: Merge the two types of nodes obtained in Step 3.2 and Step 3.3 to obtain all the nodes finally deployed in the browser, as shown in formula (5); ∑N=∑N s ∪∑N l (5) Where ∑N represents all nodes deployed in the browser, ∑N l With ∑N s These are the node sets obtained from the preceding steps; The browser includes: Multiple virtual devices are used to execute the discretization execution mechanism, specifically including: Step 2.1: Redirect the pause function set in the user code to a jump function. The jump function triggers a pause signal by modifying the register value in the virtual device. The hook function in the virtual device pauses the execution of the virtual device's central processing unit by checking the register value. Step 2.2: When the set pause time is reached, a callback function is triggered to convert the virtual device from a paused state to a logical running state; when the virtual device resumes execution from the logical running state, the clock cycle is calibrated according to formula (1); Where Δc represents the difference in calibration clock cycles, t r The timestamp at the time of wake-up, t s The timestamps represent the timestamps during sleep, both accurate to milliseconds, F. m This indicates the clock frequency of the motherboard's core. The worker manager is used to manage the activation and placement of the virtual devices.