A device monitoring method, device, equipment and medium based on log information

By identifying and processing the log information of the target device, the problem of low accuracy of existing equipment monitoring methods is solved, and more efficient and accurate equipment monitoring is achieved.

CN113672484BActive Publication Date: 2025-03-04SHENZHEN APEMAN INNOVATIONS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110909963.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2025-03-04
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

The existing equipment monitoring methods rely on the equipment monitoring template files, which are too rigid, resulting in low accuracy of equipment monitoring.

Method used

By obtaining the device identification of the target device, when the identification is a preset identification, the log information is extracted and its information type is identified, encoding conversion or data filling is performed according to the type, and encoded data is obtained for monitoring.

Benefits of technology

It improves the accuracy of log information selection and encoding conversion accuracy, reduces the use of network bandwidth by log information transmission, ensures accurate conversion of dynamic type log information, and improves the accuracy of device monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672484B_ABST
    Figure CN113672484B_ABST
Patent Text Reader

Abstract

The present invention relates to cloud monitoring technology, and discloses a device monitoring method based on log information, including: obtaining a target device and a device identifier corresponding to the target device, when the device identifier is a preset device identifier, extracting the log information generated by the target device, and identifying the information type of the log information, if the information type of the log information is a static type, encoding and converting the log information through a preset mapping table to obtain encoded data, if the information type of the log information is a dynamic type, using a preset dynamic filling method to fill the log information with data to obtain encoded data, and monitoring according to the encoded data. In addition, the present invention also relates to blockchain technology, and the log information can be stored in a node of the blockchain. The present invention also proposes a device monitoring device, an electronic device, and a computer-readable storage medium based on log information. The present invention can solve the problem of low accuracy of device monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud monitoring technology, and in particular to a device monitoring method, device, electronic device and computer-readable storage medium based on log information. Background Art

[0002] With the development of the Internet, network equipment has become increasingly popular, and the functions of equipment are becoming more and more numerous and complex. Even if many functions have undergone rigorous testing, they are still inevitably prone to failure when finally released due to differences in users' actual environments. Therefore, it is necessary to monitor the equipment to ensure that the operating status and information of the equipment can be understood in real time.

[0003] Existing device monitoring methods usually create device monitoring instances through device monitoring template files and monitor devices based on the device monitoring instances. This method is too dependent on the selected device monitoring template files and is not flexible enough. At the same time, using templates for monitoring is relatively rigid and prone to problems, resulting in low accuracy of device monitoring. Summary of the invention

[0004] The present invention provides a device monitoring method and device based on log information and a computer-readable storage medium, the main purpose of which is to solve the problem of low accuracy of device monitoring.

[0005] To achieve the above object, the present invention provides a device monitoring method based on log information, comprising:

[0006] Obtaining a target device and a device identifier corresponding to the target device;

[0007] When the device identifier is a preset device identifier, extracting log information generated by the target device and identifying the information type of the log information;

[0008] If the information type of the log information is a static type, the log information is coded and converted using a preset mapping table to obtain coded data;

[0009] If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data;

[0010] Monitoring is performed based on the encoded data.

[0011] Optionally, the identifying the information type of the log information includes:

[0012] Extracting the string text in the log information;

[0013] If the string text is consistent with a fixed string in a preset fixed string library, determining that the information type of the log information is a static type;

[0014] If the character string text contains a quoted statement, it is determined that the information type of the log information is a dynamic type.

[0015] Optionally, the encoding conversion of the log information by using a preset mapping table to obtain the encoded data includes:

[0016] Identifying a message number in the log information;

[0017] Searching for the parameter usage format corresponding to the message number according to the mapping table;

[0018] The information in the log information except the message number is converted according to the parameter usage format to obtain encoded data.

[0019] Optionally, the identifying a message number in the log information includes:

[0020] Splitting the log information into a preset number of field sets;

[0021] The first field in the field set is determined to be the message number.

[0022] Optionally, the using a preset dynamic filling method to fill the log information with data to obtain the encoded data includes:

[0023] Extract the length of the character string text in the log information, and determine whether the length is an integer multiple of a preset number;

[0024] If the length is an integer multiple of a preset number, outputting the log information as encoded data;

