Log collection method, client, terminal, server, and storage medium

By collaborating between the client and server, logs are collected and selectively stored in a customized manner according to the needs of the target application, solving the problem of lack of personalization and flexibility in log collection in existing technologies, and realizing flexible log collection and storage.

CN115525615BActive Publication Date: 2026-01-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110704277.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-24
Publication Date
2026-01-27
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

Existing log collection methods cannot collect logs in a customized manner according to user requests, and logs can only be stored on third-party service platforms, resulting in a lack of personalization and flexibility in collection.

Method used

The client sends a collection request corresponding to the target application to the server, carrying the target data and target address. It receives the server's collection rules, collects logs according to the rules, and stores them at the target address. The server creates collection rules based on the target data and address and sends them to the client.

Benefits of technology

It enables personalized log collection, improves the flexibility of log collection, and allows for customized collection based on the needs of the target application, as well as selective storage of logs at client or server storage addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525615B_ABST
    Figure CN115525615B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a log collection method, a client, a terminal, a server and a storage medium. The client sends a collection request corresponding to a target application to a server; wherein the collection request carries target data corresponding to the target application and a target address; the target address is a storage address corresponding to the server or a storage address corresponding to the client; the server sends a collection rule corresponding to the target application; the target application is collected according to the collection rule to obtain target log corresponding to the target data; and the target log is stored in the target address. The server receives the collection request sent by the client; wherein the collection request carries the target data corresponding to the target application and the target address; the collection rule corresponding to the target application is created according to the target data and the target address; and the collection rule is sent to the client to realize collection of the target log corresponding to the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of log collection technology, and in particular to a log collection method, client, terminal, server, and storage medium. Background Technology

[0002] Edge computing refers to an open platform that integrates network, computing, storage, and application capabilities on the side closest to the data source, providing services to the nearest point in time. The location where edge computing occurs is called an edge node, and a client can be any node with computing and network resources between the data source and the server. However, with the increasing number of clients connecting, when some nodes encounter problems, or when querying log information on a particular node, it becomes impossible to log in to each node individually due to the large number of nodes. Therefore, in current edge computing scenarios, effective log collection is essential.

[0003] Existing log collection methods typically deploy a log collection component on the client side to collect data from user nodes and communicate with the cloud. However, existing technologies cannot collect logs in a customized manner according to user requests, and users' logs are forced to be stored on third-party service platforms, resulting in a lack of personalization and flexibility in log collection. Summary of the Invention

[0004] This application provides a log collection method, client, terminal, server, and storage medium, which can realize personalized log collection and improve the flexibility of log collection.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] In a first aspect, embodiments of this application provide a log collection method, the method being applied to a client, the method comprising:

[0007] Send a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0008] Receive the collection rules corresponding to the target application sent by the server;

[0009] Log collection and processing are performed on the target application according to the collection rules to obtain the target logs corresponding to the target data;

[0010] Store the target log at the target address.

[0011] Secondly, embodiments of this application provide a log collection method, which is applied to a server and includes:

[0012] Receive a collection request sent by a client; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0013] Create collection rules corresponding to the target application based on the target data and the target address;

[0014] The collection rules are sent to the client to collect the target logs corresponding to the target data.

[0015] Thirdly, embodiments of this application provide a client, which includes: a first sending unit, a first receiving unit, a processing unit, and a first storage unit.

[0016] The first sending unit is used to send a collection request corresponding to the target application to the server; wherein, the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0017] The first receiving unit is used to receive the collection rules corresponding to the target application sent by the server;

[0018] The processing unit is used to perform log collection processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0019] The first storage unit is used to store the target log at the target address.

[0020] Fourthly, embodiments of this application provide a server, the server comprising: a second receiving unit, a creation unit, and a second sending unit.

[0021] The second receiving unit is used to receive a collection request sent by the client; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0022] The creation unit is used to create collection rules corresponding to the target application based on the target data and the target address;

[0023] The second sending unit is used to send the collection rules to the client in order to collect the target logs corresponding to the target data.

[0024] Fifthly, embodiments of this application provide a terminal that runs a client. The terminal includes a first processor and a first memory storing instructions executable by the first processor. When the instructions are executed by the first processor, the method described in the first aspect is implemented.

[0025] In a sixth aspect, embodiments of this application provide a server, the server including a second processor and a second memory storing instructions executable by the second processor, wherein when the instructions are executed by the second processor, the method described in the second aspect is implemented.

[0026] In a seventh aspect, embodiments of this application provide a computer-readable storage medium having a program stored thereon, which is applied in a client and a server. When the program is executed by a first processor, it implements the method described in the first aspect; when the program is executed by a second processor, it implements the method described in the second aspect.

[0027] This application provides a log collection method, client, terminal, server, and storage medium. The client sends a collection request corresponding to a target application to the server; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address. The client receives collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain target logs corresponding to the target data; and stores the target logs at the target address. The server receives the collection request sent by the client; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address; creates collection rules corresponding to the target application based on the target data and target address; and sends the collection rules to the client to collect the target logs corresponding to the target data. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 1 ;

[0029] Figure 2 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 2 ;

[0030] Figure 3 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 3 ;

[0031] Figure 4 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 4 ;

[0032] Figure 5This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 5 ;

[0033] Figure 6 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 6 ;

[0034] Figure 7 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 7 ;

[0035] Figure 8 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 8 ;

[0036] Figure 9 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 9 ;

[0037] Figure 10 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 ;

[0038] Figure 11 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 one;

[0039] Figure 12 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 two;

[0040] Figure 13 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 three;

[0041] Figure 14 Implementation architecture of the log collection method proposed in the embodiments of this application Figure 1 ;

[0042] Figure 15 Implementation architecture of the log collection method proposed in the embodiments of this application Figure 2 ;

[0043] Figure 16 This is a schematic diagram of the collection rules proposed in an embodiment of this application;

[0044] Figure 17 This is a schematic diagram illustrating the implementation process of generating filtering rules according to an embodiment of this application;

[0045] Figure 18 A schematic diagram illustrating the implementation process of log collection for the client proposed in this application embodiment;

