Method and system for implementing internet of things virtual simulation on web page
By deploying a front-end display layer, a back-end logic layer, and a data storage layer on a web page, and combining a discrete-time driven framework and 3D simulation technology, the problems of high cost and cross-platform difficulty in traditional IoT system testing are solved, achieving efficient, easy-to-upgrade, and highly realistic IoT virtual simulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional IoT system testing methods are costly, time-consuming, difficult to cross-platform, difficult to upgrade, and the simulation effect is not realistic enough, failing to demonstrate network signal performance in 3D space.
Deploy a front-end display layer, a back-end logic layer, and a data storage layer on a web page. Use a discrete-time driven framework to simulate network operations and combine Unity3D or Three.JS to implement 3D simulation, providing a cross-platform compatible and easily upgradeable IoT virtual simulation system.
It reduces deployment and maintenance costs, improves simulation efficiency and realism, achieves cross-platform compatibility, can more accurately simulate network conditions, and provides an intuitive simulation environment.
Smart Images

Figure CN119484517B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet of Things (IoT) virtual simulation technology, and more specifically to a method for implementing IoT virtual simulation on a web page and a system for applying this method. Background Technology
[0002] With the rapid development of IoT technology, the diversity and number of IoT devices have exploded, posing more stringent challenges and requirements for the testing, verification, and efficient deployment of IoT systems. Traditional IoT system testing methods have the following shortcomings:
[0003] 1. Traditional IoT system testing methods rely on actual hardware deployment, which is costly, time-consuming, and difficult to cover all possible scenarios.
[0004] 2. Traditional IoT system simulation software requires users to install a complete software suite on their computers. The simulation logic, data storage, and screen rendering all depend on the user's computer configuration. If the user's computer configuration is low, it may lead to simulation errors.
[0005] 3. Traditional IoT system simulation software typically requires users to install software that is tied to their own computer, making it incompatible with cross-platform systems and preventing easy access to simulation projects on other computers. For example, Windows system projects are often incompatible with macOS and Linux system projects.
[0006] 4. Traditional IoT system simulation software is difficult to upgrade, and incompatibility often occurs between project files and data before and after the upgrade. If a security vulnerability is found in traditional simulation software, all users are required to download the latest installation package and reinstall the software themselves, which is a huge workload and cannot achieve unified management and upgrades.
[0007] 5. Traditional IoT system simulation software typically uses 2D icons to display the status or behavior of IoT devices, which cannot display the performance of antennas and signals in 3D space, and cannot provide users with a simulation verification environment that is more in line with field applications. Summary of the Invention
[0008] To address the problems existing in the prior art, the present invention aims to provide a method and system for realizing IoT virtual simulation on a web page. It seeks to solve this technical challenge through an innovative web page IoT virtual simulation method, and achieve low-cost, high-efficiency IoT system verification and deployment.
[0009] The present invention achieves the above objectives through the following technical solutions:
[0010] A method for implementing IoT virtual simulation on a web page, the method comprising the following steps:
[0011] Resource deployment: Deploy the front-end display layer, back-end logic layer, and data storage layer on the server;
[0012] Simulation configuration: Load the front-end display layer content into the web page of the user terminal, and set the attributes of each simulation model in the IoT system according to actual needs;
[0013] Start simulation: Load the corresponding simulation logic and resources according to the user-set initialization information; initialize all device and environmental parameters and enter the simulation state; the backend logic layer monitors the data changes and device status during the simulation process, updates them in real time and sends them to the front end for display.
[0014] Model solution: A discrete-time driven framework is used to simulate network operations, ensuring that all network events occur at specific times; events are arranged in a discrete-time queue and executed automatically when their time arrives, thereby improving simulation accuracy and efficiency;
[0015] Visual presentation: The front-end presentation layer is loaded on the user terminal web page, providing functions for simulation configuration, viewing the simulation process and simulation results;
[0016] Dynamic editing: Allows editing of the simulation scene model; the backend logic layer dynamically loads resources and data based on the modified information and updates the frontend display in real time.
[0017] According to the present invention, a method for implementing Internet of Things (IoT) virtual simulation on a web page includes the following steps during resource deployment: First, the code of the front-end project is uploaded to a directory specified by the web server, and the web server is configured to correctly provide front-end resources. Second, the code of the back-end application is deployed to the server, and the back-end application is configured to correctly connect to the database and other necessary services. Third, the database is configured to store the data required by the back-end application.
[0018] According to the present invention, a method for implementing Internet of Things virtual simulation on a Web page is provided. When starting the simulation, the configuration information required for the simulation is submitted through the front-end interface. The back-end logic layer receives and parses the simulation configuration information sent by the front-end to determine the simulation resources that need to be loaded.
[0019] Based on the parsed configuration information, the backend logic layer loads the required device models from the data storage layer. The backend logic layer initializes each loaded device model according to the parameters set by the user. The initialized device parameters will be used in subsequent simulation calculations to simulate the actual behavior of the device.
[0020] The backend logic layer initializes the parameters of the simulation environment based on the environmental characteristics selected or defined by the user. These environmental parameters will affect the simulation behavior such as signal transmission and attenuation in the simulation environment.
[0021] According to the present invention, a method for implementing IoT virtual simulation on a web page is provided. After entering the simulation state, the backend logic layer immediately starts a monitoring mechanism to track data changes and device status during the simulation process.
[0022] The monitoring mechanism will periodically or according to event triggering conditions send the latest calculated data and device status to the front-end display layer. The front-end display layer establishes a connection with the back-end logic layer through a communication protocol, receives and parses the latest data and device status, extracts useful information to update the elements on the front-end interface, and provides user interaction functions by updating interface elements in real time.
[0023] The monitoring mechanism is set with trigger conditions. When specific conditions are met, the corresponding event handling logic will be triggered.
[0024] According to the present invention, a method for implementing IoT virtual simulation on a web page is provided. Before the simulation begins, the system constructs a transfer function based on the user's initial settings and the signal transmission characteristics. During the simulation, when the signal is transmitted in the system, the transfer function calculates the arrival time of the signal and other relevant parameters based on the signal characteristics and transmission path. Based on these parameters, the system generates a discrete arrival event and adds it to a discrete event queue. The events in the discrete event queue are sorted according to their arrival time. When the simulation time progresses to the arrival time of a certain event, the event is taken out of the queue and executed. The simulation process ends when all events have been executed or the user-defined simulation termination condition is met.
[0025] According to the present invention, a method for implementing IoT virtual simulation on a web page is provided, which introduces a clock module into a discrete event-driven framework. The clock module is consistent with the real world time to ensure that the execution speed of the discrete event-driven framework is consistent with the speed of the real world.
[0026] The time step of the discrete event-driven framework is dynamically adjusted based on the difference between the expected arrival time of the next event and the current real-world time, ensuring that the simulation time and real time are macroscopically aligned.
[0027] If the current real time has not yet reached the expected arrival time of the next event, the discrete event-driven framework chooses to wait until it approaches or reaches that time. Once the expected time is reached or exceeded, the discrete event-driven framework will trigger and execute the event.
[0028] According to the present invention, a method for implementing Internet of Things (IoT) virtual simulation on a web page includes, when implementing network simulation using a discrete-time driven framework, the following:
[0029] All possible events involved in network simulation are fully identified, and corresponding processing logic is developed for each event. This processing logic will be executed when the event occurs.
[0030] Create an event queue to store all pending events. Events in the queue must be ordered according to their scheduled occurrence time.
[0031] According to the present invention, a method for implementing Internet of Things virtual simulation on a Web page is provided, wherein one or more transfer functions are developed for the execution process of each event. These functions are used to simulate the process of signal transmission or event execution, and their output is one or more discrete events containing arrival time and related parameters.
[0032] When a signal is transmitted or an event is executed, its end time and other parameters are calculated by calling the corresponding transfer function, and the generated arrival event is added to the event queue.
[0033] Next, the newly generated events are added to the event queue according to their occurrence time, ensuring that the events in the queue are always arranged in chronological order.
[0034] During the simulation, the simulation system continuously checks whether the current time matches the occurrence time of an event in the event queue. Once a matching event is found, the system will immediately execute the processing logic associated with that event.
[0035] Repeat the above process until the simulation time reaches the preset end time or other stopping conditions are met.
[0036] A system for implementing IoT virtual simulation on a web page, the system being used to implement the aforementioned method for implementing IoT virtual simulation on a web page, comprising:
[0037] The front-end display layer runs on the web page of the user terminal, is used to interact with the user, receive user input, and display IoT virtual simulation scenarios, providing an intuitive graphical interface;
[0038] The backend logic layer and data storage layer are deployed on the server. When the simulation starts, they perform logical processing and manage the data flow during the simulation process according to the user's configuration.
[0039] According to the present invention, a system for implementing Internet of Things (IoT) virtual simulation on a web page is provided. The front-end display layer includes a web server, a front-end framework, user interface resources, and an interactive interface; the back-end logic layer includes a simulation model and a logic interface; and the data storage layer includes a database system, an interactive interface, and backup and recovery procedures.
[0040] Therefore, compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. Compared with traditional IoT testing and development environments, this invention can significantly reduce deployment and maintenance costs and improve development efficiency while ensuring functional integrity.
[0042] 2. This invention runs the IoT simulation model on a server, without relying on the performance of the user's device, and can achieve higher performance and larger scale simulation tasks.
[0043] 3. This invention has good cross-platform compatibility and can run widely on browsers of various operating systems and terminals.
[0044] 4. This invention deploys all resources on a server, allowing for convenient upgrades and maintenance. Once the server upgrade is complete, users can access the latest features and resources without needing to worry about software upgrades and maintenance.
[0045] 5. This invention uses technologies such as Unity3D or Three.JS to realize 3D simulation of IoT scenarios and devices, which not only improves the realism and immersion of the simulation, but also provides users with a more intuitive and easier-to-understand experimental environment.
[0046] 6. This invention visualizes the spatial behavior of network signals, enabling a more accurate simulation of network conditions in real-world environments and helping users better understand and optimize IoT systems. This simulation method is more intuitive and effective than traditional text or 2D graphics methods.
[0047] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0048] Figure 1 This is a flowchart of an embodiment of a method for implementing Internet of Things (IoT) virtual simulation on a web page according to the present invention.
[0049] Figure 2 This is a schematic diagram of an embodiment of a method for implementing IoT virtual simulation on a web page according to the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0051] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0052] An embodiment of a method for implementing IoT virtual simulation on a web page
[0053] See Figure 1 and Figure 2 This invention provides a method for implementing virtual simulation of the Internet of Things (IoT) on a web page, the method comprising the following steps:
[0054] Step S1, Resource Deployment: Deploy the front-end display layer, back-end logic layer, and data storage layer on the server;
[0055] Step S2, Simulation Configuration: Load the front-end display layer content into the user terminal's web page, and set the attributes of each simulation model in the IoT system according to actual needs;
[0056] Step S3, Start Simulation: Load the corresponding simulation logic and resources according to the user-set initialization information; initialize all device and environmental parameters and enter the simulation state; the backend logic layer monitors the data changes and device status during the simulation process, updates them in real time and sends them to the front end for display;
[0057] Step S4, Model Solving: A discrete-time driven framework is used to simulate network operations, ensuring that all network events occur at specific times; events are arranged in a discrete-time queue and automatically executed when the time arrives, in order to improve simulation accuracy and efficiency;
[0058] Step S5, Screen Presentation: Load the front-end display layer on the user terminal web page, providing functions for simulation configuration, viewing the simulation process and simulation results;
[0059] Step S6, Dynamic Editing: Allows editing of the simulation scene model; the backend logic layer dynamically loads resources and data based on the modified information and updates the frontend display in real time.
[0060] In step S1 above, when performing resource deployment, the code of the front-end project is uploaded to the directory specified by the web server, and the web server is configured to correctly provide front-end resources; the code of the back-end application is deployed to the server, and the back-end application is configured to correctly connect to the database and other necessary services; the database is configured to store the data required by the back-end application.
[0061] In step S2 above, the simulation system is opened, and the content of the front-end display layer is loaded onto the user terminal's web page. Then, based on actual needs, the attributes of each simulation model in the IoT system are set, including initial information such as the type, quantity, location layout, communication address, channel, antenna power, data packet content, and environmental parameters of each node device. After setting, this information will be sent to the back-end logic layer.
[0062] In step S3 above, upon starting the simulation, the configuration information required for the simulation is submitted through the front-end interface. The back-end logic layer receives and parses the simulation configuration information sent by the front-end to determine the simulation resources that need to be loaded. Based on the parsed configuration information, the back-end logic layer loads the required device models from the data storage layer. The back-end logic layer initializes each loaded device model according to the parameters set by the user. The initialized device parameters will be used in subsequent simulation calculations to simulate the actual behavior of the device. Simultaneously, the monitoring mechanism of the back-end logic layer tracks data changes and device status during the simulation process and sends the latest data and device status to the front-end display layer.
[0063] The backend logic layer initializes the parameters of the simulation environment based on the environmental characteristics selected or defined by the user. These environmental parameters will affect the simulation behavior such as signal transmission and attenuation in the simulation environment.
[0064] Meanwhile, once the simulation is in progress, the backend logic layer immediately initiates a monitoring mechanism to track data changes and device status during the simulation process.
[0065] The monitoring mechanism will periodically or according to event triggering conditions send the latest calculated data and device status to the front-end display layer. The front-end display layer establishes a connection with the back-end logic layer through a communication protocol, receives and parses the latest data and device status, extracts useful information to update the elements on the front-end interface, and provides user interaction functions by updating interface elements in real time.
[0066] The monitoring mechanism is set with trigger conditions. When specific conditions are met, the corresponding event handling logic will be triggered.
[0067] Specifically, when a user starts a simulation, the simulation configuration information (such as simulation scene, device type, parameter settings, etc.) submitted by the user through the front-end interface is sent to the back-end logic layer. The back-end immediately parses this configuration information and determines the simulation resources that need to be loaded (predefined 3D model files, device performance parameter tables, environment configuration files, etc.).
[0068] After loading the device model, the backend logic layer initializes the simulation parameters of each device based on user-defined parameters (such as antenna power, communication rate, initial position, etc.). These parameters will be used for subsequent simulation calculations. Similarly, the backend logic layer initializes the simulation environment parameters based on user-selected or defined environmental features (such as terrain, weather, interference sources, etc.). These environmental parameters will affect simulation behaviors such as signal transmission and attenuation.
[0069] Once the simulation begins, the backend logic layer will activate a monitoring mechanism to track data changes and device status during the simulation process. This includes real-time calculation of signal transmission path, attenuation, and received strength, as well as updating the device's current position, speed, direction, and other status information.
[0070] The monitoring mechanism will periodically or based on event triggering conditions send the latest data and device status to the front-end display layer (such as the device's real-time location, signal strength, communication status, etc.). The front-end display layer will use this data to update the display, ensuring that users can see the changes in the simulation process in real time.
[0071] In this embodiment, the simulation model uses a discrete-time driven framework to simulate network operations. All network events occur at a specific time. Events can be the sending or receiving of data packets, the acquisition of data from sensors, data updates, or interactive events caused by user operations. These events are automatically arranged in a discrete-time queue, and are automatically executed when the time arrives.
[0072] The transmission behavior of all signals and data packets will be transformed into a transfer function based on the user's initial settings and the signal transmission characteristics. The output of this transfer function is a discrete arrival event, which will be automatically queued in the discrete event queue. When the simulation time arrives, the event will be executed automatically.
[0073] Before the simulation begins, the system constructs a transfer function based on the user's initial settings and the signal transmission characteristics. During the simulation, as the signal is transmitted through the system, the transfer function calculates the signal's arrival time and other relevant parameters based on the signal's characteristics and transmission path. Based on these parameters, the system generates a discrete arrival event and adds it to the discrete event queue. The events in the discrete event queue are sorted according to their arrival time. When the simulation progresses to the arrival time of a certain event, the event is removed from the queue and executed. The simulation process ends when all events have been executed or the user-defined simulation termination condition is met.
[0074] In step S4 above, a clock module is introduced into the discrete event-driven framework. This clock module is synchronized with real-world time to ensure that the execution speed of the discrete event-driven framework is consistent with the real-world speed. The time step of the discrete event-driven framework is dynamically adjusted according to the difference between the expected arrival time of the next event and the current real-world time, ensuring that the simulation time and real time are macroscopically aligned. If the current real-world time has not yet reached the expected arrival time of the next event, the discrete event-driven framework chooses to wait until it approaches or reaches that time. Once the expected time is reached or exceeded, the discrete event-driven framework will trigger and execute the event. Therefore, to ensure that the execution speed of the discrete event-driven framework is consistent with the real-world speed, this embodiment introduces a clock module into the discrete event-driven framework. This module is synchronized with real-world time, and the time step of the discrete event-driven framework is dynamically adjusted according to the difference between the expected arrival time of the next event and the current real-world time, ensuring that the simulation time and real time are macroscopically aligned.
[0075] In this embodiment, when implementing network simulation using a discrete-time driven framework, the following are included:
[0076] First, comprehensively identify all possible events involved in the network simulation, such as the sending or receiving of data packets, sensor data acquisition, data updates, and interactive events caused by user operations. Develop corresponding processing logic for each event, which will be executed when the event occurs.
[0077] Next, create an event queue to store all pending events. Events in the queue must be ordered according to their predetermined occurrence time. Each event in the event queue should include the event type, occurrence time, relevant parameters (such as data packet content, sensor data, etc.), and the procedure for processing the event.
[0078] Since the event processing method is not completed instantaneously but requires a certain amount of time, and one or more events and data may be output during the event execution process, one or more transfer functions need to be developed for each event execution process. These functions are used to simulate the signal transmission or event execution process, and their output is one or more discrete events containing arrival time and related parameters. When a signal is transmitted or an event is executed, the corresponding transfer function is called to calculate its end time and other parameters, and the generated arrival event is added to the event queue. Then, the newly generated events are added to the event queue according to their occurrence time, ensuring that the events in the queue are always arranged in chronological order.
[0079] During the simulation, the system continuously checks if the current time matches the occurrence time of an event in the event queue. Once a match is found, the system immediately executes the processing logic associated with that event. This process is repeated until the simulation reaches a preset end time or other stopping conditions are met.
[0080] Meanwhile, during the simulation, the monitoring mechanism of the backend logic layer tracks the data changes and device status during the simulation process, and sends the latest data and device status to the frontend display layer.
[0081] In step S5 above, the front-end presentation layer is loaded onto the web page on the user's computer when the user opens the simulation system. The user configures the simulation, views the simulation process and results through the web page, and can also edit the simulation scene. Then the simulation model continues to run the simulation based on the information modified by the user.
[0082] When a user selects a simulation scenario, the web client retrieves the corresponding scenario resources from the data storage layer on the server and then presents them in 3D on the user's computer's web page. Next, the user sets the attributes of each simulation model in the IoT system, including the type, quantity, location layout, communication address, channel, antenna power, data packet content, environmental parameters, and other initial information for each node device. Once the settings are complete, the simulation begins.
[0083] After the simulation starts, the front-end presentation layer continuously receives data and device status from the back-end logic layer, and then immediately displays the data and device status.
[0084] Furthermore, when visualizing network signals, particle systems in Unity3D or Three.js are used to simulate signal propagation and attenuation. A particle emitter can be created near the antenna model of each communication device; the emitted particles represent signal propagation. As the particles travel a greater distance, the number, speed, or brightness of the particles are gradually reduced to simulate signal attenuation. By adjusting parameters and algorithms, network conditions under different environments can be accurately simulated. When the user adjusts parameters such as antenna transmission power, channel, and location, the particle emission speed, direction, lifespan, and color are simultaneously adjusted to simulate the propagation speed and attenuation effects of signals in different states.
[0085] Furthermore, this embodiment can also write custom shaders to achieve more complex signal propagation and attenuation effects. By calculating the distance between each pixel or vertex in 3D space and the signal source, and considering the absorption and scattering characteristics of the medium, the attenuation and deformation of the signal in space can be simulated, thereby showing the electromagnetic wave radiation field model of the antenna under different working conditions, including electric field distribution, magnetic field distribution, energy distribution, etc., to help users understand the radiation characteristics of the antenna signal.
[0086] In step S6 above, users can also modify the model in the simulation scenario. For example, they can manually add or delete devices, modify the address and antenna power of communication modules, and set information such as transmission delay, bandwidth, data packet loss rate, device position and orientation, and device movement direction and speed of the simulation model. The backend logic layer will dynamically load resources and data according to the user's modifications, and then send the latest data and device status to the frontend presentation layer.
[0087] In practical applications, the simulation system environment setup in this embodiment includes:
[0088] Server configuration:
[0089] Operating System: Ubuntu 20.04LTS
[0090] Web server: Nginx
[0091] Database: MySQL
[0092] Programming languages and frameworks: C++ (for NS3 emulation development), Vue.js (front-end framework)
[0093] Software installation and configuration:
[0094] Install Nginx: Install Nginx using Ubuntu's apt package manager and configure basic web services, including static file service and reverse proxy (if needed).
[0095] Install MySQL: Install the MySQL server via apt and create a database to store the simulation model's properties and experimental initialization data.
[0096] Install Unity Hub and configure the Unity editor to support WebGL export.
[0097] Deploying a Vue project to Nginx: Build the Vue project into static files and place it in a specified directory in Nginx, then configure Nginx to serve these files.
[0098] NS3 simulation environment configuration:
[0099] Compile and install the NS3 network emulator on the Ubuntu server.
[0100] Write a Zigbee simulation model in C++. This model needs to be integrated into the NS3 framework, and corresponding APIs need to be designed for communication with the front end.
[0101] Vue front-end development:
[0102] Use Vue CLI to create a project structure, including routing, state management (Vuex), etc.
[0103] Develop the user interface, including an experimental parameter setting panel and a 3D scene display area.
[0104] Implement a communication interface with the backend NS3 simulation model, and use WebSocket or HTTP requests for real-time data exchange.
[0105] Unity WebGL 3D scene development:
[0106] Create 3D scenes in Unity, including models of communication devices, antennas, etc.
[0107] The particle system in Unity is used to simulate signal propagation and attenuation, and the properties of the particle emitter are dynamically adjusted based on the parameters sent from the backend.
[0108] Write custom shaders and use ShaderLab and GLSL to implement complex signal attenuation effects, such as considering medium absorption and scattering.
[0109] Export the WebGL project and embed it into a Vue application.
[0110] Backend simulation model implementation:
[0111] NS3 simulation model:
[0112] Write a Zigbee simulation module in NS3 using C++. This module needs to support functions such as multi-node communication and signal attenuation simulation.
[0113] Implement an interface for communication with the front end, receive instructions from the front end by listening on a specific port, and return simulation results.
[0114] The attributes of each simulation model are stored in a MySQL database, including device location, antenna parameters, channel settings, etc.
[0115] Database design:
[0116] Design MySQL database tables to store initialization data, equipment configuration, experimental results, etc. for simulation experiments.
[0117] Write SQL scripts to create databases and tables, and initialize the necessary data.
[0118] System interaction process
[0119] User actions:
[0120] Users can set simulation parameters, such as device location, antenna power, and channel selection, through the Vue front-end interface.
[0121] The front end sends the user-input data to the back end NS3 emulation server via WebSocket or HTTP request.
[0122] Backend processing:
[0123] The NS3 simulation server receives data from the front end and starts the simulation model according to the parameters set by the user.
[0124] During the simulation, the NS3 model calculates signal propagation and attenuation and returns the results to the front end in real time.
[0125] Front-end display:
[0126] The Unity WebGL scene receives simulation data from the backend, dynamically adjusts the parameters of the particle system, and visually displays the signal propagation and attenuation process.
[0127] Custom shaders render the attenuation effect of signals in 3D space based on calculated data, displaying distribution maps of electric fields, magnetic fields, etc.
[0128] Data feedback:
[0129] After the simulation is complete, NS3 stores the final results in a MySQL database, and the front end can query and display the simulation report.
[0130] A system embodiment for implementing IoT virtual simulation on a web page
[0131] A system for implementing IoT virtual simulation on a web page, the system being used to implement the aforementioned method for implementing IoT virtual simulation on a web page, comprising:
[0132] The front-end display layer runs on the web page of the user terminal, is used to interact with the user, receive user input, and display IoT virtual simulation scenarios, providing an intuitive graphical interface;
[0133] The backend logic layer and data storage layer are deployed on the server. When the simulation starts, they perform logical processing and manage the data flow during the simulation process according to the user's configuration.
[0134] In this embodiment, to ensure that the server, network devices, and user terminals (computers, mobile phones, or other terminals) are correctly connected via a local area network or the Internet, resources for the front-end display layer, back-end logic layer, and data storage layer are deployed on the server. The front-end display layer should include: a web server (Nginx or Apache, etc.), a front-end framework (React, Vue, or Angular, etc.), user interface resources, and interactive interfaces; the back-end logic layer should include: a simulation model (an executable program that implements IoT simulation) and logical interfaces (interfaces for communication with the front-end and data storage); the data storage layer should include: a database system (such as MySQL, PostgreSQL, or MongoDB, etc.), interactive interfaces, and backup and recovery programs.
[0135] Preferably, the front-end presentation layer in this embodiment is mainly implemented using Unity WebGL technology and Three.JS technology. It will present the IoT virtual simulation scene in 3D form on the user's computer in the form of a web client, especially showing the performance of antennas and signals in space, enhancing the simulation effect and improving the user experience.
[0136] Preferably, in this embodiment, the backend logic layer runs an IoT simulation model. Once the backend logic layer receives the simulation configuration information, it can execute simulation tasks. It can calculate the transmission and attenuation of wireless signals in real time according to preset behavioral rules. It can also process various user-defined data packets or communication protocols and respond according to user settings. Users can modify these behavioral rules according to their needs, such as device interaction relationships and event triggering conditions.
[0137] Preferably, the data storage layer in this embodiment stores a large number of simulation resources, including model parameters of different communication devices, environmental characteristics of different scenarios, real-time status data of IoT devices, user account information, etc.
[0138] Furthermore, the device model parameters in the data storage layer are derived from test data of real IoT devices, such as antenna power, transmission distance, communication rate, and signal-to-noise ratio. This data can be modified to meet the personalized simulation needs of different users.
[0139] Furthermore, the data storage layer provides various scenario resources tailored to different environmental characteristics, such as smart agriculture, smart transportation, and smart homes. Users can load these resources according to their actual needs without installing large resource software on their computers. Users can also edit these scenario resources, such as setting different weather conditions or adding interference sources.
[0140] In summary, compared to traditional IoT testing and development environments, this invention significantly reduces deployment and maintenance costs and improves development efficiency while ensuring functional integrity. This invention runs the IoT simulation model on a server, independent of the performance of user-end devices, enabling higher performance and larger-scale simulation tasks. This invention has excellent cross-platform compatibility, running widely on various operating systems and browsers. Deploying all resources on the server allows for convenient upgrades and maintenance. Once the server is upgraded, users can access the latest features and resources without needing to worry about software upgrades and maintenance. This invention uses technologies such as Unity3D or Three.JS to achieve 3D simulation of IoT scenarios and devices, not only improving the realism and immersion of the simulation but also providing users with a more intuitive and easier-to-understand experimental environment. By visualizing the spatial behavior of network signals, this invention can more accurately simulate network conditions in real-world environments, helping users better understand and optimize IoT systems. This simulation method is more intuitive and effective than traditional text or 2D graphics methods.
[0141] It should be noted that the embodiments of the present invention can be deployed on a server with a network. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code. The above descriptions are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
[0142] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A method for implementing virtual Internet of Things (IoT) simulation on a web page, characterized in that, The method includes the following steps: Resource deployment: Deploy the front-end display layer, back-end logic layer, and data storage layer on the server; Simulation configuration: Load the front-end display layer content into the web page of the user terminal, and set the attributes of each simulation model in the IoT system according to actual needs; Start simulation: Load the corresponding simulation logic and resources according to the user-set initialization information; initialize all device and environmental parameters and enter the simulation state; the backend logic layer monitors the data changes and device status during the simulation process, updates them in real time and sends them to the front end for display. Model solution: A discrete event-driven framework is used to simulate network operations, ensuring that all network events occur at specific times; events are arranged in a discrete event queue and executed automatically when the time arrives, thereby improving simulation accuracy and efficiency; Visual presentation: The front-end presentation layer is loaded on the user terminal web page, providing functions for simulation configuration, viewing the simulation process and simulation results; Dynamic editing: Allows editing of the simulation scene model; the backend logic layer dynamically loads resources and data based on the modified information and updates the frontend display in real time; Once the simulation is initiated, the backend logic layer immediately activates a monitoring mechanism to track data changes and device status during the simulation process. The monitoring mechanism will periodically or according to event triggering conditions send the latest calculated data and device status to the front-end display layer. The front-end display layer establishes a connection with the back-end logic layer through a communication protocol, receives and parses the latest data and device status, extracts useful information to update the elements on the front-end interface, and provides user interaction functions by updating interface elements in real time. The monitoring mechanism is set with trigger conditions. When specific conditions are met, the corresponding event handling logic will be triggered. Before the simulation begins, the system constructs a transfer function based on the user's initial settings and the signal transmission characteristics. During the simulation, as the signal is transmitted through the system, the transfer function calculates the signal's arrival time and other relevant parameters based on the signal's characteristics and transmission path. Based on these parameters, the system generates a discrete arrival event and adds it to a discrete event queue. The events in the discrete event queue are ordered according to their arrival time. When the simulation progresses to the arrival time of a certain event, that event is removed from the queue and executed. The simulation process ends when all events have been executed or the user-defined simulation termination condition is met. Introduce a clock module in the discrete event-driven framework that is synchronized with real-world time to ensure that the execution speed of the discrete event-driven framework is consistent with the speed of the real world. The time step of the discrete event-driven framework is dynamically adjusted based on the difference between the expected arrival time of the next event and the current real-world time, ensuring that the simulation time and real time are macroscopically aligned. If the current real time has not yet reached the expected arrival time of the next event, the discrete event-driven framework chooses to wait until it approaches or reaches that time. Once the expected time is reached or exceeded, the discrete event-driven framework will trigger and execute the event.
2. The method according to claim 1, characterized in that: When deploying resources, upload the front-end project code to the directory specified by the web server and configure the web server to provide the front-end resources correctly. Deploy the backend application code to the server, configure the backend application to connect to the database correctly, and configure the database to store the data required by the backend application.
3. The method according to claim 1, characterized in that: When starting the simulation, the configuration information required for the simulation is submitted through the front-end interface. The back-end logic layer receives and parses the simulation configuration information sent by the front-end to determine the simulation resources that need to be loaded. Based on the parsed configuration information, the backend logic layer loads the required device models from the data storage layer. The backend logic layer initializes each loaded device model according to the parameters set by the user. The initialized device parameters will be used in subsequent simulation calculations to simulate the actual behavior of the device. The back-end logic layer initializes the parameters of the simulation environment based on the environmental characteristics selected or defined by the user. These environmental parameters will affect the transmission and attenuation simulation behavior of signals in the simulation environment.
4. The method according to claim 1, characterized in that: When implementing network simulation using a discrete event-driven framework, the following are included: All possible events involved in network simulation are fully identified, and corresponding processing logic is developed for each event. This processing logic will be executed when the event occurs. Create an event queue to store all pending events. Events in the queue must be ordered according to their scheduled occurrence time.
5. The method according to claim 4, characterized in that: Develop one or more transfer functions for the execution process of each event. These functions are used to simulate the process of signal transmission or event execution, and their output is one or more discrete events containing arrival time and related parameters. When a signal is transmitted or an event is executed, its end time and other parameters are calculated by calling the corresponding transfer function, and the generated arrival event is added to the event queue. Next, the newly generated events are added to the event queue according to their occurrence time, ensuring that the events in the queue are always arranged in chronological order; During the simulation, the simulation system continuously checks whether the current time matches the occurrence time of an event in the event queue. Once a matching event is found, the system will immediately execute the processing logic associated with that event. Repeat the above process until the simulation time reaches the preset end time or other stopping conditions are met.
6. A system for implementing virtual simulation of the Internet of Things (IoT) on a web page, characterized in that, This system is used to implement the method for realizing Internet of Things virtual simulation on a web page as described in any one of claims 1 to 5, comprising: The front-end display layer runs on the web page of the user terminal, is used to interact with the user, receive user input, and display IoT virtual simulation scenarios, providing an intuitive graphical interface; The backend logic layer and data storage layer are deployed on the server. When the simulation starts, they perform logical processing and manage the data flow during the simulation process according to the user's configuration.
7. The system according to claim 6, characterized in that: The front-end display layer includes a web server, a front-end framework, user interface resources, and interactive interfaces; the back-end logic layer includes a simulation model and logical interfaces; and the data storage layer includes a database system, interactive interfaces, and backup and recovery programs.
Citation Information
Patent Citations
Simulation IOT resource service system and method
CN106027319A
Lightweight embedded 3D simulation method and system
CN117216951A