[0025] If the length is not an integer multiple of a preset number, data padding is performed on the log information until the length of the padded character string is an integer multiple of a preset number, and the data is output as encoded data.

[0026] Optionally, the monitoring according to the coded data comprises:

[0027] Extracting characteristic values ​​of preset indicators in the coded data;

[0028] Determining whether the characteristic value reaches a monitoring threshold;

[0029] If the characteristic value reaches the monitoring threshold, an early warning is sent.

[0030] Optionally, obtaining a device identifier corresponding to the target device includes:

[0031] A device identification is extracted from non-volatile memory in the target device.

[0032] In order to solve the above problem, the present invention also provides a device monitoring device based on log information, the device comprising:

[0033] A data acquisition module, used to acquire a target device and a device identifier corresponding to the target device;

[0034] A type identification module, used for extracting the log information generated by the target device and identifying the information type of the log information when the device identifier is a preset device identifier;

[0035] A data processing module, configured to, if the information type of the log information is a static type, perform encoding conversion on the log information through a preset mapping table to obtain encoded data, and, if the information type of the log information is a dynamic type, perform data filling on the log information using a preset dynamic filling method to obtain encoded data;

[0036] A monitoring module is used to monitor according to the encoded data.

[0037] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0038] a memory storing at least one instruction; and

[0039] The processor executes the instructions stored in the memory to implement the above-mentioned device monitoring method based on log information.

[0040] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned device monitoring method based on log information.

[0041] In the embodiment of the present invention, by obtaining the target device and the device identification corresponding to the target device, when the device identification is a preset device identification, the log information generated by the target device is extracted, and the log information is extracted by judging the device identification, thereby improving the accuracy of log information selection, and then being able to accurately identify the information type of the log information, and using the corresponding method to perform encoding conversion according to the information type, thereby improving the accuracy of encoding conversion, if the information type of the log information is a static type, the log information is encoded and converted by a preset mapping table, thereby reducing the occupation of the network bandwidth by the log information transmission process, and if the information type of the log information is a dynamic type, the log information is filled with data using a preset dynamic filling method to obtain encoded data, thereby ensuring the accuracy of the dynamic type log information conversion, and monitoring is performed according to the encoded data. Since the accuracy of the encoding and transcoding conversion is high, the information contained in the obtained encoded data is more comprehensive and rich, so the device monitoring method, device, electronic device and computer-readable storage medium based on log information proposed by the present invention can solve the problem of low accuracy of device monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a flow chart of a device monitoring method based on log information provided by an embodiment of the present invention;

[0043] Figure 2 A functional module diagram of a device monitoring device based on log information provided by an embodiment of the present invention;

[0044] Figure 3 A schematic diagram of the structure of an electronic device for implementing the device monitoring method based on log information provided by an embodiment of the present invention.

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0047] The embodiment of the present application provides a device monitoring method based on log information. The execution subject of the device monitoring method based on log information includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the device monitoring method based on log information can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0048] Reference Figure 1 FIG. 1 is a flow chart of a device monitoring method based on log information provided by an embodiment of the present invention. In this embodiment, the device monitoring method based on log information includes:

[0049] S1. Obtain a target device and a device identifier corresponding to the target device.

[0050] In an embodiment of the present invention, the target device refers to an electronic device having a certain specific function and satisfying certain needs of a user. The device identifier corresponding to the target device is used to identify the device, and the device identifier is a unique identifier of the device, that is, a device can be uniquely identified by the device identifier, and different devices have different device identifiers.

[0051] Specifically, obtaining the device identification corresponding to the target device includes:

[0052] A device identification is extracted from non-volatile memory in the target device.

[0053] The non-volatile memory may be flash.

[0054] S2. When the device identifier is a preset device identifier, extract the log information generated by the target device and identify the information type of the log information.

[0055] In the embodiment of the present invention, the preset device identifier is pre-set.

[0056] For example, the preset device identification is stored in the device information table, which is an information table used to maintain device information in the background, wherein the device information table may include the preset device identification of the device, the current firmware version number of the device, and the log collection status information of the device.

