A method for providing an operating environment for the Internet of Things
By loading debug data in the virtual machine and utilizing the combination of event-driven and optimization analysis units, the problems of versatility and abnormal positioning in the software development of IoT terminal products are solved, and efficient risk limitation and abnormal positioning are achieved.
Patent Information
- Application Number
- CN202211025306.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-08-25
AI Technical Summary
The prior art is difficult to implement a multifunctional operating environment based on actual operation in the software development of IoT terminal products, and it is impossible to quickly locate abnormalities in abnormal situations.
By loading debugging data in the virtual machine, the event driver unit is used to generate semi-compiled execution code, and through the cooperation between the optimization analysis unit and the security verification module, risk identification and trimming are carried out to achieve rapid positioning and risk limitation of abnormal situations.
It realizes a multi-functional operating environment based on actual operation in the software development of IoT terminal products, and quickly locates abnormalities in abnormal situations, enhancing the functionality and security of the operating environment.
Smart Images

Figure CN115617449B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet of Things, and specifically provides a method for providing an operating environment for the Internet of Things. Background Art
[0002] The operating environment, also known as the runtime system, refers to an environment in which semi-compiled runtime code runs on a target machine. All languages based on the runtime system are semi-compiled and semi-interpreted languages. For event-driven, take a simple example. For instance, based on user input (i.e., what event occurs, such as clicking on a button), what operation the computer performs (i.e., which function is called). Of course, events are not limited to user input. The core of event-driven is naturally the event. From the perspective of events, the basic structure of an event-driven program consists of an event collector, an event sender, and an event processor. The event collector is specifically responsible for collecting all events, including those from users (such as mouse and keyboard events), from hardware (such as clock events), and from software (such as the operating system and the application itself). The event sender is responsible for distributing the events collected by the collector to the target objects. The event processor performs specific event response work, and it is often not fully determined until the implementation stage, so the virtual function mechanism needs to be used. The event-driven architecture consists of three basic components: events, event processors, and event loops. After an event is generated, it is sent to the event loop, and the event loop dispatches each event to the respective event processors. Event A is processed by processor A, and event B will be processed by processor B.
[0003] For example, in a method and system for providing an operating environment for the Internet of Things described in Patent Application No. 202111174828.5, it is pointed out that the execution of all callback functions in the events of the traditional runtime system is disorderly, or simply executed in the registration order, without taking advantage of the real-time characteristics of Internet of Things devices. And by setting the priorities of the callback functions corresponding to various events, the real-time performance of event-driven is ensured.
[0004] Based on the retrieval of the above information, it can be seen that when providing an operating environment for the Internet of Things, there is a lack of judgment on influencing variables. That is, when developing software for Internet of Things terminal products and running it on a virtual machine, the versatility of the operating environment based on the actual operating conditions cannot be achieved, and the rapid positioning of exceptions in abnormal situations cannot be achieved. Often, when an exception occurs, subsequent tests are still required to locate the exception during the software development process. Summary of the Invention
[0005] (1) Technical Problems to be Solved
[0006] In view of the deficiencies of the prior art, the present invention provides a method for providing an Internet of Things (IoT) operating environment, which solves the problems that when software development is carried out for IoT terminal products and run on a virtual machine, the versatility of the operating environment based on the actual operating conditions cannot be achieved, and the rapid positioning of exceptions in case of exceptions cannot be achieved.
[0007] (II) Technical Solution
[0008] To achieve the above object, the present invention provides the following technical solution: A method for providing an IoT operating environment, specifically including the following steps:
[0009] Step 1, Standard Library Establishment: The data loading unit loads the standard data of different IoT terminals and the ideal result data after the target code compilation in the virtual machine as debugging data, and at the same time docks with security software to identify the risks of the IoT loaded data.
[0010] Step 2, Event-driven: Load the target code into the event-driven unit of the virtual machine to generate a semi-compiled execution code, and send the standard data of different IoT terminals loaded in Step 1 to the event loop in the initial order. The event loop sends the standard data of a single IoT as a single data to the event processor for processing.
[0011] Step 3, Result Verification: Transmit the event processing result in Step 2 to the optimization analysis unit of the virtual machine, and compare it with the ideal result data corresponding to the standard data. If the results are consistent, the verification is completed; if the results are inconsistent, go to Step 4.
[0012] Step 4, Security Verification: When the comparison results in Step 3 are inconsistent, the optimization analysis unit authenticates the risk level when the corresponding IoT terminal sends data to the event loop. After the risk level is adjusted, repeat the operations of Step 2 and Step 3. When the results are consistent, determine the risk level of the corresponding IoT terminal; when the results are inconsistent, go to Step 5.
[0013] Step 5, Data Debugging: Classify the importance of different IoT terminals in Step 1, sort them according to the importance level of the IoT terminals to obtain a screening and sorting, select the same standard data, and repeat the operations of Step 2, Step 3, and Step 4 according to the screening and sorting. If the results are consistent, the verification is completed; if the results are inconsistent, replace the standard data and repeat the operations of Step 2, Step 3, and Step 4 for comparison. If the results are consistent, the comparison is completed; if the results are inconsistent, mark the execution code of the debugging data of the corresponding IoT terminal as an abnormal state.
[0014] By adopting the above technical solution, debug data is loaded into the virtual machine as test data when the virtual area is docked with the Internet of Things. Through the method of risk monitoring and adjustment, when verifying the execution code by inputting data of different risk levels into the virtual area, rapid positioning of abnormal situations is carried out, and risk limitation is provided for the accuracy of the execution code when it is put into actual use. And through the method of screening and sorting, the execution code exception of the corresponding Internet of Things terminal is located, providing an operating environment integrating risk limitation and abnormal positioning.
[0015] The present invention is further configured such that: the data loading unit is respectively docked with the event-driven unit, the optimization analysis unit, and the debugging unit, and the event-driven unit is respectively docked with the optimization analysis unit and the debugging unit.
[0016] The present invention is further configured such that: the data loading unit includes a terminal classification module, a security verification module, and a data import module;
[0017] The terminal classification module is used to test the loading order of the standard data of the Internet of Things terminal as the initial order;
[0018] The security verification module is used to dock with security software to identify the risks of the data loaded by the Internet of Things;
[0019] The data import module is used to load the debug data into the event-driven unit.
[0020] By adopting the above technical solution, when the debug data is loaded into the virtual area, risk control is carried out, so as to simulate and judge the operating environment of the operating system in the virtual area according to the risk level, and the effective operating conditions of the execution code of the corresponding Internet of Things terminal in the virtual area are highlighted in the form of importance classification, providing a flexible and convenient auxiliary environment for software development.
[0021] The present invention is further configured such that: the event-driven unit includes an execution code generation module, an event import module, an event loop module, and an event processing module, and the event loop module is docked with the event processing module;
[0022] The execution code generation module is used to load the target code into the event-driven unit of the virtual machine to generate a semi-compiled execution code;
[0023] The event import module is used to sequentially send the standard data of different Internet of Things terminals to the event loop according to the initial order, and to sequentially send the standard data of different Internet of Things terminals to the event loop according to the screening and sorting;
[0024] The event loop module is used to send the standard data of a single Internet of Things as a single data to the event processor;
[0025] The event processing module, as an event processor, is used to process the standard data of the Internet of Things according to the execution code.
[0026] The present invention is further configured as: the optimization analysis unit includes a standard verification module, a security level analysis module, a verification analysis module, and a target determination module. The standard verification module is docked with the security level analysis module, the security level analysis module is docked with the verification analysis module, and the verification analysis module is docked with the target determination module.
[0027] The present invention is further configured as: the standard verification module is used to receive the event processing result of the event driving unit and compare it with the corresponding ideal result data of the standard data;
[0028] The security level analysis module is used to authenticate the risk level when the Internet of Things terminal sends data to the event loop when the comparison result of the standard verification module is inconsistent;
[0029] The verification analysis module is used to trim the risk when the Internet of Things terminal sends data to the event loop and process the trimmed data in the event driving unit;
[0030] The target determination module is used to determine the risk level of the corresponding Internet of Things terminal and mark it as the safe working risk level when the comparison result between the event processing result corresponding to the data after risk trimming and the debugging data is consistent. When the results are inconsistent, the abnormal situation is sent to the debugging unit.
[0031] The present invention is further configured as: the debugging unit includes a screening and sorting module, a data replacement module, and an abnormal marking module. The screening and sorting module is docked with the data replacement module, and the data replacement module is docked with the abnormal marking module.
[0032] The present invention is further configured as: the screening and sorting module is used to classify the importance of different Internet of Things terminals, sort them according to the importance classification of the Internet of Things terminals, and obtain the screening and sorting;
[0033] The data replacement module is used to replace the standard data;
[0034] The abnormal marking module is used to mark the execution code of the debugging data of the corresponding Internet of Things terminal as an abnormal state when the comparison result is still inconsistent after the standard data is replaced.
[0035] By adopting the above technical solutions, after risk elimination of the debugging data, the set input of screening and sorting is performed, combined with the replacement of the standard data, the execution code in the abnormal state can be quickly located, and the abnormal location of the development software running in the virtual area can be quickly located without subsequent testing, enhancing the functionality of the operating environment.
[0036] (3) Beneficial effects
[0037] The present invention provides a method for providing an operating environment for the Internet of Things, which has the following beneficial effects:
[0038] (1) In the method for providing an operating environment for the Internet of Things, by loading debugging data into a virtual machine as test data for docking the virtual area with the Internet of Things, through the method of risk monitoring and adjustment, when verifying the execution code by inputting data of different risk levels into the virtual area, it is possible to quickly locate abnormal situations, and provide risk limitation for the accuracy of the execution code when it is put into actual use. Moreover, through the method of screening and sorting, it is possible to locate the abnormality of the execution code corresponding to the Internet of Things terminal, providing an operating environment that integrates risk limitation and abnormal situation location.
[0039] (2) In the method for providing an operating environment for the Internet of Things, when loading the debugging data into the virtual area, risk control is carried out, so as to simulate and judge the operating environment of the operating system in the virtual area according to the risk level, and highlight the effective operating status of the execution code corresponding to the Internet of Things terminal in the virtual area through the form of importance grading, providing a flexible and convenient auxiliary environment for software development.
[0040] (3) In the method for providing an operating environment for the Internet of Things, after excluding risks from the debugging data, set input of screening and sorting is carried out, combined with the replacement of standard data, to quickly locate the execution code in an abnormal state. Without the need for subsequent testing, it is possible to quickly locate the abnormality of the developed software running in the virtual area, enhancing the functionality of the operating environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flowchart of the present invention;
[0042] Figure 2 It is a system principle block diagram of the present invention;
[0043] Figure 3 It is a system principle block diagram of the data loading unit of the present invention;
[0044] Figure 4 It is a system principle block diagram of the event-driven unit of the present invention;
[0045] Figure 5 It is a system principle block diagram of the optimization analysis unit of the present invention;
[0046] Figure 6 It is a system principle block diagram of the debugging unit of the present invention.
[0047] In the figure, 1 is the data loading unit; 2 is the event-driven unit; 3 is the optimization analysis unit; 4 is the debugging unit; 5 is the terminal classification module; 6 is the security verification module; 7 is the data import module; 8 is the execution code generation module; 9 is the event import module; 10 is the event loop module; 11 is the event processing module; 12 is the standard verification module; 13 is the security level analysis module; 14 is the verification analysis module; 15 is the target determination module; 16 is the screening and sorting module; 17 is the data replacement module; 18 is the exception annotation module. Detailed implementation mode
[0048] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0049] Please refer to Figure 1-6 , the embodiments of the present invention provide the following technical solutions:
[0050] Embodiment 1
[0051] A method for providing an Internet of Things operating environment specifically includes the following steps:
[0052] Step 1, standard library establishment: The data loading unit 1 loads the standard data of different Internet of Things terminals and the ideal result data after the target code is compiled in the virtual machine as debugging data, and at the same time docks with security software to identify the risks of the Internet of Things loaded data.
[0053] Step 2, event-driven: Load the target code into the event-driven unit 2 of the virtual machine to generate a semi-compiled execution code, and send the standard data of different Internet of Things terminals loaded in Step 1 to the event loop in the initial order. The event loop sends the standard data of a single Internet of Things as a single data to the event processor for processing.
[0054] Step 3, result verification: Transmit the event processing result in Step 2 to the optimization analysis unit 3 of the virtual machine and compare it with the ideal result data corresponding to the standard data. If the results are consistent, the verification is completed. If the results are inconsistent, go to Step 4.
[0055] Step 4, security verification: When the comparison result is inconsistent in Step 3, the optimization analysis unit 3 authenticates the risk level when the corresponding Internet of Things terminal sends data to the event loop. After the risk level is adjusted, repeat the operations in Step 2 and Step 3. When the results are consistent, determine the risk level of the corresponding Internet of Things terminal.
[0056] In this embodiment, by trimming the risk level, the impact degree of the risk on the system running in the virtual area during the data transmission process of the Internet of Things terminal is determined, and an Internet of Things operating environment with a limited security operation risk is constructed.
[0057] Embodiment 2
[0058] A system for providing an Internet of Things operating environment, as shown in the appendix Figure 2 includes a data loading unit 1, an event-driven unit 2, an optimization analysis unit 3, and a debugging unit 4. The data loading unit 1 is respectively connected to the event-driven unit 2, the optimization analysis unit 3, and the debugging unit 4. The event-driven unit 2 is respectively connected to the optimization analysis unit 3 and the debugging unit 4. A method for providing an Internet of Things operating environment specifically includes the following steps:
[0059] Step 1: Standard library establishment: The data import module 7 loads the standard data of different Internet of Things terminals and the ideal result data after the target code compilation in the virtual machine as debugging data and loads them into the event-driven unit 2. The security verification module 6 docks with security software to identify the risks of the Internet of Things loaded data. The terminal grading module 5 tests the loading order of the standard data of the Internet of Things terminals as the initial order.
[0060] Step 2: Event-driven: Load the target code into the execution code generation module 8 of the virtual machine to generate semi-compiled execution code. The event import module 9 sequentially sends the standard data of different Internet of Things terminals loaded in Step 1 to the event loop in the initial order. The event loop module 10 sends the standard data of a single Internet of Things as a single data to the event processing module 11 for processing.
[0061] Step 3: Result verification: Transmit the event processing result in Step 2 to the standard verification module 12 of the virtual machine and compare it with the ideal result data corresponding to the standard data. If the results are consistent, the verification is completed. If the results are inconsistent, go to Step 4.
[0062] Step 4: Security verification: When the comparison results in Step 3 are inconsistent, the security level analysis module 13 authenticates the risk level when the corresponding Internet of Things terminal sends data to the event loop. After trimming the risk level, repeat the operations in Step 2 and Step 3. When the results are consistent, determine the risk level of the corresponding Internet of Things terminal. When the results are inconsistent, go to Step 5.
[0063] Step 5. Data debugging: The screening and sorting module 16 classifies the importance of different IoT terminals in Step 1, sorts them according to the importance level of the IoT terminals to obtain the screening and sorting. Select the same standard data and repeat the operations in Step 2, Step 3, and Step 4 according to the screening and sorting. If the results are consistent, the verification is completed. When the results are inconsistent, the data replacement module 17 replaces the standard data and repeats the operations in Step 2, Step 3, and Step 4 for comparison. If the results are consistent, the comparison is completed. When the results are inconsistent, the abnormal annotation module 18 annotates the execution code of the debugging data of the corresponding IoT terminal as an abnormal state.
[0064] Based on Embodiment 1, this embodiment classifies the importance of IoT terminals, and by means of replacing the standard data for debugging, eliminates the error influence brought by the standard data, directly locates the execution code in the abnormal state, and is flexible and convenient to use.
[0065] As a detailed description, as shown in the appendix Figure 3 The data loading unit 1 includes a terminal classification module 5, a security verification module 6, and a data import module 7;
[0066] The terminal classification module 5 is used to test the loading order of the IoT terminal standard data as the initial order;
[0067] The security verification module 6 is used to connect to the security software to identify the risks of the IoT loaded data;
[0068] The data import module 7 is used to load the debugging data into the event-driven unit 2.
[0069] Among them, the event-driven unit 2 includes an execution code generation module 8, an event import module 9, an event loop module 10, and an event processing module 11. As shown in the appendix Figure 4 The event loop module 10 is connected to the event processing module 11;
[0070] The execution code generation module 8 is used to load the target code into the event-driven unit 2 of the virtual machine to generate a semi-compiled execution code;
[0071] The event import module 9 is used to sequentially send the standard data of different IoT terminals to the event loop according to the initial order, and is used to sequentially send the standard data of different IoT terminals to the event loop according to the screening and sorting;
[0072] The event loop module 10 is used to send the standard data of a single IoT as a single data to the event processor;
[0073] The event processing module 11 serves as an event processor and is used to process the standard data of the IoT according to the execution code.
[0074] Further, as shown in the appendix Figure 5As shown in the figure, the optimization analysis unit 3 includes a standard verification module 12, a security level analysis module 13, a verification analysis module 14, and a target determination module 15. The standard verification module 12 is used to receive the event processing result of the event-driven unit 2 and compare it with the corresponding ideal result data of the standard data.
[0075] The standard verification module 12 is connected to the security level analysis module 13. The security level analysis module 13 is used to authenticate the risk level when the Internet of Things terminal sends data to the event loop when the comparison result of the standard verification module 12 is inconsistent.
[0076] The security level analysis module 13 is connected to the verification analysis module 14. The verification analysis module 14 is used to trim the risk when the Internet of Things terminal sends data to the event loop and process the trimmed data in the event-driven unit 2.
[0077] The verification analysis module 14 is connected to the target determination module 15. The target determination module 15 is used to determine the risk level of the corresponding Internet of Things terminal and mark it as the security work risk level when the comparison result between the event processing result corresponding to the risk-trimmed data and the debugging data is consistent. When the results are inconsistent, the abnormal situation is sent to the debugging unit 4.
[0078] Furthermore, as shown in the appendix Figure 6 As shown in the figure, the debugging unit 4 includes a screening and sorting module 16, a data replacement module 17, and an abnormal marking module 18. The screening and sorting module 16 is used to classify the importance of different Internet of Things terminals, sort them according to the importance classification of the Internet of Things terminals, and obtain the screening and sorting.
[0079] The screening and sorting module 16 is connected to the data replacement module 17. The data replacement module 17 is used to replace the standard data.
[0080] The data replacement module 17 is connected to the abnormal marking module 18. The abnormal marking module 18 is used to mark the execution code of the debugging data of the corresponding Internet of Things terminal as an abnormal state when the comparison result is still inconsistent after the standard data is replaced.
[0081] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for providing an operating environment for the Internet of Things, characterized in that: Specifically, it includes the following steps: Step 1, standard library establishment: The data loading unit (1) loads the standard data of different Internet of Things terminals and the result data after the target code is compiled in the virtual machine as debugging data, and at the same time docks with security software to identify the risks of the Internet of Things loaded data; Step 2, event-driven: Load the target code into the event-driven unit (2) of the virtual machine to generate semi-compiled execution codes, and send the standard data of different Internet of Things terminals loaded in Step 1 to the event loop in the initial order. The event loop sends the standard data of a single Internet of Things as a single data to the event processor for processing; Step 3, result verification: Transmit the event processing result in Step 2 to the optimization analysis unit (3) of the virtual machine, and compare it with the corresponding result data of the standard data. If the results are consistent, the verification is completed. If the results are inconsistent, go to Step 4; Step 4, security verification: When the comparison results in Step 3 are inconsistent, the optimization analysis unit (3) authenticates the risk level when the corresponding Internet of Things terminal sends data to the event loop. After the risk level is adjusted, repeat the operations in Step 2 and Step 3. When the results are consistent, determine the risk level of the corresponding Internet of Things terminal. When the results are inconsistent, go to Step 5; Step 5, data debugging: Classify the importance of different Internet of Things terminals in Step 1, sort them according to the importance level of the Internet of Things terminals to obtain a screening and sorting, select the same standard data, and repeat the operations in Step 2, Step 3, and Step 4 according to the screening and sorting. If the results are consistent, the verification is completed. If the results are inconsistent, replace the standard data and repeat the operations in Step 2, Step 3, and Step 4 for comparison. If the results are consistent, the comparison is completed. If the results are inconsistent, mark the execution code of the debugging data of the corresponding Internet of Things terminal as an abnormal state.
2. A method for providing an operating environment for the Internet of Things according to claim 1, characterized in that: The data loading unit (1) is respectively docked with the event-driven unit (2), the optimization analysis unit (3), and the debugging unit (4), and the event-driven unit (2) is respectively docked with the optimization analysis unit (3) and the debugging unit (4).
3. A method for providing an operating environment for the Internet of Things according to claim 1, characterized in that: The data loading unit (1) includes a terminal grading module (5), a security verification module (6), and a data import module (7); The terminal grading module (5) is used to test the loading order of the Internet of Things terminal standard data as the initial order; The security verification module (6) is used to dock with security software to identify the risks of the Internet of Things loaded data; The data import module (7) is used to load the debugging data into the event-driven unit (2).
4. A method for providing an operating environment for the Internet of Things according to claim 1, characterized in that: The event-driven unit (2) includes an execution code generation module (8), an event import module (9), an event loop module (10), and an event processing module (11), and the event loop module (10) is docked with the event processing module (11); The execution code generation module (8) is used to load the target code into the event-driven unit (2) of the virtual machine to generate semi-compiled execution code; The event import module (9) is used to sequentially send the standard data of different Internet of Things terminals to the event loop in the initial order, and is used to sequentially send the standard data of different Internet of Things terminals to the event loop according to screening and sorting; The event loop module (10) is used to send the standard data of a single Internet of Things as a single piece of data to the event processor; The event processing module (11) serves as an event processor and is used to process the standard data of the Internet of Things according to the execution code.
5. A method for providing an Internet of Things operating environment according to claim 1, characterized in that: The optimization analysis unit (3) includes a standard verification module (12), a security level analysis module (13), a verification analysis module (14), and a target determination module (15). The standard verification module (12) is docked with the security level analysis module (13), the security level analysis module (13) is docked with the verification analysis module (14), and the verification analysis module (14) is docked with the target determination module (15).
6. A method for providing an Internet of Things operating environment according to claim 5, characterized in that: The standard verification module (12) is used to receive the event processing result of the event-driven unit (2) and compare it with the corresponding result data of the standard data; The security level analysis module (13) is used to authenticate the risk level when the corresponding Internet of Things terminal sends data to the event loop when the comparison result of the standard verification module (12) is inconsistent; The verification analysis module (14) is used to trim the risk when the corresponding Internet of Things terminal sends data to the event loop, and send the trimmed data to the event-driven unit (2) for processing; The target determination module (15) is used to determine the risk level of the corresponding Internet of Things terminal and mark it as the safe operation risk level when the comparison result between the event processing result corresponding to the data after risk trimming and the debugging data is consistent. When the results are inconsistent, the abnormal situation is sent to the debugging unit (4).
7. A method for providing an Internet of Things operating environment according to claim 2, characterized in that: The debugging unit (4) includes a screening and sorting module (16), a data replacement module (17), and an abnormal marking module (18). The screening and sorting module (16) is docked with the data replacement module (17), and the data replacement module (17) is docked with the abnormal marking module (18).
8. A method for providing an Internet of Things operating environment according to claim 7, characterized in that: The screening and sorting module (16) is used to classify the importance of different Internet of Things terminals, sort them according to the importance classification of the Internet of Things terminals, and obtain the screening and sorting; The data replacement module (17) is used to replace the standard data; The anomaly annotation module (18) is used to annotate the execution code of the debugging data of the corresponding Internet of Things terminal as an abnormal state when the comparison results are still inconsistent after the standard data is replaced.
Citation Information
Patent Citations
Internet of Things data anomaly detection method and system based on server-free architecture
CN113687989A
Method and system for providing operating environment of Internet of Things
CN113946420A