Work log processing method and device, equipment and storage medium

By constructing an encoding dictionary and generating compressed data, the problem of insufficient memory in miniaturized WiFi devices was solved, enabling stable storage of work logs and improving the stability of device operation.

CN119544811BActive Publication Date: 2025-11-25GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311117647.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-11-25
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

Miniaturized WiFi devices have limited memory, making it difficult to effectively record and store operational logs, which affects operational status analysis and fault diagnosis.

Method used

By constructing an encoding dictionary, compressed data is generated based on the element's position and frequency of occurrence, and then sent to the target device for storage when the log cache reaches a threshold, thus avoiding the occupation of device memory.

Benefits of technology

It enables the stable storage of WiFi device operation logs without affecting the normal operation of the device, thereby improving the operational stability and reliability of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544811B_ABST
    Figure CN119544811B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a work log processing method and device, electronic equipment and a storage medium. The technical scheme provided by the embodiments of the present application generates compressed data based on the encoding symbol, the position and the number of occurrences of the corresponding element of the encoding symbol when generating the compressed data, without individually compressing each element, which can further compress the work log and reduce the memory occupation. In addition, when the cache data amount of the log cache reaches the set threshold, the compressed data is sent to the target device for storage, which can guarantee the normal storage of the work log, avoid the work log from occupying too much device memory, guarantee the stability of the Wi-Fi device work, and realize the stable storage of the work log of the small-sized Wi-Fi device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for processing work logs. Background Technology

[0002] Currently, with the rapid development and advancement of IoT technology, the application scope of WiFi devices is becoming increasingly widespread. Compared to traditional wired network devices, WiFi devices have advantages such as high portability, ease of use, and low cost, making them more popular with consumers. During the use of WiFi devices, it is necessary to record their operation process and generate corresponding work logs for device debugging and maintenance.

[0003] However, some miniaturized WiFi devices limit their built-in storage capacity in order to reduce costs. Their memory is often only used to ensure the normal operation of software programs, making it difficult to record too many work logs, which affects the analysis of the WiFi device's operating status, fault diagnosis, and maintenance. Summary of the Invention

[0004] This application provides a work log processing method, apparatus, electronic device, and storage medium, which can record the work log of a WiFi device while avoiding excessive occupation of device memory, thus solving the technical problem that miniaturized WiFi devices are difficult to record work logs.

[0005] In a first aspect, embodiments of this application provide a work log processing method, which includes:

[0006] The system acquires real-time generated work logs, which include multiple elements. A pre-built encoding dictionary is then queried to determine the corresponding encoding for each element. This encoding dictionary includes a one-to-one correspondence between elements and encodings. By determining the position and frequency of each element in the work log, compressed data is generated based on the determined position, frequency, and corresponding encoding. The compressed data is then saved to a log cache. When the cached data volume reaches a set threshold, compressed data is sequentially extracted from the log cache and sent to a target device for storage. The target device has the encoding dictionary pre-synchronized.

[0007] As can be seen, this application generates compressed data based on the encoding symbol and the position and frequency of the corresponding element, eliminating the need to compress each element individually. This further compresses the work log and reduces memory usage. Furthermore, when the amount of cached data in the log cache reaches a set threshold, this application sends the compressed data to the target device for storage. This ensures normal storage of the work log while preventing it from consuming excessive device memory, thus guaranteeing the stability of the WiFi device and enabling stable storage of work logs for miniaturized WiFi devices.

[0008] In one possible design approach, the work log processing method further includes: constructing corresponding encoding characters in the encoding dictionary based on ASCII codes and preset log elements.

[0009] In one possible design approach, the work log processing method also includes:

[0010] If the current element is not included in the encoding dictionary, construct the encoding character of the current element and add it to the encoding dictionary to update the encoding dictionary;

[0011] Synchronize the updated encoding dictionary to the target device.

[0012] In one possible design approach, the aforementioned "sending compressed data to the target device for storage" includes:

[0013] Compressed data is sent to the target device for storage via WiFi data frames; or...

[0014] If a USB link connection with the target device is detected, compressed data is sent to the target device for storage via the USB link.

