CN110286940B - Smart television log generation method - Google Patents

Smart television log generation method Download PDF

Info

Publication number
CN110286940B
CN110286940B CN201910560884.9A CN201910560884A CN110286940B CN 110286940 B CN110286940 B CN 110286940B CN 201910560884 A CN201910560884 A CN 201910560884A CN 110286940 B CN110286940 B CN 110286940B
Authority
CN
China
Prior art keywords
log
file
version
log information
android
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.)
Active
Application number
CN201910560884.9A
Other languages
Chinese (zh)
Other versions
CN110286940A (en
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910560884.9A priority Critical patent/CN110286940B/en
Publication of CN110286940A publication Critical patent/CN110286940A/en
Application granted granted Critical
Publication of CN110286940B publication Critical patent/CN110286940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/4508Management of client data or end-user data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/4508Management of client data or end-user data
    • H04N21/4516Management of client data or end-user data involving client characteristics, e.g. Set-Top-Box type, software version or amount of memory available

Abstract

The invention relates to the field of computer operating systems, and discloses a log generation method for an intelligent television, which solves the problems that in the prior art, log cannot be automatically generated by C-layer software of an intelligent television release version, and the problem is inconvenient to analyze and solve when the problem caused by the C-layer software occurs. The method can be summarized as follows: the method comprises the steps of performing different processing on a C-layer software according to versions in log management and control, namely adopting different log output modes on a development version and a release version, still adopting a traditional log management and control mode on the development version, defining different log grades for different types of log information according to the release version, setting the level of a C-layer software output log, and automatically outputting a log file in a file form for the log information meeting the output level requirement, so that the log file can be output according to the requirement on the release version, and software developers can analyze and position the problem on the release version.

Description

Smart television log generation method
Technical Field
The invention relates to the field of computer operating systems, in particular to a method for generating a smart television log.
Background
In the android intelligent television, software comprises a C layer (C \ C + +) and a Java layer, and the C layer software outputs logs in two ways:
firstly, outputting log information to standard output equipment (such as tty terminal) directly by adopting C standard information output (printf or cout);
and secondly, outputting the log information to a log information file (log.txt) of an android standard by adopting an android log system, and displaying the log information on a standard output device (tty terminal) through a logcat command.
Aiming at the first mode, in order to check the log, standard output equipment (development tools, such as a serial port) needs to be connected, and smart television software is operated at the same time; therefore, for the android smart television, the log information can be acquired only by connecting a debugging tool when the smart television software runs in the mode; aiming at the second mode, an android log system needs to be opened, and a log.txt log file is generated by the android log system; and a serial port debugging tool can be connected when the intelligent television software runs, and the corresponding file can be realized and output on the output equipment through the logcat command. Based on the difference between the two modes, for convenience, the second mode is usually adopted in the android smart television to perform log management and control.
The android smart television as an embedded system is restricted by various factors, the hardware configuration is limited, in order to improve the operation efficiency and speed of the system and improve the user experience, a strategy of closing logs (logs) is adopted in mass production products, if the log information management and control of the C-layer software adopts a second mode, the log information of the C-layer software in a release (mass production) product is closed at the same time, that is, there is no log information in the layer C software, if the problem caused by the layer C software occurs in such a release product, there is no log file, which causes inconvenience to the problem analysis and solution, in order to acquire the log file, the log system needs to be manually opened and the problem is reproduced, which wastes a lot of time, reduces the problem analysis and solving efficiency, particularly, for some accidental problems, the problems may not be reproduced, so that the problems cannot be solved; similarly, if the first mode is adopted to manage and control the C-layer software log, since the release product is basically used by the user, it cannot be guaranteed that standard output equipment outputs log files, and inconvenience is also caused to problem analysis and solution.
Therefore, the C-layer software of the smart tv release (mass production) in the conventional technology cannot automatically generate logs, and the problem analysis and solution are inconvenient when the problem caused by the C-layer software occurs.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method for generating the intelligent television logs solves the problems that logs cannot be automatically generated by C-layer software of an intelligent television release version and are inconvenient to analyze and solve when problems caused by the C-layer software occur in the traditional technology.
The technical scheme adopted by the invention for solving the technical problems is as follows:
the intelligent television log generation method comprises the following steps:
a. adding a version attribute in an android system attribute of the smart television for distinguishing a system development version and a release version software;
b. classifying the C-layer software logs of the android system according to the log information categories, defining different log grades for log information of different categories, and simultaneously setting and storing the grades of the output logs of the C-layer software;
c. in the system development version, log management and control are carried out on C-layer software in a mode of directly outputting log information to standard output equipment or outputting the log information to a log information file of an android standard by using an android log system;
d. in the system release version, the C-level software outputs the log information of the specified level to a specified log file by using a C standard function snprint and an android file management technology.
As a further optimization, in step d, the outputting the log information of the designated level to the designated log file by using the C standard function snprint and the android file management technology specifically includes:
and converting the log information which accords with the preset output level into character strings by utilizing the snprint, writing the corresponding character strings into the tail of a specified log file in an additional mode, and outputting the log information in a file form.
In the scheme, in the system release version, the log information meeting the preset log output level is output in a file form, so that the log file of the C-layer software can be output as required, software developers can analyze and position related software problems in mass production products, the time for problem recurrence is saved, and the efficiency for solving the problems of mass production products is improved.
As a further optimization, step d further includes managing the log file: and deleting the log file when a certain condition threshold value is met.
In the scheme, in order to reduce the influence on the operating efficiency of the whole machine, when a certain condition threshold value is met, the log file is deleted.
As a further optimization, the certain threshold condition is:
when the intelligent television is started, if the time of detecting the log file exceeds the set time or the size of the log file exceeds the set byte, deleting the log file.
According to the scheme, the storage time of the log file and the size of the log file are used as judgment conditions for log file deletion management, and the log file can be deleted when the storage time exceeds the set time or the size of the log file exceeds the set byte, so that the operation efficiency of the whole machine is improved.
As a further optimization, the certain threshold condition is:
after the log file is automatically extracted, the log file is deleted.
According to the scheme, the extraction state of the log file is used as a judgment condition for log file deletion management, once the log file is extracted, the log file is indicated to be used for problem analysis, and the log file is deleted, so that the running efficiency of the whole machine is improved.
The invention has the beneficial effects that:
different processing is performed on the C-layer software on log management and control according to versions, namely different log output modes are adopted on development versions and release versions (mass production versions), so that log files can be automatically output in a file form on the release versions according to requirements, a log system does not need to be manually opened, and standard output equipment does not need to be connected; therefore, software developers can conveniently acquire log files of relevant information on the release version, problem analysis and positioning are carried out according to the log files, time for simulating and reproducing problems for many times due to the fact that the release version has no log files is shortened, and therefore efficiency of solving problems found in mass production versions is improved.
Drawings
Fig. 1 is a block diagram of a structure of smart tv software;
FIG. 2 is a flowchart illustrating processing of log files after the television system is started according to an embodiment;
FIG. 3 is a flowchart of log generation for release version C layer software in the embodiment.
Detailed Description
As shown in fig. 1, the Android smart tv software includes an operating system layer (OS), various Libraries (Libraries), and an Android RunTime environment (RunTime) (also called a middleware layer), an Application Framework (Application Framework), and an Application (Application), wherein the middleware layer is mostly written and implemented by C, C + +. The invention relates to a method for processing log information of a part (called C-layer software) realized by C and C + + in a middleware layer, which solves the problems that in the prior art, the C-layer software of an intelligent television release version cannot automatically generate logs, and is inconvenient to analyze and solve when problems caused by the C-layer software occur.
The core idea is as follows: different processing is carried out on the layer C software according to versions (development versions and release versions) on log management and control, namely different log output modes are adopted on the development versions and the release versions (mass production versions), a traditional log management and control mode is still adopted on the development versions, different log grades are defined for different types of log information on the release versions, the grade of the log output by the layer C software is set, log files are automatically output in a file mode for the log information meeting the output grade requirement, therefore, the log files can be output on the release versions according to needs, software developers can analyze and position the problem on the release versions when the problem occurs, the time of simulating the problem repeatedly due to the fact that the release versions have no log files is shortened, and the problem solving efficiency of mass production version finding is improved.
In a specific implementation, the method for generating the smart television log comprises the following steps:
1) adding a system version attribute in the android system attribute: when the software is compiled, different compiling commands are input according to different versions, and different version system attributes are set according to different compiling commands, so that the version attribute values in the system attributes are set according to the versions, namely different system version attribute values are used for distinguishing in developing and releasing version software packages;
2) classifying the C-layer software logs according to log information categories (including error \ debugging \ common information and the like), defining different log levels for different types of log information, simultaneously setting the level of the C-layer output logs and storing the levels, and processing according to the set output level when the log information is output, namely filtering the log information, and outputting only the log information which accords with the set output level, thereby reducing the occupation of the storage resources of the system;
3) in the system development version, log management and control are carried out on C-layer software in a mode of directly outputting log information to standard output equipment or outputting the log information to a log information file of an android standard by using an android log system;
4) in a system release version, outputting specified-level log information to a specified file by using a C standard function snprint and an android file management technology for C-layer software, namely converting the log information into a character string by using the snprint and writing the corresponding character string into a specified log file tail in an additional mode to realize the output of the log information in a file form;
in addition, in order to reduce the influence on the running efficiency of the whole machine, the log file of the software of the C layer of the release version is deleted and managed according to specific conditions, and the specific management mode is that when the existing time of the log file exceeds the set time or the size of the log file exceeds the set size, the log file is deleted when the machine is started; or after automatically extracting the log file, deleting the log file.
Example (b):
the present embodiment is a processing scheme for a log file after a television system is started, as shown in fig. 2, the processing scheme includes:
1. after the system is started, reading the current version state and the log output level;
2. if the current system version is a development version, performing log control on the layer C software in a mode of directly outputting log information to standard output equipment or outputting the log information to a log information file of an android standard by using an android log system;
3. if the current system version is the release version, outputting the log information meeting the conditions to a specified log file according to the flow in the figure 3;
4. the system also manages the existing log files correspondingly:
when the existing time of the log file exceeds the set time or the size of the log file exceeds the set size, deleting the log file when starting the computer; or after automatically extracting the log file, deleting the log file.
As shown in fig. 3, the log output flow for the release version of the C-layer software includes:
firstly, judging whether the log information to be output meets the output condition, namely whether the log grade meets the preset output grade requirement, opening a log file in a mode of adding information to the tail of the file for the log information meeting the set output grade, then converting the log information into a character string according to a specified format by using a snprint, writing the character string into the tail of the log file by using a write operation function, and finally closing the log file, thereby finishing the output of the log information of the specified grade.