[0046] Figure 19 This is a schematic diagram of the composition structure of the client proposed in the embodiments of this application;

[0047] Figure 20 This is a schematic diagram of the component structure of the terminal proposed in the embodiments of this application;

[0048] Figure 21 This is a schematic diagram of the server structure proposed in the embodiments of this application. Figure 1 ;

[0049] Figure 22 This is a schematic diagram of the server structure proposed in the embodiments of this application. Figure 2 . Detailed Implementation

[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts related to the relevant application are shown in the accompanying drawings.

[0051] Edge computing is a computing model that provides edge intelligence services locally, operating at the network edge, physically close to the data source, and integrating core capabilities of networking, computing, storage, and applications. The location where edge computing occurs is called an edge node, which can be any node with computing and network resources between the data source and the cloud center. For example, a mobile phone is an edge node between a person and the cloud center, and a gateway is an edge node between a smart home and the cloud center. With the increasing number of edge nodes connected, a user may have multiple nodes. When some nodes malfunction, or a user wants to query log information on a specific node, a small user with a few nodes can directly log in to the machine to view the logs. However, for enterprise users who may have a massive number of nodes, logging into each machine to view the logs is impractical. Therefore, in the current edge computing scenario, effective log collection is essential.

[0052] However, existing log collection methods typically collect all logs and then upload them to a cloud server for unified control via a cloud-based console. As a result, existing log collection methods cannot be customized for different applications. Furthermore, all logs can only be stored on a third-party service platform, and it is not possible to choose to store them locally on the client side based on different applications. Consequently, log collection lacks personalization and flexibility.

[0053] To address the aforementioned issues, this application provides a log collection method, client, terminal, server, and storage medium. The client sends a collection request corresponding to a target application to the server; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address. The client receives collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain target logs corresponding to the target data; and stores the target logs at the target address. The server receives the collection request sent by the client; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address; creates collection rules corresponding to the target application based on the target data and target address; and sends the collection rules to the client to achieve the collection of target logs corresponding to the target data, thereby realizing personalized log collection and improving the flexibility of log collection.

[0054] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0055] Example 1

[0056] This application provides a log collection method applied to a client, where the client is a program that provides local services to the client. Except for some applications that run only locally, these are generally installed on ordinary client machines and need to cooperate with the server to run. With the development of the Internet, commonly used clients include web browsers used for the World Wide Web, email clients for sending and receiving emails, and instant messaging client software. For these types of applications, corresponding servers and service programs are required on the network to provide the corresponding services, such as database services and email services.

[0057] Figure 1 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 1 ,like Figure 1 As shown in the embodiments of this application, the method for client-side log collection may include the following steps:

[0058] Step 101: Send a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0059] In embodiments of this application, the client can send a collection request corresponding to the target application to the server. The collection request carries the target data and target address corresponding to the target application; the target address is either the server's storage address or the client's storage address.

[0060] It should be noted that, due to the different target applications, the target logs to be collected also differ. Therefore, when collecting logs, the client needs to send a collection request corresponding to the target application to the server. Different target applications can correspond to different collection requests, and the same target application can also send multiple different collection requests. Specifically, the target application can be any application on the client that needs to collect log information, such as social applications.

[0061] It should be noted that the target data is the data that the target application needs to obtain during use. For example, if the target application needs to obtain debug log information, then the target data can be the data in the debug log information.

[0062] Furthermore, the collection request carries the target data and target address corresponding to the target application. The target data represents the log information that the target application needs to collect; the target address represents the chosen address for storing the target logs, which can be the storage address corresponding to the server or the storage address corresponding to the client. This allows for customized collection and storage of logs based on the target data and target address.

[0063] Step 102: Receive the collection rules corresponding to the target application sent by the server.

[0064] In the embodiments of this application, after the client sends a collection request corresponding to the target application to the server, it receives the collection rules corresponding to the target application sent by the server.

[0065] In the embodiments of this application, the collection rules are used to instruct the client to perform specific log collection processing; different target applications may correspond to different collection rules, and the same target application may also correspond to multiple different collection rules.

[0066] Step 103: Perform log collection and processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0067] In the embodiments of this application, after receiving the collection rules corresponding to the target application sent by the server, the client performs log collection processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0068] It should be noted that log collection and processing involves collecting relevant log information according to the needs of the target application and storing the collected log information in a selected address. Furthermore, the target log is the log corresponding to the target data; the target data can be obtained from the acquired target log.

[0069] In the embodiments of this application, the log collection and processing process involves establishing filtering rules based on collection rules, generating a log filtering plugin based on the filtering rules, and then using the log filtering plugin to filter the source logs to obtain the target logs. This allows for customized acquisition of the target logs corresponding to the target application.

[0070] Step 104: Store the target log at the target address.

[0071] In the embodiments of this application, after the client performs log collection processing on the target application according to the collection rules and obtains the target log corresponding to the target data, it can store the target log to the target address.

[0072] It should be noted that the target address can be either the storage address corresponding to the client or the storage address corresponding to the server; if the target address is the storage address corresponding to the client, then the target log will be stored in the storage address corresponding to the client.

[0073] In the embodiments of this application, since the collection request also carries the target address, after the target log is obtained, the target log can also be stored at the target address, thereby enabling selective storage of the target log and realizing personalized storage of the target log.

[0074] Figure 2 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 2 ,like Figure 2 As shown in the embodiments of this application, the method for a client to collect and process logs from a target application according to collection rules and obtain the target logs corresponding to the target data may include the following steps:

[0075] Step 103a: Create filtering rules based on the collection rules.

[0076] In the embodiments of this application, the client performs log collection processing on the target application according to the collection rules to obtain the target logs corresponding to the target data. Specifically, the client first creates filtering rules according to the collection rules.

[0077] It should be noted that the filtering rules are created based on the collection rules; therefore, the filtering rules represent the target logs that need to be collected.

[0078] Step 103b: Create a log filtering plugin based on the filtering rules.

[0079] In the embodiments of this application, after the client creates filtering rules based on the collection rules, it can create a log filtering plugin based on the filtering rules.

[0080] In the embodiments of this application, the log filtering plugin is generated according to filtering rules. Specifically, the target log can be obtained through the log filtering plugin.

