WO2015188457A1 - Procédé et appareil d'acquisition de message d'impression - Google Patents

Procédé et appareil d'acquisition de message d'impression Download PDF

Info

Publication number
WO2015188457A1
WO2015188457A1 PCT/CN2014/085061 CN2014085061W WO2015188457A1 WO 2015188457 A1 WO2015188457 A1 WO 2015188457A1 CN 2014085061 W CN2014085061 W CN 2014085061W WO 2015188457 A1 WO2015188457 A1 WO 2015188457A1
Authority
WO
WIPO (PCT)
Prior art keywords
print message
print
message
storage device
kernel
Prior art date
Application number
PCT/CN2014/085061
Other languages
English (en)
Chinese (zh)
Inventor
苏颜军
王春龙
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015188457A1 publication Critical patent/WO2015188457A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring a print message.
  • Linux (Riox) is a freely used operating system and is currently used more and more in product development.
  • Print messages for real-time output by the Linux kernel and print messages for normal processes are usually displayed only on certain terminals. For example, on a Linux machine connected to a monitor, the Linux kernel output is usually displayed on the display; on an embedded Linux device, the Linux kernel output is usually output to the serial device.
  • the print message output by the Linux kernel can only be displayed locally. This has the disadvantage that when the device is running in the field, there is a problem with the Linux kernel. The personnel must rush to the site to obtain the print information, which brings great equipment maintenance.
  • an embodiment of the present invention provides a method for acquiring a print message, including: acquiring a print message output by a device; and redirecting the print message to a set storage device. Further, when the print message is a kernel print message of the Reniks Linux system, the kernel print message is obtained from the buffer Buffer through a Syslog interface provided by the Linux system.
  • the process print message of the process is obtained by the file open table corresponding to each process.
  • redirecting the print message to the set storage device means copying the print message to the set storage device.
  • the storage device is a universal serial bus USB interface storage device.
  • the embodiment of the present invention further provides a print message acquiring apparatus, including: a print message obtaining unit, configured to obtain a print message output by the device; and a redirecting unit configured to redirect the print message to the set storage device.
  • the print message obtaining unit is further configured to: when the print message is a kernel print message of the Rex Linux system, obtain the kernel print message from the buffer Buffer through a Syslog interface provided by the Linux system. Further, the print message obtaining unit is further configured to: when the print message is a process print message of the Rex Linux system, obtain a process print message of the process by using a file open table corresponding to each process. Further, the redirecting unit redirects the print message to the set storage device, which means copying the print message to the set storage device. Further, the storage device is a universal serial bus USB interface storage device.
  • FIG. 1 is a flowchart of a method for acquiring a print message according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a device for acquiring a print message according to an embodiment of the present invention.
  • an embodiment of the present invention relates to a method for acquiring a print message, including: Step S101: Acquire a print message output by a device; In this step, the print message includes a kernel print message and/or a process print message.
  • the Linux kernel prints the real-time output of the print directly to the printk ( ) kernel function. From the internal implementation mechanism, the Linux kernel maintains a list of kernel real-time information output devices (console-drivers).
  • the Linux kernel caches kernel print messages into the internal buffer. To get the kernel's prints, you need to fetch them from the buffer and redirect them to the usb interface storage device.
  • the Linux kernel will cache the kernel's print messages into the internal buffer. Linux provides a syslog interface, which makes it easy to get the kernel to print messages.
  • the print message of the normal process of the Linux system is implemented by calling the printf ( ) function.
  • the print message of the process is output to the standard output.
  • the default standard output of the board is the serial port. Therefore, in order to obtain the print message of the process, the standard output of the process needs to be redirected.
  • the Linux kernel provides a file open table for each process in the system. The first three items 0, 1, and 2 of the file open table are standard input, standard output, and standard error output. We only focus on the output of the process. In order to get the print message of the specified process, you need to start the required process, and then redirect the standard output of the process to get the process to print the message. Step S102, redirecting the print message to a set storage device.
  • the usb scan thread is responsible for the opening and closing of the usb print redirection function.
  • the thread scans the root directory of the usb interface storage device for the specified file. If it exists, it starts usb.
  • Print redirection function if it does not exist, turn off usb print redirection.
  • the syn log thread is responsible for redirecting kernel print messages to the system temporary file;
  • the usbcmd scan thread is responsible for executing user-specified programs or script files that redirect the standard output of the user-specified program or script file to the system temporary file.
  • the usb syn thread is responsible for synchronizing the print message to the usb interface device, which periodically synchronizes the temporary files cached in the system to the usb interface storage device.
  • a file structure is required, and then the following function is called to complete the redirection operation.
  • Void register— redir— func(unsigned long funcaddr, struct file ⁇ filep) ko tty.magic TTY MAGIC;
  • subtype PTY TYPE— MASTER
  • Redirops.write TYPE_CAST(write_fn, funcddr);
  • the embodiment of the present invention further relates to a print message acquiring apparatus for implementing the above method, comprising: a print message acquiring unit 201, configured to acquire a print message output by a device; and a redirecting unit 202, configured to The print message is redirected to the set storage device.
  • the print message obtaining unit 201 is further configured to: when the print message is a kernel print message of the Rex Linux system, obtain the kernel print message from the buffer Buffer through a Syslog interface provided by the Linux system; When the print message prints a message for the process of the Rex Linux system, the process print message of the process is obtained by the file open table corresponding to each process.
  • Redirecting unit 202 to redirect the print message to the set storage device means copying the print message to the set storage device; wherein the storage device is a universal serial bus USB interface storage device.
  • Embodiments of the present invention provide a method and an apparatus for acquiring a print message, which can remotely locate a Linux kernel problem of a device without requiring a person to go to the device site, thereby improving the efficiency of the developer positioning fault, thereby improving maintenance efficiency, especially the device.
  • the technical advantages of the present invention are more apparent. While the preferred embodiments of the present invention have been disclosed for purposes of illustration, those skilled in the art will recognize that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.
  • a method and an apparatus for acquiring a print message according to an embodiment of the present invention have the following beneficial effects:
  • the Linux kernel problem of the device can be remotely located without requiring personnel to the device site to improve developer positioning.
  • the efficiency of the failure, and thus the maintenance efficiency, especially in the remote areas, the technical advantages of the present invention are more obvious.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

L'invention concerne un procédé et un appareil d'acquisition de message d'impression. Le procédé consiste à : acquérir un message d'impression qui est délivré par un dispositif ; et rediriger le message d'impression dans un dispositif de stockage défini. Au moyen de la présente invention, le problème dans l'état de la technique selon lequel un message d'impression qui est délivré par un noyau Linux peut uniquement être affiché et visualisé localement, est résolu, de telle sorte que le problème de noyau Linux du dispositif peut être situé à distance sans avoir besoin d'un personnel pour atteindre un site de dispositif, permettant ainsi d'améliorer l'efficacité de localisation d'une anomalie par un développeur, et d'améliorer l'efficacité de maintenance. En particulier, lorsque le dispositif est situé dans une région à distance, la présente invention a des avantages techniques relativement évidents.
PCT/CN2014/085061 2014-06-11 2014-08-22 Procédé et appareil d'acquisition de message d'impression WO2015188457A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410257469.3A CN105278927A (zh) 2014-06-11 2014-06-11 打印消息获取方法及装置
CN201410257469.3 2014-06-11

Publications (1)

Publication Number Publication Date
WO2015188457A1 true WO2015188457A1 (fr) 2015-12-17

Family

ID=54832780

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085061 WO2015188457A1 (fr) 2014-06-11 2014-08-22 Procédé et appareil d'acquisition de message d'impression

Country Status (2)

