Log sending method, device and log management system

By caching logs in the log management device and sending them according to the storage device capacity, the problem of low reliability of log generation devices is solved and reliable log storage is achieved.

CN113918358BActive Publication Date: 2025-10-10ENVISION DIGITAL INT PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111095241.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2025-10-10
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

The reliability of the log generating device sending logs to the storage device is low.

Method used

After receiving the logs, the log management device caches them in the message queue and sends the logs to the target storage device, which does not exceed the amount of data that the target storage device can receive.

Benefits of technology

Improves the reliability of log sending, ensuring that the target storage device can reliably receive and store logs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918358B_ABST
    Figure CN113918358B_ABST
Patent Text Reader

Abstract

The application discloses a log sending method and device and a log management system, and belongs to the field of communication. After a log management device buffers at least one received log in a message queue, the log management device can send target logs in the message queue that are not greater than a data amount of logs that a target storage device can receive to the target storage device based on the data amount. Thus, the target storage device can reliably receive and store the target logs, thereby effectively improving the reliability of log sending.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communications, and in particular to a log sending method, device, and log management system. Background Art

[0002] A log management system typically includes a log generation device and a storage device. Specifically, the log generation device can send instructions to the IoT device based on the operation triggered by the logged-in user, so that the IoT device performs the operation indicated by the instruction. Furthermore, the log generation device can generate a log based on the login user's ID and the operation triggered by the login user, and directly send the log to the storage device. For example, if the login user's ID is 00, the IoT device is a wind turbine generator set, and the instruction is to adjust the pitch angle of the wind turbine generator set to 0 degrees, the log generated by the log generation device can be: User 00 adjusted the pitch angle of the wind turbine generator set to 0 degrees.

[0003] However, the reliability of the log generating device sending logs to the storage device is low. Summary of the Invention

[0004] The embodiments of the present disclosure provide a log sending method, device, and log management system that can solve the problem of low reliability in the related art of log generation devices sending logs to storage devices. The technical solution is as follows:

[0005] In one aspect, a log sending method is provided, which is applied to a log management device, and the method includes:

[0006] receiving at least one log sent by a log collection device;

[0007] caching the at least one log in a message queue;

[0008] Based on the data volume of the log that the target storage device can receive, the target log in the message queue is sent to the target storage device, and the data volume of the target log is less than or equal to the data volume of the log that the target storage device can receive.

[0009] Optionally, the sending the target log in the message queue to the target storage device based on the data volume of the log that can be received by the target storage device includes:

[0010] If the data volume of the log that can be received by the target storage device is greater than or equal to the data volume threshold, the target log in the message queue is sent to the target storage device.

[0011] Optionally, before sending the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive, the method further includes:

[0012] sending a data amount request to the target storage device, the data amount request being used to instruct the target storage device to feed back a data amount of logs that can be currently received;

[0013] receiving a response message sent by the target storage device, the response message being used to instruct the target storage device to feed back the data amount of logs that can be currently received.

[0014] Optionally, the log collection device is installed with a log collection application and a plurality of service applications, the service applications are used to send control instructions to the Internet of Things device, generate logs based on running data, and send the generated logs to the log collection application; and the receiving at least one log sent by the log collection device comprises:

[0015] receiving a first type of log and a second type of log sent by the log collection application, the second type of log being more important than the first type of log;

[0016] receiving the second type of log sent by the service application.

[0017] Optionally, before the receiving at least one log sent by the log collection device, the method further comprises:

[0018] verifying authentication data sent by the log collection device;

[0019] The receiving at least one log sent by the log collection device further comprises:

[0020] If it is determined that the authentication data passes the verification, receiving at least one log sent by the log collection device.

[0021] Optionally, each log carries description information of the log, the description information of the log comprising at least one of a source of the log, a type of the log, and an Internet of Things device recording the log; and the method further comprises:

[0022] based on the description information of the target log, determining a target storage device corresponding to the description information of the target log from a plurality of correspondence relationships between description information and a plurality of storage devices.

[0023] Optionally, the method further comprises:

[0024] If no storage device corresponding to the description information of the target log is determined from the plurality of correspondence relationships between description information and a plurality of storage devices based on the description information of the target log, deleting the target log.