[0015] In one possible design approach, after the aforementioned "sending compressed data to the target device for storage," the following is also included:

[0016] In response to the log read command from the host computer device, compressed data is obtained from the target device;

[0017] The obtained compressed data is decoded to obtain the corresponding work log, and the decoded work log is sent to the host computer device.

[0018] In one possible design approach, the aforementioned "querying the pre-built encoded dictionary" includes:

[0019] The work log is split into multiple data blocks, and the elements of each data block are extracted sequentially to query the pre-built encoding dictionary.

[0020] In a second aspect, embodiments of this application provide a work log processing apparatus, comprising:

[0021] The query module is used to retrieve real-time generated work logs, which include multiple elements.

[0022] Query the pre-built encoding dictionary to determine the encoding symbol corresponding to each of the multiple elements. The encoding dictionary includes a one-to-one correspondence between elements and encoding symbols.

[0023] The compression module is used to determine the position and number of occurrences of each element in the work log, and to generate compressed data based on the determined position, number of occurrences, and corresponding encoding characters.

[0024] The storage module is used to save compressed data to the log cache. When the amount of cached data in the log cache reaches a set threshold, the compressed data is extracted from the log cache in sequence and sent to the target device for storage. The target device has a pre-synchronized encoding dictionary.

[0025] In one possible design, the work log processing device further includes a construction module for constructing an encoding symbol corresponding to a preset log element based on ASCII code and preset log elements.

[0026] In one possible design approach, the query module described above is also used for:

[0027] If the encoding dictionary does not include the current element, construct the encoding symbol for the current element and add it to the encoding dictionary to update the encoding dictionary;

[0028] Synchronize the updated encoding dictionary to the target device.

[0029] In one possible design, when sending compressed data to the target device for storage, the aforementioned storage module is specifically used for:

[0030] Compressed data is sent to the target device for storage via WiFi data frames; or...

[0031] If a USB link connection with the target device is detected, compressed data is sent to the target device for storage via the USB link.

[0032] In one possible design, after sending the compressed data to the target device for storage, the aforementioned storage module is further used for:

[0033] In response to the log read command from the host computer device, compressed data is obtained from the target device;

[0034] The obtained compressed data is decoded to obtain the corresponding work log, and the decoded work log is sent to the host computer device.

[0035] In a third aspect, embodiments of this application provide a work log processing device, comprising:

[0036] Memory and one or more processors;

[0037] The memory is used to store one or more programs;

[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the job log processing method as described in the first aspect.

[0039] In a fourth aspect, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the work log processing method as described in the first aspect.

[0040] Fifthly, embodiments of this application provide a computer program product including computer instructions that, when executed on an electronic device, cause the electronic device to perform the work log processing method as described in the first aspect and any possible design thereof.

[0041] For a detailed description of the second to fifth aspects and their various implementations in the embodiments of this application, please refer to the detailed description in the first aspect and its various implementations; and for a detailed description of the beneficial effects of the second to fifth aspects and their various implementations, please refer to the beneficial effect analysis in the first aspect and its various implementations, which will not be repeated here.

[0042] These or other aspects of the embodiments of this application will become more apparent in the following description. Attached Figure Description

[0043] Figure 1 This is a flowchart of a work log processing method provided in an embodiment of this application;

[0044] Figure 2 This is a flowchart of the encoding character setting process for newly added elements in this application embodiment;

[0045] Figure 3 This is a schematic diagram of the data structure of a WiFi data frame in an embodiment of this application;

[0046] Figure 4 This is a flowchart illustrating the upload process of compressed data in an embodiment of this application;

[0047] Figure 5 This is a schematic diagram of the workflow of the work log in the embodiments of this application;

[0048] Figure 6 This is another schematic diagram of the workflow of the work log in the embodiments of this application;

[0049] Figure 7 This is a schematic diagram of the structure of a work log processing device provided in an embodiment of this application;

[0050] Figure 8 This is a schematic diagram of the structure of a work log processing device provided in an embodiment of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0052] The work log processing method of this application aims to reduce device memory usage and achieve the effect of miniaturized work log storage by processing the work logs generated during the daily operation of WiFi devices. The work logs record various information generated during the operation of the WiFi device, such as device connection records, network quality, and abnormal situations. By obtaining the work logs of the WiFi device, the daily operating status of the WiFi device can be determined, facilitating the analysis of the WiFi device's operating status, fault diagnosis, and maintenance.