[0057] In detail, when the device identifier is a preset device identifier, the corresponding target device is processed, and when the device identifier is not a preset device identifier, subsequent encoding conversion processing is not performed.

[0058] For example, the device information table includes device identifiers Uuidabcd, Uuidbcde and Uuidcdef, current firmware version numbers Version X, Version Y, Version Z, log collection status information Statuslevel1, Statusoff, Statuslevel2, etc. The device identifier of the target device is Uuidabcd, which is consistent with the preset device identifier "Uuidabcd" in the device information table, and subsequent log information extraction processing is performed. If the device identifier of the target device is Uuidaaaa, which is inconsistent with the preset device identifier in the device information table, it is prompted that the network interaction response fails, and subsequent encoding conversion processing is not performed.

[0059] Specifically, the log information generated by the target device is extracted. The log information is a record file or a set of files that record system operation events. The log information can be used to process historical data, track diagnostic problems, and other operations.

[0060] Further, the identifying the information type of the log information includes:

[0061] Extracting the string text in the log information;

[0062] If the string text is consistent with a fixed string in a preset fixed string library, determining that the information type of the log information is a static type;

[0063] If the character string text contains a quoted statement, it is determined that the information type of the log information is a dynamic type.

[0064] In detail, the string text is a sentence used to describe the target device information. For example, the string text is "Buffer 0x12345678 length 234data A, B". The preset fixed string library contains many fixed string texts, such as "hello, world" and other preset string texts. If the string text is consistent with the fixed string in the preset fixed string library, it is determined that the information type of the log information is a static type.

[0065] If the string text contains a reference statement, that is, the string text cannot be completely or partially determined before actual operation, such as a string returned from a network interface, or a string that references other strings, similar to the %s placeholder of printf in C language, such as "hello,%s", name, where name is a reference to other strings. Only providing the value of name cannot restore the string it actually points to. The string pointed to by name must be provided at the same time for final parsing and restoration. In this case, the information type of the log information is determined to be a dynamic type.

[0066] S3. If the information type of the log information is a static type, the log information is encoded and converted using a preset mapping table to obtain encoded data.

[0067] In the embodiment of the present invention, the encoding conversion of the log information by using a preset mapping table to obtain the encoded data includes:

[0068] Identifying a message number in the log information;

[0069] Searching for the parameter usage format corresponding to the message number according to the mapping table;

[0070] The information in the log information except the message number is converted according to the parameter usage format to obtain encoded data.

[0071] Specifically, the identifying the message number in the log information includes:

[0072] Splitting the log information into a preset number of field sets;

[0073] The first field in the field set is determined to be the message number.

[0074] In this embodiment, the message number is the first field in the log information.

[0075] For example, the log information is split into five fields, namely message number, parameter 1, parameter 2, parameter 3 and parameter 4. The mapping table contains the message number and the corresponding parameter usage format. The multiple parameters in the log information are converted according to the corresponding parameter usage format found to obtain encoded data.

[0076] For example, the log information is "1,0x12345678,123,65,66", and the message number in the log information is identified as "1". According to the mapping table, the parameter usage format corresponding to the message number "1" is "Buffer%p length%dcontent%c,%c", and the encoded data after conversion using the parameter usage format is "Buffer0x12345678length 123content A,B".

[0077] When the information type of the log information is a static type, the log information is encoded and converted by means of a mapping table. Since the string content usually contained in the static type log information does not contain other descriptive information but only includes key parameter values, this brings obstacles to subsequent monitoring and analysis. If the descriptive information and key parameter values ​​are stored and transmitted together, this will also bring great pressure on the storage space and network bandwidth of the device. In order to reduce the storage and bandwidth requirements when the log message is transmitted in the device, the log information can be encoded and converted to achieve the purpose of data compression. At the same time, it provides sufficient and rich information for monitoring, while reducing the requirements for device-side storage space and network bandwidth.

[0078] S4. If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data.

[0079] In the embodiment of the present invention, when the information type of the log information is a dynamic type, the data content in the log information cannot be specified in advance, so the log information needs to be filled with data using a preset dynamic filling method, and a mapping table cannot be used for encoding conversion.

[0080] Specifically, the log information is filled with data using a preset dynamic filling method to obtain coded data, including:

[0081] Extract the length of the character string text in the log information, and determine whether the length is an integer multiple of a preset number;

[0082] If the length is an integer multiple of a preset number, outputting the log information as encoded data;

[0083] If the length is not an integer multiple of a preset number, data padding is performed on the log information until the length of the padded character string is an integer multiple of a preset number, and the data is output as encoded data.

[0084] Preferably, the preset number is 4.

[0085] For example, the log information is 65535,40, "Buffer 0x12345678length 123content A,B", and the string length is 40, which is an integer multiple of 4, so no padding is required, and the output encoded data is "Buffer0x12345678length 123content A,B".

[0086] S5. Monitor according to the coded data.

[0087] In this embodiment, the encoded data is transmitted to the monitoring engine, and the encoded data is analyzed and monitored by the monitoring engine.

[0088] Further, in an optional embodiment of the present invention, the monitoring according to the coded data includes:

[0089] Extracting characteristic values ​​of preset indicators in the coded data;

[0090] Determining whether the characteristic value reaches a monitoring threshold;

[0091] If the characteristic value reaches the monitoring threshold, an early warning is sent.

[0092] In this embodiment, if the characteristic value does not reach the monitoring threshold, the monitoring operation is continued.

[0093] In this embodiment, the preset indicators are pre-set, and different monitoring objects can have different preset indicators.

[0094] Specifically, the preset indicators may be response time, memory usage, etc.

[0095] For example, the response time of the front-end page in the encoded data is extracted, and if the response time exceeds one minute, an early warning message is sent.

[0096] In the embodiment of the present invention, by obtaining the target device and the device identification corresponding to the target device, when the device identification is a preset device identification, the log information generated by the target device is extracted, and the log information is extracted by judging the device identification, thereby improving the accuracy of log information selection, and then being able to accurately identify the information type of the log information, and using the corresponding method to perform encoding conversion according to the information type, thereby improving the accuracy of encoding conversion, if the information type of the log information is a static type, the log information is encoded and converted by a preset mapping table, thereby reducing the occupation of the network bandwidth by the log information transmission process, and if the information type of the log information is a dynamic type, the log information is filled with data by a preset dynamic filling method to obtain encoded data, thereby ensuring the accuracy of the dynamic type log information conversion, and monitoring is performed according to the encoded data. Since the accuracy of the encoding and transcoding conversion is high, the information contained in the obtained encoded data is more comprehensive and rich, so the device monitoring method based on log information proposed by the present invention can solve the problem of low accuracy of device monitoring.

[0097] like Figure 2 , which is a functional module diagram of a device monitoring apparatus based on log information provided by an embodiment of the present invention.

[0098] The device monitoring device 100 based on log information of the present invention can be installed in an electronic device. According to the functions to be implemented, the device monitoring device 100 based on log information can include a data acquisition module 101, a type identification module 102, a data processing module 103 and a monitoring module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0099] In this embodiment, the functions of each module / unit are as follows:

[0100] The data acquisition module 101 is used to acquire a target device and a device identifier corresponding to the target device;

[0101] The type identification module 102 is used to extract the log information generated by the target device and identify the information type of the log information when the device identifier is a preset device identifier;

[0102] The data processing module 103 is used to convert the log information into code by using a preset mapping table to obtain coded data if the information type of the log information is a static type, and to fill the log information with data by using a preset dynamic filling method to obtain coded data if the information type of the log information is a dynamic type;

[0103] The monitoring module 104 is used to perform monitoring according to the coded data.

[0104] In detail, the specific implementation of each module of the equipment monitoring device 100 based on log information is as follows:

[0105] Step 1: Obtain a target device and a device identifier corresponding to the target device.

[0106] In an embodiment of the present invention, the target device refers to an electronic device having a certain specific function and satisfying certain needs of a user. The device identifier corresponding to the target device is used to identify the device, and the device identifier is a unique identifier of the device, that is, a device can be uniquely identified by the device identifier, and different devices have different device identifiers.

[0107] Specifically, obtaining the device identification corresponding to the target device includes:

[0108] A device identification is extracted from non-volatile memory in the target device.

[0109] The non-volatile memory may be flash.

