Method, device, equipment, medium and product for obtaining operation log
Patent Information
- Application Number
- CN202511768046.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2045-11-27
AI Technical Summary
[0003]现有技术常常通过处理设备周期性主动地向网关设备发送获取日志请求以获取物联网设备的运行日志,但是上述方式使得处理设备需要分析并处理大量的运行日志确定物联网设备运行状态,存在对处理设备的计算资源以及存储资源的浪费
[0012]本申请实施例提供的运行日志的获取方法、装置、设备、介质及产品,通过处理设备接收网关设备发送的日志特征参数,基于日志特征参数评估出物联网设备发生的预设类型的特征事件的数量与参考数量的偏移度,进而基于多个偏移度和预设权重确定网关设备的重要性评分,在重要性评分大于或等于阈值时,才向网关设备发送日志上传指令以获取网关设备发送的运行日志,上述方式能够有效识别需要上传日志的网关设备,极大地减轻了处理设备的存储和计算压力,使处理设备的资源集中于处理重要性评分高的网关设备发送的运行日志,从而有效地降低了处理设备对于日志的计算压力和存储压力。
Smart Images

Figure CN121585568B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) technology, and in particular relates to a method, apparatus, device, medium and product for obtaining operation logs. Background Technology
[0002] With the rapid development of IoT technology, the number of IoT devices connected to a single gateway device is increasing daily, resulting in an exponential growth in the amount of operational log data. These logs are crucial for analyzing device operating status and troubleshooting. Therefore, gateway devices need to upload the operational logs of IoT devices to processing devices to monitor the operational status of IoT devices.
[0003] Existing technologies often involve the processing device periodically and proactively sending log request requests to the gateway device to obtain the operating logs of IoT devices. However, this method requires the processing device to analyze and process a large number of operating logs to determine the operating status of IoT devices, resulting in a waste of the processing device's computing and storage resources. Summary of the Invention
[0004] This application provides a method, apparatus, device, medium, and product for obtaining operation logs, which can reduce the waste of computing and storage resources of processing devices.
[0005] In a first aspect, embodiments of this application provide a method for obtaining operation logs, applied to a processing device, the method comprising: The system receives log feature parameters sent by the gateway device. These log feature parameters characterize the operating status of multiple IoT devices connected to the gateway device. The log feature parameters include the number of various preset types of feature events. The feature parameters are determined based on the operating logs sent by the multiple IoT devices to the gateway device. For each preset type of feature event, determine the offset between the number of feature events and the corresponding reference number, and determine the importance score of the gateway device based on the offset and preset weight corresponding to each preset type of feature event; If the importance score is greater than or equal to the preset value, a log upload command is sent to the gateway device so that the gateway device can send the operation logs of multiple IoT devices to the processing device based on the log upload command. Receive the operation logs of IoT devices sent by the gateway device.
[0006] Secondly, embodiments of this application provide a method for obtaining operation logs, applied to a gateway device, the method comprising: Obtain the operation logs of multiple IoT devices connected to the gateway device. The operation logs include multiple characteristic events of the multiple IoT devices during operation and the number of each characteristic event. Based on the operation logs of multiple IoT devices, the quantity of feature events corresponding to various preset types is determined, and log feature parameters including the quantity of feature events corresponding to various preset types are sent to the processing device. The processing device determines the offset between the quantity of feature events of each preset type and the corresponding reference quantity. Based on the offset corresponding to feature events of each preset type and the preset weight, the importance score of the gateway device is determined, and if the importance score is greater than or equal to the preset value, a log upload instruction is generated. It receives log upload instructions from the processing device and sends the operation logs of multiple IoT devices to the processing device based on the log upload instructions.
[0007] Thirdly, embodiments of this application provide an apparatus for acquiring operation logs, applied to a processing device, the apparatus comprising: The receiving module is used to receive log feature parameters sent by the gateway device. The log feature parameters are used to characterize the operating status of multiple IoT devices connected to the gateway device. The log feature parameters include the number of feature events of various preset types. The feature parameters are determined based on the operating logs sent by multiple IoT devices to the gateway device. The determination module is used to determine the offset between the number of feature events and the corresponding reference number for each preset type of feature event, and to determine the importance score of the gateway device based on the offset and preset weight corresponding to each preset type of feature event; The sending module is used to send a log upload command to the gateway device when the importance score is greater than or equal to a preset value, so that the gateway device can send the operation logs of multiple IoT devices to the processing device based on the log upload command. The receiving module is also used to receive the operation logs of IoT devices sent by the gateway device.
[0008] Fourthly, embodiments of this application provide an apparatus for acquiring operation logs, applied to a gateway device connected to multiple IoT devices. The apparatus includes: The acquisition module is used to acquire the operation logs of multiple IoT devices connected to the gateway device. The operation logs include multiple characteristic events of the multiple IoT devices during operation and the number of each characteristic event. The determination module is used to determine the quantity of feature events of various preset types based on the operation logs of multiple IoT devices, and send log feature parameters including the quantity of feature events of various preset types to the processing device. This allows the processing device to determine the offset between the quantity of feature events of each preset type and the corresponding reference quantity. Based on the offset of feature events of each preset type and the preset weight, the importance score of the gateway device is determined, and if the importance score is greater than or equal to the preset value, a log upload instruction is generated. The receiving module is used to receive log upload instructions sent by the processing device, and send the operation logs of multiple IoT devices to the processing device based on the log upload instructions.
[0009] Fifthly, embodiments of this application provide an electronic device, the device comprising: Processor and memory storing computer program instructions; The method for obtaining the execution log of the first or second aspect described above when the processor executes computer program instructions.
[0010] In a sixth aspect, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the method for obtaining the running log described in the first or second aspect above.
[0011] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when processed by a processor, implements the method for obtaining runtime logs described in the first or second aspect above.
[0012] The operation log acquisition method, apparatus, device, medium, and product provided in this application embodiment receive log feature parameters sent by a gateway device through a processing device. Based on the log feature parameters, the offset between the number of feature events of a preset type occurring in the IoT device and a reference number is evaluated. Then, an importance score of the gateway device is determined based on multiple offsets and preset weights. Only when the importance score is greater than or equal to a threshold is a log upload instruction sent to the gateway device to obtain the operation log sent by the gateway device. The above method can effectively identify the gateway device that needs to upload logs, greatly reducing the storage and computing pressure on the processing device. It allows the resources of the processing device to be concentrated on processing the operation logs sent by gateway devices with high importance scores, thereby effectively reducing the computing and storage pressure on the processing device for logs. Attached Figure Description
[0013] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart illustrating a method for obtaining runtime logs provided in some embodiments of this application.
[0015] Figure 2 This is a flowchart illustrating another method for obtaining runtime logs provided in some embodiments of this application.
[0016] Figure 3 This is a flowchart illustrating another method for obtaining runtime logs provided in some embodiments of this application.
[0017] Figure 4 This is a schematic diagram of an apparatus for acquiring runtime logs provided in some embodiments of this application.
[0018] Figure 5 This is a schematic diagram of another apparatus for acquiring runtime logs provided in some embodiments of this application.
[0019] Figure 6 This is a flowchart illustrating a system for obtaining runtime logs, provided for some embodiments of this application.
[0020] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0022] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0023] Before describing the technical solutions provided in the embodiments of this application, in order to facilitate understanding of the embodiments of this application, this application first specifically explains the problems existing in the related technologies: Currently, when processing devices acquire operational logs from IoT devices, they often need to actively send acquisition commands to gateway devices connected to multiple IoT devices. It's conceivable that sending acquisition commands to multiple different gateway devices can lead to a heavy workload for the processing device. Furthermore, the gateway devices send the operational logs of all IoT devices to the processing device so that the processing device can analyze the operational status of the IoT devices based on the logs, resulting in significant computational and storage pressure on the processing device.
[0024] Based on this, embodiments of this application provide a method, apparatus, device, medium, and product for obtaining operation logs, which can solve the above problems. The following is a detailed description of a method for obtaining operation logs provided by embodiments of this application.
[0025] In some embodiments, such as Figure 1 As shown in the embodiment of this application, a method for obtaining runtime logs is provided, which may include: S110: The gateway device obtains the operation logs of multiple IoT devices connected to the gateway device. The operation logs include multiple characteristic events of the multiple IoT devices during operation and the number of each characteristic event.
[0026] A gateway device can connect to multiple IoT devices simultaneously and acquire the operation logs of multiple IoT devices. The operation logs can include multiple characteristic events of the IoT devices during operation and the number of each characteristic event. For example, characteristic events can include the target parameters or abnormal parameters of the IoT devices, the version number of the target firmware of the IoT devices, the execution result of the target instructions of the IoT devices, and the information interaction results between the IoT devices and preset IoT devices.
[0027] S120: The gateway device determines the quantity of various preset types of feature events based on the operation logs of multiple IoT devices, and generates log feature parameters that include the quantity of various preset types of feature events.
[0028] The gateway device can classify multiple feature events based on the operation logs of multiple IoT devices. For example, it can classify them into different types of feature events such as device failure type, communication interruption type, and firmware version check type. It can also determine the number of feature events corresponding to each preset type and generate log feature parameters.
[0029] In some examples, log feature parameters may include a sequence of numbers corresponding to each level after sorting the preset feature events by importance from high to low. For example, log feature parameters may be: Gm=[ fm(A), fm(B), ..., fm(N)], where fm(A)- fm(N) represent the number of feature events of different preset types.
[0030] S130: The gateway device sends log characteristic parameters to the processing device.
[0031] Here, the processing device can be a server or device used to deploy the log management platform system.
[0032] After the gateway device generates log characteristic parameters, it can proactively send the aforementioned log characteristic parameters to the processing device.
[0033] S140: For each preset type of feature event, the processing device determines the offset between the number of feature events and the corresponding reference number, and determines the importance score of the gateway device based on the offset and preset weight corresponding to each preset type of feature event.
[0034] The processing device stores a reference number of feature events corresponding to each preset type. The processing device can then calculate the importance score of the gateway device based on the offset between the number of feature events for each preset type and its corresponding reference number. Finally, the offset of each type of feature event is weighted and summed with a preset weight.
[0035] Here, the processing device can construct an offset sequence Q=[Q1, Q2, ..., QN] based on the offset corresponding to each feature event, and determine the importance score of the gateway device based on the pre-stored weight matrix K=[K1, K2, ..., KN] which includes the preset weights of each feature event.
[0036] S150: When the importance score is greater than or equal to the preset value, the processing device sends a log upload command to the gateway device.
[0037] The processing device will compare the importance score with the preset value to obtain the comparison result. If the comparison result includes an importance score that is less than the preset value, it indicates that the IoT device connected to the gateway device is in a normal operating state, and there is no need to obtain the IoT device's operating log. If the comparison result includes an importance score greater than or equal to a preset value, the processing device sends a log upload command to the gateway device.
[0038] In some embodiments, the processing device can connect to multiple gateway devices, each of which connects to multiple IoT devices. The processing device can receive log feature parameters sent by the multiple gateway devices. Based on the log feature parameters of each gateway device, the processing device can determine the offset sequence corresponding to each gateway device, determine the importance score of each gateway device based on the offset sequence and weight matrix, sort the importance scores of the multiple gateway devices in descending order, and select the top M gateway devices to send log upload instructions. This method can quickly identify the gateway devices that require attention and obtain the operating logs of their corresponding IoT devices, greatly reducing the computational, storage, and bandwidth pressure on the processing device and avoiding resource waste.
[0039] S160: The gateway device sends the operation logs of the IoT device to the processing device based on the log upload command.
[0040] After receiving the log upload instruction, the gateway device can send the operation logs of the IoT device to the processing device.
[0041] In some examples, the gateway device can send operation logs to the processing device in the order of their generation time, or in the order of their preset device sequence.
[0042] This application embodiment generates log feature parameters based on the acquired operational logs of IoT devices by the gateway device, and actively sends these parameters to the processing device. The processing device then evaluates the offset between the number of preset-type feature events occurring on the IoT devices and a reference number based on these log feature parameters. Furthermore, it determines the importance score of the gateway device based on multiple offsets and preset weights. Only when the importance score is greater than or equal to a threshold is a log upload command sent to the gateway device to retrieve the operational logs sent by the gateway device. This method allows the processing device to intelligently filter out target gateways requiring priority attention based solely on log feature parameters, enabling the priority uploading of important logs and ensuring that the processing device's computing resources can be quickly focused on handling potential anomalies. Simultaneously, this solution significantly reduces the burden on the processing device, requiring only the processing of lightweight feature parameters under normal circumstances, avoiding the storage and computational pressure caused by full log transmission, thereby improving the efficiency and timeliness of log management.
[0043] In some embodiments, for each feature event, determining the offset between the number of feature events and the corresponding reference number includes: For each preset type of feature event, determine the deviation between the number of feature events and the corresponding reference number, and identify the maximum and minimum deviation values among multiple deviation values. Based on the deviation value, maximum deviation value, minimum deviation value, and preset adjustment coefficient corresponding to each preset type of feature event, determine the offset of each preset type of feature event.
[0044] The aforementioned deviation value can be determined based on the absolute value of the difference between the number of feature events of each preset type and the reference number.
[0045] The maximum and minimum deviation values can be determined based on the following expressions: (1) Where CS1 is the minimum deviation value; CS2 is the maximum deviation value; fm(X) is the number of feature events for each preset type; B X The reference number of feature events for each preset type.
[0046] The offset can be determined based on the following expression: (2) Among them, Q xm For each preset type of feature event, CS1 represents the minimum deviation value; CS2 represents the maximum deviation value; fm(X) represents the number of feature events for each preset type; B represents the offset value. X The reference number of feature events for each preset type. ρ This is the adjustment coefficient.
[0047] This application's embodiments determine the offset by introducing a maximum deviation value, a minimum deviation value, a deviation value, and an adjustment coefficient. This allows the deviations between the number of features of different preset types and the reference number to be placed under the same standard, so that subsequent weighted summation of offset and weight can be performed, thereby improving the scientificity and accuracy of the importance scoring results.
[0048] In some embodiments, such as Figure 2 As shown, the log feature parameters are parameters sent by the gateway device to the processing device based on the corresponding target reporting period; the log feature parameters sent by the gateway device to the processing device may include: S210: The processing device acquires device information from multiple IoT devices. The device information includes at least one of the following: device type parameters, installation environment parameters, and number of monitoring indicators.
[0049] The processing device can obtain device information of multiple IoT devices through the gateway device. The device type parameter represents the device type of the IoT device, such as sensor, actuator, or communication transmission. The installation environment parameter represents the environment in which the IoT device is located, such as traffic environment, factory environment, or home environment. The number of monitoring indicators represents the total number of different feature event monitoring dimensions that need to be monitored and recorded for an IoT device.
[0050] S220: The processing device inputs the device information into the preset model, and determines the target reporting cycle of the gateway device based on the correspondence between the device information and the reporting cycle included in the preset model.
[0051] The processing device can input the above device information into a preset model to obtain the target reporting cycle of the gateway device.
[0052] In some examples, the processing device can determine the target reporting period for each gateway device based on the device information corresponding to each gateway device. For example, the target reporting period for gateway device N1 is determined to be 2 periods, meaning that gateway device N1 will report log feature parameters based on the standard period of 2. The target reporting period for gateway device N2 is determined to be 3 periods, meaning that gateway device N2 will report log feature parameters based on the standard period of 3.
[0053] S230: The processing device sends the target reporting cycle to the gateway device.
[0054] S240: The gateway device periodically sends log characteristic parameters to the processing device based on the target reporting cycle.
[0055] The processing device sends the target reporting cycle to the gateway device, and the gateway device periodically reports log characteristic parameters based on the reporting cycle indicated by the target reporting cycle.
[0056] The embodiments of this application can determine different reporting periods for different gateway devices, so that different gateway devices periodically report log feature parameters based on different target reporting periods. This directly reduces the bandwidth pressure required for gateway devices to upload log feature parameters, and also reduces the frequency of data reception and processing by processing devices, thus freeing up processing resources.
[0057] In some embodiments, the preset model includes a convolutional neural network model; before inputting device information into the preset model, the method may further include: Obtain sample device information and sample reporting cycle corresponding to multiple sample gateway devices; input the information of each sample device into the initial convolutional neural network model to obtain the prediction cycle corresponding to each sample gateway device; train the initial convolutional neural network model based on the deviation between the prediction cycle and the sample reporting cycle corresponding to each sample gateway device to obtain the convolutional neural network model.
[0058] The processing device can acquire historical data from multiple IoT devices to form a sample set. This sample set can include sample device information and a sample reporting cycle. The information for each sample device includes: the device type, installation environment, and number of monitoring indicators. Here, the sample reporting cycle is a manually set optimal reporting cycle.
[0059] The sample device information is input into the initial convolutional neural network model. After calculation, the model outputs a prediction period. The prediction period of the model is compared with the actual sample reporting period to calculate the deviation. Using the backpropagation algorithm, the deviation is propagated back from the output layer to the input layer. The weights and parameters inside the initial convolutional neural network model are adjusted according to the magnitude of the deviation. This process is iterated until the average deviation between the model's prediction period and the sample reporting period converges to a sufficiently small value to obtain the convolutional neural network model.
[0060] This application embodiment obtains a convolutional neural network model by training based on sample device information and sample reporting cycle, enabling the processing device to automatically calculate the reporting cycle of different gateway devices based on the convolutional neural network model, which helps to reduce the data reception and processing pressure of the processing device.
[0061] In some embodiments, such as Figure 3 As shown, the runtime log includes multiple sub-logs, and the method may also include: S310: The gateway device acquires multiple logs from multiple IoT devices.
[0062] Here, the multiple logs obtained by the gateway device from multiple IoT devices are mixed logs including timestamps and device identifiers.
[0063] S320: The gateway device can classify multiple logs into multiple sub-logs according to time sequence, and classify multiple logs into multiple sub-logs according to device sequence.
[0064] Gateway devices can classify logs according to time order based on log timestamps to obtain multiple sub-logs. At the same time, they can also classify logs according to device identifiers based on device order to obtain multiple sub-logs.
[0065] S330: The gateway device determines the variance of multiple sub-logs obtained by classifying them according to time order based on the memory occupied by each sub-log obtained by classifying them according to device order, and determines the variance of multiple sub-logs obtained by classifying them according to device order based on the memory occupied by each sub-log obtained by classifying them according to device order.
[0066] Based on the two different classification methods mentioned above, the variance can be determined based on the memory usage of multiple sub-logs corresponding to the time sequence, or based on the memory usage of multiple sub-logs corresponding to the device sequence.
[0067] S340: The gateway device determines the target upload order based on the variance of multiple sub-logs obtained by classifying them according to time order and the variance of multiple sub-logs obtained by classifying them according to device order.
[0068] The target upload order can be determined by choosing the smaller variance between the variance based on time order and the variance based on spatial order.
[0069] S350: Multiple sub-logs sent by the gateway device to the processing device in the order of target upload.
[0070] S360: The processing device stores multiple sub-logs according to the storage classification method corresponding to the target upload order.
[0071] When the processing device receives multiple sub-logs uploaded by the gateway device based on the target upload order, it will store them in a way that is more suitable for querying based on its built-in indexing mechanism. For example, when the target upload order is time order, the processing device will generate an index corresponding to the time order so that users can find logs by time index; or when the target upload order is device order, the processing device will generate an index corresponding to the device identifier so that users can find logs by device identifier.
[0072] In this embodiment, the gateway device selects the order in which the sub-log size variance is smaller, i.e., the target upload order, so that the data packet size of each transmitted sub-log is relatively uniform. This avoids the risk of network congestion, transmission timeout or failure caused by a single excessively large data packet, and ensures the smoothness and reliability of the entire upload process.
[0073] Based on the same inventive concept, embodiments of this application also provide a device for obtaining operation logs.
[0074] In some embodiments, such as Figure 4 As shown in the figure, this application embodiment provides a device for acquiring operation logs, applied to a processing device, the device comprising: The receiving module 401 is used to receive log feature parameters sent by the gateway device. The log feature parameters are used to characterize the operating status of multiple IoT devices connected to the gateway device. The log feature parameters include the number of feature events of various preset types. The feature parameters are determined based on the operating logs sent by multiple IoT devices to the gateway device. The determination module 402 is used to determine the offset between the number of feature events and the corresponding reference number for each preset type of feature event, and to determine the importance score of the gateway device based on the offset and preset weight corresponding to each preset type of feature event; The sending module 403 is used to send a log upload instruction to the gateway device when the importance score is greater than or equal to a preset value, so that the gateway device can send the operation logs of multiple IoT devices to the processing device based on the log upload instruction; The receiving module 401 is also used to receive the operation logs of the IoT devices sent by the gateway device.
[0075] In some embodiments, the determining module is configured to: For each preset type of feature event, determine the deviation value between the number of feature events and the corresponding reference number, and determine the maximum and minimum deviation values among multiple deviation values; Based on the deviation value, maximum deviation value, minimum deviation value, and preset adjustment coefficient corresponding to the feature event of each preset type, the offset corresponding to the feature event of each preset type is determined.
[0076] In one embodiment, the log feature parameters are parameters sent by the gateway device to the processing device based on the corresponding target reporting period; the receiving module is used for: Obtain device information for multiple IoT devices, including at least one of the following: device type parameters, installation environment parameters, and number of monitoring indicators; The device information is input into the preset model. Based on the correspondence between the device information and the reporting period included in the preset model, the target reporting period of the gateway device is determined and sent to the gateway device so that the gateway device can periodically send log feature parameters to the processing device based on the target reporting period.
[0077] In some embodiments, the sending module is configured to: Obtain sample device information and sample reporting cycle for multiple sample gateway devices; Input the information of each sample device into the initial convolutional neural network model to obtain the prediction period corresponding to each sample gateway device; The initial convolutional neural network model is trained based on the deviation between the prediction period and the sample reporting period corresponding to each sample gateway device, thus obtaining the convolutional neural network model.
[0078] In some embodiments, the receiving module is configured to: The gateway device receives multiple sub-logs sent in the target upload order. The multiple sub-logs are logs obtained by the gateway device from multiple logs of multiple IoT devices in chronological order or device order. The target upload order is determined based on the variance of the memory occupied by the multiple sub-logs obtained by chronological order and the variance of the memory occupied by the multiple sub-logs obtained by device order. Multiple sub-logs are stored according to the storage classification method corresponding to the target upload order.
[0079] In some embodiments, such as Figure 5 As shown in the figure, this application provides an apparatus for acquiring operation logs, applied to a gateway device. The gateway device is connected to multiple IoT devices, and the apparatus includes: The acquisition module 501 is used to acquire the operation logs of multiple IoT devices connected to the gateway device. The operation logs include multiple characteristic events of the multiple IoT devices during operation and the number of each characteristic event. The determination module 502 is used to determine the quantity of feature events of various preset types based on the operation logs of multiple IoT devices, and send log feature parameters including the quantity of feature events of various preset types to the processing device, so that the processing device can determine the offset between the quantity of feature events of each preset type and the corresponding reference quantity, determine the importance score of the gateway device based on the offset of feature events of each preset type and the preset weight, and generate a log upload instruction if the importance score is greater than or equal to the preset value. The receiving module 503 is used to receive the log upload instruction sent by the processing device, and send the operation logs of multiple IoT devices to the processing device based on the log upload instruction.
[0080] In some embodiments, the log feature parameters are parameters sent by the gateway device to the processing device based on the corresponding target reporting period; the receiving module is used for: The receiving and processing device sends the target reporting period, and periodically sends log feature parameters to the processing device based on the target reporting period. The target reporting period is the reporting period determined by the processing device by inputting the device information of multiple IoT devices into a preset model and based on the correspondence between the device information included in the preset model and the reporting period. The device information includes at least one of the following: device type parameters, installation environment parameters, and the number of monitoring indicators.
[0081] In some embodiments, the acquisition module is configured to: Obtain multiple logs from multiple IoT devices; Multiple logs can be categorized into multiple sub-logs according to time sequence, and multiple logs can be categorized into multiple sub-logs according to device sequence. Based on the memory usage of each sub-log obtained by classifying according to time order, the variance of multiple sub-logs obtained by classifying according to time order is determined; and based on the memory usage of each sub-log obtained by classifying according to device order, the variance of multiple sub-logs obtained by classifying according to device order is determined. The target upload order is determined based on the variance of multiple sub-logs obtained by classifying them according to time order and the variance of multiple sub-logs obtained by classifying them according to device order. Multiple sub-logs are sent to the gateway device in the order of the target upload, so that the processing device can store multiple sub-logs in the storage classification method corresponding to the order of the target upload.
[0082] The apparatus described above is used to implement the corresponding method for obtaining operation logs in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0083] In some embodiments, such as Figure 6 As shown in the figure, this application embodiment provides a system for obtaining operation logs, including: IoT device 601 is used to send operation logs to the gateway device.
[0084] Gateway device 602 is used to determine the quantity of feature events of various preset types based on the operation logs of multiple IoT devices, and send log feature parameters including the quantity of feature events of various preset types to the processing device.
[0085] Processing device 603 is used to determine the offset between the number of feature events of each preset type and the corresponding reference number, determine the importance score of the gateway device based on the offset and preset weight of the feature events of each preset type, and generate a log upload instruction if the importance score is greater than or equal to a preset value.
[0086] Gateway device 602 is also used to receive log upload instructions sent by processing device, and send the operation logs of multiple IoT devices to processing device based on the log upload instructions.
[0087] The system for acquiring operation logs provided in this application embodiment can send operation logs to the processing device only when the importance score of the gateway device is high, which is beneficial to freeing up the computing and storage resources of the processing device.
[0088] Figure 7 A schematic diagram of the hardware structure of an electronic device is provided in the application embodiment.
[0089] The electronic device 700 may include a processor 701 and a memory 702 storing computer program instructions.
[0090] Specifically, the processor 701 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0091] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 702 may include removable or non-removable (or fixed) media. Where appropriate, memory 702 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 702 is non-volatile solid-state memory.
[0092] In a particular embodiment, memory 702 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0093] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this application.
[0094] The processor 701 reads and executes computer program instructions stored in the memory 702 to implement any of the above-described methods for obtaining runtime logs.
[0095] In one example, the electronic device may also include a communication interface 703 and a bus 704. Wherein, as... Figure 7 The processor 701, memory 702, and communication interface 703 are connected through bus 704 and complete communication with each other.
[0096] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0097] Bus 704 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 704 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0098] The electronic devices described above are used to implement the corresponding operation log acquisition method in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0099] Furthermore, in conjunction with the methods for obtaining runtime logs in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the runtime log acquisition methods in the above embodiments.
[0100] Furthermore, in conjunction with the methods for obtaining runtime logs in the above embodiments, this application embodiment can provide a computer program product for implementation. When the instructions of this computer program product are executed by the processor of an electronic device, they implement any of the runtime log acquisition methods in the above embodiments.
[0101] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0102] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0103] It should also be noted that the exemplary embodiments mentioned in this application describe methods or apparatuses based on a series of steps or devices. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0104] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0105] The above description is merely a specific embodiment of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for obtaining runtime logs, characterized in that, Applied to a processing device, the method includes: The system receives log feature parameters sent by a gateway device, wherein the log feature parameters are used to characterize the operating status of multiple IoT devices connected to the gateway device, and the log feature parameters include the number of feature events of various preset types; the log feature parameters are determined based on the operating logs sent by the multiple IoT devices to the gateway device. For each preset type of feature event, the offset between the number of the feature events and the corresponding reference number is determined, and based on the offset and preset weight corresponding to the feature events of each preset type, the importance score of the gateway device is determined; If the importance score is greater than or equal to a preset value, a log upload instruction is sent to the gateway device, so that the gateway device can send the operation logs of multiple IoT devices to the processing device based on the log upload instruction; Receive the operation logs of the IoT device sent by the gateway device.
2. The method for obtaining runtime logs according to claim 1, characterized in that, For each feature event, determining the offset between the number of feature events and the corresponding reference number includes: For each of the preset types of feature events, determine the deviation value between the number of feature events and the corresponding reference number, and determine the maximum and minimum deviation values among the multiple deviation values; Based on the deviation value, maximum deviation value, minimum deviation value, and preset adjustment coefficient corresponding to the feature event of each preset type, the offset corresponding to the feature event of each preset type is determined.
3. The method for obtaining runtime logs according to claim 1, characterized in that, The log feature parameters are parameters sent by the gateway device to the processing device based on the corresponding target reporting cycle; Before receiving the log feature parameters sent by the gateway device, the method further includes: Obtain device information for multiple IoT devices, wherein the device information includes at least one of the following: device type parameters, installation environment parameters, and number of monitoring indicators; The device information is input into a preset model. Based on the correspondence between the device information and the reporting period included in the preset model, the target reporting period of the gateway device is determined, and the target reporting period is sent to the gateway device so that the gateway device can periodically send the log feature parameters to the processing device based on the target reporting period.
4. The method for obtaining operation logs according to claim 3, characterized in that, The preset model includes a convolutional neural network model; before inputting the device information into the preset model, the method further includes: Obtain sample device information and sample reporting cycle for multiple sample gateway devices; The information of each sample device is input into the initial convolutional neural network model to obtain the prediction period corresponding to each sample gateway device; The initial convolutional neural network model is trained based on the deviation between the prediction period and the sample reporting period corresponding to each sample gateway device to obtain the convolutional neural network model.
5. The method for obtaining runtime logs according to claim 1, characterized in that, The runtime log includes multiple sub-logs, and the method further includes: The gateway device receives multiple sub-logs sent in a target upload order, wherein the multiple sub-logs are logs obtained by the gateway device by classifying multiple logs of multiple IoT devices in chronological order or device order; the target upload order is determined based on the variance of the memory occupied by the multiple sub-logs obtained by classifying in chronological order and the variance of the memory occupied by the multiple sub-logs obtained by classifying in device order. Multiple sub-logs are stored according to the storage classification method corresponding to the upload order of the target.
6. A method for obtaining runtime logs, characterized in that, Applied to a gateway device that is connected to multiple Internet of Things (IoT) devices, the method includes: Obtain the operation logs of multiple IoT devices connected to the gateway device, wherein the operation logs include multiple characteristic events of the multiple IoT devices during operation and the number corresponding to each characteristic event; Based on the operation logs of multiple IoT devices, the quantity of feature events of various preset types is determined, and log feature parameters including the quantity of feature events of various preset types are sent to the processing device. The processing device determines the offset between the quantity of feature events of each preset type and the corresponding reference quantity. Based on the offset and preset weight of feature events of each preset type, the importance score of the gateway device is determined. If the importance score is greater than or equal to a preset value, a log upload instruction is generated. The system receives the log upload instruction sent by the processing device and sends the operation logs of multiple IoT devices to the processing device based on the log upload instruction.
7. The method for obtaining operation logs according to claim 6, characterized in that, The log feature parameters are parameters sent by the gateway device to the processing device based on the corresponding target reporting period; the sending of log feature parameters to the processing device includes a number of log feature parameters corresponding to various preset types of feature events, including: The system receives the target reporting period sent by the processing device and periodically sends the log feature parameters to the processing device based on the target reporting period. The target reporting period is the reporting period determined by the processing device by inputting the device information of multiple IoT devices into a preset model and based on the correspondence between the device information and the reporting period included in the preset model. The device information includes at least one of the following: device type parameters, installation environment parameters, and the number of monitoring indicators.
8. The method for obtaining operation logs according to claim 6, characterized in that, The operation log includes multiple sub-logs, and sending the operation logs of multiple IoT devices to the processing device includes: Obtain multiple logs from multiple IoT devices; Multiple logs are classified into multiple sub-logs according to time order, and multiple logs are classified into multiple sub-logs according to device order; Based on the memory usage of each sub-log obtained by classifying according to time order, the variance of multiple sub-logs obtained by classifying according to time order is determined; and based on the memory usage of each sub-log obtained by classifying according to device order, the variance of multiple sub-logs obtained by classifying according to device order is determined. The target upload order is determined based on the variance of multiple sub-logs obtained by classifying them according to time order and the variance of multiple sub-logs obtained by classifying them according to device order. Multiple sub-logs are sent to the gateway device in the target upload order, so that the processing device can store the multiple sub-logs in a storage classification method corresponding to the target upload order.
9. A device for acquiring operation logs, characterized in that, Applied to a processing device, the apparatus includes: A receiving module is used to receive log feature parameters sent by a gateway device, wherein the log feature parameters are used to characterize the operating status of multiple IoT devices connected to the gateway device, and the log feature parameters include the number of feature events of various preset types; the log feature parameters are determined based on the operating logs sent by the multiple IoT devices to the gateway device; The determination module is used to determine the offset between the number of feature events and the corresponding reference number for each preset type of feature event, and to determine the importance score of the gateway device based on the offset and preset weight corresponding to the feature events of each preset type; The sending module is used to send a log upload instruction to the gateway device when the importance score is greater than or equal to a preset value, so that the gateway device can send the operation logs of multiple IoT devices to the processing device based on the log upload instruction; The receiving module is also used to receive the operation logs of the IoT device sent by the gateway device.
10. A device for acquiring operation logs, characterized in that, Applied to a gateway device, the gateway device being connected to multiple Internet of Things (IoT) devices, the device includes: The acquisition module is used to acquire the operation logs of multiple IoT devices connected to the gateway device, wherein the operation logs include multiple characteristic events of the multiple IoT devices during operation and the number corresponding to each characteristic event; The determination module is used to determine the quantity of feature events of various preset types based on the operation logs of multiple IoT devices, and send log feature parameters including the quantity of feature events of various preset types to the processing device, so that the processing device can determine the offset between the quantity of feature events of each preset type and the corresponding reference quantity, determine the importance score of the gateway device based on the offset corresponding to the feature events of each preset type and the preset weight, and generate a log upload instruction if the importance score is greater than or equal to a preset value; The receiving module is used to receive the log upload instruction sent by the processing device, and send the operation logs of multiple IoT devices to the processing device based on the log upload instruction.
11. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the method for obtaining the runtime log as described in any one of claims 1 to 8.
12. A readable storage medium, characterized in that, The readable storage medium stores computer program instructions, which, when executed by a processor, implement the method for obtaining the runtime log as described in any one of claims 1 to 8.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is processed by a processor, it implements the method for obtaining the runtime log as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Data transmission method and gateway based on data priority
CN103517348A
Network equipment state information acquisition method and device
CN112866044A