[0053] Generally, WiFi devices allocate corresponding memory space to store their work logs. For miniaturized WiFi devices, to ensure the normal operation of other functions, their memory capacity needs to be prioritized for those functions. Therefore, for some miniaturized WiFi devices, it is necessary to process their work logs to avoid excessive memory consumption. Based on this, the work log processing method of this application is provided to solve the technical problem that miniaturized WiFi devices have difficulty recording work logs.

[0054] Example:

[0055] Figure 1A flowchart of a work log processing method provided in an embodiment of this application is given. The work log processing method provided in this embodiment can be executed by a work log processing device, which can be implemented by software and / or hardware.

[0056] Optionally, the work log processing device can be a WiFi device. The following description uses a WiFi device as an example to illustrate the work log processing method. (Refer to...) Figure 1 The specific methods for processing work logs include:

[0057] S110. Obtain the real-time generated work log, which includes multiple elements; query the pre-built encoding dictionary to determine the encoding symbol corresponding to each element among the multiple elements, the encoding dictionary including the one-to-one correspondence between elements and encoding symbols;

[0058] S120. Determine the position and number of occurrences of each element in the work log, and generate compressed data based on the determined position, number of occurrences, and corresponding encoding characters;

[0059] S130. Save the compressed data to the log cache. When the amount of cached data in the log cache reaches a set threshold, extract the compressed data from the log cache in sequence and send the compressed data to the target device for storage. The target device has a pre-synchronized encoding dictionary.

[0060] When processing the work logs of WiFi devices, a log cache is pre-allocated to store the processed logs. This log cache is allocated based on the actual log storage space available on the WiFi device, without affecting the normal operation of other functions. Generally, for smaller WiFi devices, considering hardware limitations, their storage capacity is relatively small, and therefore the allocated log cache will also be relatively small. Conversely, for larger WiFi devices, a larger log cache can be provided.

[0061] Furthermore, the operational logs generated by the WiFi device during operation are extracted and processed in real time, and the logs are encoded and compressed to generate corresponding compressed data. Specifically, during the encoding and compression of the log content, the relevant elements within the log content need to be converted into encoded characters to obtain the corresponding compressed data.

[0062] Before proceeding, an encoding dictionary needs to be constructed to determine the encoding symbol corresponding to each element of the string in the work log. Essentially, the encoding dictionary contains a one-to-one correspondence between elements and encoding symbols. The Wi-Fi device can then find the corresponding encoding symbol for each element in the work log. For each element (such as a character or word) in the work log string, the encoding dictionary is consulted to determine the corresponding encoding symbol. Based on the sequentially determined encoding symbols, the compressed data of the work log can be obtained.

[0063] Furthermore, considering the large number of identical elements in the work logs, leading to multiple queries finding the same encoding symbol (i.e., elements at different positions may have the same encoding symbol), it's unnecessary to record the encoding symbol for every single position when generating compressed data. Only the position and frequency of occurrence of the element corresponding to the same encoding symbol are needed to obtain the final compressed data. This streamlines the compressed data, improving the work log compression rate and reducing the memory footprint of the work logs on the WiFi device.

[0064] Furthermore, considering that as compressed data accumulates in the log cache, its cache space may become insufficient to store a certain amount of compressed data, this embodiment further extracts compressed data from the log cache sequentially according to the cache order and sends it to the target device for storage when the amount of cached data in the log cache reaches a set threshold. The target device has pre-synchronized an encoding dictionary, which allows it to decode and store the compressed data for subsequent retrieval. Thus, by sending the compressed data to another device for storage, the complete preservation of the WiFi working log can be ensured, preventing any impact on the operation of other functions of the WiFi device and improving the stability and reliability of the miniaturized WiFi device.

