Work log processing method and device, equipment and storage medium

By generating and sending compressed work log data in a miniaturized WiFi device, the problem of work log recording difficulties caused by insufficient device memory is solved, and the stable storage and analysis of the device's operating status is achieved.

CN119544811AActive Publication Date: 2025-02-28GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Due to memory limitations, miniaturized WiFi devices are difficult to effectively record and save work logs, which affects the equipment's operating status analysis, fault judgment and maintenance.

Method used

By generating compressed data, elements in the work log are encoded using a pre-built encoding dictionary, and when the log cache reaches a threshold, the compressed data is sent to the target device storage.

Benefits of technology

It realizes stable recording and saving of WiFi devices' work logs without excessively occupying device memory, ensuring the operational stability and reliability of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544811A_ABST
    Figure CN119544811A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a work log processing method and device, electronic equipment and a storage medium. According to the technical scheme provided by the embodiment of the invention, when the compressed data is generated, the compressed data is generated based on the code symbol and the position and the occurrence frequency of the element corresponding to the code symbol, each element does not need to be compressed independently, the work log can be further compressed, and memory occupation is reduced. Besides, under the condition that the cache data volume of the log cache reaches the set threshold value, the compressed data is sent to the target equipment for storage, on one hand, normal storage of the work log can be guaranteed, on the other hand, the situation that the work log occupies too much equipment memory can be avoided, the working stability of the Wi-Fi equipment is guaranteed, and the user experience is improved. The stable storage of the work log of the miniaturized Wi-Fi equipment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a work log processing method, device, electronic device and storage medium. Background Art

[0002] At present, with the rapid development of Internet of Things technology, the application scope of WiFi devices is becoming more and more extensive. Compared with traditional wired network devices, WiFi devices have the advantages of high portability, ease of use, and low cost, and are more popular with consumers. During the use of WiFi devices, it is necessary to record their working process and generate corresponding work logs for the debugging and maintenance of the equipment.

[0003] However, for some miniaturized WiFi devices, the built-in storage capacity is limited in order to reduce costs. The 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 operation status analysis, fault diagnosis and maintenance of WiFi devices. Summary of the invention

[0004] The embodiments of the present application provide a work log processing method, device, electronic device and storage medium, which can record the work log of a WiFi device while avoiding excessive occupation of device memory, and solve the technical problem that miniaturized WiFi devices are difficult to record work logs.

[0005] In a first aspect, an embodiment of the present application provides a work log processing method, the work log processing method comprising:

[0006] Obtain a work log generated in real time, wherein the work log includes multiple elements. Then query a pre-built coding dictionary to determine the coding symbol corresponding to each of the multiple elements, where the coding dictionary includes a one-to-one correspondence between elements and coding symbols. 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 coding symbol. Then save the compressed data to the log cache, and 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, wherein the target device is pre-synchronized with the coding dictionary.

[0007] It can be seen that when generating compressed data, the present application generates compressed data based on the coder, and the position and number of occurrences of the element corresponding to the coder, without compressing each element separately, which can further compress the work log and reduce memory usage. In addition, when the amount of cached data in the log cache reaches a set threshold, the present application sends the compressed data to the target device for storage, which can ensure the normal storage of the work log on the one hand, and on the other hand, it can also prevent the work log from occupying too much device memory, ensure the stability of the WiFi device, and realize the stable preservation of the work log of the miniaturized WiFi device.

[0008] In a possible design, the work log processing method further includes: the above-mentioned coding dictionary constructs corresponding coding symbols in the coding dictionary according to ASCII codes and preset log elements respectively.

[0009] In a possible design, the work log processing method further includes:

[0010] When the encoding dictionary match does not include the current element, construct the encoding symbol of the current element and put it into the encoding dictionary to update the encoding dictionary;

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

[0012] In a possible design, the above-mentioned “sending compressed data to a target device for storage” includes:

[0013] Send the compressed data to the target device for storage via WiFi data frames; or,

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

