CN110308937A - A method of hyper terminal serial ports in electric power acquisition terminal is opened based on USB flash disk - Google Patents

A method of hyper terminal serial ports in electric power acquisition terminal is opened based on USB flash disk Download PDF

Info

Publication number
CN110308937A
CN110308937A CN201910352262.7A CN201910352262A CN110308937A CN 110308937 A CN110308937 A CN 110308937A CN 201910352262 A CN201910352262 A CN 201910352262A CN 110308937 A CN110308937 A CN 110308937A
Authority
CN
China
Prior art keywords
digit strings
new
file
serial ports
judge whether
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.)
Granted
Application number
CN201910352262.7A
Other languages
Chinese (zh)
Other versions
CN110308937B (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.)
Ningbo Sanxing Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Medical and 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 Ningbo Sanxing Medical and Electric Co Ltd filed Critical Ningbo Sanxing Medical and Electric Co Ltd
Priority to CN201910352262.7A priority Critical patent/CN110308937B/en
Publication of CN110308937A publication Critical patent/CN110308937A/en
Application granted granted Critical
Publication of CN110308937B publication Critical patent/CN110308937B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation

Abstract

The present invention relates to a kind of methods for opening hyper terminal serial ports in electric power acquisition terminal based on USB flash disk, and the method includes S1, identification USB flash disk judge whether U disk file size and content meet the requirements;S2, U disk file content is obtained, first digit strings new according to the content creating;Each number in S3, the first digit strings of acquisition, number 1 is moved to left, the Contemporary Digital sizableness of digit and acquisition is moved to left, obtains multiple the second new digit strings, the multiple the second new digit strings are operated, new third digit strings are obtained;S4, assignment third digit strings give hyper terminal serial ports, open hyper terminal serial ports, monitor debugging mode.Operation of the present invention is convenient, can effectively improve debugging efficiency, reduces production cost.

Description