[0065] By generating compressed data based on the encoding symbol and the position and frequency of the corresponding element, it eliminates the need to compress each element individually, further compressing the work log and reducing memory usage. Furthermore, this application sends the compressed data to the target device for storage when the cached data volume reaches a set threshold. This ensures normal storage of the work log while preventing it from consuming excessive device memory, thus guaranteeing the stability of the WiFi device and enabling stable storage of work logs for miniaturized WiFi devices.

[0066] Based on the above embodiments, the method provided in this application further includes: constructing an encoding symbol corresponding to a preset value log element based on ASCII code and preset log elements.

[0067] Optionally, when constructing the encoding dictionary, the predefined 256 ASCII codes are first loaded. It's understandable that in a computer, all data is represented using binary numbers during storage and computation (because computers use high and low voltage levels to represent 1 and 0, respectively). For example, the 52 letters (including uppercase) like a, b, c, and d, as well as numbers like 0 and 1, and some commonly used symbols (such as *, #, @, etc.), are also represented using binary numbers when stored in a computer. ASCII codes provide a universal set of encoding rules, uniformly specifying which binary numbers are used to represent these commonly used symbols, facilitating the regular encoding of data.

[0068] Building upon this foundation, to further compress work logs and reduce cache usage, this application further constructs mapped encoding symbols based on pre-defined log elements, and obtains the encoding dictionary based on these encoding symbols and the aforementioned ASCII codes. It is understood that ASCII codes only provide encoding symbols (i.e., binary numbers) corresponding to letters, symbols, etc. For frequently occurring word data in work logs, encoding using only ASCII codes would split words into multiple letters for separate encoding. Since each letter requires finding a corresponding encoding symbol, this would consume more encoding resources, and the resulting compressed data would occupy a relatively large amount of memory. Therefore, this application collects commonly used elements (such as word data) from the logs and constructs corresponding encoding symbols based on each log element. Subsequently, when encoding work logs, if a work log is detected to contain a corresponding log element from the encoding dictionary, compression encoding is performed based on the pre-defined encoding symbol for that log element in the encoding dictionary. There is no need to split log elements into multiple characters for separate encoding; a single encoding symbol can completely represent a log element. Thus, through this pre-constructed encoding dictionary, efficient encoding of work logs is achieved, reducing the memory usage of compressed data and improving the work log compression rate.

[0069] It should be noted that the above log elements can be pre-set and corresponding mapped encoding symbols can be constructed according to actual encoding requirements. This application does not impose fixed restrictions on the log elements included in the encoding dictionary, and will not elaborate further here.

[0070] Optionally, when generating log elements, the historical work logs of the WiFi device can be obtained, and words that appear a set number of times can be extracted as log elements, and their corresponding encoding symbols can be constructed. It is understood that words appearing a set number of times in the historical work logs indicate high usage frequency. To facilitate encoding these words and reduce compressed data usage, encoding symbols are constructed for these words, so that when these words appear in subsequent work logs, the encoding symbols can be used for simplified encoding of the word data.

[0071] Subsequently, when querying the pre-built encoding dictionary based on the strings in the work log, the work log is split into multiple data blocks, and the strings of each data block are extracted sequentially to query the pre-built encoding dictionary. During data compression, the real-time generated work log is divided into multiple data blocks, and each small block is compressed separately. By scanning the elements on each data block, the encoding symbols of each element are determined. Based on these encoding symbols, the compressed data of the work log can be obtained.

[0072] Therefore, by constructing an encoding dictionary based on ASCII codes and pre-set log elements, and compressing the WiFi working logs according to this encoding dictionary, the WiFi working logs can be compressed as much as possible, reducing the amount of memory occupied by the working logs on the device.

[0073] Reference Figure 2 The work log processing method in this application embodiment further includes:

[0074] S1101. If the encoding dictionary does not include the current element, construct the encoding symbol of the current element and add it to the encoding dictionary to update the encoding dictionary;

[0075] S1102. Synchronize the updated encoding dictionary to the target device.

