CN114124679A - Internet of things terminal log uploading method and device and internet of things terminal - Google Patents

Internet of things terminal log uploading method and device and internet of things terminal Download PDF

Info

Publication number
CN114124679A
CN114124679A CN202111033842.3A CN202111033842A CN114124679A CN 114124679 A CN114124679 A CN 114124679A CN 202111033842 A CN202111033842 A CN 202111033842A CN 114124679 A CN114124679 A CN 114124679A
Authority
CN
China
Prior art keywords
target
log
internet
uploading
things
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111033842.3A
Other languages
Chinese (zh)
Inventor
林学春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Neoway Technology Co Ltd
Original Assignee
Shenzhen Neoway Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Neoway Technology Co Ltd filed Critical Shenzhen Neoway Technology Co Ltd
Priority to CN202111033842.3A priority Critical patent/CN114124679A/en
Publication of CN114124679A publication Critical patent/CN114124679A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y10/00Economic sectors
    • G16Y10/75Information technology; Communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Abstract

The application relates to an Internet of things terminal log uploading method and device, an Internet of things terminal and a storage medium. The method comprises the following steps: acquiring a log acquisition instruction, and analyzing the log acquisition instruction to obtain a target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things. Therefore, technicians can obtain the target log of the Internet of things terminal through the remote server, the problem of the Internet of things terminal can be timely reproduced, the reproduced problem is effectively analyzed, the speed of solving the fault of the Internet of things terminal is increased, and the processing efficiency is greatly improved.

Description