[0081] Step 103c: Use the log filtering plugin to filter the source logs corresponding to the target application to obtain the target logs.

[0082] In the embodiments of this application, after the client creates a log filtering plugin according to the filtering rules, it uses the log filtering plugin to filter the source logs corresponding to the target application to obtain the target logs.

[0083] In the embodiments of this application, since the source logs corresponding to the target application may include all the logs corresponding to the target application, and the target logs that the target application needs to collect may be a part of the source logs, when collecting the target logs, the source logs can be filtered by a log filtering plugin to obtain the target logs.

[0084] Figure 3 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 3 ,like Figure 3 As shown, before the client uses the log filtering plugin to filter the source logs corresponding to the target application and obtains the target logs, i.e. before step 103c, the log collection method may also include the following steps:

[0085] Step 103d: Obtain the source logs corresponding to the target application.

[0086] In the embodiments of this application, the client obtains the source logs corresponding to the target application before using the log filtering plugin to filter the source logs corresponding to the target application and obtaining the target logs.

[0087] In the embodiments of this application, since the client needs to filter the source logs through the created log filtering plugin, the source logs need to be obtained before the filtering process can be performed in order to obtain the target logs.

[0088] It should be noted that source logs refer to all log data corresponding to the target application.

[0089] Figure 4 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 4 ,like Figure 4As shown, after the client creates filtering rules based on the collection rules, i.e., after step 103a, the log collection method may include the following steps:

[0090] Step 103e: Store the filtering rules in the preset database.

[0091] In the embodiments of this application, after the client creates filtering rules according to the collection rules, the filtering rules can be stored in a preset database.

[0092] It should be noted that the default database is used to store filtering rules, and it can be a lightweight database (SQLite).

[0093] Figure 5 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 5 ,like Figure 5 As shown, after the client receives the collection rules corresponding to the target application sent by the server, i.e., after step 102, the log collection method may include the following steps:

[0094] Step 105: Send a success message to the server.

[0095] In the embodiments of this application, after receiving the collection rules corresponding to the target application sent by the server, the client sends a success message to the server.

[0096] In the embodiments of this application, after receiving the collection rules, the client needs to return a success message to the server to ensure message synchronization.

[0097] Figure 6 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 6 ,like Figure 6 As shown, after the client creates filtering rules based on the collection rules, i.e., after step 103a, the log collection method may include the following steps:

[0098] Step 103f: Send an update collection request corresponding to the target application to the server; wherein, the update collection request carries the updated data and updated address corresponding to the target application.

[0099] In the embodiments of this application, after the client creates a filtering rule according to the collection rules, it can send an updated collection request corresponding to the target application to the server; wherein, the updated collection request carries the updated data and updated address corresponding to the target application.

[0100] It should be noted that if the client needs to perform log collection processing again, it can send an updated collection request corresponding to the target application to the server to perform new log collection processing; the updated collection request carries the updated data and updated address of the target application.

[0101] Furthermore, in the embodiments of this application, the updated data may be the same as the target data in the collection request sent by the client in the prior log collection process; the updated address may be the same as the target address in the collection request sent by the client in the prior log collection process; in addition, the updated data and the updated address may be different from the target data and the target address in the collection request sent by the client in the prior log collection process. For example, if the updated data is the same as the target data, but the updated address is different from the target address, it means that the update collection request is to change the storage address of the target log, and thus the update collection request is sent to the server to change the storage address of the target log. For example, if the updated address is the same as the target address, but the updated data is different from the target data, it means that the update collection request is to change the target log to be collected, and thus the update collection request is sent to the server to change the target log to be collected. For example, if the updated data is different from the target data, and the updated address is also different from the target address, it means that the update collection request is not only to change the target log to be collected, but also to change the storage address of the target log to be collected, and thus the update collection request is sent to the server to change both the target log to be collected and the storage address.

[0102] It should be noted that, in the embodiments of this application, the client sending the post-update collection request corresponding to the target application to the server may include sending the post-update collection request to the server during the restart process of the target application.

[0103] In the embodiments of this application, log collection processing can still be performed during the restart process of the target application. That is, when the target application is restarting, the client can send an updated collection request to the server, so that log collection processing can be achieved during the restart process.

[0104] Step 103g: Receive the updated collection rules corresponding to the target application sent by the server.

[0105] In the embodiments of this application, after the client sends an updated collection request corresponding to the target application to the server, it receives the updated collection rules corresponding to the target application sent by the server.

[0106] It should be noted that the updated collection rules refer to the corresponding collection rules obtained by the client when log collection processing is performed again.

[0107] In the embodiments of this application, after receiving the updated collection rules corresponding to the target application, the client can perform log collection processing according to the updated collection rules.

[0108] Step 103h: Collect and process logs from the target application according to the updated collection rules to obtain the updated logs corresponding to the updated data.

[0109] In the embodiments of this application, after receiving the updated collection rules corresponding to the target application sent by the server, the client performs log collection processing on the target application according to the updated collection rules to obtain the updated logs corresponding to the updated data.

[0110] Furthermore, when the client performs log collection processing on the target application according to the updated collection rules, the client can obtain the updated log corresponding to the updated data. Specifically, when the updated target log in the updated collection rules is the same as the target log in the collection rules received in the previously performed log collection processing, the updated log can be the same as the target log in the previously performed log collection processing; and when the updated target log in the updated collection rules is different from the target log in the collection rules received in the previously performed log collection processing, the updated log can be different from the target log in the previously performed log collection processing.

[0111] Step 103i: Store the updated log at the updated address.

[0112] In the embodiments of this application, after the client performs log collection processing on the target application according to the updated collection rules and obtains the updated log corresponding to the updated data, it can store the updated log to the updated address.

[0113] Furthermore, after obtaining the updated logs, the client can store the updated logs at the updated address, which may be the same as or different from the target address in the previous log collection process.

[0114] For example, in the initial log collection process, the target address is the storage address corresponding to the server, while the updated address is the storage address corresponding to the client. In the initial log collection process, the collected target logs are stored at the storage address corresponding to the server, while in the log collection process of the target application according to the updated collection rules, the updated logs can be stored at the storage address corresponding to the client.