A method of hyper terminal serial ports in electric power acquisition terminal is opened based on USB flash disk
Technical field
The present invention relates to electric power acquisition field of terminal technology, more particularly to a kind of USB flash disk that is based on to open in electric power acquisition terminal The method of hyper terminal serial ports.
Background technique
Electric power acquisition terminal is as one of the key factor for building up strong smart grid comprehensively, and performance quality is largely The upper debugging for depending on exploitation maintenance phase.
At present in exploitation and maintenance phase, debugging mode is monitored frequently with the following two kinds mode.One is hyper terminal positions In in PC machine, electric power acquisition terminal is using the RS_232 serial ports or RS_ reserved on long Serial Port Line and electric power acquisition terminal 485 mouthfuls are connected, and realization is connected to PC machine, open the corresponding serial ports of hyper terminal under debugging mode in PC machine, receive electric power acquisition The data that terminal is passed back monitor debugging in real time by the hyper terminal in PC machine.Another kind is that hyper terminal is located at electric power acquisition In terminal, USB flash disk is inserted into the USB port reserved in electric power acquisition terminal and is accordingly arranged, in a debug state, electric power acquisition is whole The monitoring information at end can be retained in USB flash disk automatically, and USB flash disk is removed after a period of time and obtains Debugging message.
But the above method, there are many problems, electric power acquisition terminal is typically mounted on the more severe place of environment, such as remote On area, high electric pole or in closed basement, PC machine and long Serial Port Line need to be equipped with when being debugged using method one, Increased costs are not only caused, but also monitoring can be cannot achieve because condition does not allow, it is unfavorable to come to monitoring band;Using method two Though long Serial Port Line can be saved, this method can not open the hyper terminal in electric power acquisition terminal, can not supervise in time Debugging message is controlled, the lookup of contingency question is unfavorable for.
Summary of the invention
In view of the above problems, the purpose of the present invention is to provide a kind of before not changing electric power acquisition terminal original structure It puts, realizes and open hyper terminal under fully wireless state, in order to monitor adopting based on USB flash disk opening electric power for Debugging message in real time Collect the method for hyper terminal serial ports in terminal.
To achieve the above object, the technical solution adopted by the present invention are as follows: one kind is opened in electric power acquisition terminal based on USB flash disk to be surpassed The method of grade terminal serial ports, it is characterised in that: the method includes,
S1, identification USB flash disk, judge whether U disk file size and content meet the requirements;
S2, U disk file content is obtained, first digit strings new according to the content creating;
Each number in S3, the first digit strings of acquisition, moves to left number 1, moves to left the Contemporary Digital of digit and acquisition Sizableness obtains multiple the second new digit strings, operates, obtains to the multiple the second new digit strings New third digit strings;
S4, assignment third digit strings give hyper terminal serial ports, open hyper terminal serial ports, monitor debugging mode.
Preferably, judge whether U disk file content meets the requirements in the step S1, specifically,
All numbers in S11, traversal file, judge whether all numbers are respectively positioned between 1-31, if so, executing step S12, if it is not, executing step S13;
S12, successively judge whether the odd bits in file are number, and whether even bit is comma, if so, after continuing to execute Continuous operation, if it is not, executing step S13;
S13, mistake is returned.
Preferably, subsequent operation is executed in the step S12, specifically,
S14, judge whether to encounter branch, if so, successively judging whether the odd bits in file are several in end step S12 Word, whether even bit is the operation of comma, if it is not, continuing to execute step S12.
Preferably, U disk file size is judged in the step S1, specifically,
S15, judge whether U disk file is empty, if it is not, step S16 is executed, if so, executing step S13;
S16, judge whether U disk file size is more than buffer pool size, if so, step S13 is executed, if it is not, executing step S11。
Preferably, the U disk file content in the step S2 is successively to judge at the end of step S12 judges through step S12 The Partial Fragment content for the U disk file crossed.
Preferably, the first digit strings new according to the content creating in the step S2, specifically,
S21, number in the Partial Fragment content successively being extracted, arranged in sequence forms first digit strings, The even bit of first digit strings is comma.
Preferably, the number in first digit strings is different.
Preferably, the multiple the second new digit strings are operated in the step S3, obtains new third Digit strings, specifically,
S31, the multiple the second new digit strings are carried out or operation, is obtained or operation result character string.
Preferably, after executing the step S31, following operation has also been carried out,
S32, described or operation result character string is converted into 32 character strings, obtains the third digit strings.
Preferably, debugging mode is monitored in the step S4, specifically included,
Electric power acquisition terminal is interacted by the serial ports with hyper terminal, hyper terminal record log information, and in U File is created in disk saves log.
Preferably, the creation file is named using date Hour Minute Second format.
Preferably, the U disk file is written by PC machine.
Preferably, the U disk file format is USB.LOG.
Preferably, the buffer pool size is 2Mbit.
Compared with the prior art, the advantages of the present invention are as follows: file is written in USB flash disk, by selecting file content, forms New character string carries out shifting function to number 1 according to new character string, and passes through or operation and conversion operation, obtains super Terminal serial ports trigger word symbol string, to activate the hyper terminal of electric power acquisition terminal inner, this kind of mode can not change electric power Under the premise of acquisition terminal original structure, hyper terminal is directly opened by USB flash disk mode, and then terminal Debugging message is sent to Hyper terminal is realized and monitors and debug terminal under fully wireless state in real time, this had both facilitated the scene fortune of electric power acquisition terminal Dimension, improves timeliness, ensure that the accuracy rate that log information saves, while can save cost again.
Detailed description of the invention
Fig. 1 is a kind of workflow that the method for hyper terminal serial ports in electric power acquisition terminal is opened based on USB flash disk of the present invention Figure.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, and for explaining only the invention, and is not considered as limiting the invention.
As shown in Figure 1 for the present invention it is a kind of based on USB flash disk open electric power acquisition terminal in hyper terminal serial ports method it is excellent Select embodiment.It should be noted that the electric power acquisition terminal of the application has hyperterminal software, hyper terminal is as general Serial interactive software can be used to access distally the server under not homologous ray, and hyper terminal is downloaded to electric power acquisition by the application In terminal, cleverly using its monitoring debugging electric power acquisition terminal, PC machine, Serial Port Line etc. is eliminated, manpower object can be greatlyd save Power.
Meanwhile the USB flash disk of the application uses an external bus standard, it in this way can specification electric power acquisition terminal and computer etc. Being connected and communicate between other external equipments, and the electric power acquisition terminal of the application is then based on " QGDW 1375.2-2013 electricity Power user power utilization information acquisition system pattern specification " design, it is completely the same in hardware and structural member with current electric power acquisition terminal.
The application opens the hyper terminal serial ports in electric power acquisition terminal using USB flash disk mode, specific as follows,
S1, identification USB flash disk, judge whether U disk file size and content meet the requirements;
S2, U disk file content is obtained, first digit strings new according to the content creating;
Each number in S3, the first digit strings of acquisition, moves to left number 1, moves to left the Contemporary Digital of digit and acquisition Sizableness obtains multiple the second new digit strings, operates, obtains to the multiple the second new digit strings New third digit strings;
S4, assignment third digit strings give hyper terminal serial ports, open hyper terminal serial ports, monitor debugging mode.
File in this USB flash disk is written by technical staff by PC machine in advance, the name format of file can there are many, specifically It determines according to actual needs, in this application, definition file format is USB.LOG.
Specifically, judge whether U disk file content meets the requirements in the step S1, using following judgment mode,
All numbers in S11, traversal file, judge whether all numbers are respectively positioned between 1-31, if so, executing step S12, if it is not, executing step S13;
S12, successively judge whether the odd bits in file are number, and whether even bit is comma, if so, after continuing to execute Continuous operation, if it is not, executing step S13;
S13, mistake is returned.
The execution subsequent operation is specifically, judge whether to encounter branch, if so, successively judging file in end step S12 In odd bits whether be number, whether even bit is the operation of comma, if it is not, continuing to execute step S12.Pass through sentencing for branch It is disconnected, segment effectively can be quickly selected, for later use, improves efficiency.
And judge that U disk file size then corresponds in step S1,
S15, judge whether U disk file is empty, if it is not, step S16 is executed, if so, executing step S13;
S16, judge whether U disk file size is more than buffer pool size, if so, step S13 is executed, if it is not, executing step S11.In the present embodiment, the buffer pool size is 2Mbit, and certainly, buffer pool size is specially how many, by electric power acquisition end End determines itself.
As previously mentioned, after judging that U disk file meets the requirements, the operation to form new character string will do it, and character The U disk file content that string is utilized when being formed is the U disk file successively judged at the end of step S12 judges through step S12 Partial Fragment content.
In this way, the first digit strings new according to the content creating in step S2, are corresponding with, S21, successively extract institute The number in Partial Fragment content is stated, arranged in sequence forms first digit strings, the idol of first digit strings Numerical digit is comma.When extracting the number of Partial Fragment content, if encountering identical number, only take primary, it is obvious that be extracted The number that the number out necessarily occurs for the first time, the first new digit strings formed in this way are then different by number is formed The characteristics of.
The multiple the second new digit strings are operated in the step S3, obtain new third numerical character String obtains or operation result character string specifically, S31, carry out to the multiple the second new digit strings or operation.
In order to enable the character field to be formed effectively to activate hyper terminal serial ports, after executing the step S31, also grasped Make, described or operation result character string S32, is converted into 32 character strings, obtains the third digit strings.
After hyper terminal is activated, will in monitoring debugging mode, that is, have electric power acquisition terminal by the serial ports with Hyper terminal interacts, hyper terminal record log information, and creates file in USB flash disk and save log.Herein, creation text Part is named using date Hour Minute Second format.
The present invention can directly be opened by USB flash disk mode super under the premise of not changing electric power acquisition terminal original structure Terminal, and then terminal Debugging message is sent to hyper terminal, it realizes and monitors and debug terminal under fully wireless state in real time, this Both the live O&M for having facilitated electric power acquisition terminal, improves timeliness, ensure that the accuracy rate that log information saves, while again Cost can be saved.
Other than above-mentioned improvement, other similar improvement are also contained in improvement threshold of the invention, are not just existed herein It repeats.Although an embodiment of the present invention has been shown and described, it will be appreciated by those skilled in the art that: do not departing from the present invention Principle and objective in the case where can to these embodiments carry out it is a variety of variation, modification, replacement and deformation, the scope of the present invention It is defined by the claims and their equivalents.

