Log retrieval method and device, electronic equipment and storage medium

CN115421995BActive Publication Date: 2026-10-27BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210867540.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2026-10-27
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

[0004]本公开提供一种日志回捞方法、装置、电子设备及存储介质,以至少解决相关技术中日志回捞不及时,日志回捞效率低的问题

Benefits of technology

[0098]通过在客户端的当前场景信息与本地缓存的日志回捞场景信息相匹配时向服务器发送日志回捞请求,服务器基于该日志回捞请求在确定当前场景信息有效时生成并返回指示日志回捞的第一响应信息,客户端基于该第一响应信息启动日志回捞任务以收集并上传历史日志文件,从而在客户端首次触达日志回捞场景时就进行日志回捞操作,及时进行日志回捞,有效提高了日志回捞的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421995B_ABST
    Figure CN115421995B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a log recovery method and device, electronic equipment and storage medium. The method comprises: a client sends a log recovery request to a server when current scene information matches locally cached log recovery scene information; the server returns first response information to the client when it is determined that the current scene information is valid in response to the log recovery request; and the client starts a log recovery task in response to the first response information, which is used to collect and upload historical log files, so that log recovery operation is performed in time when the client first reaches the log recovery scene, effectively improving the efficiency of log recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computing technology, and in particular to a log retrieval method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, during the use of the client, users will provide online feedback on any client-related issues they encounter. In order to better locate the problem, it is necessary to retrieve the current device's log files so that developers can analyze and locate the client's fault.

[0003] In related technologies, log retrieval typically involves developers creating a retrieval task in the management backend when a user reports a problem requiring log retrieval. However, this retrieval task is only responded to by the client when the client logs back in, resulting in untimely and inefficient log retrieval in these technologies. Summary of the Invention

[0004] This disclosure provides a log retrieval method, apparatus, electronic device, and storage medium to at least solve the problems of untimely and inefficient log retrieval in related technologies. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a log retrieval method is provided, applied to a client, comprising:

[0006] When the current scenario information matches the log retrieval scenario information cached locally, a log retrieval request is sent to the server.

[0007] Receive the response information returned by the server in response to the log retrieval request;

[0008] When the response information is the first response information, a log retrieval task is initiated; the log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

[0009] In one exemplary implementation, before sending a log retrieval request to the server when the current scenario information matches the locally cached log retrieval scenario information, the method further includes:

[0010] During the cold start process, a request to obtain log retrieval scenario information is sent to the server;

[0011] The server receives a preset number of log retrieval scenario information in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client.

[0012] The preset number of log retrieval scenario information is cached locally.

[0013] In one exemplary implementation, after caching the preset number of log retrieval scenario information locally, the method further includes:

[0014] At preset time intervals, log retrieval scenario information update requests are sent to the server.

[0015] The server receives the target log retrieval scenario information returned in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full preset log retrieval scenario that matches the client.

[0016] Based on the target log retrieval scenario information, the log retrieval scenario information in the local cache is updated.

[0017] In one exemplary implementation, after initiating the log retrieval task, the method further includes:

[0018] Determine the task status information of the log retrieval task;

[0019] The task status information is sent to the server so that the server records the task progress of the log retrieval task based on the task status information.

[0020] In one exemplary embodiment, the method further includes:

[0021] When the response information is the second response information, the current scenario information is removed from the locally cached log retrieval scenario information; the second response information is generated by the server when it determines that the current scenario information is invalid.

[0022] According to a second aspect of the present disclosure, a log retrieval method is provided, applied to a server, comprising:

[0023] Receive a log retrieval request from the client; the log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information.

[0024] Upon determining that the current scene information is valid, a first response message is generated;

[0025] The first response information is returned to the client so that the client can start a log retrieval task based on the first response information. The log retrieval task is used to collect and upload historical log files.

[0026] In one exemplary implementation, before receiving the log retrieval request from the client, the method further includes:

[0027] Receive the log retrieval scenario information request sent by the client during the cold start process;

[0028] In response to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information;

[0029] The preset number of log retrieval scenario information is returned to the client so that the client can cache the preset number of log retrieval scenario information locally.

[0030] In one exemplary embodiment, the method further includes:

[0031] Receive log retrieval scenario information update requests sent by the client at preset time intervals;

[0032] In response to the log retrieval scenario information update request, a full preset log retrieval scenario matching the client is determined;

[0033] The scenario information of the full preset log retrieval scenario that matches the client is returned to the client as the target log retrieval scenario information, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

[0034] In one exemplary embodiment, the method further includes:

[0035] In response to the log retrieval scenario creation command, obtain basic scenario information;

[0036] The preset log retrieval scenario is created based on the basic information of the scenario.

[0037] In one exemplary embodiment, the method further includes:

[0038] Responding to the log retrieval scenario update command, obtain scenario update information;

[0039] The preset log retrieval scenario is updated based on the scenario update information.

[0040] In one exemplary embodiment, the method further includes:

[0041] Receive task status information sent by the client;

[0042] Based on the task status information, the task progress of the log retrieval task is recorded.

[0043] In one exemplary embodiment, the method further includes:

[0044] The progress of the log retrieval task is displayed on the associated display device.

[0045] In one exemplary embodiment, the method further includes:

[0046] If the current scenario is determined to be invalid, a second response message is generated;

[0047] The second response information is sent to the client so that the client removes the current scene information from the locally cached log retrieval scene information.

[0048] According to a third aspect of the present disclosure, a log retrieval device is provided, configured on a client, comprising:

[0049] The log retrieval request sending unit is configured to send a log retrieval request to the server when the current scenario information matches the locally cached log retrieval scenario information.

[0050] The first response information receiving unit is configured to receive the response information returned by the server in response to the log retrieval request;