[0025] On the other hand, a log sending device is provided, which is applied to a log management device, and the log sending device includes:

[0026] A receiving module, configured to receive at least one log sent by a log collection device;

[0027] a cache module, configured to cache the at least one log in a message queue;

[0028] The sending module is used to send the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive, and the data volume of the target log is less than or equal to the data volume of the log that the target storage device can receive.

[0029] On the other hand, a computer-readable storage medium is provided, in which a program code is stored. The program code is loaded and executed by a processor to implement the log sending method as described in the above aspects.

[0030] In another aspect, a log management system is provided, the system comprising: a log collection device, a log management device, and a storage device;

[0031] The log collection device is used to generate at least one log and send the generated at least one log to the log management device;

[0032] The log management device includes the log sending device as described above;

[0033] The storage device is used to receive and store logs sent by the log management device.

[0034] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores program code, and the program code is loaded and executed by the processor to implement the log sending method as described in the above aspect.

[0035] On the other hand, a computer program product comprising instructions is provided. When the computer program product is run on the computer, the computer is caused to execute the log sending method described in the above aspects.

[0036] The beneficial effects of the technical solutions provided by the embodiments of the present disclosure include at least:

[0037] The disclosed embodiments provide a log sending method, apparatus, and log management system. After a log management device caches at least one received log in a message queue, it can send target logs in the message queue that are no larger than the data volume of the logs that the target storage device can receive to a target storage device. This ensures that the target storage device can reliably receive and store the target logs, effectively improving the reliability of log sending. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0039] Figure 1 is a schematic diagram of a log management system provided by an embodiment of the present disclosure;

[0040] Figure 2 This is a flow chart of a log sending method provided by an embodiment of the present disclosure;

[0041] Figure 3 is a flow chart of another log sending method provided by an embodiment of the present disclosure;

[0042] Figure 4 This is a block diagram of a log sending device provided by an embodiment of the present disclosure;

[0043] Figure 5 is a block diagram of another log sending device provided by an embodiment of the present disclosure;

[0044] Figure 6 Schematic diagram of a log management device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0045] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0046] Figure 1 is a schematic diagram of a log management system provided by an embodiment of the present disclosure, such as Figure 1 As shown, the log management system may include: at least one log collection device 10 , a log management device 20 and multiple storage devices 30 . Figure 1For example, the log management system includes a log collection device 10 and two storage devices 30. The storage device 30 can be an elasticsearch storage device, an azure log storage device, or a file storage device.

[0047] Wherein, each log collection device 10 and the log management device 20, as well as each storage device 30 and the log management device 20 can be connected via a wired network or a wireless network.

[0048] Each log collection device 10 may be a device capable of generating logs and sending the generated logs to the log management device 20. Each log collection device 10 may be installed with a log collection application 101 and multiple business applications 102. The business application 102 is used to send control instructions to the IoT device, generate logs based on operating data, and send the generated logs to the log collection application 101.

[0049] Optionally, the log collection application 101 may be integrated with a log collector such as fluentd or filebeat, and the business application 102 may be integrated with a log software development kit (log SDK). The business application 102 is used to generate logs and send the generated logs to the log collection application 101. The log collection application 101 is used to send the logs to the log management device 20. The business application 102 may also send logs to the log management device 20.

[0050] For example, the business application can send a control instruction to the IoT device in response to an operation triggered by a logged-in user, the user who logged into the log collection device, causing the IoT device to perform the operation indicated by the control instruction. The logged-in user can then include the login user's identifier and the operation triggered by the logged-in user. For example, if the login user's identifier is 00, the IoT device is a wind turbine generator set, and the control instruction is to adjust the pitch angle of the wind turbine generator set to 0 degrees, the log generated by the business application can be: User 00 adjusted the pitch angle of the wind turbine generator set to 0 degrees.

[0051] Alternatively, the operation data may be data indicating an abnormality in the operation of a business application, and the log generated by the business application based on the operation data may be used to indicate the abnormality in the business application and the reason for the abnormality in the business application.

[0052] The log management device 20 may be a terminal for unified management of logs, such as a computer. The log management device 20 may manage the at least one log sent by the log collection device 10 and send the log to the storage device 30.

[0053] The storage device 30 may be a device capable of storing logs, for example, a server, a server cluster consisting of several servers, or a cloud computing service center.