Claims (14)

1. a kind of method for opening hyper terminal serial ports in electric power acquisition terminal based on USB flash disk, it is characterised in that: the method packet It includes,
S1, identification USB flash disk, judge whether U disk file size and content meet the requirements;
S2, U disk file content is obtained, first digit strings new according to the content creating;
Each number in S3, the first digit strings of acquisition, moves to left number 1, moves to left the Contemporary Digital size of digit and acquisition Quite, multiple the second new digit strings are obtained, the multiple the second new digit strings are operated, are obtained new Third digit strings;
S4, assignment third digit strings give hyper terminal serial ports, open hyper terminal serial ports, monitor debugging mode.
2. method according to claim 1, it is characterised in that: judge whether U disk file content conforms in the step S1 It asks, specifically,
All numbers in S11, traversal file, judge whether all numbers are respectively positioned between 1-31, if so, step S12 is executed, if It is no, execute step S13;
S12, successively judge whether the odd bits in file are number, and whether even bit is comma, if so, continuing to execute subsequent behaviour Make, if it is not, executing step S13;
S13, mistake is returned.
3. method according to claim 2, it is characterised in that: subsequent operation is executed in the step S12, specifically,
S14, judge whether to encounter branch, if so, successively judge whether the odd bits in file are number in end step S12, Whether even bit is the operation of comma, if it is not, continuing to execute step S12.
4. method according to claim 2, it is characterised in that: U disk file size is judged in the step S1, specifically,
S15, judge whether U disk file is empty, if it is not, step S16 is executed, if so, executing step S13;
S16, judge whether U disk file size is more than buffer pool size, if so, step S13 is executed, if it is not, executing step S11.
5. method according to claim 2, it is characterised in that:
U disk file content in the step S2 is the U disk file successively judged at the end of step S12 judges through step S12 Partial Fragment content.
6. method according to claim 5, it is characterised in that: first number new according to the content creating in the step S2 Word character string, specifically,
S21, number in the Partial Fragment content is successively extracted, arranged in sequence forms first digit strings, described The even bit of first digit strings is comma.
7. method according to claim 1, it is characterised in that:
Number in first digit strings is different.
8. method according to claim 1, it is characterised in that: to the multiple the second new numerical character in the step S3 String is operated, and new third digit strings are obtained, specifically,
S31, the multiple the second new digit strings are carried out or operation, is obtained or operation result character string.
9. method according to claim 8, it is characterised in that: after executing the step S31, following operation has also been carried out,
S32, described or operation result character string is converted into 32 character strings, obtains the third digit strings.
10. method according to claim 1, it is characterised in that: debugging mode is monitored in the step S4, is specifically included,
Electric power acquisition terminal is interacted by the serial ports with hyper terminal, hyper terminal record log information, and in USB flash disk It creates file and saves log.
11. method according to claim 10, it is characterised in that:
The creation file is named using date Hour Minute Second format.
12. method according to claim 1, it is characterised in that:
The U disk file is written by PC machine.
13. method according to claim 1, it is characterised in that:
The U disk file format is USB.LOG.
14. method according to claim 4, it is characterised in that:
The buffer pool size is 2Mbit.
CN201910352262.7A 2019-04-28 2019-04-28 Method for opening super terminal serial port in power acquisition terminal based on USB flash disk Active CN110308937B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910352262.7A CN110308937B (en) 2019-04-28 2019-04-28 Method for opening super terminal serial port in power acquisition terminal based on USB flash disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910352262.7A CN110308937B (en) 2019-04-28 2019-04-28 Method for opening super terminal serial port in power acquisition terminal based on USB flash disk