[0115] Figure 7 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 7 ,like Figure 7As shown, after the client receives the updated collection rules corresponding to the target application sent by the server, i.e., after step 103g, the log collection method may include the following steps:

[0116] Step 103j: Create updated filtering rules based on the updated collection rules.

[0117] In the embodiments of this application, after receiving the updated collection rules corresponding to the target application sent by the server, the client creates updated filtering rules based on the updated collection rules.

[0118] For example, in an embodiment of this application, the client first creates an updated filtering rule based on the updated collection rule, then creates an updated log filtering plugin based on the updated filtering rule, and finally uses the updated log filtering plugin to filter the source log.

[0119] Step 103k: Replace the filter rules in the preset database with the updated filter rules.

[0120] In the embodiments of this application, after the client creates an updated filtering rule based on the updated collection rule, it replaces the filtering rule in the preset database with the updated filtering rule.

[0121] It should be noted that since the filtering rules were already stored in the default database during the initial log collection process, after obtaining the updated filtering rules, the filtering rules in the default database need to be replaced with the updated filtering rules. The updated filtering rules can be the same as or different from the previous filtering rules.

[0122] It should be noted that replacing the filter rules in the preset database with the updated filter rules only applies to the same target application. This application provides a log collection method applied to a client. The client sends a collection request corresponding to the target application to the server; wherein the collection request carries the target data and target address corresponding to the target application; the target address is either the server's storage address or the client's storage address; the client receives the collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain the target log corresponding to the target data; and stores the target log at the target address. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection.

[0123] Example 2

[0124] This application provides a log collection method applied to a server, whereby the server provides computing or application services to other clients (such as PCs, smartphones, ATMs, and even large equipment like train systems) on a network. The server possesses high-speed CPU processing power, long-term reliable operation, powerful I / O external data throughput, and better scalability. Generally, depending on the services provided, the server has the capability to respond to service requests, provide services, and ensure service availability. As an electronic device, the server's internal structure is quite complex, but not significantly different from that of a typical computer, including components such as CPU, hard disk, memory, system, and system bus.

[0125] Figure 8 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 8 ,like Figure 8 As shown, the method for a server to collect logs may include the following steps:

[0126] Step 201: Receive a collection request sent by the client; wherein the collection request carries the target data and target address corresponding to the target application; wherein the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0127] In this embodiment of the application, the server can receive a collection request sent by the client; wherein the collection request carries target data and target address corresponding to the target application; wherein the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0128] Furthermore, the server in this application can receive collection requests sent by clients. Since the collection request carries target data and target address corresponding to the target application, the target data represents the log information that the target application needs to collect; the target address represents the address where the target log is selected to be saved, thereby realizing customized collection and storage of logs based on the target data and target address.

[0129] Specifically, the target application can be any application on the client that needs to collect log information, such as a social application; the target data is the data that the target application needs to obtain during use. For example, if the target application needs to obtain debug log information, then the target data can be the data in the debug log information.

[0130] Step 202: Create collection rules corresponding to the target application based on the target data and target address.

[0131] In the embodiments of this application, after receiving the collection request sent by the client, the server creates collection rules corresponding to the target application based on the target data and the target address.

[0132] It should be noted that the server can create corresponding collection rules based on the received collection requests. The collection rules are used to instruct the client to perform specific log collection processing. Different target applications can correspond to different collection rules, and the same target application can also correspond to multiple different collection rules.

[0133] Step 203: Send the collection rules to the client to collect the target logs corresponding to the target data.

[0134] In the embodiments of this application, after the server creates the collection rules corresponding to the target application based on the target data and the target address, it sends the collection rules to the client to realize the collection of the target logs corresponding to the target data.

[0135] It should be noted that the target log is the log corresponding to the target data, and the target data can be obtained from the target log.

[0136] Figure 9This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 9 ,like Figure 9 As shown, if the target address is the storage address corresponding to the server, after the server sends the collection rules to the client, the log collection method may also include the following steps:

[0137] Step 204: Receive the target log sent by the client.

[0138] In the embodiments of this application, if the target address is the storage address corresponding to the server, the server also receives the target log sent by the client after sending the collection rules to the client.

[0139] Furthermore, when storing target logs, the target address can be either the storage address corresponding to the client or the storage address corresponding to the server; if the target address is the storage address corresponding to the server, then the server can receive the target logs sent by the client.

[0140] Step 205: Save the target log to the target address.

[0141] In an embodiment of this application, after receiving the target log sent by the client, the server stores the target log at the target address.

[0142] Furthermore, the server stores the target logs at the target address, which is the server's corresponding storage address.

[0143] Figure 10 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 ,like Figure 10 As shown, after the server sends the collection rules to the client, i.e., after step 203, the log collection method may also include the following steps:

[0144] Step 206: Receive the updated collection request sent by the client; wherein the updated collection request carries the updated data and updated address corresponding to the target application.

[0145] In the embodiments of this application, after the server sends the collection rules to the client, it can receive the updated collection request sent by the client; wherein the updated collection request carries the updated data and updated address corresponding to the target application.

[0146] It should be noted that when log collection processing is required again, the server can receive an updated collection request sent by the client to perform new log collection processing; the updated collection request carries the updated data and updated address of the target application.

[0147] Furthermore, in the embodiments of this application, the updated data may be the same as the target data in the collection request received by the server in the prior log collection process; the updated address may be the same as the target address in the collection request received by the server in the prior log collection process; in addition, the updated data and the updated address may be different from the target data and the target address in the collection request received by the server in the prior log collection process. For example, if the updated data is the same as the target data, but the updated address is different from the target address, it means that the updated collection request is to change the storage address of the target log. The server receives the updated collection request to change the storage address of the target log. For example, if the updated address is the same as the target address, but the updated data is different from the target data, it means that the updated collection request is to change the target log to be collected. The server receives the updated collection request to change the target log to be collected. For example, if the updated data is different from the target data, and the updated address is also different from the target address, it means that the updated collection request is to change not only the target log to be collected, but also the storage address of the target log to be collected. The server receives the updated collection request to change both the target log to be collected and its storage address.