[0076] When scanning uncompressed characters in a string, if an element is encountered that does not match the current encoding dictionary, a new encoding symbol needs to be constructed for that new element. This encoding symbol is placed at the end of the encoding dictionary for subsequent encoding of the new element. Furthermore, since the encoding dictionary has been updated, it needs to be resynchronized with the target device to ensure that the target device can fully decode the received compressed data. As needed, the encoding dictionary can also be updated in real time when new log elements are set. By continuously adding encoding symbols for possible log elements in the work log, the encoding of the work log becomes more efficient, the generated compressed data is more lightweight, and the device memory usage is reduced.

[0077] Optionally, when the WiFi device in this application embodiment sends compressed data to the target device for storage, it includes: sending the compressed data to the target device for storage via WiFi data frames; or, if a USB link connection with the target device is detected, sending the compressed data to the target device for storage based on the USB link.

[0078] During compressed data transmission, the compressed data is transmitted via WiFi data frames. Prior to this, the encoding dictionary is transmitted to the target device in the form of WiFi data frames.

[0079] The target device receives WiFi data frames via its WiFi module and obtains the encoding dictionary data. Upon receiving compressed data, it parses the data and combines all the encoded characters to obtain the compressed data. Similarly, during data decoding, the encoding dictionary is queried one by one to determine the element corresponding to each encoded character, and by combining all elements, the corresponding WiFi log is output.

[0080] Specifically, refer to Figure 3 This document provides a schematic diagram of the data structure of a WiFi data frame. A WiFi data frame includes a frame header, sender, data length, frame sequence number, ACK, message type, message subtype, data type, compressed data (payload), and a checksum. The frame header identifies and detects the data frame; the sender defines which slave device sent the frame; the data length includes the length from the frame sequence number to the checksum; the frame sequence number is incremented by 1 each time a new communication is initiated, and is reset to 0 if it exceeds 255; the ACK verifies whether the data frame was successfully received; the message type includes broad categories such as status, control, and data; message subtypes are subtypes of these broad categories, for example, "status" can be divided into mute, volume, etc.; the data type is 1 byte, indicating the data type of the payload, which may be JSON, string, or integer; the payload represents the data carried in the message; and the checksum is a CRC8 checksum from the frame sequence number to the payload. By using the communication module built into the WiFi device for compressed data transmission, no additional communication link with the target device is required, facilitating the transmission and storage of compressed data.

[0081] On the other hand, if the WiFi device is connected to the target device via a USB link, the compressed work log can be transmitted to the target device through the USB HID communication protocol, and the compressed data can be stored in the target device for subsequent use of the work log.

[0082] Optionally, based on the compressed data that has been stored as described above, when work log analysis is required, the compressed data can be extracted through a host computer device for WiFi device work log analysis. (Refer to...) Figure 4 After sending the compressed data to the target device for storage, it also includes:

[0083] S140, In response to the log read command from the host computer device, obtain compressed data from the target device;

[0084] S150: Decode the obtained compressed data, obtain the corresponding work log, and send the decoded work log to the host computer device.

[0085] The work logs can be read by interacting with the WIFI device through a host computer. For example... Figure 5 As shown, WiFi device 11 compresses the work log to generate compressed data and sends it to target device 12 for storage. Host computer device 13 then sends a log read command to the WiFi device. In response to this command, WiFi device 11 requests the corresponding compressed data from target device 12. It then uses an encoding dictionary to decompress the compressed data and uploads the decompressed work log to the host computer device. Based on the obtained work log, the host computer device can perform operational analysis of the WiFi device and promptly debug and maintain it.

[0086] Optionally, the host computer device can also connect directly to the target device and request the working logs from the target device. Similarly, based on the request from the host computer device, the target device uses an encoding dictionary to decompress the corresponding compressed data and send it to the host computer device.

[0087] In addition, refer to Figure 6 The host computer device 14 can also be the target device. When saving the compressed data, the WiFi device 11 directly uploads the compressed data to the host computer device 14. When the user needs to perform WiFi log analysis, the required compressed data is directly extracted, decompressed using an encoding dictionary, and the operation analysis is performed based on the decompressed work logs to promptly debug and maintain the device.