[0110] Step 2: When the device identifier is a preset device identifier, extract the log information generated by the target device and identify the information type of the log information.

[0111] In the embodiment of the present invention, the preset device identifier is pre-set.

[0112] For example, the preset device identification is stored in the device information table, which is an information table used to maintain device information in the background, wherein the device information table may include the preset device identification of the device, the current firmware version number of the device, and the log collection status information of the device.

[0113] In detail, when the device identifier is a preset device identifier, the corresponding target device is processed, and when the device identifier is not a preset device identifier, subsequent encoding conversion processing is not performed.

[0114] For example, the device information table includes device identifiers Uuidabcd, Uuidbcde and Uuidcdef, current firmware version numbers Version X, Version Y, Version Z, log collection status information Statuslevel1, Statusoff, Statuslevel2, etc. The device identifier of the target device is Uuidabcd, which is consistent with the preset device identifier "Uuidabcd" in the device information table, and subsequent log information extraction processing is performed. If the device identifier of the target device is Uuidaaaa, which is inconsistent with the preset device identifier in the device information table, it is prompted that the network interaction response fails, and subsequent encoding conversion processing is not performed.

[0115] Specifically, the log information generated by the target device is extracted. The log information is a record file or a set of files that record system operation events. The log information can be used to process historical data, track diagnostic problems, and other operations.

[0116] Further, the identifying the information type of the log information includes:

[0117] Extracting the string text in the log information;

[0118] If the string text is consistent with a fixed string in a preset fixed string library, determining that the information type of the log information is a static type;

[0119] If the character string text contains a quoted statement, it is determined that the information type of the log information is a dynamic type.

[0120] In detail, the string text is a sentence used to describe the target device information. For example, the string text is "Buffer 0x12345678length 234data A,B". The preset fixed string library contains many fixed string texts, such as "hello, world" and other preset string texts. If the string text is consistent with the fixed string in the preset fixed string library, it is determined that the information type of the log information is a static type.

[0121] If the string text contains a reference statement, that is, the string text cannot be completely or partially determined before actual operation, such as a string returned from a network interface, or a string that references other strings, similar to the %s placeholder of printf in C language, such as "hello,%s", name, where name is a reference to other strings. Only providing the value of name cannot restore the string it actually points to. The string pointed to by name must be provided at the same time for final parsing and restoration. In this case, the information type of the log information is determined to be a dynamic type.

[0122] Step three: if the information type of the log information is a static type, the log information is encoded and converted using a preset mapping table to obtain encoded data.

[0123] In the embodiment of the present invention, the encoding conversion of the log information by using a preset mapping table to obtain the encoded data includes:

[0124] Identifying a message number in the log information;

[0125] Searching for the parameter usage format corresponding to the message number according to the mapping table;

[0126] The information in the log information except the message number is converted according to the parameter usage format to obtain encoded data.

[0127] Specifically, the identifying the message number in the log information includes:

[0128] Splitting the log information into a preset number of field sets;

[0129] The first field in the field set is determined to be the message number.

[0130] In this embodiment, the message number is the first field in the log information.

[0131] For example, the log information is split into five fields, namely message number, parameter 1, parameter 2, parameter 3 and parameter 4. The mapping table contains the message number and the corresponding parameter usage format. The multiple parameters in the log information are converted according to the corresponding parameter usage format found to obtain encoded data.

[0132] For example, the log information is "1,0x12345678,123,65,66", and the message number in the log information is identified as "1". According to the mapping table, the parameter usage format corresponding to the message number "1" is "Buffer%p length%dcontent%c,%c", and the encoded data after conversion using the parameter usage format is "Buffer0x12345678length 123content A,B".

[0133] When the information type of the log information is a static type, the log information is encoded and converted by means of a mapping table. Since the string content usually contained in the static type log information does not contain other descriptive information but only includes key parameter values, this brings obstacles to subsequent monitoring and analysis. If the descriptive information and key parameter values ​​are stored and transmitted together, this will also bring great pressure on the storage space and network bandwidth of the device. In order to reduce the storage and bandwidth requirements when the log message is transmitted in the device, the log information can be encoded and converted to achieve the purpose of data compression. At the same time, it provides sufficient and rich information for monitoring, while reducing the requirements for device-side storage space and network bandwidth.