[0015] In a possible design, after the above “sending the compressed data to the target device for storage”, it also includes:

[0016] Responding to a log reading instruction of the host device, obtaining compressed data from the target device;

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

[0018] In a possible design, the above-mentioned "querying a pre-built encoding dictionary" includes:

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

[0020] In a second aspect, an embodiment of the present application provides a work log processing device, including:

[0021] A query module is used to obtain a work log generated in real time. The work log includes multiple elements.

[0022] Querying a pre-built coding dictionary to determine a coding symbol corresponding to each of the plurality of elements, the coding dictionary including a one-to-one correspondence between the elements and the coding symbols;

[0023] A compression module, for determining the position and number of occurrences of each element in the work log, and generating compressed data based on the determined position, number of occurrences, and corresponding coder;

[0024] The storage module is used to save the compressed data into 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 is pre-synchronized with a coding dictionary.

[0025] In a possible design, the work log processing device further includes a construction module; the construction module is used to construct a coder corresponding to a preset log element according to the ASCII code and the preset log element.

[0026] In a possible design, the query module is also used to:

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

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

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

[0030] Send the compressed data to the target device for storage via WiFi data frames; or,

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

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

[0033] Responding to a log reading instruction of the host device, obtaining compressed data from the target device;

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

[0035] In a third aspect, an embodiment of the present application provides a work log processing device, including:

[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 work log processing method as described in the first aspect.

[0039] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the work log processing method as described in the first aspect.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the work log processing method as described in the first aspect and any possible design thereof.

[0041] For the specific description of the second to fifth aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to fifth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here.

[0042] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of a work log processing method provided by an embodiment of the present application;

[0044] Figure 2 is a flowchart of setting the encoder symbol of the newly added element in the embodiment of the present application;

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

[0046] Figure 4 This is a flowchart of uploading compressed data in an embodiment of the present application;

[0047] Figure 5 It is a flow diagram of the work log in the embodiment of the present application;

[0048] Figure 6 This is another flow diagram of the work log in the embodiment of the present application;

[0049] Figure 7 It is a structural schematic diagram of a work log processing device provided in an embodiment of the present application;

[0050] Figure 8 It is a structural diagram of a work log processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0052] The work log processing method of the embodiment of the present application aims to reduce the memory usage of the device and save the work log of the miniaturized WiFi device by processing the work log generated during the daily operation of the WiFi device. The work log is used to record various records generated during the operation of the WiFi device, such as device connection records, network quality, abnormal conditions, etc. By obtaining the work log of the WiFi device, the daily operation of the WiFi device can be determined, which is convenient for the operation status analysis, fault diagnosis and maintenance of the WiFi device.

[0053] Generally speaking, a WiFi device will allocate corresponding memory space to store the device's work log. For a miniaturized WiFi device, in order to ensure the normal operation of other functions, its memory capacity needs to be allocated to other functions first. Therefore, for some miniaturized WiFi devices, it is necessary to process the work log of its WiFi device to avoid excessive occupation of the device memory by the work log. Based on this, a work log processing method of an embodiment of the present application is provided to solve the technical problem that it is difficult for a miniaturized WiFi device to record a work log.

[0054] Example:

[0055] Figure 1A flow chart of a work log processing method provided in an embodiment of the present 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 may be a WiFi device. The following description is made by taking the WiFi device as an example of the subject of executing the work log processing method. Figure 1 , the work log processing method specifically includes:

[0057] S110, obtaining a work log generated in real time, the work log including multiple elements; querying a pre-built coding dictionary to determine a coding symbol corresponding to each of the multiple elements, the coding dictionary including a one-to-one correspondence between the elements and the coding symbols;

[0058] S120, determining the position and number of occurrences of each element in the work log, and generating compressed data based on the determined position, number of occurrences, and corresponding coder;

[0059] S130, saving the compressed data to the log cache, and when the amount of cached data in the log cache reaches a set threshold, extracting the compressed data from the log cache in sequence, and sending the compressed data to a target device for storage, the target device being pre-synchronized with a coding dictionary.