[0051] The log retrieval task initiation unit is configured to initiate a log retrieval task when the response information is the first response information; the log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

[0052] In one exemplary embodiment, the apparatus further includes:

[0053] The first request sending unit is configured to send a log retrieval scenario information acquisition request to the server during the cold start process;

[0054] The first scenario information receiving unit is configured to receive a preset number of log retrieval scenario information returned by the server in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client.

[0055] The scene information caching unit is configured to cache the preset number of log retrieved scene information locally.

[0056] In one exemplary embodiment, the apparatus further includes:

[0057] The second request sending unit is configured to send a log retrieval scenario information update request to the server at a preset time interval;

[0058] The second scenario information receiving unit is configured to receive the target log retrieval scenario information returned by the server in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full set of preset log retrieval scenarios that match the client.

[0059] The scene information update unit is configured to update the log retrieval scene information in the local cache based on the target log retrieval scene information.

[0060] In one exemplary embodiment, the apparatus further includes:

[0061] The status information determination unit is configured to determine the task status information of the log retrieval task.

[0062] The status information sending unit is configured to send the task status information to the server so that the server records the task progress of the log retrieval task based on the task status information.

[0063] In one exemplary embodiment, the apparatus further includes:

[0064] The scene information removal unit is configured to remove the current scene information from the locally cached log scene information when the response information is the second response information; the second response information is generated by the server when it determines that the current scene information is invalid.

[0065] According to a fourth aspect of the present disclosure, a log retrieval device is provided, configured on a server, comprising:

[0066] The log retrieval request receiving unit is configured to receive log retrieval requests from clients; the log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information.

[0067] The first response information generation unit is configured to generate first response information when it is determined that the current scene information is valid;

[0068] The first response information return unit is configured to return the first response information to the client so that the client can start a log retrieval task based on the first response information. The log retrieval task is used to collect and upload historical log files.

[0069] In one exemplary embodiment, the apparatus further includes:

[0070] The first request receiving unit is configured to receive the log retrieval scenario information acquisition request sent by the client during the cold start process;

[0071] The scenario information determination unit is configured to respond to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of preset log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information.

[0072] The first scenario information return unit is configured to return the preset number of log retrieval scenario information to the client, so that the client can cache the preset number of log retrieval scenario information locally.

[0073] In one exemplary embodiment, the apparatus further includes:

[0074] The second request receiving unit is configured to receive the log retrieval scenario information update request sent by the client at a preset time interval;

[0075] The log retrieval scenario determination unit is configured to execute a response to the log retrieval scenario information update request and determine a full set of preset log retrieval scenarios that match the client.

[0076] The second scenario information return unit is configured to return the scenario information of the full preset log retrieval scenario that matches the client as the target log retrieval scenario information to the client, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

[0077] In one exemplary embodiment, the apparatus further includes:

[0078] The scene basic information acquisition unit is configured to execute a scene creation command in response to log retrieval and acquire scene basic information.

[0079] The log retrieval scenario creation unit is configured to create the preset log retrieval scenario based on the scenario's basic information.

[0080] In one exemplary embodiment, the apparatus further includes:

[0081] The scene update information acquisition unit is configured to execute a scene update command in response to log retrieval and acquire scene update information.

[0082] The log retrieval scenario update unit is configured to update the preset log retrieval scenario based on the scenario update information.

[0083] In one exemplary embodiment, the apparatus further includes:

[0084] The status information receiving unit is configured to receive task status information sent by the client;

[0085] The task progress recording unit is configured to record the task progress of the log retrieval task based on the task status information.

[0086] In one exemplary embodiment, the apparatus further includes:

[0087] The display unit is configured to perform the task progress of the log retrieval task by displaying it through an associated display device.

[0088] In one exemplary embodiment, the apparatus further includes:

[0089] The second response information generation unit is configured to generate second response information when it is determined that the current scenario is invalid;

[0090] The second response information sending unit is configured to send the second response information to the client so that the client removes the current scene information from the locally cached log retrieval scene information.

[0091] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising:

[0092] processor;

[0093] Memory used to store the processor's executable instructions;

[0094] The processor is configured to execute the instructions to implement the log retrieval methods of the first and second aspects described above.

[0095] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the log retrieval methods of the first and second aspects described above.

[0096] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the log retrieval methods of the first and second aspects described above.

[0097] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:

[0098] When the client's current scenario information matches the locally cached log retrieval scenario information, a log retrieval request is sent to the server. Based on this request, the server generates and returns a first response indicating log retrieval when it determines that the current scenario information is valid. The client then initiates a log retrieval task based on this first response to collect and upload historical log files. This allows the log retrieval operation to be performed as soon as the client first encounters the log retrieval scenario, ensuring timely log retrieval and effectively improving log retrieval efficiency.

[0099] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0100] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0101] Figure 1a This is a schematic diagram illustrating the application environment of a log retrieval method according to an exemplary embodiment;

[0102] Figure 1b This is a system architecture diagram illustrating a log retrieval method according to an exemplary embodiment;

[0103] Figure 2 This is a flowchart illustrating a log retrieval method according to an exemplary embodiment;

[0104] Figure 3 This is a flowchart illustrating another log retrieval method according to an exemplary embodiment;

[0105] Figure 4 This is a flowchart illustrating another log retrieval method according to an exemplary embodiment;

[0106] Figure 5 This is a flowchart illustrating another log retrieval method according to an exemplary embodiment;

[0107] Figure 6 This is a flowchart illustrating another log retrieval method according to an exemplary embodiment;

[0108] Figure 7 This is a schematic diagram illustrating the process of creating and updating a preset log retrieval scenario according to an exemplary embodiment;

[0109] Figure 8 This is a structural block diagram of a log retrieval device according to an exemplary embodiment;

