A log message transmission method, device, equipment and medium for terminal equipment

By configuring the static and dynamic mapping tables of terminal devices, identifying and processing attributes in log files, the problem of low transmission efficiency of terminal device log content is solved, reducing the amount of data and improving transmission efficiency.

CN113672482BActive Publication Date: 2024-08-23SHENZHEN APEMAN INNOVATIONS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110908671.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2024-08-23
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

Due to the limited storage capacity and bandwidth of the network serial port, the log content generated during the operation of the terminal device results in low transmission efficiency of the log content.

Method used

By configuring the static mapping table and dynamic mapping table of the terminal device, the string attributes in the log file are identified, and the static attributes and dynamic attributes are transferred to the corresponding mapping tables respectively, thereby reducing the data volume of the log content and improving the transmission efficiency.

Benefits of technology

It effectively reduces the amount of data in the transmission process of the terminal device log content, reduces the storage and bandwidth requirements for the network serial port, improves the efficiency of log message transmission, and displays the operating data of the terminal device in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672482B
    Figure CN113672482B
Patent Text Reader

Abstract

The present application relates to the field of data transmission, and discloses a method, device, electronic device and storage medium for transmitting log messages of terminal devices, wherein the method comprises: collecting device information of the terminal device, identifying the information category of the device information, and configuring the static mapping table and dynamic mapping table of the terminal device according to the information category; querying the log file of the terminal device during operation; identifying the string attribute of each log content in the log file; when the string attribute is a dynamic attribute, transmitting the log content corresponding to the dynamic attribute to the dynamic mapping table to obtain a dynamic data table; when the string attribute is a static attribute, extracting the string parameter of the log content corresponding to the static attribute, transmitting the string parameter to the static mapping table to obtain a static data table; returning the log content in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation. The present application can improve the transmission efficiency of the log content of the terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to a log message transmission method and apparatus for a terminal device, an electronic device, and a computer-readable storage medium. Background Art

[0002] Terminal equipment refers to equipment that inputs programs and data into a computer or receives computer output processing results via communication facilities. At present, the log content generated by the terminal equipment during operation is usually returned to the terminal user through the network serial port. However, in actual business scenarios, the network serial port has very limited storage capacity and connection bandwidth in addition to supporting normal functions. This makes it difficult to support the transmission of log content of terminal equipment with large amounts of data, which leads to low efficiency in the transmission of log content of terminal equipment. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a log message transmission method, device, electronic device and computer-readable storage medium of a terminal device, which can reduce the amount of data in the log content of the terminal device during the transmission process and improve the log content transmission efficiency of the terminal device.

[0004] In a first aspect, the present application provides a log message transmission method of a terminal device, comprising:

[0005] Collecting device information of a terminal device, identifying information categories of the device information, and configuring a static mapping table and a dynamic mapping table of the terminal device according to the information categories;

[0006] Querying the log files of the terminal device during operation;

[0007] Identify the string attribute of each log content in the log file;

[0008] When the string attribute is a dynamic attribute, the log content corresponding to the dynamic attribute is transmitted to the dynamic mapping table to obtain a dynamic data table;

[0009] When the string attribute is a static attribute, extracting the string parameter of the log content corresponding to the static attribute, transferring the string parameter to the static mapping table, and obtaining a static data table;

[0010] The log contents in the static data table and the dynamic data table are returned to the front-end page to display the operation data of the terminal device during operation.

[0011] It can be seen that the embodiment of the present application firstly configures the static mapping table and the dynamic mapping table of the terminal device to obtain the storage location of the data generated by the subsequent terminal device during operation; secondly, the embodiment of the present application determines the storage method of each log content according to the string attribute of each log content in the log file generated by the terminal device during operation, and extracts the string attribute as the string parameter of the log content corresponding to the static attribute, so as to reduce the amount of data of the subsequent log content during transmission, thereby reducing the storage and bandwidth requirements of the network serial port in the device log message transmission, and improving the transmission efficiency of the device log message. Furthermore, the present application returns the log content in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation, so as to facilitate the user to view the device status of the terminal device during operation in real time. Therefore, the log message transmission method of a terminal device proposed in the embodiment of the present application can reduce the amount of data of the log content of the terminal device during transmission and improve the transmission efficiency of the log content of the terminal device.

[0012] In a possible implementation manner of the first aspect, the identifying the information category of the device information includes:

[0013] Acquire fields of the device information, and identify attributes of the device information according to the fields;