[0060] When processing the work log of the WiFi device, a log cache will be allocated in advance to store the work log processed by the device. Without affecting the normal operation of other business functions of the WiFi device, the log cache is divided according to the log storage space that the WiFi device can actually provide. Generally speaking, for miniaturized WiFi devices, considering the limitations of the device hardware settings, the storage capacity of its memory is relatively small, so the divided log cache will also be relatively small. On the contrary, for non-miniaturized WiFi devices, a larger log cache can be adaptively provided.

[0061] Furthermore, for the work log generated during the operation of the WiFi device, the work log will be extracted in real time for work log processing, and the work log will be encoded and compressed to generate corresponding compressed data. When encoding and compressing the work log content, the corresponding elements in the work log content need to be converted into encoding symbols to obtain corresponding compressed data.

[0062] Prior to this, a coding dictionary needs to be constructed accordingly to determine the coder corresponding to each element of the string in the work log according to the coding dictionary. It is understandable that the coding dictionary includes a one-to-one correspondence between elements and coders. The WIFI device can find the corresponding coder based on each element contained in the work log. For each element (such as a character or word) in the work log string, the coder corresponding to the element in the coding dictionary is determined by querying the coding dictionary. Based on the coders determined in sequence, the compressed data of the work log can be obtained.

[0063] In addition, considering that there are a large number of identical elements in the work log, the same coder may be queried multiple times, that is, the coders corresponding to elements at different positions may be the same. Therefore, when generating compressed data, there is no need to record the coders at each position. It is only necessary to record the position and number of occurrences of the elements corresponding to the same coder to obtain the final compressed data. In this way, by streamlining the compressed data, the compression rate of the work log is improved, and the memory usage of the work log on the WiFi device is reduced.

[0064] Furthermore, considering that as the log cache continuously accumulates compressed data, its cache space cannot meet the storage of a certain amount of accumulated compressed data. Therefore, in order to enable the continuously accumulated compressed data to be completely preserved and avoid the loss of the WiFi work log, the embodiment of the present application further extracts the compressed data from the log cache in sequence 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 the coding dictionary, so the compressed data can be decoded and stored according to the coding dictionary for subsequent extraction and use. In this way, by sending the compressed data to other devices for storage, the complete preservation of the WiFi work log can be guaranteed, the operation of other functions of the WiFi device can be avoided from being affected, and the stability and reliability of the operation of the miniaturized WiFi device can be improved.

[0065] By generating compressed data based on the coder and the position and number of occurrences of the element corresponding to the coder when generating compressed data, it is not necessary to compress each element separately, so that the work log can be further compressed and the memory usage can be reduced. In addition, when the amount of cached data in the log cache reaches a set threshold, the application sends the compressed data to the target device for storage, which can ensure the normal storage of the work log on the one hand, and on the other hand, it can also prevent the work log from occupying too much device memory, ensure the stability of the WiFi device, and realize the stable storage of the work log of the miniaturized WiFi device.

[0066] On the basis of the above-mentioned embodiment, the method provided in the embodiment of the present application further includes: constructing a coding symbol corresponding to the log element of the preset value according to the ASCII code and the preset log element.