Claims (5)

1. The intelligent television log generation method is characterized by comprising the following steps:
a. adding a version attribute in an android system attribute of the smart television for distinguishing a system development version and a release version software;
b. classifying the C-layer software logs of the android system according to the log information categories, defining different log grades for log information of different categories, and simultaneously setting and storing the grades of the output logs of the C-layer software;
c. in the system development version, log management and control are carried out on C-layer software in a mode of directly outputting log information to standard output equipment or outputting the log information to a log information file of an android standard by using an android log system;
d. in the system release version, the C-level software outputs the log information of the specified level to a specified log file by using a C standard function snprint and an android file management technology.
2. The smart television log generation method of claim 1,
in step d, the outputting the log information of the specified level to the specified log file by using the C standard function snprint and the android file management technology specifically includes:
and converting the log information which accords with the preset output level into character strings by utilizing the snprint, writing the corresponding character strings into the tail of a specified log file in an additional mode, and outputting the log information in a file form.
3. The smart television log generation method of claim 1,
step d, managing the log file: and deleting the log file when a certain condition threshold value is met.
4. The smart television log generation method of claim 3,
the certain condition threshold is as follows:
when the intelligent television is started, if the time of detecting the log file exceeds the set time or the size of the log file exceeds the set byte, deleting the log file.
5. The smart television log generation method of claim 3,
the certain condition threshold is as follows:
after the log file is automatically extracted, the log file is deleted.
CN201910560884.9A 2019-06-26 2019-06-26 Smart television log generation method Active CN110286940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910560884.9A CN110286940B (en) 2019-06-26 2019-06-26 Smart television log generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910560884.9A CN110286940B (en) 2019-06-26 2019-06-26 Smart television log generation method