[0110] Figure 9 This is a structural block diagram of another log retrieval device according to an exemplary embodiment;

[0111] Figure 10 This is a structural block diagram of a terminal according to an exemplary embodiment;

[0112] Figure 11 This is a structural block diagram of a server according to an exemplary embodiment. Detailed Implementation

[0113] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0114] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0115] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0116] Please see Figure 1a The diagram illustrates an application environment for a log retrieval method according to an exemplary embodiment. The application environment may include a client 110 and a server 120. The client 110 and the server 120 can communicate via a network connection, which may be a wired network or a wireless network.

[0117] Client 110 may include terminal devices such as smartphones, desktop computers, tablets, laptops, digital assistants, and smart wearable devices. It may also include software running on the terminal device, such as web pages provided to users by service providers, or applications provided to users by such service providers. The application may be a standalone application or a subroutine within an application; for example, the application may include video applications, live streaming applications, etc. Users of client 110 can log in using pre-registered user information, which may include an account and password.

[0118] Server 120 can provide background services to client 110. These background services may include a log retrieval service, which involves collecting historical log files that the client has not yet reported or that failed to report, allowing developers to analyze and locate the client's faults. Specifically, server 120 can provide log retrieval services based on scenario information from multiple pre-configured preset log retrieval scenarios. These preset log retrieval scenarios can be dynamically adjusted according to actual needs.

[0119] Server 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, an edge computing node, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0120] In a specific application scenario, such as Figure 1b As shown, server 120 may include a log retrieval server, a management server, and a database. The log retrieval server is responsible for providing log retrieval services to clients. These services include a log retrieval task generation service and a log retrieval task status service. The log retrieval task generation service generates a log retrieval task identifier upon receiving a log retrieval request from a client and determining that the client's current scenario information triggering the request is valid. This identifier is then returned to the client as a response, enabling the client to initiate a log retrieval task to collect historical log files and upload them to the log file server. The log retrieval task status service receives task status information sent by the client during the log retrieval task execution and records the task progress on the client based on this information.

[0121] The management server is responsible for providing log retrieval scenario configuration services. Business users can pre-configure multiple preset log retrieval scenarios through this service, and update the scenario information of these preset scenarios to the log retrieval server via RPC (Remote Procedure Call). Thus, the log retrieval server can provide log retrieval services based on the scenario information of these multiple preset scenarios. Additionally, the management server can also retrieve and display the task progress of log retrieval tasks from the log retrieval server during the log retrieval process.

[0122] To improve the performance of the log retrieval server, the log retrieval server can record relevant information of multiple preset log retrieval scenarios and the task progress of log retrieval tasks on the client into the database, and retrieve the corresponding data from the database when needed.

[0123] Figure 2 This is a flowchart illustrating a log retrieval method according to an exemplary embodiment, such as... Figure 2 As shown, the log retrieval method includes the following steps.

[0124] In step S201, when the current scene information matches the log retrieval scene information cached locally, the client sends a log retrieval request to the server.

[0125] The current scenario information refers to the information of the client's current business scenario, which can be a scenario identifier for the current business scenario, such as the page identifier of the client's current page. The locally cached log retrieval scenario information can be a scenario identifier for a preset log retrieval scenario. It can be understood that there can be multiple locally cached log retrieval scenario information.

[0126] Taking scenario information as the scenario identifier as an example, when the client enters the current business scenario, the client obtains the current scenario identifier of the current business scenario and searches for the current scenario identifier in the locally cached log retrieval scenario identifier. If it is found, it means that the current scenario identifier matches the locally cached log retrieval scenario identifier, that is, the current business scenario is the preset log retrieval scenario, and the client sends a log retrieval request to the server. Conversely, if it is not found, it means that the current scenario identifier does not match the locally cached log retrieval scenario identifier, that is, the current business scenario is not the preset log retrieval scenario, and the client will not send a log retrieval request to the server.

[0127] Before the aforementioned step S201 is implemented, the client needs to request log retrieval scenario information from the server to cache locally. In this embodiment, the client's request for log retrieval scenario information involves two scenarios: one is requesting log retrieval scenario information from the server and caching it locally during the client's cold start process; the other is updating the locally cached log retrieval scenario information. Based on this, in an exemplary implementation, such as... Figure 3 As shown, before step S201, the method may further include:

[0128] In step S301, during the cold start process, the client sends a request to the server to obtain log retrieval scenario information.

[0129] Among them, the Log Retrieval Scenario Information Acquisition Request is used to request and obtain log retrieval scenario information.

[0130] Correspondingly, the server receives requests from clients during the cold start process to retrieve log retrieval scenario information.

[0131] In step S303, in response to the log retrieval scenario information acquisition request, the server determines the scenario information of a preset number of preset log retrieval scenarios that match the client, and obtains the preset number of log retrieval scenario information.

[0132] The preset number can be set in advance, for example, 50.

[0133] In practice, each preset log retrieval scenario has corresponding basic scenario information on the server. This basic scenario information includes scenario identifier, scenario description, total number of retrieved logs, scenario validity period, and scenario system version. When determining a preset log retrieval scenario that matches the client, the server can first identify valid preset log retrieval scenarios. A valid preset log retrieval scenario refers to a preset log retrieval scenario where the current total number of retrieved logs has not reached the set total number of retrieved logs and is within the scenario validity period. Then, the server can obtain the client's current system version, find valid preset log retrieval scenarios whose scenario system version matches the current system version as the preset log retrieval scenario that matches the client, and then use the scenario identifier in the basic scenario information of the matching preset log retrieval scenario as the corresponding log retrieval scenario information.

[0134] In practical applications, the preset log retrieval scenarios in the server can also be set with priorities. When determining the preset number of preset log retrieval scenarios that match the preset number, the preset log retrieval scenarios that match the preset number can be determined in descending order of priority, so that the client will prioritize the preset number of preset log retrieval scenarios for log retrieval.