[0054] Figure 2 This is a flow chart of a log sending method provided by an embodiment of the present disclosure, which can be applied to Figure 1 The log management device shown. Figure 2 As shown, the method may include:

[0055] Step 201: Receive at least one log sent by a log collection device.

[0056] In an embodiment of the present disclosure, after generating at least one log, the log collection device may send the at least one log to the log management device, and the log management device may receive the at least one log sent by the log collection device.

[0057] Step 202: Cache at least one log in a message queue.

[0058] After receiving the at least one log sent by the log collection device, the log management device may cache the at least one log in the message queue. Optionally, the log management device may cache the at least one log at the end of the message queue.

[0059] Step 203: Based on the data volume of the logs that the target storage device can receive, the target logs in the message queue are sent to the target storage device.

[0060] After caching at least one log in a message queue, the log management device may send a target log in the message queue to a target storage device based on a data volume of the logs that the target storage device can receive, wherein the data volume of the target log is less than or equal to the data volume of the logs that the target storage device can receive.

[0061] In related technologies, log collection devices directly send collected logs to storage devices. If the storage device cannot receive the log, it will send the log back to the log collection device, which will then discard the log, resulting in low reliability of log transmission. However, in the log transmission method provided by the embodiments of the present disclosure, because the log management device can send the target logs in the message queue that do not exceed the data volume of the logs that the target storage device can receive based on the data volume of the logs, the reliability of log transmission is effectively improved.

[0062] In summary, the disclosed embodiments provide a log sending method. After a log management device caches at least one received log in a message queue, it can then send target logs in the message queue that do not exceed the data volume of the logs that the target storage device can receive to a target storage device, based on the data volume of the logs that the target storage device can receive. This ensures that the target storage device can reliably receive and store the target logs, effectively improving the reliability of log sending.

[0063] Figure 3 This is a flow chart of another log sending method provided by an embodiment of the present disclosure, which can be applied to Figure 1 The log management system shown in the figure. Figure 3 As shown, the method may include:

[0064] Step 301: The log collection device sends at least one log to the log management device.

[0065] The log collection device can generate at least one log and, after generating the at least one log, send authentication data to the log management device. After receiving the authentication data sent by the log collection device, the log management device can verify the authentication data. If the authentication data is successfully verified, a verification success instruction can be sent to the log collection device. After receiving the verification success instruction, the log collection device can send the at least one log to the log management device, thereby ensuring the reliability of the received log. If the log management device fails to verify the authentication data, a verification failure instruction can be sent to the log collection device.

[0066] The authentication data may be data sent by the log management device to the log collection device and stored in the log collection device. The log management device may periodically generate authentication data and send the authentication data to the log collection device.

[0067] Optionally, after receiving the authentication data, the log management device may compare the authentication data with its stored authentication data. If the received authentication data is identical to the stored authentication data, then it may be determined that the received authentication data has been successfully verified. If the received authentication data is different from the stored authentication data, then it may be determined that the received authentication data has failed verification.

[0068] In an embodiment of the present disclosure, a log collection device may be installed with a log collection application and multiple business applications. The business application is used to send control instructions to the IoT device, generate logs based on operating data, and send the generated logs to the log collection application.

[0069] The logs generated by the business application may include a first type of log and a second type of log. The importance of the second type of log is higher than that of the first type of log. Optionally, the first type of log may be a log generated by the business application when the user does not operate the business application, and the second type of log may be a log generated by the business application based on the user's operation.

[0070] For example, the business application can send a control instruction to the IoT device in response to an operation triggered by a logged-in user, such that the IoT device performs the operation indicated by the control instruction. The logged-in user is the user who logged into the log collection device. The operation data can then include the login user's identifier and the operation triggered by the logged-in user. For example, if the login user's identifier is 00, the IoT device is a wind turbine generator set, and the control instruction is to adjust the pitch angle of the wind turbine generator set to 0 degrees, the log generated by the business application can be: User 00 adjusted the pitch angle of the wind turbine generator set to 0 degrees. This log is a second type of log.

[0071] Alternatively, the operation data may be data indicating an abnormality in the operation of a business application. The log generated by the business application based on the operation data may be used to indicate the abnormality in the business application and the reason for the abnormality. The log is a first type of log.