[0067] Optionally, when constructing the encoding dictionary, first load the predefined 256 ASCII codes. It is understandable that in a computer, all data must be represented by binary numbers when stored and calculated (because the computer uses high and low levels to represent 1 and 0, respectively). For example, 52 letters such as a, b, c, d (including uppercase letters) and numbers such as 0 and 1, as well as some commonly used symbols (such as *, #, @, etc.), must also be represented by binary numbers when stored in the computer. The ASCII code provides a set of general encoding rules, which uniformly stipulates which binary numbers are used to represent the above commonly used symbols, so as to facilitate the conventional encoding of data.

[0068] On this basis, in order to further compress the work log and reduce the cache occupancy, the embodiment of the present application further constructs the mapped coder according to the preset log element, and obtains the coding dictionary based on this part of the coder and the above-mentioned ASCII code. It is understandable that the ASCII code only provides the coder (i.e., binary number) corresponding to letters, symbols, etc. For the word data that often appears in the work log, if only the ASCII code is used for encoding, the word will be split into multiple letters for encoding respectively. Since each letter needs to find the corresponding coder, more coding resources will be spent in this way, and the generated compressed data will occupy a relatively large memory. Based on this, the present application collects the common elements (such as word data) in the log and constructs the corresponding coder based on each log element. Later, when encoding the work log, if it is detected that the work log contains the corresponding log element in the coding dictionary, the compression coding is performed according to the coder preset by the log element in the coding dictionary. There is no need to split the log element into multiple characters for encoding respectively, and a coder can be used to fully represent a log element. In this way, through the pre-constructed coding dictionary, the efficient coding of the work log is realized, and the memory occupancy of the compressed data is reduced, and the compression rate of the work log is improved.

[0069] It should be noted that the above log elements can be pre-set according to actual coding requirements and corresponding mapped code symbols can be constructed. The embodiment of the present application does not impose fixed restrictions on the log elements included in the coding dictionary, and will not be elaborated here.

[0070] Optionally, when generating a log element, the historical work log of the WiFi device can also be obtained, and the word data whose occurrences reach a set number of times can be extracted as a log element, and the construction of its code symbol can be performed accordingly. It can be understood that for the word data whose occurrences reach a set number of times in the historical work log, it indicates that its frequency of use is relatively large. In order to facilitate encoding of the word and reduce the occupancy of compressed data, a code symbol is constructed for the word, so that when the word data appears in the subsequent work log, the code symbol is used to perform the simplified encoding of the word data.

[0071] Afterwards, when querying the pre-built coding dictionary based on the character string of the work log, the work log is split into multiple data blocks, and the character string of each data block is extracted in sequence to query the pre-built coding dictionary. When compressing data, 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 coder of each element is determined. Based on these coders, the compressed data of the work log can be obtained.

[0072] In this way, by constructing a coding dictionary according to ASCII codes and preset log elements, and compressing the WiFi work log according to the coding dictionary, the WiFi work log can be compressed as much as possible, reducing the occupation of the device memory by the work log.

[0073] Reference Figure 2 , the work log processing method of the embodiment of the present application also includes:

[0074] S1101. If the coding dictionary does not include the current element, construct a coding symbol for the current element and put it into the coding dictionary to update the coding dictionary;

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

[0076] When scanning the uncompressed characters on the string one by one, if an element that does not match the current encoding dictionary is scanned, a new encoder needs to be constructed for the new element. Put this encoder at the end of the encoding dictionary for subsequent encoding of the new element according to the encoding dictionary. In addition, since the encoding dictionary has been updated, it is necessary to resynchronize the encoding dictionary to the target device to ensure that the target device can completely decode the received compressed data. According to actual needs, when new log elements need to be set, the encoding dictionary can also be updated in real time. By continuously increasing the encoders of log elements that may appear in the work log, the encoding of the work log can be made more efficient, the generated compressed data can be more lightweight, and the device memory is less occupied.

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

[0078] When compressed data is transmitted, the compressed data is transmitted in the form of WiFi data frames. Prior to this, the coding dictionary is transmitted to the target device in the form of WiFi data frames in advance.

[0079] The target device receives the WiFi data frame through the WiFi module and obtains the coding dictionary data. When the compressed data is subsequently received, the compressed data can be obtained by combining all the coding symbols through data parsing. Similarly, when decoding the data, the elements corresponding to each coding symbol are determined by querying the coding dictionary one by one, and all the elements are combined to output the corresponding WiFi work log.

[0080] Specifically, refer to Figure 3 , provides a data structure diagram of the WiFi data frame. The WiFi data frame includes the frame header, sender, data length, frame sequence number, ACK, message type, message subtype, data type, compressed data (Payload) and check bit. Among them, the frame header is used to identify and detect the data frame; the sender is used to define which slave device sends the data frame; the data length includes the length from the frame sequence number to the check bit; the frame sequence number is used to increase the sequence number by 1 each time a new communication is initiated, and it is flipped to 0 when it exceeds 255 and recounted; ACK is used to check whether the data frame is successfully received; the message type includes major types such as status, control, and data; the message subtype is a subtype under each major type, for example, "status" can be divided into mute, volume, etc.; the data type is 1 byte, which refers to the data type of the payload. It may be Json, string or integer, etc.; Payload represents the data carried by the message; the check bit is CRC8, which is the checksum from the frame sequence number to the payload. By using the communication module that comes with the WiFi device for compressed data transmission, there is no need to build an additional communication link with the target device, which facilitates 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 via the USB HID communication protocol, and the compressed data can be saved in the target device for subsequent use of the work log.

[0082] Optionally, based on the compressed data stored above, when work log analysis is required, the compressed data can be extracted by the host device to perform work log analysis of the WiFi device. Figure 4 , after sending the compressed data to the target device for storage, it also includes:

[0083] S140, in response to a log reading instruction of the host device, obtaining compressed data from the target device;

[0084] S150, decoding the obtained compressed data to obtain a corresponding work log, and sending the decoded work log to the upper computer device.

[0085] The work log can be read by interacting with the host device and the WIFI device. Figure 5 As shown, the WiFi device 11 compresses the work log to generate compressed data and sends it to the target device 12 for storage. The host device 13 sends a log reading instruction to the WiFi device, and the WiFi device 11 responds to the log reading instruction and requests the corresponding compressed data from the target device 12. Then, the compressed data is decompressed using the coding dictionary, and the decompressed work log is uploaded to the host device. Based on the obtained work log, the host device can perform corresponding operation analysis of the WiFi device and debug and maintain the device in a timely manner.

[0086] Optionally, the host device can also directly connect to the target device and request the work log from the target device. Similarly, based on the request of the host device, the target device uses the coding dictionary to decompress the corresponding compressed data and sends it to the host device.

[0087] In addition, refer to Figure 6 , the host 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 device 14. When the user needs to perform WiFi log analysis, the required compressed data is directly extracted and decompressed using the coding dictionary, so as to perform operation analysis based on the decompressed work log and debug and maintain the device in a timely manner.

[0088] For example, when debugging and maintaining a device, a user connects to a WiFi device through a PC and receives compressed data uploaded by the WiFi device. At this time, the PC is used as the target device, and the compressed data is decompressed using a pre-synchronized coding dictionary to obtain the work log. Then, by viewing the work log, the current operation status of the WiFi device can be determined.

[0089] The above work log processing method collects the work log of the WiFi device in real time, compresses it, and transmits it to other devices for storage. Compared with the single-machine storage method, off-site storage does not occupy the limited storage resources of the WiFi device itself, and it is also convenient for users to analyze the working status of the device.

[0090] Based on the above embodiments, Figure 7 This is a schematic diagram of the structure of a work log processing device provided in an embodiment of the present application. 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] The query module 21 is used to obtain a work log generated in real time, the work log includes multiple elements; query a pre-built coding dictionary to determine the coding symbol corresponding to each of the multiple elements, the coding dictionary includes a one-to-one correspondence between the elements and the coding symbols;

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

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