[0135] In step S305, the server returns a preset number of log retrieval scenario information to the client.

[0136] Correspondingly, the client receives a preset number of log retrieval scenario information returned by the server.

[0137] In step S307, the client caches a preset number of log retrieval scenario information locally.

[0138] In the above embodiments, by caching the scenario information of a preset number of matching preset log retrieval scenarios locally on the client during the cold start phase, it is ensured that the client can perform log retrieval when it first encounters the preset log retrieval scenario. Moreover, it avoids the waste of resources caused by the client having to complete all scenario log retrievals due to the scenario information of all preset log retrieval scenarios being sent at once, which helps to speed up the log retrieval speed.

[0139] In another exemplary implementation, see [link to previous document]. Figure 3 After the client caches a preset number of log retrieval scenario information locally, the method may also include:

[0140] In step S309, the client sends a log retrieval scenario information update request to the server at preset time intervals.

[0141] The Log Retrieval Scenario Information Update Request is used to request an update to the log retrieval scenario information.

[0142] Correspondingly, the server receives log retrieval scenario information update requests sent by the client at preset time intervals. The preset time interval can be set according to actual needs, for example, it can be set to 1 day, that is, the client can send a log retrieval scenario update request to the server once every day.

[0143] In step S311, the server responds to the log retrieval scenario information update request and determines the full preset log retrieval scenario that matches the client.

[0144] In specific implementation, when the server determines the full preset log retrieval scenario that matches the client, it can first determine all valid preset log retrieval scenarios. A valid preset log retrieval scenario refers to a preset log retrieval scenario where the total number of retrieved logs has not reached the set total number of retrieved logs and is within the scenario's validity period. Then, the server can obtain the client's current system version, find all valid preset log retrieval scenarios whose scenario system versions match the current system version, and thus determine the full preset log retrieval scenario that matches the client.

[0145] In step S313, the server returns the scenario information of the full preset log retrieval scenario that matches the client as the target log retrieval scenario information to the client.

[0146] In step S315, the client updates the locally cached log retrieval scenario information based on the target log retrieval scenario information.

[0147] Specifically, the client performs a full update during the update process, which means replacing all locally cached log retrieval scenario information with the target log retrieval scenario information.

[0148] In the above embodiments, by requesting target log retrieval scenario information and performing a full update at preset time intervals, resource waste can be avoided and log retrieval speed can be improved.

[0149] Correspondingly, the server receives log retrieval requests sent by the client.

[0150] In step S203, the server determines whether the current scene information is valid.

[0151] If the server determines that the current scene information is valid, then steps S205 to S207 are executed; otherwise, if the server determines that the current scene information is invalid, then steps S209 to S211 are executed.

[0152] In this context, "current scenario information is valid" means that the total number of currently retrieved logs in the preset log retrieval scenario corresponding to the current scenario information has not reached the set total number of retrieved logs, and is within the scenario's validity period. Conversely, "current scenario information is invalid" means that the total number of currently retrieved logs in the preset log retrieval scenario corresponding to the current scenario information has reached the set total number of retrieved logs, or is not within the scenario's validity period.

[0153] In step S205, the server generates a first response message and returns the first response message to the client.

[0154] Among them, the first response information indicates log retrieval.

[0155] In practice, to record relevant information for each log retrieval task, the server can generate a log retrieval task identifier when it determines that the current scenario information is valid. Based on this identifier and the client identifier, the server records the client's log retrieval task execution status. Then, when generating the first response information, the server can use this log retrieval task identifier to generate the first response information.

[0156] Correspondingly, the client receives the first response information returned by the server.

[0157] In step S207, the client responds to the first response information and initiates the log retrieval task.

[0158] The log retrieval task is used to collect and upload historical log files. Specifically, after the client starts the log retrieval task, it begins collecting, compressing, and uploading historical log files.

[0159] In step S209, the server generates a second response message and returns the second response message to the client.

[0160] The second response information indicates the removal of the current scene information.

[0161] In practice, the second response information can be a fixed error code. When the client receives the error code returned by the server, it indicates that the current scene information needs to be removed from the local cache.

[0162] Correspondingly, the client receives the second response information returned by the server.

[0163] In step S211, the client responds to the second response information by removing the current scene information from the locally cached log retrieval scene information.

[0164] Specifically, once the client removes the current scenario information from the cached log retrieval scenario information, the next time the client enters the business scenario corresponding to the current scenario information, log retrieval will not be triggered. This avoids wasting client resources and improves the accuracy of log retrieval.

[0165] As can be seen from the above technical solutions of the embodiments of this disclosure, the embodiments of this disclosure maintain preset log retrieval scenarios through the server and cache the scenario information of the preset log retrieval scenarios that match the client in advance on the client's local storage, thereby enabling the log retrieval task to be started and the log retrieval to be performed in a timely manner when the client first touches the preset retrieval scenario, thus improving the log retrieval efficiency.

[0166] In one exemplary implementation, to facilitate timely understanding of the progress of log retrieval tasks by business personnel, such as... Figure 4 As shown, after the client starts the log retrieval task, the method may further include:

[0167] In step S401, the client determines the task status information of the log retrieval task and sends the task status information to the server.

[0168] The task status information indicates the current status of the log retrieval task. For example, the task status information may include collection status, packaging status, compression status, upload status, completion status, etc. The progress of the log retrieval task can be divided into different statuses according to actual needs.

[0169] Correspondingly, the server receives task status information sent by the client.

[0170] In step S403, the server records the task progress of the log retrieval task on the client based on the above task status information.

[0171] Specifically, the server can use the log retrieval task identifier and client identifier as keys, and the task status information sent by the client as the value, to record the task progress of the log retrieval task on that client.

