CN110308937B - Method for opening super terminal serial port in power acquisition terminal based on USB flash disk - Google Patents

Method for opening super terminal serial port in power acquisition terminal based on USB flash disk Download PDF

Info

Publication number
CN110308937B
CN110308937B CN201910352262.7A CN201910352262A CN110308937B CN 110308937 B CN110308937 B CN 110308937B CN 201910352262 A CN201910352262 A CN 201910352262A CN 110308937 B CN110308937 B CN 110308937B
Authority
CN
China
Prior art keywords
character string
file
new
digit
content
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
CN201910352262.7A
Other languages
Chinese (zh)
Other versions
CN110308937A (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

Images

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 invention relates to a method for opening a super terminal serial port in an electric power acquisition terminal based on a USB flash disk, which comprises the steps of S1, identifying the USB flash disk, and judging whether the file size and the content of the USB flash disk meet the requirements or not; s2, acquiring the content of the U disk file, and creating a new first digital character string according to the content; s3, obtaining each digit in the first digit character string, left-shifting the digit by 1, wherein the left-shifting number is equivalent to the size of the obtained current digit to obtain a plurality of new second digit character strings, and operating the plurality of new second digit character strings to obtain a new third digit character string; and S4, assigning the third digital character string to the super terminal serial port, opening the super terminal serial port, and monitoring the debugging state. The invention has convenient operation, can effectively improve the debugging efficiency and reduce the production cost.

Description

Method for opening super terminal serial port in power acquisition terminal based on USB flash disk
Technical Field
The invention relates to the technical field of power acquisition terminals, in particular to a method for opening a serial port of a super terminal in a power acquisition terminal based on a USB flash disk.
Background
The performance of the power acquisition terminal, which is one of the key factors for fully building a strong smart power grid, depends on the debugging in the development and maintenance stage to a great extent.
At present, in the development and maintenance stage, the following two ways are often adopted to monitor the debugging state. The utility model provides a super terminal is located the PC, and electric power acquisition terminal adopts long serial port line and links to each other with RS _232 serial ports or RS _485 mouth that reserves on the electric power acquisition terminal, realizes and communicates with the PC, opens the corresponding serial port of super terminal on the PC under the debugging state, receives the data that electric power acquisition terminal returned, through the super terminal real time monitoring debugging on the PC. The other type is that the super terminal is positioned on the electric power acquisition terminal, the USB port reserved on the U disk inserted into the electric power acquisition terminal is correspondingly set, the monitoring information of the electric power acquisition terminal can be automatically kept in the U disk in a debugging state, and the U disk is taken down after a period of time to obtain debugging information.
However, the above method has many problems, and the power acquisition terminal is usually installed in a place with a severe environment, such as a remote area, a high-rise utility pole or in a closed basement, and a PC and a long serial port line need to be equipped when debugging is performed by the first method, which not only increases the cost, but also causes disadvantages for monitoring because the conditions are not allowed and the monitoring cannot be realized; although long serial line can be omitted by adopting the second method, the super terminal in the power acquisition terminal cannot be opened by the second method, debugging information cannot be monitored in time, and searching of subsequent problems is not facilitated.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a method for opening a serial port of a super terminal in an electric power collection terminal based on a usb flash disk, which realizes that the super terminal is opened in a completely wireless state without changing an original structure of the electric power collection terminal, so as to monitor debugging information in real time.
In order to achieve the purpose, the invention adopts the technical scheme that: a method for opening a super terminal serial port in a power acquisition terminal based on a USB flash disk is characterized in that: the method comprises the following steps of,
s1, identifying the USB flash disk, and judging whether the file size and the content of the USB flash disk meet the requirements or not;
s2, acquiring the content of the U disk file, and creating a new first digital character string according to the content;
s3, obtaining each digit in the first digit character string, left-shifting the digit by 1, wherein the left-shifting number is equivalent to the size of the obtained current digit to obtain a plurality of new second digit character strings, and operating the plurality of new second digit character strings to obtain a new third digit character string;
and S4, assigning the third digital character string to the super terminal serial port, opening the super terminal serial port, and monitoring the debugging state.
Preferably, in the step S1, it is determined whether the content of the U-disk file meets the requirement, specifically,
s11, traversing all numbers in the file, judging whether all numbers are located between 1 and 31, if so, executing a step S12, and if not, executing a step S13;
s12, sequentially judging whether the odd-numbered digits in the file are numbers and the even-numbered digits are commas, if so, continuing to execute subsequent operations, and if not, executing a step S13;
and S13, returning an error.
Preferably, a subsequent operation is performed in step S12, specifically,
and S14, judging whether the semicolon is met, if so, ending the operation of sequentially judging whether the odd digits in the file are numbers and the even digits are commas in the step S12, and if not, continuing to execute the step S12.
Preferably, in the step S1, the size of the usb disk file is determined, specifically,
s15, judging whether the U disk file is empty, if not, executing a step S16, and if so, executing a step S13;
s16, judging whether the size of the U disk file exceeds the capacity of the buffer area, if yes, executing step S13, and if not, executing step S11.
Preferably, the contents of the U-disk file in step S2 are partial clip contents of U-disk files sequentially judged in step S12 when the judgment in step S12 is finished.
Preferably, in step S2, a new first numeric character string is created according to the content, specifically,
and S21, sequentially extracting the numbers in the partial segment content, and sequentially arranging the numbers to form the first number character string, wherein the even number of the first number character string is comma.
Preferably, the numbers in the first numeric string are different.
Preferably, in step S3, the plurality of new second numeric character strings are operated to obtain a new third numeric character string, specifically,
and S31, performing OR operation on the plurality of new second numeric character strings to obtain an OR operation result character string.
Preferably, after step S31 is executed, the following operations are also performed,
and S32, converting the character string of the OR operation result into a 32-bit character string to obtain the third digital character string.
Preferably, the step S4 is to monitor the debugging status, specifically including,
the power acquisition terminal interacts with the super terminal through the serial port, the super terminal records log information and creates a file storage log in the USB flash disk.
Preferably, the created file is named in a format of year, month, day, hour, minute and second.
Preferably, the U disk file is written in through a PC.
Preferably, the file format of the usb disk is usb.
Preferably, the buffer capacity is 2 Mbit.
Compared with the prior art, the invention has the advantages that: the method comprises the steps of writing a file in a USB flash disk, forming a new character string by selecting the content of the file, carrying out shift operation on a number 1 according to the new character string, obtaining a serial port trigger character string of a super terminal through OR operation and conversion operation, and activating the super terminal inside the power acquisition terminal.
Drawings
Fig. 1 is a flowchart of the operation of a method for opening a serial port of a super terminal in a power acquisition terminal based on a usb flash disk according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
Fig. 1 shows a preferred embodiment of a method for opening a serial port of a super terminal in a power acquisition terminal based on a usb flash disk according to the present invention. It should be mentioned that the power acquisition terminal of this application has super terminal software, and super terminal is as general serial interactive software, can be used to visit the server under the different systems of far-end, and this application downloads super terminal to the power acquisition terminal in, and the power acquisition terminal is debugged in its control of ingenious utilization, has saved PC, serial port line etc. can use manpower and materials resources greatly sparingly.
Meanwhile, the USB flash disk adopts an external bus standard, so that the connection and communication between the power acquisition terminal and other external equipment such as a computer can be standardized, and the power acquisition terminal is designed based on the QGDW 1375.2-2013 Power consumption information acquisition System type Specification for Power consumers and is completely consistent with the current power acquisition terminal in hardware and structural components.
The application adopts a USB flash disk mode to open the serial port of the super terminal in the power acquisition terminal, and particularly comprises the following steps,
s1, identifying the USB flash disk, and judging whether the file size and the content of the USB flash disk meet the requirements or not;
s2, acquiring the content of the U disk file, and creating a new first digital character string according to the content;
s3, obtaining each digit in the first digit character string, left-shifting the digit by 1, wherein the left-shifting number is equivalent to the size of the obtained current digit to obtain a plurality of new second digit character strings, and operating the plurality of new second digit character strings to obtain a new third digit character string;
and S4, assigning the third digital character string to the super terminal serial port, opening the super terminal serial port, and monitoring the debugging state.
The file in the U disk is written in by a technician through a PC in advance, the naming format of the file can be various, and the naming format is determined according to actual needs.
Specifically, in the step S1, it is determined whether the content of the U-disk file meets the requirement, and the following determination method is adopted,
s11, traversing all numbers in the file, judging whether all numbers are located between 1 and 31, if so, executing a step S12, and if not, executing a step S13;
s12, sequentially judging whether the odd-numbered digits in the file are numbers and the even-numbered digits are commas, if so, continuing to execute subsequent operations, and if not, executing a step S13;
and S13, returning an error.
The subsequent operation is specifically to determine whether the semicolon is encountered, if yes, the operation of sequentially determining whether the odd-numbered digits in the file are numbers and the even-numbered digits are commas is ended in step S12, and if not, the operation of step S12 is continued. Through the judgment of the number division, the fragments can be effectively and quickly selected for subsequent utilization, and the efficiency is improved.
And the determination of the size of the usb disk file in step S1 is corresponding,
s15, judging whether the U disk file is empty, if not, executing a step S16, and if so, executing a step S13;
s16, judging whether the size of the U disk file exceeds the capacity of the buffer area, if yes, executing step S13, and if not, executing step S11. In this embodiment, the buffer capacity is 2Mbit, and of course, the specific buffer capacity is determined by the power acquisition terminal itself.
As described above, after the usb disk file is determined to meet the requirement, an operation of forming a new character string is performed, and the contents of the usb disk file used in forming the character string are the partial segment contents of the usb disk file sequentially determined in step S12 when the determination in step S12 is completed.
In this way, in step S2, a new first numeric character string is created according to the content, and corresponding to the first numeric character string, S21, the numbers in the partial segment content are sequentially extracted and arranged to form the first numeric character string, and the even number of the first numeric character string is comma. When the numbers of the partial segment contents are extracted, if the same number is encountered, the number is only extracted once, obviously, the extracted number is necessarily the number appearing for the first time, and the new first number character string formed in this way has the characteristic of different composition numbers.
In the step S3, the new second numeric character strings are operated to obtain a new third numeric character string, specifically, in S31, the new second numeric character strings are subjected to an or operation to obtain an or operation result character string.
In order to enable the formed character field to effectively activate the super terminal serial port, after the step S31 is executed, the operation is further performed, and S32, the or operation result character string is converted into a 32-bit character string, so as to obtain the third numeric character string.
And after the super terminal is activated, the super terminal is in a monitoring and debugging state, namely, the power acquisition terminal interacts with the super terminal through the serial port, the super terminal records log information and creates a file storage log in the USB flash disk. Here, the created file is named in a year, month, day, hour, minute, second format.
According to the invention, on the premise of not changing the original structure of the power acquisition terminal, the super terminal is directly opened in a USB flash disk mode, so that terminal debugging information is sent to the super terminal, and real-time monitoring and debugging of the terminal in a completely wireless state are realized, thereby not only facilitating field operation and maintenance of the power acquisition terminal, improving timeliness, ensuring the accuracy of log information storage, but also saving cost.
In addition to the above-mentioned modifications, other similar modifications are also included in the scope of the modifications of the present invention, and are not described herein in detail. While embodiments of the invention have been shown and described, it will be understood by those skilled in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (13)

1. A method for opening a super terminal serial port in a power acquisition terminal based on a USB flash disk is characterized in that: the method comprises the following steps of,
s1, identifying the USB flash disk, and judging whether the file size and the content of the USB flash disk meet the requirements or not;
s2, acquiring the content of the U disk file, and creating a new first digital character string according to the content;
s3, obtaining each digit in the first digit character string, left-shifting the digit by 1, wherein the left-shifting number is equivalent to the size of the obtained current digit to obtain a plurality of new second digit character strings, and operating the plurality of new second digit character strings to obtain a new third digit character string;
s4, assigning a third digital character string to the super terminal serial port, opening the super terminal serial port, and monitoring the debugging state;
wherein, in the step S1, it is determined whether the content of the usb disk file meets the requirement, specifically,
s11, traversing all numbers in the file, judging whether all numbers are located between 1 and 31, if so, executing a step S12, and if not, executing a step S13;
s12, sequentially judging whether the odd-numbered digits in the file are numbers and the even-numbered digits are commas, if so, continuing to execute subsequent operations, and if not, executing a step S13;
and S13, returning an error.
2. The method of claim 1, further comprising: in step S12, a subsequent operation is performed, specifically,
and S14, judging whether the semicolon is met, if so, ending the operation of sequentially judging whether the odd digits in the file are numbers and the even digits are commas in the step S12, and if not, continuing to execute the step S12.
3. The method of claim 2, further comprising: in step S1, the size of the usb disk file is determined, specifically,
s15, judging whether the U disk file is empty, if not, executing a step S16, and if so, executing a step S13;
s16, judging whether the size of the U disk file exceeds the capacity of the buffer area, if yes, executing step S13, and if not, executing step S11.
4. The method of claim 2, further comprising:
the content of the U disk file in the step S2 is the partial segment content of the U disk file judged in sequence in the step S12 when the judgment of the step S12 is finished.
5. The method of claim 4, further comprising: in step S2, a new first numeric character string is created according to the content, specifically,
and S21, sequentially extracting the numbers in the partial segment content, and sequentially arranging the numbers to form the first number character string, wherein the even number of the first number character string is comma.
6. The method of claim 1, further comprising:
the numbers in the first numeric string are different.
7. The method of claim 1, further comprising: in step S3, the plurality of new second numeric character strings are operated to obtain a new third numeric character string, specifically,
and S31, performing OR operation on the plurality of new second numeric character strings to obtain an OR operation result character string.
8. The method of claim 7, further comprising: after step S31 is performed, the following operations are also performed,
and S32, converting the character string of the OR operation result into a 32-bit character string to obtain the third digital character string.
9. The method of claim 1, further comprising: in step S4, the debugging status is monitored, specifically including,
the power acquisition terminal interacts with the super terminal through the serial port, the super terminal records log information and creates a file storage log in the USB flash disk.
10. The method of claim 9, further comprising:
the created file is named in a format of year, month, day, hour, minute and second.
11. The method of claim 1, further comprising:
and the U disk file is written in through a PC.
12. The method of claim 1, further comprising:
LOG is the file format of the USB flash disk.
13. The method of claim 3, further comprising:
the buffer capacity is 2 Mbit.
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 CN110308937A (en) 2019-10-08
CN110308937B true 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 (8)

* 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
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8038937B2 (en) * 2007-08-07 2011-10-18 University Of Maryland Center For Environmental Science Autonomous device with biofouling control and method for monitoring aquatic environment
US10671403B2 (en) * 2017-02-17 2020-06-02 Lenovo (Beijing) Co., Ltd. Method and apparatus for identifying hardware device in operating system

Patent Citations (8)

* 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
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
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 (2)

* Cited by examiner, † Cited by third party
Title
基于U盘读取文件机制打开超级终端串口的研究;陈文敏;《机电信息》;20190315(第8期);第22-23页 *
陈文敏.基于U盘读取文件机制打开超级终端串口的研究.《机电信息》.2019,(第8期), *

Also Published As

Publication number Publication date
CN110308937A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
CN100495041C (en) Remote automatic centralized control monitoring meter reading system
CN102608962B (en) A kind of power information collecting device automatic maintenance method from bottom to top
CN108345524A (en) Method for monitoring application program and Application Monitoring device
CN107730394A (en) The polynary isomeric data fusion method of panorama power network based on big data
CN102955977A (en) Energy efficiency service method and energy efficiency service platform adopting same on basis of cloud technology
CN102984244A (en) Uploading system and uploading method of bill data
CN102969796A (en) Near-real-time electric quantity monitoring and dispatching management system for rural power grid
CN104980552B (en) Realize the method and system of Android mobile terminal automatic test
CN109302646A (en) A kind of implementation method of the water meter long-distance meter-reading system based on GPRS and system
CN107957904B (en) Power consumption information acquisition task management method based on object-oriented exchange protocol
CN102736594A (en) Modular design method of unified platform of intelligent power distribution terminal
CN110308937B (en) Method for opening super terminal serial port in power acquisition terminal based on USB flash disk
CN103810094A (en) Executing method and device for test case and test tool
CN101324989A (en) Automatic recognition technique of electrical energy meter in centralized meter reading system
CN109189724B (en) Method and device for improving audio and video data storage efficiency of video monitoring system
CN108334582B (en) Method for compressing historical data in real-time database
CN106557550B (en) Method and device for realizing rapid storage, retrieval and completion of self-description fixed-point records of power distribution terminal
CN106446133A (en) Method and device for simultaneous butt joint of two databases
CN104516953B (en) A kind of black box subsystem for power dispatching automation magnanimity message
CN102752374B (en) System and method for storing and accessing power utilization efficacy data
CN103379519A (en) Smartphone-based mobile communication network testing method
CN101183973A (en) Method of implementing command line configuration distribution in distributed system
CN103633736A (en) Online monitoring communication method from substation sub station to main station
CN111625517B (en) New energy real-time data processing method and device based on change storage
CN103294053A (en) K-line diagnostic system for automobiles

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