[0148] Step 207: Create the updated collection rules for the target application based on the updated data and updated address.

[0149] In the embodiments of this application, after receiving the post-update collection request sent by the client, the server creates a post-update collection rule corresponding to the target application based on the updated data and the updated address.

[0150] It should be noted that the updated collection rules refer to the corresponding collection rules received by the server when log collection processing is performed again.

[0151] Step 208: Send the updated collection rules to the client to collect the updated logs corresponding to the updated data.

[0152] In the embodiments of this application, after the server creates the post-update collection rules corresponding to the target application based on the updated data and the updated address, it sends the post-update collection rules to the client to realize the collection of the post-update logs corresponding to the updated data.

[0153] It should be noted that when the updated target log in the updated collection rule is the same as the target log in the collection rule received by the previous log collection process, the updated log can be the same as the target log in the previous log collection process; however, when the updated target log in the updated collection rule is different from the target log in the collection rule received by the previous log collection process, the updated log can be different from the target log in the previous log collection process.

[0154] Figure 11 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 First, such as Figure 11 As shown, if the updated address is the storage address corresponding to the server, then after the server sends the updated collection rules to the client, i.e. after step 208, the log collection method may also include the following steps:

[0155] Step 209: Receive the updated log sent by the client.

[0156] In the embodiments of this application, if the updated address is the storage address corresponding to the server, the server receives the updated log sent by the client after sending the updated collection rules to the client.

[0157] Step 210: Store the updated log at the updated address.

[0158] In an embodiment of this application, after receiving the updated log sent by the client, the server stores the updated log at the updated address.

[0159] For example, in the initial log collection process, the collected target logs are stored at the storage address corresponding to the client. In the log collection process of the target application according to the updated collection rules, the updated logs can be stored at the storage address corresponding to the server.

[0160] This application provides a log collection method in which a server receives a collection request sent by a client; wherein the collection request carries target data and a target address corresponding to the target application; wherein the target address is a storage address corresponding to the server or a storage address corresponding to the client; a collection rule corresponding to the target application is created based on the target data and the target address; and the collection rule is sent to the client to realize the collection of target logs corresponding to the target data. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection.

[0161] Example 3

[0162] Based on the above embodiments, another embodiment of this application proposes a log collection method, applied in both a client and a server. Figure 12 This is a schematic diagram of the implementation process of the log collection method. Figure 10 Second, such as Figure 12 As shown, the methods for client and server to collect logs may include the following steps:

[0163] Step 301: The client sends a collection request corresponding to the target application to the server; the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0164] In the embodiments of this application, the client first sends a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0165] In the embodiments of this application, after the client sends a collection request corresponding to the target application to the server, the server receives the collection request sent by the client; wherein, the collection request carries the target data and target address corresponding to the target application; wherein, the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0166] Step 302: The server creates collection rules corresponding to the target application based on the target data and target address.

[0167] In the embodiments of this application, after receiving the collection request sent by the client, the server creates collection rules corresponding to the target application based on the target data and the target address.

[0168] Step 303: The server sends the collection rules to the client.

[0169] In the embodiments of this application, after the server creates the collection rules corresponding to the target application based on the target data and the target address, it sends the collection rules to the client to realize the collection of the target logs corresponding to the target data.

[0170] Step 304: The client sends a success message to the server.

[0171] In the embodiments of this application, after receiving the collection rules corresponding to the target application sent by the server, the client sends a success message to the server.

[0172] Step 305: The client performs log collection and processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0173] In the embodiments of this application, after receiving the collection rules corresponding to the target application sent by the server, the client performs log collection processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0174] It should be noted that this application does not restrict the order of steps 304 and 305 mentioned above.

[0175] In the embodiments of this application, the client performs log collection processing on the target application according to the collection rules to obtain the target logs corresponding to the target data.

[0176] Step 306: If the target address is the storage address corresponding to the client, the client stores the target log at the target address.

[0177] In the embodiments of this application, after the client performs log collection processing on the target application according to the collection rules and obtains the target log corresponding to the target data, it stores the target log to the target address.

[0178] Step 307: The client sends an update collection request for the target application to the server; the update collection request carries the updated data and updated address of the target application.

[0179] In the embodiments of this application, after the client has performed log collection processing, it can also perform new log collection processing. First, it needs to send an updated collection request corresponding to the target application to the server. The updated collection request carries the updated data and updated address of the target application.

[0180] In embodiments of this application, the client sends an update collection request corresponding to the target application to the server, including sending the update collection request to the server during the restart process of the target application.

[0181] Step 308: The server creates the updated collection rules corresponding to the target application based on the updated data and the updated address.

[0182] In the embodiments of this application, after receiving the post-update collection request sent by the client, the server creates a post-update collection rule corresponding to the target application based on the updated data and the updated address.

[0183] Step 309: The client performs log collection processing on the target application according to the updated collection rules to obtain the updated logs corresponding to the updated data.

[0184] In the embodiments of this application, after receiving the updated collection rules corresponding to the target application sent by the server, the client performs log collection processing on the target application according to the updated collection rules to obtain the updated logs corresponding to the updated data.

[0185] In the embodiments of this application, after receiving the updated collection rules corresponding to the target application sent by the server, the client creates updated filtering rules based on the updated collection rules.

[0186] In the embodiments of this application, after the client creates an updated filtering rule based on the updated collection rule, it replaces the filtering rule in the preset database with the updated filtering rule.

[0187] In the embodiments of this application, after receiving the updated log sent by the client, the server stores the updated log to the updated address. If the updated address is the storage address corresponding to the client, the client stores the updated log; if the updated address is the storage address corresponding to the server, the server receives the updated log sent by the client. Figure 13 This is a schematic diagram of the implementation process of the log collection method proposed in the embodiments of this application. Figure 10 Third, such as Figure 13As shown, the methods for client and server to collect logs may include the following steps:

[0188] Step 312: If the target address is the storage address corresponding to the server, the server receives the target log sent by the client.

[0189] In the embodiments of this application, if the target address is the storage address corresponding to the server, the server receives the target log sent by the client.