[0072] In an embodiment of the present disclosure, a log collection application may send a first type of log and a second type of log to a log management device. Accordingly, the log management device is configured to receive the first type of log and the second type of log sent by the log collection application.

[0073] Optionally, the log collection application may send authentication data to the log management device before sending the log to the log management device. After receiving the authentication data sent by the log collection application, the log management device may verify the authentication data. If the authentication data is successfully verified, a verification success instruction may be sent to the log collection application. After receiving the verification success instruction, the log collection application may send the log to the log management device.

[0074] The business application may send the second type of log to the log management device. Correspondingly, the log management device is configured to receive the second type of log sent by the log collection application.

[0075] Optionally, before sending a log to the log management device, the business application may send authentication data to the log management device. After receiving the authentication data sent by the business application, the log management device may verify the authentication data. If the authentication data is successfully verified, a verification success instruction may be sent to the business application. After receiving the verification success instruction, the business application sends the second type of log to the log management device.

[0076] It should be noted that the authentication data sent by the log collection application and each business application to the log management device may be the same or different, and this embodiment of the present disclosure does not limit this.

[0077] In the disclosed embodiment, since logs can be sent to the log management device by both the log collection application and multiple business applications, even if the log collection application experiences an anomaly, the multiple business applications can still send the more important second type of logs to the log management device, ensuring the integrity of the storage of the more important logs. This effectively avoids the problem of a single log source and enriches the sources of logs.

[0078] Step 302: The log management device caches at least one log in a message queue.

[0079] After receiving at least one log from the log collection device, the log management device can cache the at least one log in a message queue. For example, the message queue can be implemented using Kafka, a distributed publish-subscribe messaging system that can process all action stream data of consumers on the website.

[0080] Optionally, the log management device may cache at least one log at the end of the message queue.

[0081] refer to Figure 1 The log management device may be installed with a log cache application 201, which may be used to receive at least one log sent by the log collection device and cache the at least one log in a message queue.

[0082] Step 303: Based on the description information of the target log, the log management device determines a target storage device corresponding to the description information of the target log from the correspondence between multiple description information and multiple storage devices.

[0083] In an embodiment of the present disclosure, each log may carry log description information, and the log description information includes at least one of the source of the log, the type of the log, and the IoT device that recorded the log.

[0084] The source of the log refers to the business application that generates the log. The type of the log can be the first type or the second type.

[0085] After caching at least one log in a message queue, the log management device can obtain a target log from the head of the message queue and, based on the description information of the target log, determine a target storage device corresponding to the description information of the target log from a plurality of correspondences between the description information and the plurality of storage devices. The correspondences between the plurality of description information and the plurality of storage devices can be correspondences pre-stored in the log management device.

[0086] For example, if the descriptive information of the target log includes the source of the log and the type of the log, assuming that the source of the log is business application A and the type of the log is the second type, the log management device can determine the target storage device corresponding to the business application A and the second type from the correspondence between the multiple descriptive information and the multiple storage devices.

[0087] If the descriptive information of the log includes an IoT device recorded in the log, assuming that the IoT device is a wind turbine generator set, the log management device can determine the target storage device corresponding to the wind turbine generator set from the correspondence between the multiple descriptive information and the multiple storage devices.

[0088] refer to Figure 1 The log management device 20 may also be installed with a log sending application 202. The log sending application 202 may determine the target storage device corresponding to the target log's description information from a correspondence between multiple descriptions and multiple storage devices based on the target log's description information. For example, the log sending application 202 may be integrated with Flume, which processes data and transmits the processed data to a data recipient.

[0089] In the disclosed embodiment, if the log management device fails to determine a storage device corresponding to the description information of the target log from the correspondence between multiple description information and multiple storage devices based on the description information of the target log, the log management device can delete the target log. This avoids the log management device from storing too many useless logs and ensures the operating speed of the log management device.

[0090] In the embodiment of the present disclosure, since the log management device can send the target log to different storage devices based on the description information of the target log, compared to storing all logs in one storage device, it effectively reduces the pressure on the storage device to store data, while avoiding the situation of a single storage device and enriching the types of storage devices.

[0091] Step 304: The log management device sends a data volume request to the target storage device.