[0094] In a possible design, the working condition processing device further includes a construction module, which is used to construct a code corresponding to the preset log element according to the ASCII code and the preset log element.

[0095] In a possible design, the query module is also used to:

[0096] When the encoding dictionary match does not include the current element, construct the encoding symbol of the current element and put it into the encoding dictionary to update the encoding dictionary;

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

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

[0099] Send the compressed data to the target device for storage via WiFi data frames; or,

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

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

[0102] Responding to a log reading instruction of the host device, obtaining compressed data from the target device;

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

[0104] As described above, by generating compressed data based on the coder and the position and number of occurrences of the element corresponding to the coder when generating compressed data, it is not necessary to compress each element separately, so that the work log can be further compressed and the memory usage can be reduced. In addition, when the amount of cached data in the log cache reaches a set threshold, the application sends the compressed data to the target device for storage, which can ensure the normal storage of the work log on the one hand, and on the other hand, it can also avoid the work log from occupying too much device memory, ensure the stability of the WiFi device, and realize the stable preservation of the work log of the miniaturized WiFi device.

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

[0106] The present application embodiment 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 in the work log processing device can be one or more, 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 through a bus or other methods.

[0107] As a computer-readable storage medium, the memory can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the work log processing method described in any embodiment of the present application (for example, the query module, compression module and storage module in the work log processing device). The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination 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 the software programs, instructions and modules stored in the memory, that is, implements the above-mentioned work log processing method.

