Search

CN-122001753-A - Heterogeneous equipment log processing method, device, equipment and medium of industrial Internet of things

CN122001753ACN 122001753 ACN122001753 ACN 122001753ACN-122001753-A

Abstract

The invention discloses a heterogeneous equipment log processing method, device, equipment and medium of an industrial Internet of things, relating to the technical field of Internet of things logs, comprising the steps of creating a runtime instance and initializing a log module; the method comprises the steps of collecting log data of an application processor and a communication processor to form unified log stream, selecting a log analysis strategy according to a source identifier to generate structured log analysis data, and receiving configuration update data to carry out dynamic hot update. The method and the system realize the decoupling of heterogeneous log processing and AP firmware, realize the isolation processing of all logs in WASM sandboxes, prevent the stability of host programs and AP systems from being affected by abnormality, dynamically update log modules and strategy configuration, quickly respond to the requirement to adjust log levels and filtering rules in real time, ensure the service continuity by atomic switching and automatic rollback, ensure the uninterrupted log acquisition processing, and effectively reduce the network transmission overhead by differential configuration update, thereby being particularly suitable for the industrial Internet of things edge computing scene with limited network bandwidth and computing resources.

Inventors

  • LI YULEI
  • QIN TIANZHU
  • DENG JIE
  • Lei Helei
  • GUO HAO
  • WU CHUNGUANG

Assignees

  • 麒麟软件有限公司

Dates

Publication Date
20260508
Application Date
20260409

Claims (10)

  1. 1. The heterogeneous equipment log processing method of the industrial Internet of things is characterized by comprising the following steps of: S101, creating WebAssembly a runtime instance and setting resource limiting parameters, then loading WebAssembly log module, checking version compatibility of the log module, and initializing WebAssembly log module; S102, collecting first log data through a host program of an AP application processor, collecting second log data from a CP communication processor through a communication interface, adding corresponding source identifiers for the first log data and the second log data respectively, forming a unified log stream and transmitting the unified log stream to a WebAssembly log module; S103, a WebAssembly log module receives the unified log stream, selects a corresponding preset log analysis strategy according to the source identifier, performs log analysis and generates structured log analysis data; And S104, receiving configuration update data sent from the cloud, and performing incremental update or full update on the configuration of the WebAssembly log module according to the configuration update data.
  2. 2. The method according to claim 1, wherein the method further comprises: Receiving a new WebAssembly log module update package issued from a cloud, executing integrity check based on hash value verification, version compatibility check based on temporary sandboxes and functional verification, marking the current WebAssembly log module as backup and retaining in an atomic switching mode after verification is successful, and switching the new WebAssembly log module as a production execution module; if the new module fails, the system automatically rolls back to the old WebAssembly log module which is backed up.
  3. 3. The method according to claim 1, wherein said S101 comprises: Reading a pre-deployed WebAssembly log module and a strategy configuration file thereof, creating WebAssembly runtime instance at an edge gateway, and setting a resource upper limit threshold and an execution time upper limit threshold; Loading WebAssembly log modules into a runtime and performing version compatibility checking; and calling WebAssembly an initialization function of the log module, transmitting the initialization function into a strategy configuration file, and caching the configuration object in the global memory of the WebAssembly log module.
  4. 4. A method according to claim 3, wherein the version compatibility check comprises: Enumerating WebAssembly a list of functions derived by the log module, verifying whether the list contains the necessary init function and process_log function, checking that the function signature is consistent with the expectations of the host program, and initializing WebAssembly the log module after passing.
  5. 5. The method according to claim 1, wherein S103 comprises: the host program maintains a log buffer queue according to the received unified log stream, and determines a log processing mode according to the length of the log buffer queue; Comparing the length of the log buffer queue with a preset high water level threshold, if the length exceeds the high water level threshold, switching from a single processing mode to a batch processing mode, and packaging a plurality of logs in the log buffer queue into batch processing functions of a batch calling WebAssembly log module; Comparing the length of the log buffer queue with a preset back pressure threshold value, if the length exceeds the back pressure threshold value, sending a sampling signal to a host program of the AP application processor, triggering a log sampling frequency-reducing strategy and suspending acquisition of second log data of the CP communication processor from the communication interface; when WebAssembly log module fails, the log module is bypassed WebAssembly by switching to a degradation mode, and unified log streams are directly packaged and transmitted out.
  6. 6. The method of claim 5, wherein the log parsing comprises: firstly, performing quick scanning, analyzing a log head with a preset length, extracting a source identifier and log level information, and comparing the log level information with a level threshold value in a strategy configuration file; if the log level is lower than the level threshold, discarding the current log to return an empty result without subsequent analysis; If the log level is higher than the level threshold, a preset log analysis strategy is matched according to the source identifier, a time stamp, an event type and key parameter fields are extracted from the complete unified log stream, a knowledge base built in a WebAssembly log module is queried to expand the abbreviation of the equipment into readable description, and the sensitive fields are subjected to desensitization processing to form structured log analysis data.
  7. 7. The method according to claim 1, wherein S104 comprises: Receiving configuration update data issued by a cloud, and performing incremental update identification by identifying version numbers and change fields; if the change field is identified as incremental update, extracting a change field to construct an incremental update fragment, calling a configuration update function, and carrying out incremental combination update on WebAssembly log modules by adopting a differential update mechanism.
  8. 8. A heterogeneous device log processing apparatus of an industrial internet of things, configured to implement a heterogeneous device log processing method of the industrial internet of things according to any one of claims 1 to 7, comprising: an initializing unit, configured to create WebAssembly a runtime instance and set resource limitation parameters, then load WebAssembly the log module while checking version compatibility thereof, and initialize WebAssembly the log module; The log acquisition unit is used for acquiring first log data through a host program of the AP application processor, acquiring second log data from the CP communication processor through a communication interface, adding corresponding source identifiers for the first log data and the second log data respectively, forming a unified log stream and transmitting the unified log stream to the WebAssembly log module; The log analysis unit is used for receiving unified log streams by the WebAssembly log module, selecting a corresponding preset log analysis strategy according to the source identifier, executing log analysis and generating structured log analysis data; The updating unit is used for receiving configuration updating data sent by the cloud and carrying out incremental updating or full updating on the configuration of the WebAssembly log module according to the configuration updating data.
  9. 9. An electronic device, the electronic device comprising: One or more processors; Storage means for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the heterogeneous device log processing method of the industrial internet of things as claimed in any one of claims 1-7.
  10. 10. A storage medium containing computer executable instructions, which when executed by a computer processor are for performing the heterogeneous device log processing method of the industrial internet of things of any of claims 1-7.