Publications (2)

Publication Number Publication Date
CN110286940A CN110286940A (en) 2019-09-27
CN110286940B true CN110286940B (en) 2022-03-25

Family

ID=68006149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910560884.9A Active CN110286940B (en) 2019-06-26 2019-06-26 Smart television log generation method

Country Status (1)

Country Link
CN (1) CN110286940B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257643B (en) * 2022-01-28 2023-03-24 北京安帝科技有限公司 Log transmission method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7730123B1 (en) * 2005-12-20 2010-06-01 At&T Intellectual Property Ii, Lp Software application implemented using services from a services repository generated using a target services roadmap
CN105577445A (en) * 2015-12-30 2016-05-11 北京京东尚科信息技术有限公司 Method and device for collecting and reporting logs
CN102622241B (en) * 2011-01-26 2016-06-15 腾讯科技(深圳)有限公司 A kind of method for upgrading software and device
CN107071569A (en) * 2016-12-30 2017-08-18 武汉斗鱼网络科技有限公司 The method and system of application are debugged on a kind of Android TV
CN109614165A (en) * 2018-12-04 2019-04-12 山东财经大学 A kind of parallel operation method of the multi version of com component and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10296661B2 (en) * 2015-09-11 2019-05-21 Salesforce.Com, Inc. Processing log files using a database system
US10180825B2 (en) * 2015-09-30 2019-01-15 Apple Inc. System and method for using ubershader variants without preprocessing macros

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7730123B1 (en) * 2005-12-20 2010-06-01 At&T Intellectual Property Ii, Lp Software application implemented using services from a services repository generated using a target services roadmap
CN102622241B (en) * 2011-01-26 2016-06-15 腾讯科技(深圳)有限公司 A kind of method for upgrading software and device
CN105577445A (en) * 2015-12-30 2016-05-11 北京京东尚科信息技术有限公司 Method and device for collecting and reporting logs
CN107071569A (en) * 2016-12-30 2017-08-18 武汉斗鱼网络科技有限公司 The method and system of application are debugged on a kind of Android TV
CN109614165A (en) * 2018-12-04 2019-04-12 山东财经大学 A kind of parallel operation method of the multi version of com component and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"How to run release variant of";Aman Gupta;《https://mobikul.com/release-variant-of-app-enable-logcat-running-release-build-application/》;20180221;第1-9页 *
"LINUX系统以及ANDROID 平台log信息输出级别设置 [MTK]";起舞的迈特凯;《https://blog.csdn.net/Internet_t/article/details/89472541》;20190423;第1-8页 *