[0110] The input device can be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device can include display devices such as display screens.

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

[0112] The embodiment of the present application also provides a storage medium including computer executable instructions, which are used to execute a work log processing method when executed by a computer processor, the work log processing method comprising: obtaining a work log generated in real time, the work log comprising multiple elements; querying a pre-built coding dictionary to determine the coding symbol corresponding to each of the multiple elements, the coding dictionary comprising a one-to-one correspondence between elements and coding symbols; determining the position and number of occurrences of each element in the work log, and generating compressed data based on the determined position, number of occurrences, and corresponding coding symbol; saving the compressed data to a log cache, and when the amount of cached data in the log cache reaches a set threshold, sequentially extracting the compressed data from the log cache, and sending the compressed data to a target device for storage, the target device being pre-synchronized with the coding dictionary. .

[0113] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; 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 (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is 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" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0114] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the work log processing method described above, can also execute related operations in the work log processing method provided in any embodiment of the present application.

[0115] An embodiment of the present application also provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the work log processing method as described above.

[0116] The above are only preferred embodiments of the present application and the technical principles used. The present 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 deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

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

2. The work log processing method according to claim 1, characterized in that: The method further comprises: According to the ASCII code and the preset log element, a coder corresponding to the preset log element is constructed.

3. The work log processing method according to claim 1, characterized in that: The method further comprises: If the coding dictionary does not include the current element, construct a coding symbol of the current element and put it into the coding dictionary to update the coding dictionary; The updated encoding dictionary is synchronized to the target device.

4. The work log processing method according to claim 1, characterized in that: The step of sending the compressed data to a target device for storage comprises: Send the compressed data to the target device for storage via a WiFi data frame; or, When a USB link connection with the target device is detected, the compressed data is sent to the target device for storage based on 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 method further includes: Responding to a log reading instruction of a host device, obtaining the compressed data from the target device; The obtained compressed data is decoded to obtain a 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: A query module, used to obtain a work log generated in real time, wherein the work log includes multiple elements; Querying a pre-built coding dictionary to determine a coding symbol corresponding to each of the plurality of elements, the coding dictionary including a one-to-one correspondence between elements and coding symbols; A compression module, used to determine the position and the number of occurrences of each element in the work log, and generate compressed data based on the determined position, the number of occurrences, and the corresponding code; The storage module is used to save the compressed data into 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 is pre-synchronized with the encoding dictionary.

7. The work log processing device according to claim 6, characterized in that: The device also includes a building block; The construction module is used to construct a coder corresponding to the preset log element according to 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 coding dictionary does not include the current element, construct a coding symbol of the current element and put it into the coding dictionary to update the coding dictionary; The updated encoding dictionary is 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: Send the compressed data to the target device for storage via a WiFi data frame; or, When a USB link connection with the target device is detected, the compressed data is sent to the target device for storage based on 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 used for: Responding to a log reading instruction of a host device, obtaining the compressed data from the target device; The obtained compressed data is decoded to obtain a 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 to 5.

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

Citation Information

Patent Citations

  • Log data recording method and apparatus

    CN106649735A

  • Log data processing method and device, electronic equipment and storage medium

    CN113886193A

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

    CN115438002A