[0092] After determining the target storage device, the log management device may send a data volume request to the target storage device, wherein the data volume request is used to instruct the target storage device to feed back the data volume of the log that can currently be received.

[0093] Optionally, the log sending device in the log management device 20 may also be used to send a data volume request to the target storage device.

[0094] Step 305: The log management device receives a response message sent by the target storage device.

[0095] After receiving the data volume request sent by the log management device, the target storage device can determine the current amount of data that can be received and send a response message to the log management device, wherein the response message is used to indicate the current amount of log data that the target storage device can receive.

[0096] In the embodiment of the present disclosure, the target storage device can determine the amount of data it can receive based on the current processing capability of its processor. In addition, the log sending device in the log management device 20 can also be used to receive a response message sent by the target storage device.

[0097] Step 306: The log management device sends the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive.

[0098] After receiving the response message sent by the target storage device, the log management device may send the target log at the head of the message queue to the target storage device based on the data volume of the logs that the target storage device can receive, wherein the data volume of the target log is less than or equal to the data volume of the logs that the target storage device can receive.

[0099] Optionally, if the log management device determines that the target storage device can receive log data that is greater than or equal to a data volume threshold, the target log in the message queue may be sent to the target storage device.

[0100] In the embodiment of the present disclosure, the log sending device in the log management device 20 can also be used to send the target log in the message queue to the target storage device if it is determined that the data volume of the log that the target storage device can receive is greater than or equal to the data volume threshold.

[0101] Step 307: The target storage device stores the target log.

[0102] After receiving the target log, the target storage device can store the target log. Furthermore, after receiving the log acquisition request sent by the log query device, the target storage device can obtain the log indicated by the log acquisition request based on the log acquisition request and send the obtained log to the log query device. After receiving the log, the log query device can display the content of the log. This allows the user to learn the specific content of the log.

[0103] In the disclosed embodiments, each business application in the log collection device integrates a Docker log driver interface. This log driver interface is configured with a JSON (JavaScript Object Notation) file facility, a lightweight data exchange format. Business applications can use the log driver interface to send logs to the log collection application. These logs can be formatted in JSON.

[0104] Docker is an open-source application container engine. The aforementioned log collection application and business applications can run in Docker containers. Kubernetes (K8s) supports Docker, a container orchestration engine that supports automated deployment, large-scale scalability, and containerized application management.

[0105] It should be noted that the sequence of the steps of the log sending method provided in the embodiment of the present application can be appropriately adjusted, and the steps can also be deleted according to the circumstances. For example, the above-mentioned step 303 can be deleted according to the circumstances, that is, the log management device does not need to determine the target storage device based on the description information of the target log. For example, the log management device can randomly select a target storage device from multiple storage devices, or can use the storage device with the largest remaining storage capacity as the target storage device. Alternatively, the above-mentioned step 303 can be performed before step 302. Any person skilled in the art can easily think of the method of variation within the technical scope disclosed in this application, and should be included in the protection scope of this application, so it will not be repeated here.

[0106] In summary, the disclosed embodiments provide a log sending method. After a log management device caches at least one received log in a message queue, it can then send target logs in the message queue that do not exceed the data volume of the logs that the target storage device can receive to a target storage device, based on the data volume of the logs that the target storage device can receive. This ensures that the target storage device can reliably receive and store the target logs, effectively improving the reliability of log sending.

[0107] Figure 4 This is a block diagram of a log sending device provided by an embodiment of the present disclosure. Figure 4 As shown, the log sending device 40 may include:

[0108] The receiving module 401 is configured to receive at least one log sent by a log collection device.

[0109] The cache module 402 is configured to cache at least one log in a message queue.

[0110] The sending module 403 is configured to send the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive. The data volume of the target log is less than or equal to the data volume of the log that the target storage device can receive.

[0111] In summary, the disclosed embodiments provide a log sending device. After a log management device caches at least one received log in a message queue, it can then send target logs in the message queue that are no larger than the data volume of the logs that the target storage device can receive to a target storage device. This ensures that the target storage device can reliably receive and store the target logs, effectively improving the reliability of log sending.

[0112] Optionally, the sending module 403 is configured to:

[0113] If the data volume of the log that can be received by the target storage device is greater than or equal to the data volume threshold, the target log in the message queue is sent to the target storage device.