[0134] Step 4: If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data.

[0135] In the embodiment of the present invention, when the information type of the log information is a dynamic type, the data content in the log information cannot be specified in advance, so the log information needs to be filled with data using a preset dynamic filling method, and a mapping table cannot be used for encoding conversion.

[0136] Specifically, the log information is filled with data using a preset dynamic filling method to obtain coded data, including:

[0137] Extract the length of the character string text in the log information, and determine whether the length is an integer multiple of a preset number;

[0138] If the length is an integer multiple of a preset number, outputting the log information as encoded data;

[0139] If the length is not an integer multiple of a preset number, data padding is performed on the log information until the length of the padded character string is an integer multiple of a preset number, and the data is output as encoded data.

[0140] Preferably, the preset number is 4.

[0141] For example, the log information is 65535,40, "Buffer 0x12345678length 123content A,B", and the string length is 40, which is an integer multiple of 4, so no padding is required, and the output encoded data is "Buffer0x12345678length 123content A,B".

[0142] Step 5: Monitor according to the coded data.

[0143] In this embodiment, the encoded data is transmitted to the monitoring engine, and the encoded data is analyzed and monitored by the monitoring engine.

[0144] Further, in an optional embodiment of the present invention, the monitoring according to the coded data includes:

[0145] Extracting characteristic values ​​of preset indicators in the coded data;

[0146] Determining whether the characteristic value reaches a monitoring threshold;

[0147] If the characteristic value reaches the monitoring threshold, an early warning is sent.

[0148] In this embodiment, if the characteristic value does not reach the monitoring threshold, the monitoring operation is continued.

[0149] In this embodiment, the preset indicators are pre-set, and different monitoring objects can have different preset indicators.

[0150] Specifically, the preset indicators may be response time, memory usage, etc.

[0151] For example, the response time of the front-end page in the encoded data is extracted, and if the response time exceeds one minute, an early warning message is sent.

[0152] In the embodiment of the present invention, by obtaining the target device and the device identification corresponding to the target device, when the device identification is a preset device identification, the log information generated by the target device is extracted, and the log information is extracted by judging the device identification, thereby improving the accuracy of log information selection, and then being able to accurately identify the information type of the log information, and using the corresponding method to perform encoding conversion according to the information type, thereby improving the accuracy of encoding conversion, if the information type of the log information is a static type, the log information is encoded and converted by a preset mapping table, thereby reducing the occupation of network bandwidth by the log information transmission process, if the information type of the log information is a dynamic type, the log information is filled with data by a preset dynamic filling method, and the encoded data is obtained, thereby ensuring the accuracy of the dynamic type log information conversion, and monitoring is performed according to the encoded data. Since the accuracy of the encoding and transcoding conversion is high, the information contained in the obtained encoded data is more comprehensive and rich, so the device monitoring device based on log information proposed by the present invention can solve the problem of low accuracy of device monitoring.

[0153] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a device monitoring method based on log information provided by an embodiment of the present invention.

[0154] The electronic device may include a processor 10, a memory 11, a communication interface 12 and a bus 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a device monitoring program based on log information.

[0155] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the device monitoring program based on log information, but also be used to temporarily store data that has been output or is to be output.

[0156] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (such as device monitoring programs based on log information, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0157] The communication interface 12 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0158] The bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 13 may be divided into an address bus, a data bus, a control bus, etc. The bus 13 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0159] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0160] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0161] Furthermore, the electronic device may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.

[0162] Optionally, the electronic device may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0163] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0164] The device monitoring program based on log information stored in the memory 11 of the electronic device is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0165] Obtaining a target device and a device identifier corresponding to the target device;

[0166] When the device identifier is a preset device identifier, extracting log information generated by the target device and identifying the information type of the log information;

[0167] If the information type of the log information is a static type, the log information is coded and converted using a preset mapping table to obtain coded data;

[0168] If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data;

[0169] Monitoring is performed based on the encoded data.

[0170] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0171] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0172] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0173] Obtaining a target device and a device identifier corresponding to the target device;