Publications (2)

Publication Number Publication Date
CN110308937A true CN110308937A (en) 2019-10-08
CN110308937B CN110308937B (en) 2022-06-03

Family

ID=68074485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910352262.7A Active CN110308937B (en) 2019-04-28 2019-04-28 Method for opening super terminal serial port in power acquisition terminal based on USB flash disk

Country Status (1)

Country Link
CN (1) CN110308937B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6378015B1 (en) * 1999-01-25 2002-04-23 George Yen Flash memory module comprising an IDE interface engageable in a vertical position perpendicular to a motherboard and having an IDE expansion slot
CN1529475A (en) * 2003-10-10 2004-09-15 复旦大学 Local area network based on mobile operating system configuration
US20090041621A1 (en) * 2007-08-07 2009-02-12 University Of Maryland Center For Environmental Science Autonomous device with biofouling control and method for monitoring aquatic environment
CN102622359A (en) * 2011-01-27 2012-08-01 联想移动通信科技有限公司 Method and device for searching character strings in database
CN103944744A (en) * 2013-01-21 2014-07-23 博雅网络游戏开发(深圳)有限公司 Method and system for log acquisition
CN107102973A (en) * 2017-03-15 2017-08-29 中国互联网络信息中心 The data extraction method and system of a kind of CSV formatted files
CN107992407A (en) * 2017-11-15 2018-05-04 烽火通信科技股份有限公司 System and method using USB flash disk to android terminal equipment debugging
US20180239614A1 (en) * 2017-02-17 2018-08-23 Lenovo (Beijing) Co., Ltd. Method for identifying hardware device in operating system and computer apparatus thereof
CN108986437A (en) * 2018-07-23 2018-12-11 宁波三星医疗电气股份有限公司 A kind of electric power acquisition terminal monitoring adjustment method based on WIFI
CN109491878A (en) * 2018-09-26 2019-03-19 深圳市吉祥腾达科技有限公司 A method of equipment of serial Log is acquired by USB flash disk

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6378015B1 (en) * 1999-01-25 2002-04-23 George Yen Flash memory module comprising an IDE interface engageable in a vertical position perpendicular to a motherboard and having an IDE expansion slot
CN1529475A (en) * 2003-10-10 2004-09-15 复旦大学 Local area network based on mobile operating system configuration
US20090041621A1 (en) * 2007-08-07 2009-02-12 University Of Maryland Center For Environmental Science Autonomous device with biofouling control and method for monitoring aquatic environment
CN102622359A (en) * 2011-01-27 2012-08-01 联想移动通信科技有限公司 Method and device for searching character strings in database
CN103944744A (en) * 2013-01-21 2014-07-23 博雅网络游戏开发(深圳)有限公司 Method and system for log acquisition
US20180239614A1 (en) * 2017-02-17 2018-08-23 Lenovo (Beijing) Co., Ltd. Method for identifying hardware device in operating system and computer apparatus thereof
CN107102973A (en) * 2017-03-15 2017-08-29 中国互联网络信息中心 The data extraction method and system of a kind of CSV formatted files
CN107992407A (en) * 2017-11-15 2018-05-04 烽火通信科技股份有限公司 System and method using USB flash disk to android terminal equipment debugging
CN108986437A (en) * 2018-07-23 2018-12-11 宁波三星医疗电气股份有限公司 A kind of electric power acquisition terminal monitoring adjustment method based on WIFI
CN109491878A (en) * 2018-09-26 2019-03-19 深圳市吉祥腾达科技有限公司 A method of equipment of serial Log is acquired by USB flash disk

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈文敏: "基于U盘读取文件机制打开超级终端串口的研究", 《机电信息》 *

Also Published As

Publication number Publication date
CN110308937B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
CN102622234B (en) Development system and method for automatic test case
CN106325819B (en) Computer instruction processing method, coprocessor and system
CN107730394A (en) The polynary isomeric data fusion method of panorama power network based on big data
CN107992367B (en) Modbus serial port data processing method
CN103326465A (en) Power distribution network terminal access method based on IEC61850 standard
CN103856372A (en) Method and device for monitoring GOOSE messages of digital substation
CN108206522B (en) Power equipment state monitoring method and system
CN106570781B (en) Intelligent substation monitoring information step-by-step acceptance method based on three-layer two-network structure
CN106685685A (en) Method and system for monitoring performance of exchange boards across safety subareas
CN101998687A (en) Method and device for collecting network parameters of WLAN (Wireless Local Area Network)
CN107992403A (en) IO performance test methods, device, equipment and computer-readable recording medium
CN109086499A (en) A kind of topological automatic mapping method of the configuration of distribution FA on the spot
CN110308937A (en) A method of hyper terminal serial ports in electric power acquisition terminal is opened based on USB flash disk
CN102222980A (en) Transient wave-recording playback system of series capacitor compensation device or fault current limiter device
CN111786941A (en) Automatic identification method and communication method for communication protocol
CN108111578B (en) Method for accessing power distribution terminal data acquisition platform into terminal equipment based on NIO
CN104507100B (en) A method of Zigbee network is managed using wireless terminal
CN106557550B (en) Method and device for realizing rapid storage, retrieval and completion of self-description fixed-point records of power distribution terminal
CN102917007B (en) A kind of system and method based on flash animation real-time exhibition monitor equipment status
CN102752374B (en) System and method for storing and accessing power utilization efficacy data
CN106888128A (en) A kind of transformer station's Intranet monitoring system and its monitoring method
CN101183973A (en) Method of implementing command line configuration distribution in distributed system
CN110083128A (en) Mine cloud Monitor-Networking command system
CN101800843A (en) Set top box capturing printing information method
CN110222083A (en) Collecting method and device for smart machine

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