Description

Heterogeneous equipment log processing method, device, equipment and medium of industrial Internet of things Technical Field The invention relates to the technical field of logs of the Internet of things, in particular to a heterogeneous equipment log processing method, a heterogeneous equipment log processing device, heterogeneous equipment log processing equipment and a heterogeneous equipment log processing medium of the Internet of things. Background In modern internet of things applications such as industrial automation and intelligent security, heterogeneous combinations of Application Processors (APs) and Communication Processors (CPs) are commonly used in hardware architecture of devices. The AP usually runs a general operating system such as Linux or Android and is responsible for service logic processing, and the CP (communication module/Modem) runs a real-time operating system and specially processes wireless communication protocols such as 5G/4G and the like. In order to achieve comprehensive monitoring and fault diagnosis of the running state of the device, the log system needs to collect and process log information from two processors, namely the AP and the CP, simultaneously. In the traditional scheme, the log service running on the AP needs to write special native codes to analyze the log format of the CP and perform unified processing with the log of the AP. However, when the CP log is analyzed, the native library which depends on is tightly coupled with the firmware version of the specific CP model, and is also bound with the CPU architecture and the operating system of the AP, and the module for analyzing the CP log processes the untrusted input from the outside, and lacks a security isolation mechanism. Especially when hardware is replaced or firmware is upgraded, the hardware needs to be transplanted, compiled and tested again, the research, development and maintenance cost is high, the embedded development language is dominated by C/C++, the selection is limited, the characteristics of memory safety, concurrency advantages and the like of the modern language cannot be utilized, strategies such as log filtering rules, output formats and the like are written in codes, and the operation and maintenance are stiff due to strategy hard coding. Disclosure of Invention The embodiment of the invention provides a method, a device, equipment and a medium for processing heterogeneous equipment logs of an industrial Internet of things, which are used for solving the technical problems of high research and development operation and maintenance cost and insufficient safety flexibility caused by stiff processing logic of the heterogeneous logs of the Internet of things. In a first aspect, an embodiment of the present invention provides a method for processing logs of heterogeneous devices of an industrial internet of things, including: S101, creating WebAssembly a runtime instance and setting resource limiting parameters, then loading WebAssembly log module, checking version compatibility of the log module, and initializing WebAssembly log module; S102, collecting first log data through a host program of an AP application processor, collecting second log data from a CP communication processor through a communication interface, adding corresponding source identifiers for the first log data and the second log data respectively, forming a unified log stream and transmitting the unified log stream to a WebAssembly log module; S103, a WebAssembly log module receives the unified log stream, selects a corresponding preset log analysis strategy according to the source identifier, performs log analysis and generates structured log analysis data; And S104, receiving configuration update data sent from the cloud, and performing incremental update or full update on the configuration of the WebAssembly log module according to the configuration update data. In a second aspect, an embodiment of the present invention provides a heterogeneous device log processing apparatus for industrial internet of things, including: an initializing unit, configured to create WebAssembly a runtime instance and set resource limitation parameters, then load WebAssembly the log module while checking version compatibility thereof, and initialize WebAssembly the log module; The log acquisition unit is used for acquiring first log data through a host program of the AP application processor, acquiring second log data from the CP communication processor through a communication interface, adding corresponding source identifiers for the first log data and the second log data respectively, forming a unified log stream and transmitting the unified log stream to the WebAssembly log module; The log analysis unit is used for receiving unified log streams by the WebAssembly log module, selecting a corresponding preset log analysis strategy according to the source identifier, executing log analysis and generating structured log analysis data; The up