[0174] When the device identifier is a preset device identifier, extracting log information generated by the target device and identifying the information type of the log information;

[0175] If the information type of the log information is a static type, the log information is coded and converted using a preset mapping table to obtain coded data;

[0176] If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data;

[0177] Monitoring is performed based on the encoded data.

[0178] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0179] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0180] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0181] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0182] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0183] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0184] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A device monitoring method based on log information, characterized in that: The method comprises: Obtaining a target device and a device identifier corresponding to the target device; When the device identifier is a preset device identifier, extracting log information generated by the target device and identifying the information type of the log information; If the information type of the log information is a static type, the log information is coded and converted using a preset mapping table to obtain coded data; If the information type of the log information is a dynamic type, fill the log information with data using a preset dynamic filling method to obtain encoded data; monitoring according to the coded data; The monitoring according to the coded data comprises: Extracting characteristic values ​​of preset indicators in the coded data; Determining whether the characteristic value reaches a monitoring threshold; If the characteristic value reaches the monitoring threshold, an early warning is sent; The encoding conversion of the log information by using a preset mapping table to obtain the encoded data includes: Identifying a message number in the log information; Searching for the parameter usage format corresponding to the message number according to the mapping table; The information in the log information except the message number is converted according to the parameter usage format to obtain coded data, wherein multiple parameters in the log information are converted according to the corresponding parameter usage format found to obtain coded data; The method of filling the log information with data by using a preset dynamic filling method to obtain coded data includes: Extract the length of the character string text in the log information, and determine whether the length is an integer multiple of a preset number; If the length is an integer multiple of a preset number, outputting the log information as encoded data; If the length is not an integer multiple of a preset number, data padding is performed on the log information until the length of the padded character string is an integer multiple of a preset number, and the data is output as encoded data.

2. The device monitoring method based on log information according to claim 1, characterized in that: The information type for identifying the log information includes: Extracting the string text in the log information; If the string text is consistent with a fixed string in a preset fixed string library, determining that the information type of the log information is a static type; If the character string text contains a quoted statement, it is determined that the information type of the log information is a dynamic type.

3. The device monitoring method based on log information according to claim 1, characterized in that: The identifying the message number in the log information includes: Splitting the log information into a preset number of field sets; The first field in the field set is determined to be the message number.

4. The device monitoring method based on log information according to any one of claims 1 to 3, characterized in that: The obtaining of a device identifier corresponding to the target device includes: A device identification is extracted from non-volatile memory in the target device.

5. A device monitoring device based on log information, characterized in that: The device comprises: A data acquisition module, used to acquire a target device and a device identifier corresponding to the target device; A type identification module, used for extracting the log information generated by the target device and identifying the information type of the log information when the device identifier is a preset device identifier; A data processing module, configured to, if the information type of the log information is a static type, perform encoding conversion on the log information through a preset mapping table to obtain encoded data, and, if the information type of the log information is a dynamic type, perform data filling on the log information using a preset dynamic filling method to obtain encoded data; A monitoring module, used for monitoring according to the coded data; The monitoring according to the coded data comprises: Extracting characteristic values ​​of preset indicators in the coded data; Determining whether the characteristic value reaches a monitoring threshold; If the characteristic value reaches the monitoring threshold, an early warning is sent; The encoding conversion of the log information by using a preset mapping table to obtain the encoded data includes: Identifying a message number in the log information; Searching for the parameter usage format corresponding to the message number according to the mapping table; The information in the log information except the message number is converted according to the parameter usage format to obtain coded data, wherein multiple parameters in the log information are converted according to the corresponding parameter usage format found to obtain coded data; The method of filling the log information with data by using a preset dynamic filling method to obtain coded data includes: Extract the length of the character string text in the log information, and determine whether the length is an integer multiple of a preset number; If the length is an integer multiple of a preset number, outputting the log information as encoded data; If the length is not an integer multiple of a preset number, data padding is performed on the log information until the length of the padded character string is an integer multiple of a preset number, and the data is output as encoded data.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the device monitoring method based on log information as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the device monitoring method based on log information as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device for memorizing automobile log, microprocessor and memory medium

    CN108876963A

  • Log file automatic generation method based on model driving

    CN110275817A