[0088] For example, when a user is debugging and maintaining a device, they connect to the WiFi device via a PC and receive compressed data uploaded by the WiFi device. Then, using the PC as the target device, the compressed data is decompressed using a pre-synchronized encoding dictionary to obtain the work log. By reviewing this work log, the current operating status of the WiFi device can be determined.

[0089] The above-described log processing method involves collecting and compressing the logs from WiFi devices in real time, then transmitting them to other devices for storage. Compared to single-device storage, off-site storage does not consume the limited storage resources of the WiFi devices themselves, and also facilitates user analysis of the devices' operational status.

[0090] Based on the above embodiments, Figure 7 This is a schematic diagram of a work log processing device provided in an embodiment of this application. (Reference) Figure 6 The work log processing device provided in this embodiment specifically includes: a query module 21, a compression module 22, and a storage module 23.

[0091] Among them, the query module 21 is used to obtain the real-time generated work log, which includes multiple elements; and to query the pre-built encoding dictionary to determine the encoding symbol corresponding to each element among the multiple elements. The encoding dictionary includes a one-to-one correspondence between elements and encoding symbols.

[0092] Compression module 22 is used to determine the position and number of occurrences of each element in the work log, and generate compressed data based on the determined position, number of occurrences, and corresponding encoding characters;

[0093] Storage module 23 is used to save compressed data to the log cache. When the amount of cached data in the log cache reaches a set threshold, compressed data is extracted from the log cache in sequence and sent to the target device for storage. The target device has a pre-synchronized encoding dictionary.

[0094] In one possible design, the working fluid processing device further includes a construction module. This construction module is used to construct an encoding symbol corresponding to a preset log element based on the ASCII code and the preset log element.

[0095] In one possible design approach, the query module described above is also used for:

[0096] If the current element is not included in the encoding dictionary, construct the encoding character of the current element and add it to the encoding dictionary to update the encoding dictionary;

[0097] Synchronize the updated encoding dictionary to the target device.

[0098] In one possible design, when sending compressed data to the target device for storage, the aforementioned storage module is specifically used for:

[0099] Compressed data is sent to the target device for storage via WiFi data frames; or...

[0100] If a USB link connection with the target device is detected, compressed data is sent to the target device for storage via the USB link.

[0101] In one possible design, after sending the compressed data to the target device for storage, the aforementioned storage module is further used for:

[0102] In response to the log read command from the host computer device, compressed data is obtained from the target device;

[0103] The obtained compressed data is decoded to obtain the corresponding work log, and the decoded work log is sent to the host computer device.

[0104] As described above, by generating compressed data based on the encoding symbol and the position and frequency of the corresponding element, it is not necessary to compress each element individually. This further compresses the work log and reduces memory usage. Furthermore, this application sends the compressed data to the target device for storage when the amount of cached log data reaches a set threshold. This ensures normal storage of the work log while preventing it from consuming excessive device memory, thus guaranteeing the stability of the WiFi device and enabling stable storage of work logs for miniaturized WiFi devices.

[0105] The work log processing apparatus provided in this application embodiment can be used to execute the work log processing method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0106] This application provides a work log processing device, referring to... Figure 8 The work log processing device includes a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The number of processors and the number of memories in the work log processing device can be one or more. The processor, memory, communication module, input device, and output device of the work log processing device can be connected via a bus or other means.

[0107] Memory, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the work log processing method described in any embodiment of this application (e.g., the query module, compression module, and storage module in the work log processing device). Memory may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0108] The communication module is used for data transmission.

[0109] The processor executes various functional applications and data processing of the device by running software programs, instructions, and modules stored in memory, thus realizing the above-mentioned work log processing method.

[0110] Input devices can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the device. Output devices may include display devices such as displays.

[0111] The work log processing device provided above can be used to execute the work log processing method provided in the above embodiments, and has corresponding functions and beneficial effects.