[0172] In one exemplary implementation, see continue to see Figure 4 The method may also include:

[0173] In step S405, the server displays the progress of the log retrieval task through the associated display device.

[0174] The server can display the progress of log retrieval tasks through its associated display device. In practice, the management server can call the backend interface of the log retrieval server to query the log retrieval progress. The log retrieval server can then send the progress of all current log retrieval tasks to the management server, allowing the management server to display the progress of each log retrieval task through the front-end display device.

[0175] In the above embodiments, by displaying the task progress of log retrieval tasks, business personnel can promptly understand the progress of each log retrieval task for corresponding management.

[0176] The log retrieval method of this disclosure embodiment is described below with the client as the execution subject. For example... Figure 5 The flowchart shown illustrates a log retrieval method, which includes:

[0177] In step S501, when the current scene information matches the log retrieval scene information cached locally, a log retrieval request is sent to the server.

[0178] In step S503, the response information returned by the server in response to the log retrieval request is received.

[0179] In step S505, when the response information is the first response information, the log retrieval task is started.

[0180] The log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

[0181] In step S507, when the response information is the second response information, the current scene information is removed from the locally cached log retrieval scene information.

[0182] The second response information is generated by the server when it determines that the current scene information is invalid.

[0183] In one exemplary embodiment, prior to step S501, the method may further include:

[0184] During the cold start process, a request to obtain log retrieval scenario information is sent to the server;

[0185] The server receives a preset number of log retrieval scenario information in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client.

[0186] The preset number of log retrieval scenario information is cached locally.

[0187] In one exemplary implementation, after caching a preset number of log retrieval scenario information locally, the method may further include:

[0188] At preset time intervals, log retrieval scenario information update requests are sent to the server.

[0189] The server receives the target log retrieval scenario information returned in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full preset log retrieval scenario that matches the client.

[0190] Based on the target log retrieval scenario information, the log retrieval scenario information in the local cache is updated.

[0191] In an exemplary embodiment, after initiating the log retrieval task, step S505 above may further include:

[0192] Determine the task status information of the log retrieval task;

[0193] The task status information is sent to the server so that the server records the task progress of the log retrieval task based on the task status information.

[0194] The log retrieval method of this disclosure is described below using a server as the execution subject. For example... Figure 6 The flowchart shown illustrates a log retrieval method, which includes:

[0195] In step S601, a log retrieval request is received from the client.

[0196] The log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information.

[0197] In step S603, it is determined whether the current scene information is valid. If the result of the determination is yes, the following step S605 is executed; otherwise, if the result of the determination is no, the following step S607 is executed.

[0198] In step S605, a first response message is generated and returned to the client.

[0199] The first response message indicates log retrieval. Understandably, upon receiving the first response message, the client initiates a log retrieval task based on this message. This task is used to collect and upload historical log files.

[0200] In step S607, a second response message is generated and returned to the client.

[0201] The second response information indicates the removal of the current scene information.

[0202] In one exemplary embodiment, prior to step S601, the method may further include:

[0203] Receive the log retrieval scenario information request sent by the client during the cold start process;

[0204] In response to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information;

[0205] The preset number of log retrieval scenario information is returned to the client so that the client can cache the preset number of log retrieval scenario information locally.

[0206] In one exemplary embodiment, the method may further include:

[0207] Receive log retrieval scenario information update requests sent by the client at preset time intervals;

[0208] In response to the log retrieval scenario information update request, a full preset log retrieval scenario matching the client is determined;

[0209] The scenario information of the full preset log retrieval scenario that matches the client is returned to the client as the target log retrieval scenario information, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

[0210] In one exemplary implementation, the method further includes a process for creating a preset log retrieval scenario, specifically as follows: Figure 7 As shown, it may include:

[0211] In step S701, in response to the log retrieval scenario creation instruction, basic scenario information is obtained;

[0212] In step S703, the preset log retrieval scenario is created based on the scenario basic information.

[0213] The basic scenario information may include scenario identifier, scenario description, total number of retrieved logs, scenario validity period, scenario system version, etc. The scenario identifier is used to uniquely identify a log retrieval scenario and can be sent to the client as scenario information in this embodiment. It is understood that the basic scenario information may also include other information needed in practical applications, such as scenario completion timestamp, update timestamp, scenario status, etc.

[0214] By maintaining preset log retrieval scenarios on the server, the system sends the corresponding scenario information to the client during a cold start. Based on the client's update request, the system sends the latest scenario information to fully update the scenario information cached locally on the client. This ensures that log retrieval is performed as soon as the client first encounters the preset log retrieval scenario, thus improving the efficiency of log retrieval.

[0215] To improve the flexibility of log retrieval, in one exemplary implementation, see [link to example]. Figure 7 The method may also include:

[0216] In step S705, in response to the log retrieval scene update command, scene update information is obtained.

[0217] The scenario update information can be an update of the basic information of any preset log retrieval scenario, such as the total number of retrieved logs, the scenario validity period, and other information that needs to be updated according to actual needs.

[0218] In step S707, the preset log retrieval scenario is updated based on the scenario update information.

[0219] The above embodiments achieve dynamic maintenance of preset log retrieval scenarios in the server by updating preset log retrieval scenarios, thereby improving the flexibility of log retrieval.

[0220] In one exemplary embodiment, the method may further include:

[0221] Receive task status information sent by the client;

[0222] Based on the task status information, the task progress of the log retrieval task is recorded.

[0223] Specifically, the server can use (scene identifier + log retrieval task identifier + client identifier) ​​as the primary key and the task status information sent by the client as the value to record the task progress of the log retrieval task on that client. In practice, the server can store the task progress of the log retrieval task on each client in the database.