[0014] According to the attribute, an information category of the device information is identified, wherein the information category includes a static category and a dynamic category.

[0015] In a possible implementation manner of the first aspect, configuring the static mapping table and the dynamic mapping table of the terminal device according to the information category includes:

[0016] Collecting description information of the device information corresponding to the static category of the information category, constructing a static message identifier of the description information, and creating a static mapping table of the device information in the form of a key-value pair according to the description information and the static message identifier, wherein the static message number and the message character string are in a one-to-one correspondence;

[0017] A dynamic message identifier of the device information corresponding to the dynamic category is constructed, and a dynamic mapping table of the device information is created according to the dynamic message identifier.

[0018] In a possible implementation manner of the first aspect, after configuring the static mapping table and the dynamic mapping table of the device information according to the information category, the method further includes:

[0019] Obtaining a device identifier of a terminal device for obtaining the device information;

[0020] According to the device identification, the static mapping table and the dynamic mapping table are marked with identities, so that a corresponding relationship is established between the static mapping table and the dynamic mapping table and the terminal device of the device information.

[0021] In a possible implementation manner of the first aspect, querying a log file of the terminal device during operation includes:

[0022] In response to an operation of the terminal device, performing identity authentication on the terminal device;

[0023] When the identity authentication is successful, the operation data recorded by the terminal device during the operation is queried using a query statement to obtain the operation log file of the terminal device.

[0024] In a possible implementation manner of the first aspect, extracting the string parameter of the log content corresponding to the static attribute includes:

[0025] Query the content message identifier and operation parameters of the log content corresponding to the static attribute;

[0026] The content message identifier and the operating parameter are used as character string parameters of the log content corresponding to the static attribute.

[0027] In a possible implementation manner of the first aspect, transmitting the string parameter to the static mapping table to obtain a static data table includes:

[0028] Obtaining a content message identifier and an operation parameter in the string parameter, and matching the content message identifier with a static message number in the static data table;

[0029] Query the description information in the static message number that matches successfully;

[0030] According to the operating parameters corresponding to the content message identifier, the parameter placeholders in the description information are updated to obtain a static data table.

[0031] In a second aspect, the present application provides a log message transmission device of a terminal device, and the device is applied to a server and includes:

[0032] A mapping table configuration module, used to collect device information of a terminal device, identify the information category of the device information, and configure a static mapping table and a dynamic mapping table of the terminal device according to the information category;

[0033] A file query module, used to query the log files of the terminal device during operation;

[0034] An attribute recognition module, used to recognize the character string attribute of each log content in the log file;

[0035] A data transmission module, used for transmitting the log content corresponding to the dynamic attribute to the dynamic mapping table to obtain a dynamic data table when the string attribute is a dynamic attribute;

[0036] The data transmission module is further used to extract the string parameter of the log content corresponding to the static attribute when the string attribute is a static attribute, and transmit the string parameter to the static mapping table to obtain a static data table;

[0037] The data display module is used to return the log contents in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation.

[0038] In a third aspect, the present application provides an electronic device, including:

[0039] at least one processor; and a memory communicatively coupled to the at least one processor;

[0040] The memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the log message transmission method of the terminal device as described in any one of the first aspects above.

[0041] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a log message transmission method for a terminal device as described in any one of the first aspects above.

[0042] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A schematic diagram of a flow chart of a log message transmission method of a terminal device provided in one embodiment of the present application;

[0046] Figure 2 In one embodiment of this application Figure 1A flowchart of one of the steps of a log message transmission method for a terminal device is provided;

[0047] Figure 3 A module schematic diagram of a log message transmission device of a terminal device provided in one embodiment of the present application;

[0048] Figure 4 A schematic diagram of the internal structure of an electronic device for implementing a log message transmission method of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0050] See also Figure 1 FIG. 1 is a flow chart of a log message transmission method of a terminal device provided in an embodiment of the present application. Figure 1 The log message transmission method of the terminal device described in is applied to the server, including:

[0051] S1. Collect device information of a terminal device, identify the information category of the device information, and configure a static mapping table and a dynamic mapping table of the terminal device according to the information category.

[0052] In the embodiment of the present application, the terminal device can be understood as a device that inputs programs and data into a computer via communication facilities, and or receives computer output processing results, such as smart home terminals, smart conference desktop terminals, and financial smart terminals, and the device information refers to data describing the terminal device, such as identification information, function information, and performance information of the terminal device. Among them, the identification information refers to the device identification data describing the terminal device, such as the device ID, the function information refers to the data describing the functions included in the terminal device, such as the data of the smart positioning function, and the performance data refers to the data describing the hardware included in the terminal device, such as the processor model, memory size, etc.

[0053] Furthermore, the embodiment of the present application identifies the information attributes of the device information to obtain which data generated by the terminal device during operation does not require description information and which data does require description information. The description information refers to the annotation information of the data generated by the terminal device during operation. For example, if the data generated by the terminal device during operation includes: length 1.4m, height 1.5m and width 1.2m, the length, height and width are the description information.

[0054] As an embodiment of the present application, the identifying the information category of the device information includes: obtaining the field of the device information, identifying the attribute of the device information based on the field, and identifying the information category of the device information based on the attribute, wherein the information category includes a static category and a dynamic category.

[0055] Among them, the field refers to the identifier of each column in a two-dimensional table with a relational model as the data structure. For example, in time series data, the field can be time, and the attribute is used to characterize the data type of the data in the time series data. For example, the attribute of the time field can be a description of the time data generated in the time field.

[0056] Furthermore, in an embodiment of the present application, the static category can be understood as the device information generated by the terminal device during operation is fixed, or some fixed parts of the device information can be changed, but after the parameterized description of these changing parts, the parameters themselves can fully describe the category of the changing content. For example, for a smart home terminal, the welcome data (such as Hello, welcome, etc.) that appears during operation. Since these welcome data are fixed, the category of the welcome data can be used as a static category. For example, the time data (such as time: 11.30am) that appears during the operation of the smart home terminal. If the description information of the time data is deleted and the data of 11.30am appears directly, it does not affect the information description of the time term. Therefore, the category of the time data can also be used as a static category.

[0057] Furthermore, in an embodiment of the present application, the dynamic category is used to characterize string content that cannot be fully or partially determined before actual operation, such as a string returned from a network interface, or a string that references other strings, similar to the %s placeholder of printf in the C language, such as "hello, %s, name", where name is a reference to other strings. Providing only the value of name cannot restore the string it actually points to, and the string pointed to by name must be provided at the same time to finally parse and restore.

[0058] Furthermore, the present application configures a static mapping table and a dynamic mapping table of the device information according to the information category, wherein the static mapping table and the dynamic mapping table are used to determine the storage location and storage method of the data generated by the subsequent terminal device during operation.

[0059] As an embodiment of the present application, see Figure 2 As shown, configuring the static mapping table and the dynamic mapping table of the terminal device according to the information category includes:

[0060] S201, collecting description information of the device information corresponding to the static category of the information category, constructing a static message identifier of the description information, and creating a static mapping table of the device information in the form of a key-value pair according to the description information and the static message identifier, wherein the static message number and the message string are in a one-to-one correspondence;

[0061] S202: Construct a dynamic message identifier of the device information corresponding to the dynamic category, and create a dynamic mapping table of the device information according to the dynamic message identifier.

[0062] Among them, the static message identifier can be understood as the ID of the description information, which is used to characterize the identity information of the description information. It should be noted that in different business scenarios, there will be multiple description fields in a description information to form a more specific device information description content. There will be a parameter placeholder in each description field to store the specific parameters generated by the subsequent terminal device during operation. It should be understood that the log message corresponding to the dynamic category is in a state of change, so when constructing the dynamic mapping table, you only need to create a dynamic message identifier for the device information.

[0063] Optionally, the construction of the static message identifier and the dynamic message identifier may be implemented by a self-increasing sequence algorithm.

[0064] Furthermore, in order to avoid changes in device information during the upgrade and maintenance of terminal devices, the embodiment of the present application, after configuring the static mapping table and the dynamic mapping table of the device information according to the information category, also includes: obtaining the device identification of the terminal device of the device information, and according to the device identification, identity marking the static mapping table and the dynamic mapping table to establish a correspondence between the static mapping table and the dynamic mapping table and the terminal device of the device information, wherein the device identification includes the device version number + device UUID.

[0065] S2. Query the log file of the terminal device during operation.

[0066] In the embodiment of the present application, the operation of the terminal device can be triggered by a trigger instruction, and the trigger instruction can be a switch instruction of the terminal device. The log file refers to the operation data generated by the terminal device during operation, which includes function data, performance data, etc. As an embodiment of the present application, the query of the log file of the terminal device during operation includes: in response to the operation operation of the terminal device, authenticating the terminal device, and when the authentication is successful, querying the operation data recorded by the terminal device during the operation process using a query statement to obtain the log file of the terminal device.

[0067] The identity authentication of the terminal device is used to identify whether the terminal device has established a network connection with its corresponding server, and to ensure the security of subsequent data interaction between the terminal device and its corresponding server. Optionally, the identity authentication of the terminal device can be performed by querying whether the device identification of the terminal device has been pre-registered in the server corresponding to the terminal device. If the device identification of the terminal device has not been pre-registered, the identity authentication of the terminal device fails. If the device identification of the terminal device has been pre-registered, the identity authentication of the terminal device succeeds.

[0068] Furthermore, in an optional embodiment of the present application, the query statement may be a SQL statement, such as a select statement.

[0069] It should be noted that the operation data generated during the operation of the terminal device can be recorded by a log generation script of the terminal device, and the log generation script can be compiled by JavaScript scripting language.

[0070] S3. Identify the character string attribute of each log content in the operation log file.

[0071] In an embodiment of the present application, the character string attribute of each log content in the operation log file is identified to identify the subsequent transmission mode of each log content. The character string attribute is used to characterize the content form of the corresponding log content, that is, to determine whether the log content is static content or dynamic content, which includes static attributes and dynamic attributes. Optionally, the character string attribute can be determined by the content category of the log content. The method for identifying the content category of the log content can refer to the method for identifying the information category of the device information in S1 above, which will not be further elaborated here.

[0072] S4. When the character string attribute is a dynamic attribute, the log content corresponding to the dynamic attribute is transmitted to the dynamic mapping table to obtain a dynamic data table.

[0073] It should be understood that when the string attribute is a dynamic attribute, it means that the log content corresponding to the string attribute is dynamic content, that is, the log content requires description information to clearly understand the meaning expressed by the log content, such as "xiaoming, welcome". Therefore, the embodiment of the present application transmits the log content corresponding to the dynamic attribute to the dynamic mapping table to transmit the operating data of the terminal device to the front-end page for user access.

[0074] Optionally, the transmission of the log content corresponding to the dynamic attribute can be performed based on the identifier of the log content, that is, matching the identifier of the log content with the dynamic message identifier in the dynamic data table, and transmitting the log content corresponding to the successfully matched identifier to the character string of the dynamic message identifier to obtain the dynamic data table.

[0075] S5. When the string attribute is a static attribute, extract the string parameter of the log content corresponding to the static attribute, and transfer the string parameter to the static mapping table to obtain a static data table.

[0076] It should be understood that when the string attribute is a static attribute, it means that the log content corresponding to the string attribute is static content, that is, the meaning expressed by the log content can be clearly understood without descriptive information, such as "hello world". Therefore, the embodiment of the present application extracts the string parameters of the log content corresponding to the static attribute to reduce the amount of data of the subsequent log content during the transmission process, thereby reducing the storage and bandwidth requirements of the network serial port in the device log message transmission, and improving the transmission efficiency of the device log message.

[0077] As an embodiment of the present application, extracting the string parameters of the log content corresponding to the static attribute includes: querying the content message identifier and the operating parameters of the log content corresponding to the static attribute, and using the content message identifier and the operating parameters as the string parameters of the log content corresponding to the static attribute.

[0078] The content message identifier is used to characterize the content identity of the log content, and the operation parameter refers to specific data generated by the terminal device during operation.

[0079] Furthermore, the embodiment of the present application transmits the string parameter to the static mapping table to transmit the operation data of the terminal device to the front-end page for easy reference by user personnel.

[0080] As an embodiment of the present application, the string parameter is transmitted to the static mapping table to obtain a static data table, including: obtaining a content message identifier and an operating parameter in the string parameter, matching the content message identifier with a static message number in the static data table, querying the description information in the successfully matched static message number, and updating the parameter placeholder in the description information according to the operating parameter corresponding to the content message identifier to obtain a static data table.

[0081] Exemplarily, there is a string parameter of "0001+0x12345674, 123, A, B", where 0001 represents the content message identifier of the log content, and "0x12345674, 123, A, B" represents the operating parameters of the log content. The description information that successfully matches the content message identifier in the static data table is queried as "Buffer%p length%d content%c,%c". According to the operating parameters, the parameter placeholder of the description information is updated to obtain "Buffer 0x12345674, length 123, content A, B".

[0082] S6. Return the log contents in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation.

[0083] The embodiment of the present application returns the log contents in the static data table and the dynamic data table to the front-end page to display the operating data of the terminal device during operation, so that the user can view the device status of the terminal device during operation in real time, thereby facilitating the user to monitor the abnormal operation points of the terminal device and make rapid warnings.