[0190] Step 313: The server stores the target log at the target address.

[0191] In embodiments of this application, if the target address is the storage address corresponding to the server, after receiving the target log sent by the client, the server stores the target log at the target address. In embodiments of this application, before obtaining the target log, the client can first obtain the source log corresponding to the target application by filtering the source log corresponding to the target application using a log filtering plugin. Embodiments of this application provide a log collection method, client, terminal, server, and storage medium. The client sends a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client; the client receives the collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain the target log corresponding to the target data; and stores the target log at the target address. The server receives the collection request sent by the client; wherein, the collection request carries the target data and target address corresponding to the target application; wherein, the target address is the storage address corresponding to the server or the storage address corresponding to the client; creates collection rules corresponding to the target application according to the target data and target address; and sends the collection rules to the client to achieve the collection of the target log corresponding to the target data. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection.

[0192] Example 4

[0193] Based on the above embodiments, in another embodiment of this application... Figure 14 Implementation architecture for log collection methods Figure 1 ,like Figure 14 As shown, the client 10 proposed in this application embodiment may include an edge log proxy module 11, a log output module 12, and a log storage module 13; wherein, the edge log proxy module 11 includes a message processing module 111, a log proxy module 112, and a lightweight database 113.

[0194] In the embodiments of this application, the client sends a collection request corresponding to the target application to the server, and then receives the collection rules corresponding to the target application sent by the server through the message processing module in the edge log proxy module. After receiving the collection rules, the message processing module creates filtering rules according to the collection rules and transmits the filtering rules to the log proxy module. The log proxy module creates a log filtering plugin corresponding to the filtering rules, and then filters the source logs through the log filtering plugin created by the log proxy module to obtain the target logs. During this process, the filtering rules created by the message processing module are stored in a lightweight database. After obtaining the target logs, the target logs are output through the log output module. If the target address is the client, the target logs are stored in the client log storage module.

[0195] It should be noted that log output modules can typically implement output methods such as Logstash and Kafka. The log output module in this application adopts a plug-in development approach. If the provided output cannot meet the user's needs, the default log output plugin can be freely replaced through the output interface defined in this application. For example, if the user replaces the default output plugin with the output plugin implemented by this application, the collected logs can be output to the address deployed by the user, thus making log output more flexible and convenient.

[0196] Figure 15 Implementation architecture of the log collection method proposed in the embodiments of this application Figure 2 ,like Figure 15 As shown, the server 20 proposed in this application embodiment may include a server log storage module 21, a cloud management platform 22, and a message center 23.

[0197] In the embodiments of this application, the server receives a collection request sent from the client through the cloud management platform. The cloud management platform then generates a corresponding collection rule based on the collection request and transmits the collection rule to the message center. The message center sends the collection rule to the edge log agent module in the client, thereby realizing log collection processing. The server log storage module is used to store the logs received by the server.

[0198] Figure 16 This is a schematic diagram of the collection rules proposed in an embodiment of this application, such as... Figure 16 As shown, the content of the collection rule can include message rule fields and corresponding descriptions. For example, message_id in the message rule field represents the identity document (ID) of the collection rule.

[0199] Figure 17 This is a schematic diagram illustrating the implementation process of generating filtering rules proposed in the embodiments of this application, as follows: Figure 20 As shown, the distribution of collection rules may include the following steps:

[0200] Step 401: Issue collection rules through the server.

[0201] In the embodiments of this application, the collection rules are distributed through a server.

[0202] Step 402: The client generates the filtering plugin.

[0203] In the embodiments of this application, after receiving the collection rules, the client generates a filtering plugin based on the collection rules.

[0204] Step 403: The client stores the filtering rules in the preset database.

[0205] In the embodiments of this application, after the client generates filtering rules according to the collection rules, it synchronously stores the filtering rules in a preset database.

[0206] Step 404: Restart the application.

[0207] In the embodiments of this application, if log collection processing is performed when the application restarts, a collection request is immediately sent to the server during the application restart process. The server generates collection rules based on the collection request and then distributes the collection rules.

[0208] Figure 18 The following is a schematic diagram illustrating the implementation process of log collection for the client proposed in this application embodiment. As shown in the figure, the log collection method may include the following steps:

[0209] Step 501: Application launch.

[0210] In the embodiments of this application, the application is first started, and then the application will have corresponding log collection requirements, so the client and server perform corresponding log collection and processing.

[0211] Step 502: The edge log agent module loads the log output plugin.

[0212] In the embodiments of this application, since the log output module adopts a plug-in development approach, the edge log agent module will load the log output module from a fixed installation path each time it starts, thereby achieving complete log output.

[0213] Step 503: Generate the filter plugin.

[0214] In the embodiments of this application, the client achieves personalized collection of logs by generating a filtering plugin.

[0215] Step 504: Collect logs.

[0216] In the embodiments of this application, after the client generates the filtering plugin, it uses the filtering plugin to filter the source logs, thereby collecting the logs.

[0217] Step 505: Store the logs to the client.

[0218] In the embodiments of this application, after collecting logs, if the storage address is the client, the logs are stored on the client.

[0219] Step 506: Store the logs on the server.

[0220] In the embodiments of this application, after collecting logs, if the storage address is the server, the client stores the logs on the server.

[0221] This application provides a log collection method, client, terminal, server, and storage medium. The client sends a collection request corresponding to a target application to the server; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address. The client receives collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain target logs corresponding to the target data; and stores the target logs at the target address. The server receives the collection request sent by the client; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address; creates collection rules corresponding to the target application based on the target data and target address; and sends the collection rules to the client to collect the target logs corresponding to the target data. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection.

[0222] Example 5

[0223] Based on embodiments one to four described above, in another embodiment of this application... Figure 19 This is a schematic diagram of the composition structure of the client proposed in the embodiments of this application, as shown below. Figure 19 As shown, the client 10 proposed in this embodiment may include a first sending unit 14, a first receiving unit 15, a processing unit 16, a first storage unit 17, and an acquisition unit 18.

[0224] The first sending unit 14 is used to send a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0225] The first receiving unit 15 is used to receive the collection rules corresponding to the target application sent by the server.