[0112] This application embodiment also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a work log processing method. The work log processing method includes: acquiring a real-time generated work log, the work log including multiple elements; querying a pre-built encoding dictionary to determine the encoding symbol corresponding to each of the multiple elements, the encoding dictionary including a one-to-one correspondence between elements and encoding symbols; determining the position and frequency of each element in the work log, and generating compressed data based on the determined position, frequency, and corresponding encoding symbol; saving the compressed data to a log cache; when the cached data volume in the log cache reaches a set threshold, sequentially retrieving the compressed data from the log cache; and sending the compressed data to a target device for storage, the target device having the encoding dictionary pre-synchronized.

[0113] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0114] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the work log processing method described above, but can also execute related operations in the work log processing method provided in any embodiment of this application.

[0115] This application also provides a computer program product, which includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the work log processing method described above.

[0116] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A method for processing work logs, characterized in that, include: Obtain the real-time work log generated by the WiFi device, the work log including multiple elements; Query a pre-built encoding dictionary to determine the encoding symbol corresponding to each of the plurality of elements, wherein the encoding dictionary includes a one-to-one correspondence between elements and encoding symbols; Determine the position and frequency of each element in the work log, and generate compressed data based on the determined position, frequency, and corresponding encoding. The compressed data is saved to a log cache. When the amount of cached data in the log cache reaches a set threshold, the compressed data is extracted from the log cache in sequence and sent to the target device for storage. The target device has the encoding dictionary pre-synchronized.

2. The work log processing method according to claim 1, characterized in that, The method further includes: Based on the ASCII code and the preset log element, construct the encoding symbol corresponding to the preset log element.

3. The work log processing method according to claim 1, characterized in that, The method further includes: If the encoding dictionary does not include the current element, construct the encoding symbol for the current element and add it to the encoding dictionary to update the encoding dictionary; The updated encoding dictionary will be synchronized to the target device.

4. The work log processing method according to claim 1, characterized in that, Sending the compressed data to the target device for storage includes: The compressed data is sent to the target device for storage via WiFi data frames; or... If a USB link connection is detected with the target device, the compressed data is sent to the target device for storage via the USB link.

5. The work log processing method according to claim 1, characterized in that, After sending the compressed data to the target device for storage, the process also includes: In response to a log read command from a host computer device, the compressed data is obtained from the target device; The obtained compressed data is decoded to obtain the corresponding work log, and the decoded work log is sent to the host computer device.

6. A work log processing device, characterized in that, include: The query module is used to obtain the real-time working logs generated by the WiFi device, which include multiple elements. Query a pre-built encoding dictionary to determine the encoding symbol corresponding to each of the plurality of elements, wherein the encoding dictionary includes a one-to-one correspondence between elements and encoding symbols; The compression module is used to determine the position and number of occurrences of each element in the work log, and generate compressed data based on the determined position, number of occurrences, and corresponding encoding characters; The storage module is used to save the compressed data to a log cache. When the amount of cached data in the log cache reaches a set threshold, the compressed data is extracted from the log cache in sequence and sent to the target device for storage. The target device has the encoding dictionary pre-synchronized.

7. The work log processing device according to claim 6, characterized in that, The device also includes a construction module; The construction module is used to construct an encoding symbol corresponding to the preset log element based on the ASCII code and the preset log element.

8. The work log processing device according to claim 6, characterized in that, The query module is also used for: If the encoding dictionary does not include the current element, construct the encoding symbol for the current element and add it to the encoding dictionary to update the encoding dictionary; The updated encoding dictionary will be synchronized to the target device.

9. The work log processing device according to claim 6, characterized in that, When sending the compressed data to the target device for storage, the storage module is specifically used for: The compressed data is sent to the target device for storage via WiFi data frames; or... If a USB link connection is detected with the target device, the compressed data is sent to the target device for storage via the USB link.

10. The work log processing device according to claim 6, characterized in that, After sending the compressed data to the target device for storage, the storage module is further configured to: In response to a log read command from a host computer device, the compressed data is obtained from the target device; The obtained compressed data is decoded to obtain the corresponding work log, and the decoded work log is sent to the host computer device.

11. A work log processing device, characterized in that, include: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the work log processing method as described in any one of claims 1-5.

12. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the work log processing method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Log data recording method and apparatus

    CN106649735A

  • Log file compression method and device, electronic equipment and storage medium

    CN115438002A