[0224] In one exemplary implementation, the server can also display the task progress of log retrieval tasks through an associated display device, such as an associated display terminal.

[0225] Figure 8 This is a block diagram illustrating a log retrieval device according to an exemplary embodiment, the log retrieval device being configured in a client. (Refer to...) Figure 8 The log retrieval device 800 includes:

[0226] The log retrieval request sending unit 810 is configured to send a log retrieval request to the server when the current scenario information matches the log retrieval scenario information cached locally.

[0227] The first response information receiving unit 820 is configured to receive the response information returned by the server in response to the log retrieval request;

[0228] The log retrieval task initiation unit 830 is configured to initiate a log retrieval task when the response information is the first response information; the log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

[0229] In one exemplary embodiment, the device 800 further includes:

[0230] The first request sending unit is configured to send a log retrieval scenario information acquisition request to the server during the cold start process;

[0231] The first scenario information receiving unit is configured to receive a preset number of log retrieval scenario information returned by the server in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client.

[0232] The scene information caching unit is configured to cache the preset number of log retrieved scene information locally.

[0233] In one exemplary embodiment, the device 800 further includes:

[0234] The second request sending unit is configured to send a log retrieval scenario information update request to the server at a preset time interval;

[0235] The second scenario information receiving unit is configured to receive the target log retrieval scenario information returned by the server in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full set of preset log retrieval scenarios that match the client.

[0236] The scene information update unit is configured to update the log retrieval scene information in the local cache based on the target log retrieval scene information.

[0237] In one exemplary embodiment, the device 800 further includes:

[0238] The status information determination unit is configured to determine the task status information of the log retrieval task.

[0239] The status information sending unit is configured to send the task status information to the server so that the server records the task progress of the log retrieval task based on the task status information.

[0240] In one exemplary embodiment, the device 800 further includes:

[0241] The scene information removal unit is configured to remove the current scene information from the locally cached log scene information when the response information is the second response information; the second response information is generated by the server when it determines that the current scene information is invalid.

[0242] Figure 9 This is a block diagram illustrating another log retrieval device according to an exemplary embodiment, the log retrieval device being configured in a server. (Refer to...) Figure 9 The log retrieval device 900 includes:

[0243] The log retrieval request receiving unit 910 is configured to receive log retrieval requests from clients; the log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information.

[0244] The first response information generation unit 920 is configured to generate first response information when it is determined that the current scene information is valid;

[0245] The first response information return unit 930 is configured to return the first response information to the client so that the client can start a log retrieval task based on the first response information. The log retrieval task is used to collect and upload historical log files.

[0246] In one exemplary embodiment, the device 900 further includes:

[0247] The first request receiving unit is configured to receive the log retrieval scenario information acquisition request sent by the client during the cold start process;

[0248] The scenario information determination unit is configured to respond to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of preset log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information.

[0249] The first scenario information return unit is configured to return the preset number of log retrieval scenario information to the client, so that the client can cache the preset number of log retrieval scenario information locally.

[0250] In one exemplary embodiment, the device 900 further includes:

[0251] The second request receiving unit is configured to receive the log retrieval scenario information update request sent by the client at a preset time interval;

[0252] The log retrieval scenario determination unit is configured to execute a response to the log retrieval scenario information update request and determine a full set of preset log retrieval scenarios that match the client.

[0253] The second scenario information return unit is configured to return the scenario information of the full preset log retrieval scenario that matches the client as the target log retrieval scenario information to the client, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

[0254] In one exemplary embodiment, the device 900 further includes:

[0255] The scene basic information acquisition unit is configured to execute a scene creation command in response to log retrieval and acquire scene basic information.

[0256] The log retrieval scenario creation unit is configured to create the preset log retrieval scenario based on the scenario's basic information.

[0257] In one exemplary embodiment, the device 900 further includes:

[0258] The scene update information acquisition unit is configured to execute a scene update command in response to log retrieval and acquire scene update information.

[0259] The log retrieval scenario update unit is configured to update the preset log retrieval scenario based on the scenario update information.

[0260] In one exemplary embodiment, the device 900 further includes:

[0261] The status information receiving unit is configured to receive task status information sent by the client;

[0262] The task progress recording unit is configured to record the task progress of the log retrieval task based on the task status information.

[0263] In one exemplary embodiment, the device 900 further includes:

[0264] The display unit is configured to perform the task progress of the log retrieval task by displaying it through an associated display device.

[0265] In one exemplary embodiment, the device 900 further includes:

[0266] The second response information generation unit is configured to generate second response information when it is determined that the current scenario is invalid;

[0267] The second response information sending unit is configured to send the second response information to the client so that the client removes the current scene information from the locally cached log retrieval scene information.

[0268] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0269] In one exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements the client-side log retrieval method or the server-side log retrieval method provided in the embodiments of this disclosure.

[0270] In one example, the electronic device could be a terminal. Figure 10 This is a structural block diagram of a terminal according to an exemplary embodiment, specifically:

[0271] The terminal may include an RF (Radio Frequency) circuit 1010, a memory 1020 including one or more computer-readable storage media, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a WiFi (Wireless Fidelity) module 1070, a processor 1080 including one or more processing cores, and a power supply 1090, etc. Those skilled in the art will understand that... Figure 10 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0272] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1080 for processing; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other terminals. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0273] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various functional applications and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1020 may also include a memory controller to provide access to the memory 1020 for the processor 1080 and the input unit 1030.

[0274] The input unit 1030 can be used to receive input numerical or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, the input unit 1030 may include a touch-sensitive surface 1031 and other input devices 1032. The touch-sensitive surface 1031, also known as a touch display screen or touchpad, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface 1031), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 1080, and can receive and execute commands from the processor 1080. In addition, the touch-sensitive surface 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0275] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 1040 may include a display panel 1041, which may optionally be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar display panel. Further, a touch-sensitive surface 1031 may cover the display panel 1041. When the touch-sensitive surface 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. The touch-sensitive surface 1031 and the display panel 1041 can be two independent components to implement input and output functions. However, in some embodiments, the touch-sensitive surface 1031 and the display panel 1041 can be integrated to achieve both input and output functions.