[0226] The processing unit 16 is used to perform log collection processing on the target application according to the collection rules to obtain the target log corresponding to the target data.

[0227] The first storage unit 17 is used to store the target log to the target address.

[0228] Furthermore, the processing unit 16 is specifically used to create filtering rules according to the collection rules; create a log filtering plugin according to the filtering rules; and use the log filtering plugin to filter the source logs corresponding to the target application to obtain the target logs.

[0229] The acquisition unit 18 is used to acquire the source log corresponding to the target application.

[0230] The first storage unit 17 is also used to store the filtering rules in a preset database.

[0231] The first sending unit 14 is also configured to send a successful reception message to the server.

[0232] The first sending unit 14 is further configured to send an updated collection request corresponding to the target application to the server; wherein the updated collection request carries the updated data and updated address corresponding to the target application.

[0233] The first receiving unit 15 is further configured to receive the updated collection rules corresponding to the target application sent by the server.

[0234] The processing unit 16 is further configured to perform log collection processing on the target application according to the updated collection rules, and obtain the updated logs corresponding to the updated data.

[0235] The first storage unit 17 is also used to store the updated log to the updated address.

[0236] The processing unit 16 is also specifically used to create updated filtering rules based on the updated collection rules.

[0237] The first storage unit 17 is also used to replace the filtering rules in the preset database with the updated filtering rules.

[0238] The first sending unit 14 is also configured to send the updated collection request to the server during the restart of the target application.

[0239] Furthermore, embodiments of this application propose a terminal that runs the client described in the above embodiments. Figure 20 This is a schematic diagram of the terminal's structural composition according to an embodiment of this application, as shown below. Figure 20 As shown, the terminal 30 proposed in this application embodiment may include a first processor 31, a first memory 32 storing instructions executable by the first processor 31, and further, the terminal 30 may also include a first communication interface 33 and a first bus 34 for connecting the first processor 31, the first memory 32 and the first communication interface 33.

[0240] In the embodiments of this application, the first processor 31 can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and this application embodiment does not specifically limit it. The terminal 30 may also include a first memory 32, which can be connected to the first processor 31. The first memory 32 is used to store executable program code, which includes computer operation instructions. The first memory 32 may include high-speed RAM memory and may also include non-volatile memory, such as at least two disk drives.

[0241] In embodiments of this application, the first bus 34 is used to connect the first communication interface 33, the first processor 31, and the first memory 32, as well as the mutual communication between these devices.

[0242] In embodiments of this application, the first memory 32 is used to store instructions and data.

[0243] Furthermore, in the embodiments of this application, the first processor 31 is configured to send a collection request corresponding to the target application to the server; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client; receive the collection rules corresponding to the target application sent by the server; perform log collection processing on the target application according to the collection rules to obtain the target log corresponding to the target data; and store the target log to the target address.

[0244] Figure 21 This is a schematic diagram of the server structure proposed in the embodiments of this application. Figure 1 ,like Figure 21 As shown, the server 20 proposed in this embodiment may include a second receiving unit 24, a creation unit 25, a second sending unit 26, and a second storage unit 27.

[0245] The second receiving unit 24 is used to receive a collection request sent by the client; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client.

[0246] The creation unit 25 is used to create collection rules corresponding to the target application based on the target data and the target address.

[0247] The second sending unit 26 is used to send the collection rules to the client in order to collect the target logs corresponding to the target data.

[0248] The second receiving unit 24 is also used to receive the target log sent by the client.

[0249] The second storage unit 27 is used to store the target log to the target address.

[0250] The second receiving unit 24 is further configured to receive an updated collection request sent by the client; wherein the updated collection request carries the updated data and updated address corresponding to the target application.

[0251] The creation unit 25 is also used to create an updated collection rule corresponding to the target application based on the updated data and the updated address.

[0252] The second sending unit 26 is further configured to send the updated collection rules to the client in order to collect the updated logs corresponding to the updated data.

[0253] The second receiving unit 24 is also used to receive the updated log sent by the client.

[0254] The second storage unit 27 is also used to store the updated log to the updated address.

[0255] In the embodiments of this application, further, Figure 22 This is a schematic diagram of the server structure proposed in the embodiments of this application. Figure 2 ,like Figure 22 As shown, the server 20 proposed in this application embodiment may further include a second processor 28, a second memory 29 storing instructions executable by the second processor 28, and further, the server 20 may also include a second communication interface 210 and a second bus 211 for connecting the second processor 28, the second memory 29 and the second communication interface 210.

[0256] In the embodiments of this application, the second processor 28 can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other types, and this application embodiment does not specifically limit this. The server 20 may also include a second memory 29, which can be connected to the second processor 28. The second memory 29 is used to store executable program code, which includes computer operation instructions. The second memory 29 may include high-speed RAM memory and may also include non-volatile memory, such as at least two disk drives.

[0257] In embodiments of this application, the second bus 27 is used to connect the second communication interface 28, the second processor 28, and the second memory 29, as well as the mutual communication between these devices.

[0258] In embodiments of this application, the second memory 29 is used to store instructions and data.

[0259] Furthermore, in the embodiments of this application, the second processor 28 is configured to receive a collection request sent by a client; wherein the collection request carries target data and a target address corresponding to the target application; wherein the target address is a storage address corresponding to the server or a storage address corresponding to the client; create a collection rule corresponding to the target application based on the target data and the target address; and send the collection rule to the client to realize the collection of target logs corresponding to the target data.

[0260] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0261] This application provides a log collection method, client, terminal, server, and storage medium. The client sends a collection request corresponding to a target application to the server; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address. The client receives collection rules corresponding to the target application sent by the server; performs log collection processing on the target application according to the collection rules to obtain target logs corresponding to the target data; and stores the target logs at the target address. The server receives the collection request sent by the client; the collection request carries target data and a target address corresponding to the target application; the target address is either the server's storage address or the client's storage address; creates collection rules corresponding to the target application based on the target data and target address; and sends the collection rules to the client to collect the target logs corresponding to the target data. In other words, in the embodiments of this application, when collecting logs of a target application, the client can send a collection request corresponding to the target application to the server. Since the collection request carries target data and target address, the server can create corresponding collection rules based on the target data and target address. Thus, the client can obtain the target logs according to the collection rules sent by the server, and can also save the target logs in the deployed target address. It can be seen that the log collection method proposed in the embodiments of this application does not directly collect all logs of the target application when the client or server collects logs, but rather collects a portion of the logs according to the needs of the target application. Furthermore, when storing the collected logs, the client does not directly store the collected logs to a third-party platform on the server, but selectively stores the logs in the client's local storage address or the server's storage address according to the target address, thereby realizing personalized log collection and improving the flexibility of log collection.

[0262] This application provides a first computer-readable storage medium having a program stored thereon, which, when executed by a first processor, implements the methods of Embodiments 1 to 3.

[0263] Specifically, the program instructions corresponding to a log collection method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to a log collection method in the storage media are read or executed by an electronic device, the following steps are included:

[0264] Send a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0265] Receive the collection rules corresponding to the target application sent by the server;

[0266] Log collection and processing are performed on the target application according to the collection rules to obtain the target logs corresponding to the target data;

[0267] Store the target log at the target address.

[0268] Specifically, the program instructions corresponding to a log collection method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to a log collection method in the storage media are read or executed by an electronic device, the following steps are included:

[0269] Receive a collection request sent by a client; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client;

[0270] Create collection rules corresponding to the target application based on the target data and the target address;

[0271] The collection rules are sent to the client to collect the target logs corresponding to the target data.

[0272] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0273] This application is described with reference to schematic and / or block diagrams of implementations of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the schematic and / or block diagrams can be implemented by computer program instructions, and combinations of blocks in the schematic and / or block diagrams can be implemented. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the schematic and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0274] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the implementation flow diagram. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0275] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0276] The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application.

Claims

1. A log collection method, characterized in that, Applied to a client, the method includes: Send a collection request corresponding to the target application to the server; wherein, the collection request carries the target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client; Receive the collection rules corresponding to the target application sent by the server; Create filtering rules based on the collection rules; Create a log filtering plugin based on the filtering rules; The source logs corresponding to the target application are filtered using the log filtering plugin to obtain the target logs; Store the target log at the target address; The method further includes, after creating the filtering rules based on the collection rules: Send an updated collection request corresponding to the target application to the server; wherein, the updated collection request carries the updated data and updated address corresponding to the target application; Receive the updated collection rules corresponding to the target application sent by the server; Log collection and processing are performed on the target application according to the updated collection rules to obtain the updated logs corresponding to the updated data; The updated log is stored at the updated address.

2. The method according to claim 1, characterized in that, After receiving the updated collection rules corresponding to the target application sent by the server, the method further includes: Create updated filtering rules based on the updated collection rules; The updated filtering rules replace the filtering rules in the preset database.

3. The method according to claim 1, characterized in that, Sending the updated collection request corresponding to the target application to the server includes: During the restart process of the target application, the post-update collection request is sent to the server.

4. A log collection method, characterized in that, Applied to a server, the method includes: Receive a collection request sent by a client; wherein the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client; Create collection rules corresponding to the target application based on the target data and the target address; The collection rules are sent to the client to collect the target logs corresponding to the target data; The method further includes, after sending the collection rules to the client: Receive the updated collection request sent by the client; wherein the updated collection request carries the updated data and updated address corresponding to the target application; Create updated collection rules for the target application based on the updated data and the updated address; The updated collection rules are sent to the client to collect the updated logs corresponding to the updated data.

5. A client application, characterized in that, The client includes: a first sending unit, a first receiving unit, a processing unit, and a first storage unit. The first sending unit is used to send a collection request corresponding to the target application to the server; wherein, the collection request carries target data and target address corresponding to the target application; the target address is the storage address corresponding to the server or the storage address corresponding to the client; The first receiving unit is used to receive the collection rules corresponding to the target application sent by the server; The processing unit is configured to: create filtering rules according to the collection rules; create a log filtering plugin according to the filtering rules; and use the log filtering plugin to filter the source logs corresponding to the target application to obtain the target logs. The first storage unit is used to store the target log at the target address; The first sending unit is further configured to send an updated collection request corresponding to the target application to the server; wherein the updated collection request carries the updated data and updated address corresponding to the target application; The first receiving unit is further configured to receive the updated collection rules corresponding to the target application sent by the server; The processing unit is further configured to perform log collection processing on the target application according to the updated collection rules, and obtain the updated logs corresponding to the updated data; The first storage unit is also used to store the updated log at the updated address.

6. A server, characterized in that, The server includes: a second receiving unit, a creation unit, and a second sending unit. The second receiving unit is used to receive a collection request sent by a client; wherein the collection request carries target data and a target address corresponding to the target application; the target address is a storage address corresponding to the server or a storage address corresponding to the client; The creation unit is used to create collection rules corresponding to the target application based on the target data and the target address; The second sending unit is used to send the collection rules to the client in order to collect the target logs corresponding to the target data; The second receiving unit is further configured to receive an updated collection request sent by the client; wherein the updated collection request carries the updated data and updated address corresponding to the target application; The creation unit is also used to create an updated collection rule corresponding to the target application based on the updated data and the updated address; The second sending unit is further configured to send the updated collection rules to the client in order to collect the updated logs corresponding to the updated data.

7. A terminal, characterized in that, The terminal runs the client as described in claim 5, and the terminal includes a first processor and a first memory storing instructions executable by the first processor. When the instructions are executed by the first processor, the method as described in any one of claims 1-3 is implemented.

8. A server, characterized in that, The server includes a second processor and a second memory storing instructions executable by the second processor, wherein when the instructions are executed by the second processor, the method as described in claim 4 is implemented.

9. A computer-readable storage medium having a program stored thereon for use in a client and a server, characterized in that, When the program is executed by the first processor, it implements the method as described in any one of claims 1-3; when the program is executed by the second processor, it implements the method as described in claim 4.

Citation Information

Patent Citations

  • Log collection method, device and system

    CN112307276A

  • Distributed log collection method and device, medium and electronic equipment

    CN112800017A