Internet of things terminal log uploading method and device and internet of things terminal
Technical Field
The application relates to the technical field of internet of things, in particular to an uploading method and device of an internet of things terminal log, an internet of things terminal and a storage medium.
Background
With the development of the technology of the internet of things and edge computing, more and more internet of things terminals are formed by a microcontroller and a cellular communication module. The microcontroller is used as a master control, the cellular communication module provides a transparent transmission channel, and is connected with the microcontroller through a serial port, so that the access capability of a cellular network is improved for the microcontroller. The internet of things terminal can be an OBD (On Board Diagnostics, vehicle automatic diagnosis) box, a vehicle event data recorder and the like.
Since the terminals of the internet of things are often deployed in remote areas or in different places or even in regions across countries, most of the terminals are in an unattended state. When the compatibility or the stability problem of field application appears at the thing networking terminal, technical staff can't go to the on-the-spot solution problem in time, consequently, need to send back the thing networking terminal that appears the problem to must reproduce the problem that appears. Therefore, when the fault of the terminal of the Internet of things is solved, the problem of low processing efficiency exists.
Disclosure of Invention
Based on this, it is necessary to provide a method and an apparatus for uploading a log of an internet of things terminal, the internet of things terminal, and a storage medium for solving the above technical problems.
An uploading method of terminal logs of the Internet of things comprises the following steps:
acquiring a log acquisition instruction, and analyzing the log acquisition instruction to obtain a target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things.
In one embodiment, the internet of things terminal comprises a microcontroller, a software real-time operating system runs in the microcontroller, a plurality of software tasks and log recording tasks are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the log recording tasks.
In one embodiment, the analyzing the log collection instruction to obtain a target task identifier includes:
uploading parameters respectively corresponding to the task identifications are determined from the log acquisition instruction; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
In one embodiment, the method further comprises:
and if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier.
In one embodiment, the method further comprises:
determining whether the current network signal meets a dialing condition; determining whether a target log is stored in the current target storage area; determining whether a current communication module is in an idle state; determining whether the current time of the microcontroller is consistent with the network time of the communication module; when the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
In one embodiment, the method further comprises:
if the current state does not meet the uploading condition, determining the current erasing times of the memory; if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log; and if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
In one embodiment, if the current erase count is smaller than the erase count threshold, the step of collecting and storing the target log is continued, including:
if the current erasing times are smaller than the erasing times threshold, judging whether a new log acquisition instruction is received; if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution; and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
An uploading device of terminal logs of the internet of things, the device comprising:
the analysis module is used for acquiring a log acquisition instruction and analyzing the log acquisition instruction to obtain a target task identifier;
the acquisition module is used for determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the Internet of things and acquiring a target log corresponding to the target software task;
the storage module is used for storing the target log to a target storage area in the terminal of the Internet of things;
and the uploading module is used for uploading the target log to a remote server from a target storage area if the current state meets the log uploading condition so as to remotely analyze the running state of the terminal of the Internet of things.
The terminal of the Internet of things comprises a memory and a microcontroller, wherein the memory stores a computer program, and the microcontroller executes the computer program to realize the uploading method of any log of the terminal of the Internet of things.
A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method for uploading the terminal log of the internet of things as described above.
According to the method and the device for uploading the log of the Internet of things terminal, the Internet of things terminal and the storage medium, the log acquisition instruction is obtained, and the log acquisition instruction is analyzed to obtain the target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things. Therefore, technicians can obtain the target log of the terminal of the Internet of things by accessing the remote server, and time cost is greatly saved. Meanwhile, the problem of the Internet of things terminal can be timely reproduced based on the target log acquired by the remote server, and the reproduced problem is effectively analyzed, so that the speed of solving the fault of the Internet of things terminal is increased, and the processing efficiency is greatly improved.
Drawings
Fig. 1 is an application environment diagram of an uploading method of a terminal log of the internet of things in one embodiment;
fig. 2 is a schematic flow chart illustrating an uploading method of a terminal log of the internet of things in one embodiment;
FIG. 3 is a diagram of a software real-time operating system in one embodiment;
fig. 4 is a schematic structural diagram of an internet of things terminal in one embodiment;
fig. 5 is a schematic flowchart of an uploading method of a terminal log of the internet of things in another embodiment;
fig. 6 is a block diagram illustrating a structure of an apparatus for uploading a log of a terminal of the internet of things according to an embodiment;
fig. 7 is an internal structure diagram of the terminal of the internet of things in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for uploading the terminal logs of the internet of things can be applied to the application environment shown in fig. 1. The internet of things terminal 102 and the remote server 104 communicate with each other through a network. The internet of things terminal 102 acquires a log acquisition instruction, and analyzes the log acquisition instruction to obtain a target task identifier; the internet of things terminal 102 determines a target software task corresponding to the target task identifier from a plurality of software tasks executed in the internet of things terminal, and collects a target log corresponding to the target software task; the internet of things terminal 102 stores the target log into a target storage area in the internet of things terminal; if the current state of the internet of things terminal 102 meets the log uploading condition, the target log is uploaded to the remote server 104 from the target storage area. The internet of things terminal 102 may be composed of a microcontroller and a communication module, and the remote server 104 may be implemented by an independent server or a server cluster composed of a plurality of servers.
In an embodiment, as shown in fig. 2, an uploading method of an internet of things terminal log is provided, which is described by taking the application of the method to the internet of things terminal in fig. 1 as an example, and includes the following steps:
step S202, a log collection instruction is obtained, and the log collection instruction is analyzed to obtain a target task identifier.
The log acquisition instruction is an instruction for instructing the Internet of things terminal to acquire the software task. The task identifier is used for distinguishing each software task, and each software task corresponds to software operated by the terminal of the internet of things.
Specifically, the remote server issues a log acquisition instruction to the internet of things terminal, and the internet of things terminal acquires the log acquisition instruction. The Internet of things terminal analyzes the log collection instruction to obtain task identifications corresponding to the software tasks, and screens the task identifications to obtain target task identifications. For example, the remote server issues a log acquisition instruction to the internet of things terminal, and the internet of things terminal acquires the log acquisition instruction. The internet of things terminal analyzes the log acquisition instruction to obtain Task identifiers, for example, the Task identifiers are Task1, Task2, Task … … and Task8 respectively. And screening each Task identifier to obtain a target Task identifier corresponding to the acquisition instruction, for example, the target Task identifiers are Task1 and Task 2.
It should be noted that the internet of things terminal logs to be collected in the present application are collected on the premise of authorization by the user owning the ownership of the internet of things terminal or the related user. For example, the log collection instruction obtained by the terminal of the internet of things is generated and sent to the terminal of the internet of things after the remote terminal receives the authorization or confirmation instruction of the user.
Step S204, determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the Internet of things, and collecting a target log corresponding to the target software task.
The log (log) refers to a collection of some operations of the objects specified by the system and operation results thereof in order according to time, and the log file is a log file which records information of interaction between the system and users of the system, and the log file can be a text file.
Specifically, from a plurality of software tasks executed in the terminal of the internet of things, the terminal of the internet of things determines a target software task corresponding to a target task identifier based on the target task identifier. And the terminal of the Internet of things acquires a target log corresponding to the target software task based on the target software task.
For example, the terminal of the internet of things runs 8 tasks (for example, software tasks a and … … and software task H) of certain software. Each software Task corresponds to a Task identifier one by one, for example, the Task identifiers Task1 and … … corresponding to the software Task a and the Task identifier Task8 corresponding to the software Task H. The terminal of the internet of things obtains target Task identifiers of Task1 and Task2, and determines target software tasks corresponding to the target Task identifiers based on the corresponding relation between the Task of each software and the Task identifier, namely the target software tasks are respectively a Task corresponding to the software Task A and a Task corresponding to the software Task B. And the terminal of the Internet of things collects target logs corresponding to the target software task, namely a target log a corresponding to the software task A and a target log B corresponding to the software task B.
And step S206, storing the target log to a target storage area in the terminal of the Internet of things.
Specifically, the terminal of the internet of things determines a target storage area, and stores the target log to the target storage area in the terminal of the internet of things based on the acquired target log.
In one embodiment, the terminal of the internet of things designates a storage area as a target storage area, and stores a target log to the target storage area in the terminal of the internet of things based on the acquired target log.
In one embodiment, the terminal of the internet of things uses an area which is not stored in the storage area as a target storage area, and stores a target log into the target storage area in the terminal of the internet of things based on the collected target log.
And step S208, if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server for remote analysis of the running state of the terminal of the Internet of things.
The current state is at least one of a current network signal state, a current storage state, a current service processing state, a current time state and the like.
Specifically, based on the current network signal state, the storage state, the service processing state and the time state, the terminal of the internet of things determines the current state. And if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server.
The method for uploading the terminal logs of the Internet of things acquires the log acquisition instruction, and analyzes the log acquisition instruction to obtain the target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things. Therefore, technicians can obtain the target log of the terminal of the Internet of things by accessing the remote server, and time cost is greatly saved. Meanwhile, the problem of the Internet of things terminal can be timely reproduced based on the target log acquired by the remote server, and the reproduced problem is effectively analyzed, so that the speed of solving the fault of the Internet of things terminal is increased, and the processing efficiency is greatly improved.
In one embodiment, the terminal of the internet of things comprises a microcontroller, wherein a software real-time operating system runs in the microcontroller, a plurality of software tasks and log recording tasks are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the log recording tasks.
Among them, the Real-time operating system (RTOS) is an instant operating system, and the system can run and manage system resources according to the sequence and provide a consistent basis for developing application programs. The software real-time operating system is used for creating multitasking operation.
Specifically, a microcontroller in the terminal of the internet of things runs a software real-time operating system, and a plurality of software tasks corresponding to the running software and log recording tasks are pre-deployed in the software real-time operating system. Wherein the logging task is not run by default. When the microcontroller acquires the log acquisition instruction, the microcontroller controls the on-off condition of the corresponding software function based on the log acquisition instruction. And in the running process of the microcontroller, the microcontroller analyzes the log acquisition instruction through the log recording task to obtain a target task identifier. And determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the microcontroller, and collecting a target log corresponding to the target software task. And the microcontroller stores the target log into a target storage area in the terminal of the Internet of things.
Such as a software real-time operating system as shown in fig. 3. And a microcontroller in the terminal of the Internet of things runs a software real-time operating system, and N software tasks corresponding to the running software and log recording tasks are pre-deployed in the software real-time operating system. Wherein the logging task is not run by default. When the microcontroller acquires the log acquisition instruction, the microcontroller controls the on-off condition of the corresponding software function based on the log acquisition instruction. And in the running process of the microcontroller, the microcontroller analyzes the log acquisition instruction to obtain task identifiers corresponding to the software tasks, and screens the task identifiers to obtain target task identifiers. And the microcontroller determines a target software task corresponding to the target task identifier based on the target task identifier. And collecting a target log corresponding to the target software task based on the target software task. And the microcontroller determines a target storage area and stores the target log to the target storage area in the terminal of the Internet of things based on the acquired target log.
In this embodiment, the internet of things terminal includes a microcontroller, and a real-time operating system based on software in the microcontroller can enable a log recording task to run independently to execute the steps of analyzing a log collection instruction, collecting a target log, and storing the target log. Therefore, the decoupling from other tasks can be realized, and the software transplantation is facilitated.
In one embodiment, the analyzing the log collection instruction to obtain the target task identifier includes: uploading parameters respectively corresponding to the task identifications are determined from the log acquisition instruction; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
Wherein the upload parameter may be a BYTE (BYTE) type or a WORD (WORD) type parameter. Taking byte as an example, it has 8 bits, each bit takes 1 or 0, i.e. bit value 1 is used to indicate that upload is enabled and bit value 0 is used to indicate that upload is closed.
Specifically, the internet of things terminal acquires a log acquisition instruction, and determines uploading parameters corresponding to each task identifier from the log acquisition instruction. And the Internet of things terminal judges uploading parameters respectively corresponding to each task identifier, and if the uploading parameters are characterized as enabled uploading parameters, the task identifiers corresponding to the enabled uploading parameters are determined as target task identifiers.
For example, the terminal of the internet of things obtains a log collection instruction, which is shown in table 1 below:
TABLE 1 Log Collection Instructions
Figure BDA0003246212500000081
Based on the log collection instruction, the terminal of the internet of things determines upload parameters respectively corresponding to each Task identifier from the log collection instruction, for example, RM, log of Task1 and Task2 are specified by LOGUP 0x03 (binary is 00000011B) to be collected, recorded and uploaded, and the upload parameters respectively corresponding to Task identifiers Task1 to Task8 are 1, 0, and 0. Wherein the bit value 1 is characterized to enable uploading, and the bit value 0 is characterized to close uploading. The Internet of things terminal judges uploading parameters corresponding to the Task identifications respectively, and determines that the tasks 1 and 2 enable the uploading, and the tasks 3 to 8 close the uploading. And if the uploading parameters are characterized as enabled uploading parameters, determining Task identifications Task1 and Task identifications Task2 corresponding to the enabled uploading parameters as target Task identifications.
In this embodiment, upload parameters respectively corresponding to each task identifier are determined from the log collection instruction; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier. Therefore, the target task identifier can be quickly and effectively screened out based on the uploading parameter. Therefore, the target log can be obtained based on the target task identifier, the correctness of the collected log is ensured, the technical personnel can quickly and accurately reproduce the problem, and the problem solving speed is greatly accelerated.
In one embodiment, the method further comprises: and if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier.
Wherein the upload parameter may be a BYTE (BYTE) type or a WORD (WORD) type parameter. Taking byte as an example, it has 8 bits, each bit takes 1 or 0, i.e. bit value 1 is used to indicate that upload is enabled and bit value 0 is used to indicate that upload is closed. Specifically, the terminal of the internet of things obtains a log collection instruction, and the log collection instruction can be shown in table 1. And determining uploading parameters respectively corresponding to the task identifications from the log acquisition instruction. The Internet of things terminal judges uploading parameters corresponding to the task identifiers respectively, if the uploading parameters are characterized as non-enabled uploading parameters, the task identifiers corresponding to the uploading parameters which are characterized as non-enabled are determined as non-target task identifiers, and collection of logs generated in the running process of software tasks corresponding to the non-target task identifiers is forbidden.
For example, the terminal of the internet of things acquires a log collection instruction, and determines, based on the log collection instruction, upload parameters respectively corresponding to each Task identifier from the log collection instruction, where the upload parameters respectively corresponding to the Task identifiers Task1 through Task8 are 1, 0, and 0. Wherein the bit value 1 is characterized to enable uploading, and the bit value 0 is characterized to close uploading. The Internet of things terminal judges uploading parameters corresponding to the Task identifications respectively, and determines that the tasks 1 and 2 enable the uploading, and the tasks 3 to 8 close the uploading. If the uploading parameters are characterized as the non-enabled uploading parameters, determining Task identifications Task3 to Task8 corresponding to the uploading parameters which are characterized as the non-enabled uploading parameters as non-target Task identifications, and forbidding collection of logs generated in the running process of the software tasks corresponding to the non-target Task identifications.
In this embodiment, if the upload parameter is characterized as the non-enabled upload parameter, determining the task identifier corresponding to the upload parameter characterized as the non-enabled upload parameter as the non-target task identifier, and prohibiting collecting a log generated in the running process of the software task corresponding to the non-target task identifier. Therefore, the non-target task identification can be rapidly determined based on the uploading parameters, and the collection of the logs corresponding to the non-target task identification can be prohibited in time, so that the correctness of the collected logs is ensured, the technical personnel can rapidly and accurately reproduce the problem, and the problem solving speed is greatly accelerated.
In one embodiment, the method further comprises the step of determining whether the current state meets a log uploading condition, wherein the step comprises: determining whether the current network signal meets a dialing condition; determining whether a target log is stored in the current target storage area; determining whether a current communication module is in an idle state; determining whether the current time of the microcontroller is consistent with the network time of the communication module; when the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
The communication module is a core component of the Internet of things equipment, converts data into a signal capable of being transmitted, and transmits the signal through a wireless network. The idle state of the communication module is that the original data service of the communication module is processed and completed. The original data service may be data that needs to be uploaded by the device, that is, internet of things sensing layer data such as GPS (Global Positioning System) position information, state data information, sensor data, and the like.
Specifically, the terminal of the internet of things acquires a current state, wherein the current state is determined by a current network signal state, a storage state, a service processing state and a time state, and the four states. The terminal of the internet of things determines whether each state meets the corresponding state judgment condition based on the corresponding state judgment condition of each state, namely the terminal of the internet of things determines whether the current network signal meets the dialing condition, determines whether the current target storage area stores the target log, determines whether the current communication module is in an idle state, and determines whether the current time of the microcontroller is consistent with the network time of the communication module. When the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition. The acquisition and storage of the target logs and the uploading of the target logs are carried out asynchronously, and when the internet of things terminal acquires and stores the target logs, if the current state meets the uploading condition, the stored target logs are uploaded to the remote server.
In order not to affect the logic of the original data service, the target log needs to be uploaded when the communication module is in an idle state, for example, when the microcontroller is in a pre-sleep stage, the original data service of the communication module is processed, and the communication module uploads the target log. The pre-dormancy stage is to complete the original data service logic of the microcontroller and prepare to enter the dormancy stage. Therefore, the influence of direct uploading of the target log on the service logic of the original service data can be avoided, and meanwhile, the problems of data loss or delay caused by insufficient throughput of uploaded data due to the increase of the target log can be effectively avoided. In addition, the microcontroller is timed based on the network time of the communication module, so that the recorded target log contains time information (e.g., date, hour, minute, second).
In this embodiment, it is determined whether the current network signal satisfies the dialing condition, it is determined whether the target log is stored in the current target storage area, it is determined whether the current communication module is in an idle state, and it is determined whether the current time of the microcontroller is consistent with the network time of the communication module. When the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition. Therefore, the target log containing the time information can be directly acquired from the target storage area, and under the condition that a network dialing data link is normal, the communication module accurately and efficiently uploads the target log to a remote server under the condition that original service data is not influenced, so that technicians can remotely acquire the target log, and the problem can be quickly and accurately solved.
In one embodiment, the method further comprises: if the current state does not meet the uploading condition, determining the current erasing times of the memory; if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log; and if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
The memory is a flash memory, belongs to one type of memory devices, and is a nonvolatile memory. The threshold number of erasures is the maximum number of times the memory can be cyclically erased. The erasing time threshold can be determined by estimating the erasing life and the product life of the flash in combination with the use times of the remote log.
Specifically, if at least one state in the current states does not satisfy the corresponding state judgment condition, it is determined that the current state does not satisfy the log uploading condition. And if the current state does not meet the log uploading condition, the terminal of the Internet of things determines the current erasing and writing times of the memory and compares the current erasing and writing times with the threshold value of the erasing and writing times. And if the current erasing times are smaller than the erasing times threshold, continuing the steps of collecting and storing the target log by the terminal of the Internet of things. And if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log by the terminal of the Internet of things, and uploading the target log to a remote server from a target storage area by the terminal of the Internet of things when a log uploading condition is met.
For example, the terminal of the internet of things acquires a current state, namely a current network signal state, a current storage state, a current service processing state and a current time state. And the terminal of the Internet of things determines whether each state meets the corresponding state judgment condition based on the state judgment condition corresponding to each state. And if at least one state in the current states does not meet the corresponding state judgment condition, determining that the current state does not meet the uploading condition, and determining that the current state does not meet the log uploading condition. And if the current state does not meet the log uploading condition, the terminal of the Internet of things determines the current erasing and writing times of the memory and compares the current erasing and writing times with the threshold value of the erasing and writing times. And if the current erasing times are smaller than the erasing times threshold, continuing the steps of collecting and storing the target log by the terminal of the Internet of things. If the target log a is fully stored in the target storage area at present but the target log a is not stored yet, the terminal of the internet of things uploads the target log a stored in the target area to the remote server, and erases the target storage area so as to store the remaining target log a which is not stored. If the current erasing times is larger than or equal to the erasing times threshold, the internet of things terminal stops collecting and storing the target log, waits for the current state to meet the log uploading condition, and uploads the target log to the remote server from the target storage area when the log uploading condition is met.
In this embodiment, if the current status does not satisfy the upload condition, the current erase/write count of the memory is determined. And if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log. And if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met. Therefore, in the process of waiting for reaching the log uploading condition, the target storage area of the memory can be maximally utilized based on the actual erasable condition of the memory, so that the target log can be maximally uploaded to the remote server, and the problem can be solved more efficiently by technicians.
In one embodiment, if the current erasing times is less than the erasing times threshold, the step of collecting and storing the target log is continued, including: if the current erasing times are smaller than the erasing times threshold, judging whether a new log acquisition instruction is received; if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution; and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
Specifically, if the current erasing times is smaller than the erasing times threshold, the internet of things terminal judges whether a new log collection instruction is received. And if a new log acquisition instruction is not received, the Internet of things terminal directly returns to the step of acquiring the target log corresponding to the target software task to continue execution, the acquired target log is stored in a target storage area in the Internet of things terminal, and the target log is uploaded to a remote server from the target storage area after the current state meets the log uploading condition. And if a new log acquisition instruction is received, the Internet of things terminal analyzes the new log acquisition instruction to obtain a new target task identifier. And the Internet of things terminal determines a new target software task from a plurality of software tasks executed by the Internet of things terminal based on the new target task identifier and collects a new target log corresponding to the target software task. And storing the new target log into a target storage area, and waiting for the current state to meet a log uploading condition so as to upload the new target log from the target storage area to a remote server.
For example, if the current erasing times is smaller than the erasing times threshold, the internet of things terminal determines whether a new log collection instruction is received. And if a new log collection instruction is not received, the Internet of things terminal directly returns to the step of collecting the target log corresponding to the target software task to continue execution, if the target software task is a software task A and a software task B. And the terminal of the Internet of things acquires a target log a corresponding to the software task A and a target log B corresponding to the software task B. And the Internet of things terminal stores the target log a and the target log b in a target storage area in the Internet of things terminal, and waits for the current state to meet a log uploading condition so as to upload the target log a and the target log b to a remote server. If a new log collection instruction is received, the internet of things terminal analyzes the new log collection instruction to obtain a new target Task identifier, for example, the new target Task identifier is Task1, and the Task identifier corresponds to the software Task a. And the Internet of things terminal determines a new target software task corresponding to the new task identifier, namely a software task A, through the new target task identifier. And the terminal of the Internet of things stops collecting the target log b corresponding to the previous log collecting instruction, and collects a new target log corresponding to the new target software task, namely a target log a. And storing the new target log into a target storage area, and waiting for the current state to meet a log uploading condition so as to upload the new target log from the target storage area to a remote server.
In this embodiment, if the current erasing frequency is smaller than the erasing frequency threshold, it is determined whether a new log collection instruction is received. And if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution. And if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier. In this way, the updated target log is collected and stored based on the update judgment of the log collection instruction. Therefore, the target log actually required by the technical staff can be flexibly acquired based on the real-time log acquisition requirement, and the problem processing speed of the technical staff can be increased.
To facilitate a clearer understanding of the technical solutions of the present application, a more detailed description of the embodiments is provided. Fig. 4 shows a structure diagram of the terminal of the internet of things. The internet of things terminal is composed of a Microcontroller (MCU) and a cellular communication module MODEM, wherein the Microcontroller comprises a memory Flash, the cellular communication module is used as a transparent transmission channel, and the Microcontroller is controlled through an AT (attention) instruction. The microcontroller operates a software real-time operating system, a plurality of software tasks and a log recording task are pre-deployed in the software real-time operating system, and the log recording task executes the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log. The logging task is not allowed by default, and the corresponding software task can be controlled to be opened or closed based on the log collection instruction.
The flowchart of the detailed embodiment is shown in fig. 5, where the remote server issues a log acquisition instruction to the terminal of the internet of things, and a communication module in the terminal of the internet of things receives the issued log acquisition instruction and transparently transmits the log acquisition instruction to a microcontroller of the terminal of the internet of things. And a microcontroller in the terminal of the Internet of things acquires a log acquisition instruction, and determines uploading parameters respectively corresponding to each task identifier from the log acquisition instruction. And the microcontroller judges the uploading parameters corresponding to the task identifications respectively. And if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier. And if the uploading parameters are characterized as enabled uploading parameters, determining the task identifiers corresponding to the enabled uploading parameters as target task identifiers. And determining a target software task corresponding to the target task identifier by a microcontroller in the terminal of the internet of things based on the target task identifier from a plurality of software tasks executed in the terminal of the internet of things. The microcontroller collects a target log corresponding to the target software task based on the target software task. And a microcontroller in the terminal of the Internet of things determines a target storage area, and stores the target log into the target storage area of a memory in the terminal of the Internet of things based on the acquired target log. A microcontroller in the terminal of the Internet of things acquires a current state, and the current state is determined by a current network signal state, a storage state, a service processing state and a time state. The microcontroller determines whether each state satisfies a corresponding state determination condition based on the state determination condition corresponding to each state. Namely, the microcontroller respectively determines whether the current network signal meets the dialing condition, determines whether the current target storage area stores the target log, determines whether the current communication module is in an idle state, and determines whether the time of the current microcontroller is consistent with the network time of the communication module.
And when at least one state in the current states does not meet the corresponding state judgment condition, determining that the current state does not meet the log uploading condition. And if the current state does not meet the log uploading condition, determining the current erasing and writing times of the memory by a microcontroller in the terminal of the Internet of things, and comparing the current erasing and writing times with the erasing and writing times threshold value. And if the current erasing times are smaller than the erasing times threshold, the microcontroller judges whether a new log acquisition instruction is received. And if a new log acquisition instruction is not received, the microcontroller in the terminal of the Internet of things directly returns to the step of acquiring the target log corresponding to the target software task to continue execution, the acquired target log is stored in a target storage area of a memory in the terminal of the Internet of things, and the target log is uploaded to a remote server from the target storage area after the current state meets a log uploading condition. And if a new log acquisition instruction is received, the microcontroller in the Internet of things terminal analyzes the new log acquisition instruction to obtain a new target task identifier. The microcontroller determines a new target software task from a plurality of software tasks executed by a software real-time operating system in the terminal of the internet of things based on the new target task identifier, and collects a new target log corresponding to the target software task. And storing the new target log into a target storage area, and waiting for the current state to meet a log uploading condition so as to upload the new target log from the target storage area to a remote server. And if the current erasing and writing times are larger than or equal to the erasing and writing time threshold, stopping the acquisition and storage of the target log by a microcontroller in the terminal of the Internet of things, and uploading the target log to a remote server from a target storage area by the microcontroller when a log uploading condition is met.
When the current network signal meets the dialing condition, a target log is stored in the current target storage area, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, the current state is determined to meet the log uploading condition, and the communication module uploads the target log to a remote server from the target storage area so as to perform remote analysis on the running state of the terminal of the internet of things.
In this embodiment, a log collection instruction is obtained, and the log collection instruction is analyzed to obtain a target task identifier. And determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task. And storing the target log to a target storage area in the terminal of the Internet of things. And if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things. Therefore, technicians can obtain the target log of the terminal of the Internet of things by accessing the remote server, and time cost is greatly saved. Meanwhile, the problem of the Internet of things terminal can be timely reproduced based on the target log acquired by the remote server, and the reproduced problem is effectively analyzed, so that the speed of solving the fault of the Internet of things terminal is increased, and the processing efficiency is greatly improved. In addition, by running the software real-time operating system at the terminal of the Internet of things, the log uploading task and other tasks can be decoupled, and the software is favorably transplanted.
It should be understood that although the steps in the flowcharts of fig. 2 and 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 6, there is provided an apparatus for uploading a terminal log of an internet of things, including: the system comprises a parsing module 602, an acquisition module 604, a storage module 606 and an uploading module 608, wherein:
and the analysis module 602 is configured to obtain a log acquisition instruction, and analyze the log acquisition instruction to obtain a target task identifier.
The collecting module 604 is configured to determine a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collect a target log corresponding to the target software task.
The storage module 606 is configured to store the target log in a target storage area in the terminal of the internet of things.
The uploading module 608 is configured to upload the target log from the target storage area to a remote server if the current state meets the log uploading condition, so as to perform remote analysis on the operation state of the internet of things terminal.
In one embodiment, the terminal of the internet of things comprises a microcontroller, wherein a software real-time operating system runs in the microcontroller, a plurality of software tasks and log recording tasks are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the log recording tasks.
In an embodiment, the parsing module 602 is configured to determine, from the log collection instruction, upload parameters respectively corresponding to the task identifiers; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
In an embodiment, the parsing module 602 is further configured to determine, if there is an upload parameter that is characterized as a non-enabled upload parameter, a task identifier corresponding to the upload parameter that is characterized as being not enabled as a non-target task identifier, and prohibit collecting a log generated in an operating process of a software task corresponding to the non-target task identifier.
In one embodiment, the upload module 608 is further configured to determine whether the current network signal satisfies a dialing condition; determining whether a target log is stored in the current target storage area; determining whether a current communication module is in an idle state; determining whether the current time of the microcontroller is consistent with the network time of the communication module; when the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
In one embodiment, the upload module 608 is further configured to determine the current erasing times of the memory if the current status does not satisfy the upload condition; if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log; and if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
In one embodiment, the upload module 608 is further configured to determine whether a new log collection instruction is received if the current erase count is less than an erase count threshold; if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution; and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
For specific limitation of the uploading device of the terminal log of the internet of things, reference may be made to the above limitation on the uploading method of the terminal log of the internet of things, and details are not described here. All modules in the uploading device of the terminal log of the internet of things can be completely or partially realized through software, hardware and a combination of the software and the hardware. The modules can be embedded in a hardware form or independent of a processor in the terminal of the internet of things, and can also be stored in a memory in the terminal of the internet of things in a software form, so that the processor can call and execute the corresponding operations of the modules.
In one embodiment, an internet of things terminal is provided, and the internet of things terminal may be composed of a low-cost microcontroller, a memory and a communication module, and an internal structure diagram of the internet of things terminal may be as shown in fig. 7. The terminal of the Internet of things comprises a microcontroller, a memory and a communication module which are connected through a system bus. The microcontroller of the terminal of the Internet of things is used for providing calculation and control capability. The memory of the terminal of the Internet of things comprises a nonvolatile storage medium and an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The memory of the terminal of the Internet of things is used for storing the uploading data of the terminal log of the Internet of things. The communication module of the terminal of the Internet of things is used for being connected with an external terminal through a network for communication. The computer program is executed by a processor to realize the uploading method of the terminal log of the Internet of things.
Those skilled in the art will appreciate that the structure shown in fig. 7 is only a block diagram of a part of the structure related to the present application, and does not constitute a limitation on the internet of things terminal to which the present application is applied, and a specific internet of things terminal may include more or less components than those shown in the figure, or combine some components, or have different component arrangements.
In one embodiment, there is provided an internet of things terminal, including a memory and a microcontroller, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: acquiring a log acquisition instruction, and analyzing the log acquisition instruction to obtain a target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server.
In one embodiment, the terminal of the internet of things comprises a microcontroller, wherein a software real-time operating system runs in the microcontroller, a plurality of software tasks and log recording tasks are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the log recording tasks.
In one embodiment, the processor, when executing the computer program, further performs the steps of: uploading parameters respectively corresponding to the task identifications are determined from the log acquisition instruction; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining whether the current network signal meets a dialing condition; determining whether a target log is stored in the current target storage area; determining whether a current communication module is in an idle state; determining whether the current time of the microcontroller is consistent with the network time of the communication module; when the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the current state does not meet the uploading condition, determining the current erasing times of the memory; if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log; and if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the current erasing times are smaller than the erasing times threshold, judging whether a new log acquisition instruction is received; if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution; and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a log acquisition instruction, and analyzing the log acquisition instruction to obtain a target task identifier; determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task; storing the target log to a target storage area in the terminal of the Internet of things; and if the current state meets the log uploading condition, uploading the target log from the target storage area to a remote server.
In one embodiment, the terminal of the internet of things comprises a microcontroller, wherein a software real-time operating system runs in the microcontroller, a plurality of software tasks and log recording tasks are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the log recording tasks.
In one embodiment, the computer program when executed by the processor further performs the steps of: uploading parameters respectively corresponding to the task identifications are determined from the log acquisition instruction; and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: and if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining whether the current network signal meets a dialing condition; determining whether a target log is stored in the current target storage area; determining whether a current communication module is in an idle state; determining whether the current time of the microcontroller is consistent with the network time of the communication module; when the current network signal meets the dialing condition, the current target storage area stores a target log, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the current state does not meet the uploading condition, determining the current erasing times of the memory; if the current erasing times are smaller than the threshold value of the erasing times, continuing to carry out the steps of collecting and storing the target log; and if the current erasing times is larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the current erasing times are smaller than the erasing times threshold, judging whether a new log acquisition instruction is received; if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution; and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An uploading method of terminal logs of the Internet of things is executed by a terminal of the Internet of things, and the method comprises the following steps:
acquiring a log acquisition instruction, and analyzing the log acquisition instruction to obtain a target task identifier;
determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things, and collecting a target log corresponding to the target software task;
storing the target log to a target storage area in the terminal of the Internet of things;
and if the current state meets the log uploading condition, uploading the target log from a target storage area to a remote server so as to remotely analyze the running state of the terminal of the Internet of things.
2. The method according to claim 1, wherein the terminal of the internet of things comprises a microcontroller, a software real-time operating system runs in the microcontroller, a plurality of software tasks and a logging task are pre-deployed in the software real-time operating system, and in the running process of the microcontroller, the steps of analyzing a log acquisition instruction, acquiring a target log and storing the target log are executed through the logging task.
3. The method of claim 1, wherein parsing the log collection instruction to obtain a target task identifier comprises:
uploading parameters respectively corresponding to the task identifications are determined from the log acquisition instruction;
and if the uploading parameter is characterized as the enabled uploading parameter, determining the task identifier corresponding to the enabled uploading parameter as the target task identifier.
4. The method of claim 3, further comprising:
and if the uploading parameter is characterized as the non-enabled uploading parameter, determining the task identifier corresponding to the uploading parameter characterized as the non-enabled uploading parameter as a non-target task identifier, and forbidding collection of logs generated in the running process of the software task corresponding to the non-target task identifier.
5. The method of claim 1, further comprising:
determining whether the current network signal meets a dialing condition;
determining whether a target log is stored in the current target storage area;
determining whether a current communication module is in an idle state;
determining whether a current time of the microcontroller is consistent with a network time of the communication module;
and when the current network signal meets the dialing condition, a target log is stored in the current target storage area, the current communication module is in an idle state, and the time of the current microcontroller is consistent with the network time of the communication module, determining that the current state meets the log uploading condition.
6. The method according to any one of claims 1 to 5, further comprising:
if the current state does not meet the uploading condition, determining the current erasing times of the memory;
if the current erasing times are smaller than the erasing times threshold, continuing to acquire and store the target log;
and if the current erasing times are larger than or equal to the erasing times threshold, stopping the acquisition and storage of the target log, and uploading the target log to a remote server from a target storage area when a log uploading condition is met.
7. The method of claim 6, wherein if the current number of erasures is less than the threshold number of erasures, continuing with the step of collecting and storing the target log, comprises:
if the current erasing times are smaller than the erasing times threshold, judging whether a new log acquisition instruction is received;
if a new log collection instruction is not received, directly returning to the step of collecting the target log corresponding to the target software task for continuous execution;
and if a new log acquisition instruction is received, analyzing the new log acquisition instruction to obtain a new target task identifier, and acquiring and storing a new target log based on the new target task identifier.
8. The utility model provides an uploading device of thing networking terminal log which characterized in that, the device includes:
the analysis module is used for acquiring a log acquisition instruction and analyzing the log acquisition instruction to obtain a target task identifier;
the acquisition module is used for determining a target software task corresponding to the target task identifier from a plurality of software tasks executed in the terminal of the internet of things and acquiring a target log corresponding to the target software task;
the storage module is used for storing the target log to a target storage area in the terminal of the Internet of things;
and the uploading module is used for uploading the target log to a remote server from a target storage area if the current state meets the log uploading condition so as to remotely analyze the running state of the terminal of the Internet of things.
9. An internet of things terminal comprising a memory and a microcontroller, the memory storing a computer program, characterized in that the microcontroller, when executing the computer program, implements the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111033842.3A 2021-09-03 2021-09-03 Internet of things terminal log uploading method and device and internet of things terminal Pending CN114124679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111033842.3A CN114124679A (en) 2021-09-03 2021-09-03 Internet of things terminal log uploading method and device and internet of things terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111033842.3A CN114124679A (en) 2021-09-03 2021-09-03 Internet of things terminal log uploading method and device and internet of things terminal