Also Published As

Publication number Publication date
CN110286940A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
US10067757B2 (en) Dynamic update of an application in compilation and deployment with hot-swapping
CN109448100B (en) Three-dimensional model format conversion method, system, computer device and storage medium
EP2098954B1 (en) Systems and methods for template reverse engineering
CN103440201A (en) Dynamic taint analysis device and application thereof to document format reverse analysis
WO2017020459A1 (en) Method and apparatus for configuring plugin package for host
CN112558980A (en) Multi-software-package management method and device
CN110737589A (en) automatic point burying method, device, medium and electronic equipment
WO2017087801A1 (en) Dynamic update of an application in compilation and deployment
KR20100071361A (en) Project management device and method for architecture modeling tool of application software on autosar and computer readable recording medium therefor
US7966600B2 (en) Distributed resource understanding tool management
CN114329367B (en) Network disk file tracing method and device, network disk and storage medium
CN114329366B (en) Network disk file control method and device, network disk and storage medium
CN110286940B (en) Smart television log generation method
CN110019527B (en) Slave library reading method, related device and equipment
CN103914288A (en) Control state judging method
CN111475150B (en) Cross-language binding method, device, equipment and storage medium
CN113741954A (en) System software generation method and device, electronic equipment and storage medium
CN103902275A (en) Method and system for achieving conversion of language versions of applications
CN112765110B (en) PDF annotation data generation method, device, equipment and storage medium
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN114115952A (en) Method and device for automatically upgrading packaged low-code application
KR101476536B1 (en) The method and system for inspecting program
KR100992622B1 (en) Method and system for performing automatic test in embedded platform
CN111625302A (en) Function time consumption tracking method, device and storage medium
CN105183491A (en) Cross-platform desktop GIS and starting method thereof

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
GR01 Patent grant
GR01 Patent grant