[0084] Optionally, the log contents in the static data table and the dynamic data table may be returned via a file transfer protocol, and the file transfer protocol may be an http / https protocol.

[0085] It can be seen that the embodiment of the present application firstly configures the static mapping table and the dynamic mapping table of the terminal device to obtain the storage location of the data generated by the subsequent terminal device during operation; secondly, the embodiment of the present application determines the storage method of each log content according to the string attribute of each log content in the log file generated by the terminal device during operation, and extracts the string attribute as the string parameter of the log content corresponding to the static attribute, so as to reduce the amount of data of the subsequent log content during transmission, thereby reducing the storage and bandwidth requirements of the network serial port in the device log message transmission, and improving the transmission efficiency of the device log message. Furthermore, the present application returns the log content in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation, so as to facilitate the user to view the device status of the terminal device during operation in real time. Therefore, the log message transmission method of a terminal device proposed in the embodiment of the present application can reduce the amount of data of the log content of the terminal device during transmission and improve the transmission efficiency of the log content of the terminal device.

[0086] like Figure 3 The figure shows a functional module diagram of the log message transmission device of the terminal device of the present application.

[0087] The log message transmission device 300 of the terminal device described in the present application can be installed in an electronic device. According to the functions implemented, the log message transmission device of the terminal device may include a mapping table configuration module 301, a file query module 302, an attribute identification module 303, a data transmission module 304 and a data display module 305. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0088] In this embodiment, the functions of each module / unit are as follows:

[0089] The mapping table configuration module 301 is used to collect device information of the terminal device, identify the information category of the device information, and configure the static mapping table and the dynamic mapping table of the terminal device according to the information category;

[0090] The file query module 302 is used to query the log file of the terminal device during operation;

[0091] The attribute identification module 303 is used to identify the string attribute of each log content in the log file;

[0092] The data transmission module 304 is used to transmit the log content corresponding to the dynamic attribute to the dynamic mapping table to obtain a dynamic data table when the string attribute is a dynamic attribute;

[0093] The data transmission module 304 is further used to extract the string parameter of the log content corresponding to the static attribute when the string attribute is a static attribute, and transmit the string parameter to the static mapping table to obtain a static data table;

[0094] The data display module 305 is used to return the log contents in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation.

[0095] In detail, each module in the log message transmission device 300 of the terminal device in the embodiment of the present application adopts the same method as above when used. Figure 1 and Figure 2 The log message transmission method of the terminal device described in the present invention has the same technical means and can produce the same technical effects, so it will not be repeated here.

[0096] like Figure 4 , which is a schematic diagram of the structure of an electronic device that implements the log message transmission method of a terminal device in the present application.

[0097] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a log message transmission program of a terminal device.

[0098] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 11 (for example, executing the log message transmission program of the terminal device, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0099] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the log message transmission program of the terminal device, but also can be used to temporarily store data that has been output or is to be output.

[0100] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0101] The communication interface 13 is used for communication between the above-mentioned electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices 1. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0102] Figure 3 Only the electronic device 1 having components is shown, and those skilled in the art can understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0103] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0104] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0105] The log message transmission program of the terminal device stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can achieve:

[0106] Collecting device information of a terminal device, identifying information categories of the device information, and configuring a static mapping table and a dynamic mapping table of the terminal device according to the information categories;

[0107] Querying the log files of the terminal device during operation;

[0108] Identify the string attribute of each log content in the log file;

[0109] When the string attribute is a dynamic attribute, the log content corresponding to the dynamic attribute is transmitted to the dynamic mapping table to obtain a dynamic data table;

[0110] When the string attribute is a static attribute, extracting the string parameter of the log content corresponding to the static attribute, transferring the string parameter to the static mapping table, and obtaining a static data table;

[0111] The log contents in the static data table and the dynamic data table are returned to the front-end page to display the operation data of the terminal device during operation.

[0112] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0113] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0114] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of the electronic device 1, the computer program can implement:

[0115] Collecting device information of a terminal device, identifying information categories of the device information, and configuring a static mapping table and a dynamic mapping table of the terminal device according to the information categories;

[0116] Querying the log files of the terminal device during operation;

[0117] Identify the string attribute of each log content in the log file;

[0118] When the string attribute is a dynamic attribute, the log content corresponding to the dynamic attribute is transmitted to the dynamic mapping table to obtain a dynamic data table;