[0276] The terminal may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured on the terminal, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0277] Audio circuitry 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the terminal. Audio circuitry 1060 converts received audio data into electrical signals, which are then transmitted to speaker 1061, where they are converted into sound signals for output. Conversely, microphone 1062 converts collected sound signals into electrical signals, which are received by audio circuitry 1060, converted back into audio data, processed by processor 1080, and then transmitted via RF circuitry 1010 to, for example, another terminal, or output to memory 1020 for further processing. Audio circuitry 1060 may also include an earphone jack to facilitate communication between a peripheral headset and the terminal.

[0278] WiFi is a short-range wireless transmission technology. The terminal, through the WiFi module 1070, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 10 WiFi module 1070 is shown, but it is understood that it is not a necessary component of the terminal and can be omitted as needed without changing the nature of the invention.

[0279] The processor 1080 is the control center of the terminal, connecting various parts of the terminal through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020 and calls data stored in the memory 1020 to perform various functions and process data, thereby providing overall monitoring of the terminal. Optionally, the processor 1080 may include one or more processing cores; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1080.

[0280] The terminal also includes a power supply 1090 (such as a battery) to power various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1090 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0281] Although not shown, the terminal may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the terminal also includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors. The aforementioned one or more programs contain instructions for executing the log retrieval method provided in the above-described client-side method embodiment.

[0282] In one example, the electronic device could be a server. Figure 11 This is a hardware structure block diagram of a server that runs the server-side log retrieval method in this embodiment of the invention, as provided in the embodiments of the present invention. Figure 11As shown, the server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1110 (CPUs 1110 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1130 for storing data, and one or more storage media 1120 (e.g., one or more mass storage devices) for storing application programs 1123 or data 1122. The memory 1130 and storage media 1120 may be temporary or persistent storage. The program stored in the storage media 1120 may include one or more modules, each module including a series of instruction operations on the server. Furthermore, the CPU 1110 may be configured to communicate with the storage media 1120 and execute the series of instruction operations stored in the storage media 1120 on the server 1100. Server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1140, and / or one or more operating systems 1121, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0283] The input / output interface 1140 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1100. In one example, the input / output interface 1140 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1140 may be a radio frequency (RF) module for wireless communication with the Internet.

[0284] Those skilled in the art will understand that Figure 11 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1100 may also include... Figure 11 The more or fewer components shown, or having the same Figure 11 The different configurations shown.

[0285] In one exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, which can be executed by the processor of device 800 or 900 to complete the corresponding log retrieval method. Optionally, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0286] In one exemplary embodiment, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement the client-side or server-side log retrieval method provided in the embodiments of this disclosure.

[0287] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0288] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A log retrieval method, characterized in that, Applied to the client side, including: During the cold start process, a request to retrieve scenario information from log retrieval is sent to the server; The server receives a preset number of log retrieval scenario information in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client. The preset number of log retrieval scenario information are cached locally; When the current scenario information matches the log retrieval scenario information cached locally, a log retrieval request is sent to the server. The current scenario information is the scenario identifier of the current business scenario, and the locally cached log retrieval scenario information is the scenario identifier of the preset log retrieval scenario. Receive the response information returned by the server in response to the log retrieval request; When the response information is the first response information, a log retrieval task is initiated; the log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

2. The method according to claim 1, characterized in that, After caching the preset number of log retrieval scenario information locally, the method further includes: At preset time intervals, a log retrieval scenario information update request is sent to the server. The server receives the target log retrieval scenario information returned in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full preset log retrieval scenario that matches the client. Based on the target log retrieval scenario information, the log retrieval scenario information in the local cache is updated.

3. The method according to claim 1, characterized in that, After initiating the log retrieval task, the method further includes: Determine the task status information of the log retrieval task; The task status information is sent to the server so that the server records the task progress of the log retrieval task based on the task status information.

4. The method according to claim 1, characterized in that, The method further includes: When the response information is the second response information, the current scenario information is removed from the locally cached log retrieval scenario information; the second response information is generated by the server when it determines that the current scenario information is invalid.

5. A log retrieval method, characterized in that, Applied to servers, including: Receive requests from clients during the cold start process to retrieve log retrieval scenario information; In response to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information; The preset number of log retrieval scenario information is returned to the client so that the client can cache the preset number of log retrieval scenario information locally; Receive the log retrieval request from the client; the log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information, the current scenario information is the scenario identifier of the current business scenario, and the locally cached log retrieval scenario information is the scenario identifier of the preset log retrieval scenario; Upon determining that the current scene information is valid, a first response message is generated; The first response information is returned to the client so that the client can start a log retrieval task based on the first response information. The log retrieval task is used to collect and upload historical log files.

6. The method according to claim 5, characterized in that, The method further includes: Receive log retrieval scenario information update requests sent by the client at preset time intervals; In response to the log retrieval scenario information update request, a full preset log retrieval scenario matching the client is determined; The scenario information of the full preset log retrieval scenario that matches the client is returned to the client as the target log retrieval scenario information, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

7. The method according to claim 6, characterized in that, The method further includes: In response to the log retrieval scenario creation command, obtain basic scenario information; The preset log retrieval scenario is created based on the basic information of the scenario.

8. The method according to claim 6, characterized in that, The method further includes: Responding to the log retrieval scenario update command, obtain scenario update information; The preset log retrieval scenario is updated based on the scenario update information.

9. The method according to claim 5, characterized in that, The method further includes: Receive task status information sent by the client; Based on the task status information, the task progress of the log retrieval task is recorded.

10. The method according to claim 9, characterized in that, The method further includes: The progress of the log retrieval task is displayed on the associated display device.

11. The method according to claim 5, characterized in that, The method further includes: If the current scenario information is determined to be invalid, a second response message is generated; The second response information is sent to the client so that the client removes the current scene information from the locally cached log retrieval scene information.

12. A log retrieval device, characterized in that, Configuration on the client side includes: The first request sending unit is configured to send a request to the server to obtain log retrieval scenario information during the cold start process; The first scenario information receiving unit is configured to receive a preset number of log retrieval scenario information returned by the server in response to the log retrieval scenario information acquisition request; the log retrieval scenario information is scenario information of a preset log retrieval scenario that matches the client. The scene information caching unit is configured to cache the preset number of log retrieved scene information locally; The log retrieval request sending unit is configured to send a log retrieval request to the server when the current scenario information matches the log retrieval scenario information cached locally. The current scenario information is the scenario identifier of the current business scenario, and the locally cached log retrieval scenario information is the scenario identifier of a preset log retrieval scenario. The first response information receiving unit is configured to receive the response information returned by the server in response to the log retrieval request; The log retrieval task initiation unit is configured to initiate a log retrieval task when the response information is the first response information; the log retrieval task is used to collect and upload historical log files, and the first response information is generated by the server when it determines that the current scenario information is valid.

13. The apparatus according to claim 12, characterized in that, The device further includes: The second request sending unit is configured to send a log retrieval scenario information update request to the server at a preset time interval; The second scenario information receiving unit is configured to receive the target log retrieval scenario information returned by the server in response to the log retrieval scenario information update request; the target log retrieval scenario information is the scenario information of the full set of preset log retrieval scenarios that match the client. The scene information update unit is configured to update the log retrieval scene information in the local cache based on the target log retrieval scene information.

14. The apparatus according to claim 12, characterized in that, The device further includes: The status information determination unit is configured to determine the task status information of the log retrieval task. The status information sending unit is configured to send the task status information to the server so that the server records the task progress of the log retrieval task based on the task status information.

15. The apparatus according to claim 12, characterized in that, The device further includes: The scene information removal unit is configured to remove the current scene information from the locally cached log scene information when the response information is the second response information; the second response information is generated by the server when it determines that the current scene information is invalid.

16. A log retrieval device, characterized in that, Configured on the server, including: The first request receiving unit is configured to execute the request to receive log retrieval scenario information sent by the client during the cold start process; The scenario information determination unit is configured to respond to the log retrieval scenario information acquisition request, determine the scenario information of a preset number of preset log retrieval scenarios that match the client, and obtain the preset number of log retrieval scenario information. The first scenario information return unit is configured to return the preset number of log retrieval scenario information to the client, so that the client can cache the preset number of log retrieval scenario information locally; The log retrieval request receiving unit is configured to receive log retrieval requests from clients. The log retrieval request is sent by the client when the current scenario information matches the locally cached log retrieval scenario information. The current scenario information is the scenario identifier of the current business scenario, and the locally cached log retrieval scenario information is the scenario identifier of a preset log retrieval scenario. The first response information generation unit is configured to generate first response information when it is determined that the current scene information is valid; The first response information return unit is configured to return the first response information to the client so that the client can start a log retrieval task based on the first response information. The log retrieval task is used to collect and upload historical log files.

17. The apparatus according to claim 16, characterized in that, The device further includes: The second request receiving unit is configured to receive the log retrieval scenario information update request sent by the client at a preset time interval; The log retrieval scenario determination unit is configured to execute a response to the log retrieval scenario information update request and determine a full set of preset log retrieval scenarios that match the client. The second scenario information return unit is configured to return the scenario information of the full preset log retrieval scenario that matches the client as the target log retrieval scenario information to the client, so that the client can update the locally cached log retrieval scenario information based on the target log retrieval scenario information.

18. The apparatus according to claim 17, characterized in that, The device further includes: The scene basic information acquisition unit is configured to execute a scene creation command in response to log retrieval and acquire scene basic information. The log retrieval scenario creation unit is configured to create the preset log retrieval scenario based on the scenario's basic information.

19. The apparatus according to claim 17, characterized in that, The device further includes: The scene update information acquisition unit is configured to execute a scene update command in response to log retrieval and acquire scene update information. The log retrieval scenario update unit is configured to update the preset log retrieval scenario based on the scenario update information.

20. The apparatus according to claim 16, characterized in that, The device further includes: The status information receiving unit is configured to receive task status information sent by the client; The task progress recording unit is configured to record the task progress of the log retrieval task based on the task status information.

21. The apparatus according to claim 20, characterized in that, The device further includes: The display unit is configured to perform the task progress of the log retrieval task by displaying it through an associated display device.

22. The apparatus according to claim 16, characterized in that, The device further includes: The second response information generation unit is configured to generate second response information when it is determined that the current scene information is invalid; The second response information sending unit is configured to send the second response information to the client so that the client removes the current scene information from the locally cached log retrieval scene information.

23. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the log retrieval method as described in any one of claims 1 to 4 or the log retrieval method as described in any one of claims 5 to 11.

24. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the log retrieval method as described in any one of claims 1 to 4 or the log retrieval method as described in any one of claims 5 to 11.

25. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the log retrieval method according to any one of claims 1 to 4 or the log retrieval method according to any one of claims 5 to 11.

Citation Information

Patent Citations

  • Method and device for collecting and reporting logs

    CN105577445A

  • Automatic log salvage method, device and system, computer program product and medium

    CN113688016A

  • Log uploading method and device, electronic equipment and computer readable storage medium

    CN114077529A