[0114] Optionally, the sending module 403 is further configured to send a data volume request to the target storage device before sending the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive. The data volume request is used to instruct the target storage device to feedback the data volume of the log that it can currently receive.

[0115] The receiving module 401 is further configured to receive a response message sent by a target storage device, where the response message is used to indicate the amount of log data that the target storage device can currently receive.

[0116] Optionally, a log collection application and multiple business applications are installed in the log collection device, and the business application is used to send control instructions to the IoT device, generate logs based on the operation data, and send the generated logs to the log collection application. The receiving module 401 is used to:

[0117] A first type of log and a second type of log sent by a log collection application are received, where the importance of the second type of log is higher than that of the first type of log.

[0118] Receive the second type of log sent by the business application.

[0119] Optional, reference Figure 5 , the device may further include:

[0120] The verification module 404 is configured to verify the authentication data sent by the log collection device before receiving at least one log sent by the log collection device.

[0121] The receiving module 401 is used for:

[0122] If it is determined that the authentication data verification is successful, at least one log sent by the log collection device is received.

[0123] Optionally, each log contains log description information, which includes at least one of the log source, log type, and IoT device that recorded the log. Figure 5 , the device may further include:

[0124] The determination module 405 is configured to determine, based on the description information of the target log, a target storage device corresponding to the description information of the target log from the correspondence between a plurality of description information and a plurality of storage devices.

[0125] Optional, reference Figure 5 , the device may further include:

[0126] The deleting module is configured to delete the target log if, based on the description information of the target log, no storage device corresponding to the description information of the target log is determined from the correspondence between the plurality of description information and the plurality of storage devices.

[0127] In summary, the disclosed embodiments provide a log sending device. After a log management device caches at least one received log in a message queue, it can then send target logs in the message queue that are no larger than the data volume of the logs that the target storage device can receive to a target storage device. This ensures that the target storage device can reliably receive and store the target logs, effectively improving the reliability of log sending.

[0128] The embodiment of the present disclosure provides a computer-readable storage medium in which a program code is stored. The program code is loaded and executed by a processor to implement the log sending method shown in the above embodiment, for example Figure 1 or Figure 2 The log sending method shown.

[0129] The embodiment of the present disclosure provides a computer program product including instructions. When the computer program product is run on a computer, the computer is caused to execute the log sending method shown in the above embodiment, for example: Figure 1 or Figure 2 The log sending method shown.

[0130] The present disclosure provides a log management device 20, referring to Figure 6 The log management device 20 of the control instruction may include a processor 21 and a memory 22. The memory 22 stores a program code, which is loaded and executed by the processor 21 to implement the log sending method shown in the above embodiment, for example Figure 1 or Figure 2 The log sending method shown.

[0131] like Figure 1 As shown, an embodiment of the present disclosure provides a log management system, which may include a log collection device 10 , a log management device 20 and a storage device 30 .

[0132] The log collection device 10 is used to generate at least one log and send the generated at least one log to the log management device 20. The log management device includes Figure 4 or Figure 5 The log sending device shown, or Figure 6 The storage device 30 is used to receive and store the logs sent by the log management device 20.

[0133] In the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In the embodiments of the present disclosure, the term "plurality" means two or more.

[0134] The above description is merely an optional embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. A log sending method, characterized in that: Applied to a log management device, the method includes: Periodically generating authentication data and sending the authentication data to a log collection device; the log collection device is used to store the authentication data; after generating at least one log, the authentication data is sent to the log management device; Verifying the authentication data sent by the log collection device; If it is determined that the authentication data verification is passed, at least one log sent by the log collection device is received through the log cache application; the log collection device is installed with a log collection application and multiple business applications; the at least one log is sent to the log management device through the log collection application and the multiple business applications; the business application is used to send control instructions to the Internet of Things device, generate logs based on operation data, and send the generated logs to the log collection application; the logs generated by the business application include a first type of log and a second type of log; the first type of log is a log generated by the business application when the user does not operate the business application, and the second type of log is a log generated by the business application based on the user's operation; the log collection application is used to send the first type of log and the second type of log to the log management device; the business application is used to send the second type of log to the log management device; receiving the authentication data sent by the business application, and verifying the authentication data; if the authentication data is successfully verified, sending a verification success instruction to the business application; the business application is configured to send the second type of log to the log management device after receiving the verification success instruction; and receiving the second type of log sent by the business application; caching the at least one log in a message queue through the log caching application; each log carries description information of the log, the description information of the log including at least one of the source of the log, the type of the log, and the IoT device that recorded the log; Determine, by sending the log, a target storage device corresponding to the description information of the target log based on the description information of the target log from a correspondence between a plurality of description information and a plurality of storage devices; Sending a data volume request to the target storage device, where the data volume request is used to instruct the target storage device to feedback the data volume of the log that can currently be received; receiving a response message sent by the target storage device, the response message being used to indicate the amount of log data that the target storage device can currently receive; the amount of log data that can be received is determined by the target storage device based on a current processing capability of a processor; Based on the data volume of the log that the target storage device can receive, the target log in the message queue is sent to the target storage device, and the data volume of the target log is less than or equal to the data volume of the log that the target storage device can receive.