[0119] When the string attribute is a static attribute, extracting the string parameter of the log content corresponding to the static attribute, transferring the string parameter to the static mapping table, and obtaining a static data table;

[0120] The log contents in the static data table and the dynamic data table are returned to the front-end page to display the operation data of the terminal device during operation.

[0121] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0122] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0124] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application.

[0125] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present application is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0126] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A log message transmission method for a terminal device, characterized in that: The method is applied to the server and includes: Collecting device information of a terminal device, identifying information categories of the device information, and configuring a static mapping table and a dynamic mapping table of the terminal device according to the information categories; Querying the log files of the terminal device during operation; Identify the string attribute of each log content in the log file; When the string attribute is a dynamic attribute, the log content corresponding to the dynamic attribute is transmitted to the dynamic mapping table to obtain a dynamic data table; When the string attribute is a static attribute, query the content message identifier and the operation parameters of the log content corresponding to the static attribute; Using the content message identifier and the operation parameter as a string parameter of the log content corresponding to the static attribute; Obtaining a content message identifier and an operation parameter in the string parameter, and matching the content message identifier with a static message number in the static mapping table; Query the description information in the static message number that matches successfully; According to the operation parameters corresponding to the content message identifier, the parameter placeholder in the description information is updated to obtain a static data table; The log contents in the static data table and the dynamic data table are returned to the front-end page to display the operation data of the terminal device during operation.

2. The log message transmission method of a terminal device according to claim 1, characterized in that: The information category for identifying the device information includes: Acquire fields of the device information, and identify attributes of the device information according to the fields; According to the attribute, an information category of the device information is identified, wherein the information category includes a static category and a dynamic category.

3. The log message transmission method of a terminal device according to claim 1, characterized in that: The configuring the static mapping table and the dynamic mapping table of the terminal device according to the information category includes: Collecting description information of the device information corresponding to the static category of the information category, constructing a static message identifier of the description information, and creating a static mapping table of the device information in the form of a key-value pair according to the description information and the static message identifier, wherein the static message number and the message string are in a one-to-one correspondence; A dynamic message identifier of the device information corresponding to the dynamic category is constructed, and a dynamic mapping table of the device information is created according to the dynamic message identifier.

4. The log message transmission method of a terminal device according to claim 1, characterized in that: After configuring the static mapping table and the dynamic mapping table of the device information according to the information category, the method further includes: Obtaining a device identifier of a terminal device for obtaining the device information; According to the device identification, the static mapping table and the dynamic mapping table are marked with identities, so that a corresponding relationship is established between the static mapping table and the dynamic mapping table and the terminal device of the device information.

5. The log message transmission method of a terminal device according to claim 1, characterized in that: The querying of the log file of the terminal device during operation includes: In response to an operation of the terminal device, performing identity authentication on the terminal device; When the identity authentication is successful, the operation data recorded by the terminal device during the operation is queried using a query statement to obtain the operation log file of the terminal device.

6. A log message transmission device for a terminal device, characterized in that: The device is applied to the server and includes: A mapping table configuration module, used to collect device information of a terminal device, identify the information category of the device information, and configure a static mapping table and a dynamic mapping table of the terminal device according to the information category; A file query module, used to query the log files of the terminal device during operation; An attribute recognition module, used to recognize the character string attribute of each log content in the log file; A data transmission module, used for transmitting the log content corresponding to the dynamic attribute to the dynamic mapping table to obtain a dynamic data table when the string attribute is a dynamic attribute; The data transmission module is further used to query the content message identifier and operation parameters of the log content corresponding to the static attribute when the string attribute is a static attribute; use the content message identifier and the operation parameters as the string parameters of the log content corresponding to the static attribute; obtain the content message identifier and the operation parameters in the string parameters, match the content message identifier with the static message number in the static mapping table; query the description information in the static message number that successfully matches; update the parameter placeholder in the description information according to the operation parameters corresponding to the content message identifier, and obtain a static data table; The data display module is used to return the log contents in the static data table and the dynamic data table to the front-end page to display the operation data of the terminal device during operation.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log message transmission method of the terminal device as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the log message transmission method of a terminal device as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Diary record system and method

    CN101178709A

  • NOR-FLASH data storage method, computer device and storage medium

    CN110175001A

  • Log analysis rule generation method

    CN110795606A

  • Data secret transmission method and system based on cloud platform

    CN111865895A

  • Dynamic character encoding

    US20090315744A1