Publications (1)

Publication Number Publication Date
CN114124679A true CN114124679A (en) 2022-03-01

Family

ID=80441187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111033842.3A Pending CN114124679A (en) 2021-09-03 2021-09-03 Internet of things terminal log uploading method and device and internet of things terminal

Country Status (1)

Country Link
CN (1) CN114124679A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701335A (en) * 2023-05-17 2023-09-05 中国第一汽车股份有限公司 Cross-system log data processing method for vehicle-mounted cabin domain controller

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170586A (en) * 2017-12-26 2018-06-15 广东欧珀移动通信有限公司 log processing method, device, storage medium and terminal device
CN109308749A (en) * 2017-07-26 2019-02-05 比亚迪股份有限公司 Vehicle defect diagnostic method, automobile and server
CN110463142A (en) * 2018-01-22 2019-11-15 松下电器(美国)知识产权公司 Vehicle abnormality detection service device, vehicle abnormality detection system and vehicle abnormality detection method
CN112233278A (en) * 2020-12-09 2021-01-15 智道网联科技(北京)有限公司 Remote fault analysis method, vehicle-mounted terminal, server, device and medium
CN112712610A (en) * 2020-12-30 2021-04-27 深圳市元征科技股份有限公司 Vehicle diagnosis log processing method and device, terminal device and readable storage medium
CN112925686A (en) * 2019-12-06 2021-06-08 中兴通讯股份有限公司 Data acquisition method, server, system and storage medium
CN112953753A (en) * 2019-12-24 2021-06-11 深圳市明源云科技有限公司 Data acquisition method and device, terminal equipment and storage medium
CN113259401A (en) * 2021-07-15 2021-08-13 国汽智控(北京)科技有限公司 Vehicle data control method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308749A (en) * 2017-07-26 2019-02-05 比亚迪股份有限公司 Vehicle defect diagnostic method, automobile and server
CN108170586A (en) * 2017-12-26 2018-06-15 广东欧珀移动通信有限公司 log processing method, device, storage medium and terminal device
CN110463142A (en) * 2018-01-22 2019-11-15 松下电器(美国)知识产权公司 Vehicle abnormality detection service device, vehicle abnormality detection system and vehicle abnormality detection method
CN112925686A (en) * 2019-12-06 2021-06-08 中兴通讯股份有限公司 Data acquisition method, server, system and storage medium
CN112953753A (en) * 2019-12-24 2021-06-11 深圳市明源云科技有限公司 Data acquisition method and device, terminal equipment and storage medium
CN112233278A (en) * 2020-12-09 2021-01-15 智道网联科技(北京)有限公司 Remote fault analysis method, vehicle-mounted terminal, server, device and medium
CN112712610A (en) * 2020-12-30 2021-04-27 深圳市元征科技股份有限公司 Vehicle diagnosis log processing method and device, terminal device and readable storage medium
CN113259401A (en) * 2021-07-15 2021-08-13 国汽智控(北京)科技有限公司 Vehicle data control method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701335A (en) * 2023-05-17 2023-09-05 中国第一汽车股份有限公司 Cross-system log data processing method for vehicle-mounted cabin domain controller