2. The method according to claim 1, characterized in that The sending the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive includes: If the data volume of the log that can be received by the target storage device is greater than or equal to the data volume threshold, the target log in the message queue is sent to the target storage device.

3. The method according to claim 1 or 2, characterized in that The receiving at least one log sent by the log collection device includes: A first type of log and a second type of log sent by the log collection application are received, where the importance of the second type of log is higher than that of the first type of log.

4. The method according to claim 1 or 2, characterized in that The method further comprises: If, based on the description information of the target log, a storage device corresponding to the description information of the target log is not determined from the correspondence between a plurality of description information and a plurality of storage devices, the target log is deleted.

5. A log sending device, characterized in that: Applied to a log management device, the log sending device includes: a sending module, configured to periodically generate authentication data and send the authentication data to a log collection device; the log collection device is configured to store the authentication data; and after generating at least one log, send the authentication data to the log management device; A verification module, configured to verify the authentication data sent by the log collection device; A receiving module, configured to receive at least one log sent by the log collection device through a log cache application if it is determined that the authentication data verification has passed; a log collection application and multiple business applications are installed in the log collection device; the at least one log is sent to the log management device through the log collection application and the multiple business applications; the business application is used to send control instructions to the IoT device, generate logs based on operation data, and send the generated logs to the log collection application; the logs generated by the business application include a first type of log and a second type of log; the first type of log is a log generated by the business application when the user has not operated the business application, and the second type of log is a log generated by the business application based on the user's operation; the log collection application is used to send the first type of log and the second type of log to the log management device; the business application is used to send the second type of log to the log management device; The receiving module is configured to receive the authentication data sent by the business application and verify the authentication data; if the authentication data is successfully verified, send a verification success instruction to the business application; after receiving the verification success instruction, the business application is configured to send the second type of log to the log management device; and receive the second type of log sent by the business application; A cache module, configured to cache the at least one log in a message queue through the log cache application; each log carries descriptive information of the log, the descriptive information of the log including at least one of the source of the log, the type of the log, and the IoT device recording the log; A determination module, configured to apply descriptive information based on a target log through a log sending application, and determine a target storage device corresponding to the descriptive information of the target log from a correspondence between a plurality of descriptive information and a plurality of storage devices; The sending module is configured to send a data volume request to the target storage device, wherein the data volume request is used to instruct the target storage device to feed back the data volume of the log that can currently be received; The receiving module is configured to receive a response message sent by the target storage device, wherein the response message is used to indicate the amount of log data that the target storage device can currently receive; the amount of log data that can be received is determined by the target storage device based on the current processing capability of a processor; The sending module is used to send the target log in the message queue to the target storage device based on the data volume of the log that the target storage device can receive, and the data volume of the target log is less than or equal to the data volume of the log that the target storage device can receive.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program code, which is loaded and executed by a processor to implement the log sending method according to any one of claims 1 to 4.

7. A log management system, characterized in that: The system includes: a log collection device, a log management device and a storage device; The log collection device is used to generate at least one log and send the generated at least one log to the log management device; The log management device includes the log sending device according to claim 5; The storage device is used to receive and store the logs sent by the log management device.

Citation Information

Patent Citations

  • Log storage method and distributed system

    CN110968561A

  • Log data processing method and device

    CN111198855A