Country Link
CN (1) CN105278927A (fr)
WO (1) WO2015188457A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107908576A (zh) * 2017-12-08 2018-04-13 上海市共进通信技术有限公司 实现重定向应用程序标准输出控制的方法
CN111045977B (zh) * 2019-12-18 2021-07-27 深圳先进技术研究院 Linux***控制台的USB串口实现方法及相关产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1925666A (zh) * 2006-09-30 2007-03-07 华为技术有限公司 一种实现单板设备串口重定向的装置和方法
CN101340314A (zh) * 2008-08-11 2009-01-07 中兴通讯股份有限公司 一种嵌入式***的实时调试定位方法及其装置
CN101800843A (zh) * 2010-04-22 2010-08-11 四川长虹电器股份有限公司 一种机顶盒抓取打印信息的方法
US20110185068A1 (en) * 2010-01-22 2011-07-28 Microsoft Corporation Multi-link remote protocol
CN102609349A (zh) * 2012-02-08 2012-07-25 北京百度网讯科技有限公司 服务器故障截屏方法及***

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289368B (zh) * 2011-06-17 2017-09-05 中兴通讯股份有限公司 一种获取串口打印信息的方法及***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1925666A (zh) * 2006-09-30 2007-03-07 华为技术有限公司 一种实现单板设备串口重定向的装置和方法
CN101340314A (zh) * 2008-08-11 2009-01-07 中兴通讯股份有限公司 一种嵌入式***的实时调试定位方法及其装置
US20110185068A1 (en) * 2010-01-22 2011-07-28 Microsoft Corporation Multi-link remote protocol
CN101800843A (zh) * 2010-04-22 2010-08-11 四川长虹电器股份有限公司 一种机顶盒抓取打印信息的方法
CN102609349A (zh) * 2012-02-08 2012-07-25 北京百度网讯科技有限公司 服务器故障截屏方法及***

Also Published As

Publication number Publication date
CN105278927A (zh) 2016-01-27

Similar Documents

Publication Publication Date Title
US7216257B2 (en) Remote debugging
TWI476692B (zh) 變更設備配置檔之資訊通知裝置及方法
US20120127512A1 (en) Branch office direct printing
JP6576071B2 (ja) 情報処理装置、サーバクライアントシステム、情報処理装置の制御方法及びプログラム
JP2015046075A (ja) 情報処理装置、その制御方法、及びコンピュータプログラム
CN107707687A (zh) 一种虚拟机ip地址配置的方法和装置
CN107710720B (zh) 用于移动客户端设备的云计算
JP2016018339A (ja) システム、及びシステムの制御方法
WO2015188457A1 (fr) Procédé et appareil d'acquisition de message d'impression
WO2015131549A1 (fr) Procédé et dispositif de collecte des informations sur une défaillance d'un système d'exploitation et ordinateur
JP2011044110A (ja) ソフトウェアプログラム実行装置、ソフトウェアプログラム実行方法、及びプログラム
JP2016139307A (ja) 情報処理装置、プログラム、及び記録媒体
CN106354608B (zh) 电子设备硬件请求注册管理的装置及方法
JP2011028438A (ja) アプリケーション検証システム及びコンピュータプログラム
JP2015032142A (ja) 計算機システム、デバイスドライバインストール方法
JP6281122B2 (ja) 情報処理装置
JP7381146B1 (ja) 管理システム、アダプタ装置、管理方法及びプログラム
JP5613091B2 (ja) デバイスドライバ起動監視プログラム、電子機器
JP2011150459A (ja) ディザスタリカバリシステムおよびバックアップサイト構築方法
WO2013145361A1 (fr) DISPOSITIF D'EXÉCUTION OSGi ET SYSTÈME OSGi
JP2003067192A (ja) プログラム構成管理システム
JP3577234B2 (ja) プロセス管理装置
JP2015146063A (ja) 管理プロセスのメモリリークと異常終了の対応処理方法
JP4681669B2 (ja) 要求内容抽出プログラム、要求内容抽出方法および要求内容抽出装置
JPH0926900A (ja) 稼働情報・障害情報採取システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14894212

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14894212

Country of ref document: EP

Kind code of ref document: A1