Similar Documents

Publication Publication Date Title
US11237913B2 (en) System and method for data classification during file backup
CN102110211B (en) For the method and apparatus of Administrative Security event
US20200073712A1 (en) Method, apparatus, device and medium for processing topological relation of tasks
CN109684370A (en) Daily record data processing method, system, equipment and storage medium
CN105184166A (en) Kernel-based Android application real-time behavior analysis method and system
CN115422592A (en) Big data security processing method and system
CN108268546A (en) A kind of method and device for optimizing database
CN111259212B (en) Telemetering data interpretation method, device, equipment and storage medium
CN114124679A (en) Internet of things terminal log uploading method and device and internet of things terminal
CN113282920B (en) Log abnormality detection method, device, computer equipment and storage medium
CN110941632A (en) Database auditing method, device and equipment
CN115576973A (en) Service deployment method, device, computer equipment and readable storage medium
CN115309802A (en) User distribution thermodynamic diagram acquisition method and device, electronic equipment and storage medium
CN111857551B (en) Video data aging method and device
CN110647527B (en) Big data-based invalid label clearing method and device, equipment and readable medium
US20120137274A1 (en) Software application feedback collection system and method
CN114116908A (en) Data management method and device and electronic equipment
CN112582080A (en) Internet of things equipment state monitoring method and system
CN110968467A (en) Remote automatic test method for GPU and algorithm
CN112729319A (en) Automatic data acquisition and analysis system and method
CN115878439B (en) System performance bottleneck positioning method and device, electronic equipment and storage medium
CN116974468B (en) Equipment data storage management method and system based on big data
US11861206B1 (en) Garbage collection for object-based storage systems
US20220107869A1 (en) System and method for selecting a backup plan for newly stored files
CN116257404A (en) Log analysis method and computing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination