[go: up one dir, main page]

CN106060066A - Embedded linux-based method for realizing terminal maintenance and information release - Google Patents

Embedded linux-based method for realizing terminal maintenance and information release Download PDF

Info

Publication number
CN106060066A
CN106060066A CN201610495093.9A CN201610495093A CN106060066A CN 106060066 A CN106060066 A CN 106060066A CN 201610495093 A CN201610495093 A CN 201610495093A CN 106060066 A CN106060066 A CN 106060066A
Authority
CN
China
Prior art keywords
file
client
cgi
information
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610495093.9A
Other languages
Chinese (zh)
Inventor
孙明刚
徐军
杨坤龙
李春雷
刘亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Integrated Electronic Systems Lab Co Ltd
Original Assignee
Integrated Electronic Systems Lab 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 Integrated Electronic Systems Lab Co Ltd filed Critical Integrated Electronic Systems Lab Co Ltd
Priority to CN201610495093.9A priority Critical patent/CN106060066A/en
Publication of CN106060066A publication Critical patent/CN106060066A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to an embedded linux-based method for realizing terminal maintenance and information release. According to the method, information interaction between an embedded web server and all functional modules of an electricity information collection terminal system is realized by using a common gateway interface (CGI) mechanism; and a client can visit an electricity information collection terminal service process by installing a web browser in a local computer, so that electricity information collection terminal maintenance and information release are realized. Without being limited by time and space, the user uses the WEB browser to visit, monitor and maintain a far end electricity information collection terminal through the Internet, specific software is not installed, and the method has the characteristic of cross-platform. An operator does not need to go to the site to operate, and the electricity information collection terminal maintenance is more conveniently, is real-time, and is efficient and safe.

Description

Terminal maintenance and the method for information issue is realized based on embedded Linux
Technical field
The present invention relates to power utilization information collection system field used for intelligent electric network, be specifically related to a kind of real based on embedded Linux The method that existing terminal maintenance and information are issued.
Background technology
Along with the development of Internet technology, embedded device management and mutual in, take based on embedded type web The development and application of business device becomes main flow.The general B/S structure that uses, i.e. runs a web server on embedded device, should Server needs to support script or CGI function, uses this structure to realize the generation of dynamic page.User has only in client Just can be realized the management to embedded device by web browser conveniently and efficiently, monitor and safeguard.
Power information acquisition terminal is the equipment gathering each information gathering point power information, it is possible to achieve electric energy meter data Collection, data management, data double-way transmission and forward or perform control command equipment.Power information acquisition terminal is by answering The classes such as special transformer acquisition terminal, centralized automatic meter-reading terminal (including concentrator, harvester), distributed energy monitor terminal it are divided into place Type.
Power information acquisition terminal is in During Process of Long-term Operation, because of complexity, the multiformity of running environment, polytropy and product The factors such as the limitation of product service life and developer's thinking logic, the routine maintenance for product is particularly important.Use telecommunications Breath acquisition terminal is on stream, it is also desirable to be analyzed the problem run into during exploitation accurate and effective orientation problem Place, maintenance and problem investigation method currently for power information acquisition terminal have following several:
1, by log information and running log record terminal operating situation.Power information acquisition terminal increase log information or Running log writing function, power information acquisition terminal in running, can by its mutual message with other equipment or Self-operating log recording, in specific file, when on-site terminal needs to safeguard, then uses third party's instruments such as FTP, SSH to incite somebody to action Message or daily record are derived to local, by being analyzed determining problem place to message or running log;2, controlled by system Acquisition terminal is safeguarded by platform.Various Linux can be performed by system control position to instruct, it is achieved system administration, process pipe Reason, checks system information, stack information, creates, replicates, moves, edits, deletes the correlation function such as file or catalogue, comes with this Reach the maintenance function to acquisition terminal linux system;
3, use field maintenance device that acquisition terminal is safeguarded.Scene can use palm machine to join acquisition terminal Number inquiry and setting, it is also possible to acquisition terminal is carried out application program updating, if combining copy controller can realize acquisition terminal load Ripple is checked meter the investigation of aspect problem, can monitor acquisition terminal by power line carrier with have the mutual of harvester or carrier wave meter under its command Message;
4, use special maintenance software that acquisition terminal is safeguarded.The necessity safeguarded in view of acquisition terminal, typically Each acquisition terminal manufacturer has all developed and has safeguarded software accordingly, it is possible to achieve look into parameter setting, the parameter of acquisition terminal The correlation function such as ask, remotely controls, application program updating, terminal resets, inquiry data, forwarding are checked meter;
5, use liquid crystal interface that acquisition terminal is safeguarded.Although Guo Wang company to the display content of liquid crystal display screen (LCD), Format, arrangement position etc. have respective specified, but can be by being extended liquid crystal interface, real in extension liquid crystal interface The now maintenance function to acquisition terminal, it is also possible to realize the real-time display to acquisition terminal with each equipment mutual message;
6, use main station system that acquisition terminal is safeguarded.Main station system is powerful, it is possible to record main website and electricity consumption The mutual message of information acquisition terminal, can carry out the operations such as parameter setting, inquiry, can inquire about the history of terminal inner storage Data, can realize the maintenance function to acquisition terminal to a certain extent.
But there is following several respects defect in the above-mentioned several maintaining methods that presently, there are:
1, mutual message or log recording function need acquisition terminal in real time in storage device write terminal set with other Standby mutual message or system running log, cause the operation to storage device excessively frequent, can have a strong impact on storage device In service life, the flash equipment at file system place is easily caused to produce bad block;
2, use the softwares of the third party such as SSH, FTP, hyper terminal or special maintenance software that acquisition terminal is safeguarded, big portion Dividing and need to install, common customer considers system run all right and safety factor, forbids installing similar software in main website side, As needed to use, then must carry equipment such as being provided with the notebook of corresponding software, netting twine and operate to scene, much gather end End installation site is more remote, is even arranged in the distribution box that position is higher, and on-site maintenance operation easier is very big, acquisition terminal Frequency faces high pressure equipment, and misoperation can affect personal safety;
3, real-time can not be guaranteed.Mutual message or running log are in recording process, for preventing log file excessive, Need file carries out periodically cutting, or limit the size of message file, if acquisition terminal message exports to this not in time Be analyzed, perhaps can affect the ageing of message and integrity;
4, the above-mentioned several maintaining methods that presently, there are all cannot realize the maintenance to acquisition terminal system from hardware view, Do not possess inquiry hardware register and the function of configuration hardware register, the most not Inspection and maintenance to bottom hardware driver Function;
5, all cannot be realized linux system, application program, file system by any of the above described a kind of maintaining method merely System, the full maintenance of bottom layer driving, need to combine above-mentioned multiple maintaining method and between different software switching realize gathering Terminal maintenance, operation complexity, but also limited by software running platform, just need to install because of software, therefore, associated maintenance operates Must go to on-the-spot execution;
6, use palm machine and copy controller that on-site terminal is safeguarded, need the palm machine software journey that relevant manufacturers exploitation is corresponding Sequence, copy controller directly contacts electric lines of force also can affect equipment and personal safety, and on-site maintenance adds maintenance cost;
7, use the softwares such as SSH, FTP that acquisition terminal file system is operated, easily revise the file of some file Name and file content, cause the data failure of vital document, affects the stability that system is run, easily causes customers' conflict event and send out Raw.
Summary of the invention
For the problems referred to above, the present invention provides a kind of limitation that can break existing maintenance mode, strengthens power information Acquisition terminal safety, real-time and motility in maintenance process realize terminal maintenance and letter based on embedded Linux The method that breath is issued.
For solving the problems referred to above, the technical scheme that the present invention takes is: realize terminal maintenance and letter based on embedded Linux The method that breath is issued, comprises the steps:
The transplanting of the embedded web server that step one, offer CGI support
First from official website, download embedded web server source code, select suitable compiler to enter according to Target Board Row source code compiles, and compiled file destination and configuration file is copied under Target Board respective directories and is taken by embedded type web Business device process is arranged to acquisition terminal start self-starting;
Currently used popular embedded web server has thttpd, boa, go ahead etc., and these several moneys are embedded Well support can be transplanted in linux system and be provided CGI to web server easily, and the design is selected CGI, is because CGI performance and compatibility is relatively good, can support that polyglot is developed, and transplantability is relatively good, and this maintenance is Uniting the not harshest for concurrent demand, CGI can meet design requirement completely.
Step 2, the design of login authentication interface html list
Login authentication interface, for the use authority of the user of authentication-access embedded web server, also possesses amendment and uses Name in an account book and the function of password;When need to user input username and password verify or by user change user name and Password is set up TCP and is connected and information is passed to the CGI process of web server end and process when sending web server to;
In login authentication interface form, embed JavaScript script, provide prompting letter when user's input information is the most full-time Breath, when user exists change user name, cryptography requirements when, dynamically displaying user name, password amendment interface (include inputting former Input frames such as user name, original code, new user name, confirmation new user name, new password, confirmation new password possessing determine, cancel, Button is submitted in logins etc. to), only as the user needing the username and password that user is inputted to verify or user to be changed Name and password are just set up TCP when sending server to and are connected and information is passed to the CGI process of server end and process, login Authentication interface html form design is stored in what Target Board web server configuration file was specified with .html formatted file after completing Under catalogue.
Step 3, functional part select the design of interface html list
Functional part select interface provide each maintenance function entrance, including linux system safeguard, application process safeguard, File system is mutual, bottom layer driving is mutual, debugging interface, and functional part is civilian with .html form after selecting INTERFACE DESIGN to complete Part is stored under the catalogue that Target Board web server configuration file is specified;
Step 4, client list design with CGI process interface Extended Protocol
The design each function of client list submits the Interface Expanding agreement between button and CGI process to, uses list variable FCCV distinguishes the big class of following functions: log-on message checking, linux system are safeguarded, application process is safeguarded, file system is mutual, the end Layer drives mutual, debugging interface;The big class of each function has each subfunction under its command and uses application level function code AFN to make a distinction;
User clicks on certain in client browser and submits button to, and form data can be submitted to service by browser Device, server is passed CGI process by standard output oral instructions and is processed, in view of the service type of client submission is the most, Need to design each function of html list and submit the Interface Expanding agreement between button and CGI process to.
Step 5, CGI(Common gateway interface) cgi script design
The function that CGI(Common gateway interface) cgi script mainly realizes has: user login information processes, the request of customer in response end is right Linux system carries out safeguarding, customer in response end request application processes carries out safeguarding, the request of customer in response end is entered with file system Row is mutual, bottom hardware driving is interacted, provides debugging interface to realize single line in application processes by the request of customer in response end The functions such as the debugging of journey.According to modular design method and scalability requirement, each CGI function uses difference in functionality module Realize: from environmental variable REQUEST_METHOD, first obtain client table forms data way of submission, if GET mode, From environmental variable QUERY_STRING, then obtain client submit data to, if POST mode, then obtain from standard input port Take client and submit data to.Then according to URL encoding and decoding are regular, it is decoded the client table forms data received processing, from The form data parsed enters following different functional module program according to values different for list variable FCCV process: Log-on message authentication module, linux system maintenance module, application process maintenance module, file system interactive module, bottom layer driving Interactive module, debugging interface module.
The relevant information that the present invention uses active document technology to input client carries out anticipation;Use CGI(Common gateway interface) It is mutual with the information of the power information each functional module of acquisition terminal system that CGI mechanism realizes embedded web server;For answering With, client has only to install in a local computer web browser, it is possible to access power information acquisition terminal service routine, Realize power information acquisition terminal to safeguard and information issue.
The process of log-on message authentication module comprises the steps: whether there is passwdnet under a. inspection/etc catalogue File, if it does not exist, then newly-built passwdnet file, and default username and password (being admin) are encrypted place Write in passwdnet file after reason;
B. log-on message authentication module is divided into two subfunctions according to application level function code AFN: user login information is verified Revise with user login information;If user login information checking then performs step c, if user login information amendment then performs Step d;
C. open/etc catalogue under passwdnet file, from file, read the username and password of encryption, to visitor The username and password that family end sends is encrypted, if the two is consistent, then log-on message is proved to be successful, then by functional part Interface html formfile is selected to submit client to;If the two is inconsistent, then returns user's authentication failed information, and login is recognized Card interface html formfile submits client to;
D. open/etc catalogue under passwdnet file, from file, read the username and password of encryption, to visitor Original subscriber's name and password that family end sends are encrypted, if the two is consistent, then new user name and password are encrypted place Writing passwdnet file after reason, and submit login authentication interface html formfile to client, username and password is repaiied Make merit into;If the two is inconsistent, then return original subscriber's name or code error information, and by login authentication interface html formfile Submit client to.
The process of linux system maintenance module comprises the steps:
A. obtaining the Linux instruction that will perform the form data after decoding, calling system function popen completes The execution of Linux instruction.On the one hand popen function creates subprocess execution shell-command and completes the execution of Linux instruction, separately On the one hand the pipeline between CGI process and subprocess is further created;
B. for inquiry class Linux instruction, CGI process obtains subprocess by the pipeline between itself and the subprocess that create The data returned, return to client according to after CGI coding criterion and html format analysis processing by standard output to returning data;
C. for performing the instruction of class Linux, after calling popen function, popen function return value is first determined whether, if returning Return NULL, then explanation instruction performs failure, by standard output mouth, instruction execution failure information is returned to client, if returned Returning value is not NULL, then query statement performs result, if meeting the requirements, then explanation instruction runs succeeded, and instruction is run succeeded Information returns to client by standard output mouth, if continuous-query 3 times is the most undesirable, then explanation instruction performs Failure, performs instruction unsuccessfully information and returns to client by standard output mouth.
The process of application process maintenance module comprises the steps:
A, application process maintenance module perform different sub-function module according to application level function code AFN difference: to collection The parameter query of terminal, parameter are arranged, long-range control, terminal resets, software upgrading, data query, manual framing;
B, form data after decoding obtain application level function code AFN, information point Pn, info class Fn and data sheet Metadata, carries out framing process according to the communication protocol between main website and terminal that Guo Wang company stipulations specify;
Frame is sent to application process by interprocess communication mode and processes by c, CGI process;
D, CGI process receives the Echo Frame that application process returns, if time-out does not receives the Echo Frame of application process, then returns Mistake;
The Frame that e, parsing receive, according to the application level function code AFN of this sub-function module performed, determines and needs The data of parsing are loaded in corresponding list during rebuilding list content and return to client by list content to be rebuild End browser.The process of file system interactive module comprises the steps:
A, file interaction module perform different subfunction according to application level function code AFN difference: log file download, should With program file renewal, the renewal of cgi script file, driver update, user-defined file is downloaded, user-defined file is uploaded, but It is mainly to include two parts from the point of view of entirety: uploading and downloading of file, if files passe, then goes to step b, if under file Carry, then go to step c;
B, first form data after decoding obtain this condition code and the catalogue of upper transmitting file and filename, Judge the end of condition code and the beginning of file data, then according to different subfunctions under corresponding catalogue newly-built accordingly Temporary file, is written to the file data read from standard input port in newly-built temporary file, and data have write afterwards will Original is deleted, and temporary file name is modified as the filename of original, and going wrong during files passe then will be interim File is deleted and returns, to client browser, the prompting that files passe is failed;
C, first form data after decoding obtain the place catalogue of file and filename needing to download, then Under assigned catalogue, find corresponding file and file content is sent to client browser by standard output port.
Bottom layer driving interactive module performs different subfunctions according to application level function code AFN difference: post bottom hardware The inquiry of storage, configuration and the Applied layer interface function providing each bsp driver are tested.
The process of debugging interface module is as follows: firstly the need of by the file destination after each multi-threaded program compiling to be debugged Uploading under acquisition terminal particular category, then by interprocess communication mode, CGI notifies that application process stops thread to be debugged Operation, CGI process is initiated a subprocess and also the operation code of subprocess is replaced to thread code to be debugged, makes thread A subprocess as CGI process runs, and by standard output oral instructions, the Debugging message in running is delivered to client End shows, by the analysis of Debugging message judges the problem source of this thread in client.
Beneficial effects of the present invention is as follows:
1, evade the software login storage devices such as FTP and the risk of file content has likely been deleted or modified, download file The Shi Caiyong CGI each file of indirect operation file system, is also first to write file data to interim literary composition when of upper transmitting file In part, question paper write success and data carry out file replacement the most again, do not exist and delete file or amendment file content by mistake Risk, it is ensured that acquisition terminal system run safety and stability;
2, user can not be limited by space-time, utilizes web browser to complete far-end power information by Internet and adopts The access of collection terminal, monitor and the operation such as maintenance, it is not necessary to specific software is installed, there is cross-platform characteristic, breach acquisition terminal It is difficult to the limitation of remote maintenance, impact on power information acquisition system in maintenance process is preferably minimized limit;
3, the direct contact to electric lines of force or high pressure equipment in maintenance process is avoided, it is ensured that personal safety;
4, message and the system that can download acquisition terminal record in power information acquisition system main website side in real time run day Will, it is ensured that message and the real-time of system running log and effectiveness, it is possible to provide effectively opinion for terminal maintenance to greatest extent According to;
5, possess the detection function to bottom hardware equipment, from hardware view, acquisition terminal can be safeguarded, permissible Inquiring about hardware register independent of application process or configure, each function of application interface simultaneously provided driver is entered Row test;
6, this maintenance system provides debugging interface, can be adjusted separately through debugging interface by each for application process thread Examination;
7, WEB is used to issue organic combination together the multiple acquisition terminal maintenance mode that presently, there are, it is to avoid the Software of the third party needs to install registration and is limited by software platform and need switch between different software to bother in maintenance process.
8, real time inspection terminal inner actual operating state can be instructed by Linux, truly realize terminal fortune The monitoring in real time of row, in real time control, real-time management.
9, using modular design method to carry out CGI software program design, autgmentability is good;
10, design process possesses the link such as authentication and encryption, it is to avoid abnormal operation issuable impact, peace Full property is preferable;
11, message and system running log writing function can be turned on and off by client browser real time remote, Avoid that message and the frequent erasable flash of system running log during terminal operating cause produced the storage device life-span Impact;
12, compared to the interface between server and the application process of interpreted languages realization, compiled language is used more Can guarantee that the safety of system, it also avoid the trouble needing to increase interpreter in acquisition terminal system;
13, terminal maintenance and information issuing system are realized based on embedded Linux, can be according to the inhomogeneity of acquisition terminal Type and performance, carry out function cutting and Function Extension, flexibly closer to maintenance needs.
Detailed description of the invention
A kind of realize the method that terminal maintenance and information are issued based on embedded Linux, comprise the steps:
The transplanting of the embedded web server that step one, offer CGI support
First from official website, download embedded web server source code, select suitable compiler to enter according to Target Board Row source code compiles, and compiled file destination and configuration file is copied under Target Board respective directories and is taken by embedded type web Business device process is arranged to acquisition terminal start self-starting;
Step 2, the design of login authentication interface html list
Login authentication interface, for the use authority of the user of authentication-access embedded web server, also possesses amendment and uses Name in an account book and the function of password;When need to user input username and password verify or by user change user name and Password is set up TCP and is connected and information is passed to the CGI process of web server end and process when sending web server to, log in Authentication interface is stored under the catalogue that Target Board web server configuration file is specified with .html formatted file after having designed;
Step 3, functional part select the design of interface html list
Functional part select interface provide each maintenance function entrance, including linux system safeguard, application process safeguard, File system is mutual, bottom layer driving is mutual, debugging interface, and functional part is civilian with .html form after selecting INTERFACE DESIGN to complete Part is stored under the catalogue that Target Board web server configuration file is specified;
Step 4, client list design with CGI process interface Extended Protocol
The design each function of client submits the Interface Expanding agreement between button and CGI process to, uses list variable FCCV Distinguish the big class of following functions: log-on message checking, linux system are safeguarded, application process is safeguarded, file system is mutual, bottom drives Dynamic mutual, debugging interface;The big class of each function has each subfunction under its command and uses application level function code AFN to make a distinction, and sees following table:
Corresponding relation between FCCV value and the big class of each function
FCCV Functional part title
0x00 Log-on message is verified
0x01 Linux system is safeguarded
0x02 Application process is safeguarded
0x03 File system is mutual
0x04 Bottom layer driving is mutual
0x05 Debugging interface
Log-on message checking include user login information checking and user login information revise two subfunctions, AFN value and Corresponding relation between subfunction sees following table:
AFN value verifies each subfunction corresponding relation with log-on message
Application process safeguards a series of functions mainly realizing special maintenance software, continues to use the master that Guo Wang company stipulations specify Standing and terminal communication protocol, divide it according to application level function code difference, AFN value is with each subfunction corresponding relation such as Under, info class that each subfunction is corresponding and the communication protocol that information point is also fully consistent with between main website and terminal:
AFN value safeguards each subfunction corresponding relation with application process
File system mainly realizes uploading and download function of file, is directed to application program, CGI, driving Corresponding relation between the mutual each subfunction of the upgrading of program etc., AFN value and file system sees following table:
AFN value and the mutual each subfunction corresponding relation of file system
AFN Subfunction title
0x00 Log file download
0x01 Application file updates
0x02 Cgi script file updates
0x03 Driver file updates
0x04 User-defined file is downloaded
0x05 User-defined file is uploaded
Bottom layer driving mainly realizes the inquiry to hardware register, setting and the test merit to each driver Can, corresponding relation such as following table:
AFN value and the mutual each subfunction corresponding relation of bottom layer driving
AFN Subfunction title
0x00 Depositor is inquired about
0x01 Depositor is arranged
0x02 Driver is tested
Step 5, CGI(Common gateway interface) cgi script design
1, form data obtains: obtains information between server and CGI process from environmental variable REQUEST_METHOD and passes Pass mode, if GET mode, then from environmental variable QUERY_STRING, obtain form data, if POST mode, first Obtain the length of form data from environmental variable CONTENT_LENGTH, then read the list of regular length from standard input port Data;
2, URL decoding: according to URL encoding and decoding rule, is decoded the form data received processing, the table analytically gone out Forms data enters different functional module programs according to values different for FCCV process, following 38;
3, log-on message authentication module processes.
A. whether there is passwdnet file under inspection/etc catalogue, if it does not exist, then newly-built passwdnet file, And default username and password (can specify voluntarily) are encrypted afterwards write passwdnet file in;
B. user login information authentication module (FCCV=0x00) mainly includes two subfunctions: user login information is verified Revise with user login information.If AFN is 0x00, then perform step c, if AFN is 0x01, then perform step d;
C. user login information verification process.Open/etc catalogue under passwdnet file, read at encryption from file The username and password of reason, the username and password sending client is encrypted, if the two is consistent, then log-on message It is proved to be successful, then functional part selects interface html formfile submit client to;If the two is inconsistent, then returns user and test Card failure information, and submit user's login interface html formfile to client;
D. user login information amendment processes.Open/etc catalogue under passwdnet file, read at encryption from file The username and password of reason, the original subscriber's name and the password that send client are encrypted, if the two is consistent, then will newly use Name in an account book and password are encrypted write passwdnet file afterwards, and are submitted to by user's login interface html formfile Client, username and password is successfully modified;If the two is inconsistent, then returns original subscriber's name or code error information, and will use Family login interface html formfile submits client to.
4, linux system maintenance module processes.
A. obtaining the Linux instruction that will perform the form data after decoding, calling system function popen completes The execution of Linux instruction.On the one hand popen function creates subprocess execution shell-command and completes the execution of Linux instruction, separately On the one hand the pipeline between CGI process and subprocess is further created;
B. for inquiry class Linux instruction, CGI process obtains subprocess by the pipeline between itself and the subprocess that create The data returned, return to client according to after CGI coding criterion and html format analysis processing by standard output to returning data;
C. for performing the instruction of class Linux, after calling popen function, popen function return value is first determined whether, if returning Return NULL, then explanation instruction performs failure, by standard output mouth, instruction execution failure information is returned to client, if returned Returning value is not NULL, then query statement performs result, if meeting the requirements, then explanation instruction runs succeeded, and instruction is run succeeded Information returns to client by standard output mouth, if continuous-query 3 times is the most undesirable, then explanation instruction performs Failure, performs instruction unsuccessfully information and returns to client by standard output mouth.
5, application process maintenance module processes.
A, application process maintenance module (FCCV=0x02) mainly realize the parameter query to acquisition terminal, parameter is arranged, The subfunctions such as long-range control, terminal resets, software upgrading, data query, manual framing, perform different according to different AFN Sub-function module;
B, form data after decoding obtain application level function code AFN, information point Pn, info class Fn and data sheet Metadata, carries out framing process according to the communication protocol between main website and the terminal of state's net corporate policy;
C, by interprocess communication mode (can be realized by modes such as shared drive, message queue, pipelines) by data Frame is sent to application process and processes;
D, reception application process are sent to the Echo Frame of CGI process.If time-out does not receives the Echo Frame of application process, then return Return mistake;
The Frame that e, parsing receive, according to the AFN of this sub-function module performed, determines the webpage needing to rebuild The data of parsing are loaded in corresponding list during rebuilding web page contents and return to client browser by content.
6, file system interactive module processes.
A, file system interactive module (FCCV=0x03) mainly realize uploading and download function of file, according to different AFN performs log file download, application program update, cgi script renewal, driver update, self-defined download respectively, makes by oneself Justice is uploaded, and the essence of each sub-function module is all the application with download function of uploading of file, but distinguishes as shown in the table:
If desired perform files passe, then go to step b, if desired perform file download, then go to step c;
B, files passe.The general POST mode that uses, first obtains this feature the form data after decoding Code and the catalogue of upper transmitting file and filename, can judge the end of condition code and opening of file data by character ‘ r n ' Begin, then according to different subfunctions newly-built corresponding temporary file under corresponding catalogue, by read from standard input port File data is written in newly-built temporary file, and original is deleted after having write by data, and temporary file name is revised Become the filename of original.Notice that application program, cgi script, driver file need checking in view of safety before uploading Username and password, goes wrong during files passe and is then deleted by temporary file and return on file to client browser Pass failed prompting;
C, file download.The general GET mode that uses, first obtains, the form data after decoding, the literary composition needing to download The place catalogue of part and filename, then find corresponding file and by file content by standard output end under assigned catalogue Mouth is sent to client browser.
7, bottom layer driving interactive module processes.
Bottom layer driving interactive module (FCCV=0x04) mainly realizes the inquiry to bottom hardware depositor, configuration and to often Individual bsp driver carries out the function tested., hardware implementations difference different according to acquisition terminal type, this module relates to The flow process of the driver needing inquiry and the depositor number of configuration, type and needs test arrived is the most inconsistent;Such as, one As acquisition terminal all possess AC sampling chip, processor and friendship and adopt between chip by SPI communication, AC sampling chip wraps Containing various depositors, some of which depositor is the calibration factor of configuration carrying out exchange calibration when, works as AC sampling After going wrong, first we just can test SPI driving by this module and wait the most normal, if driver is normal, and can To inquire about the configuring condition of depositor, read calibration factor therein and calculate, it may be judged whether calibration factor occurs abnormal Deng, this part can diagnose the special circumstances such as driver is abnormal, hardware configuration is abnormal, hardware device is abnormal;
8, debugging interface resume module.
Debugging interface module is that each thread of application program is individually debugged and provided interface.Firstly the need of by each line to be debugged File destination after Cheng Chengxu compiling uploads under acquisition terminal particular category, and then CGI is led to by interprocess communication mode Knowing that application process stops the operation of thread to be debugged, then CGI process initiates a subprocess and by the operation code of subprocess Replace to thread code to be debugged, make thread run as a subprocess of CGI process, and by the debugging in running Information is delivered to client by standard output oral instructions and is shown, by the analysis of Debugging message being judged this line in client Which part existing problem of journey.

Claims (7)

1. realize terminal maintenance and the method for information issue based on embedded Linux, it is characterised in that comprise the steps:
The transplanting of the embedded web server that step one, offer CGI support
First download embedded web server source code from official website, then select suitable compiler to carry out according to Target Board Source code compiles, and compiled file destination and configuration file is copied under Target Board respective directories and by embedded type web service Device process is arranged to acquisition terminal start self-starting;
Step 2, the design of login authentication interface html list
Login authentication interface, for the use authority of the user of authentication-access embedded web server, also possesses amendment user name Function with password;When needing the username and password of user's input to be verified or by the username and password of user's change Set up TCP when sending web server to connect and information is passed to the CGI process of web server end and process, login authentication INTERFACE DESIGN completes to leave under the catalogue that Target Board server profile is specified with .html formatted file;
Step 3, functional part select the design of interface html list
Functional part selects interface to provide the entrance of each maintenance function, including linux system maintenance, application process maintenance, file System interaction, bottom layer driving are mutual, debugging interface, and functional part selects INTERFACE DESIGN to complete to leave in .html formatted file Under the catalogue that Target Board server profile is specified;
Step 4, client list design with CGI process interface Extended Protocol
The design each function of client list submits the Interface Expanding agreement between button and CGI process to, uses list variable FCCV Distinguish the big class of following functions: log-on message checking, linux system are safeguarded, application process is safeguarded, file system is mutual, bottom drives Dynamic mutual, debugging interface;The big class of each function has each subfunction under its command and uses application level function code AFN to make a distinction;
Step 5, CGI(Common gateway interface) cgi script design
First CGI process obtains form data from environmental variable REQUEST_METHOD and submits mode, if GET mode, then Obtain list data delivery from environmental variable QUERY_STRING, if POST mode, then from standard inputs, obtain list Data delivery;Then according to URL encoding and decoding are regular, it is decoded the form data received processing, the list number analytically gone out Enter following different functional module program according to the middle value different according to list variable FCCV to process: log-on message checking mould Block, linux system maintenance module, application process maintenance module, file system interactive module, bottom layer driving interactive module, debugging Interface module.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, the process of log-on message authentication module comprises the steps:
A. whether there is passwdnet file under inspection/etc catalogue, if it does not exist, then newly-built passwdnet file, and right Default username and password are encrypted and write in passwdnet file afterwards;
B. log-on message authentication module is divided into two subfunctions according to application level function code AFN difference: user login information is verified Revise with user login information;If user login information checking then performs step c, if user login information amendment then performs Step d;
C. open/etc catalogue under passwdnet file, from file, read the username and password of encryption, to client The username and password sent is encrypted, if the two is consistent, then log-on message is proved to be successful, and is selected by functional part Interface html formfile submits client to;If the two is inconsistent, then returns user's authentication failed information, and login is recognized Card interface html formfile submits client to;
D. open/etc catalogue under passwdnet file, from file, read the username and password of encryption, to client The original subscriber's name and the password that send are encrypted, if the two is consistent, then new user name and password are encrypted it Rear write passwdnet file, and login authentication interface html formfile is submitted to client, prompting user use new user Name and new password log in;If the two is inconsistent, then return original subscriber's name or password authentification failure information, and by login authentication interface Html formfile submits client to.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, the process of linux system maintenance module comprises the steps:
A, from decoding after form data obtain will perform Linux instruction, calling system function popen completes The execution of Linux instruction;On the one hand popen function creates subprocess execution shell-command and completes the execution of Linux instruction, separately On the one hand the pipeline between CGI process and subprocess is further created;
B, for inquiry class Linux instruction, CGI process obtains subprocess by the pipeline between itself and the subprocess that create and returns Data, to return data return to client according to after CGI coding criterion and html format analysis processing by standard output;
C, for perform class Linux instruction, after calling popen function, first determine whether popen function return value, if return NULL, then explanation instruction performs failure, by standard output mouth, instruction execution failure information is returned to client, if returned Value is not NULL, then query statement performs result, if meeting the requirements, then explanation instruction runs succeeded, and instruction being run succeeded carries Showing that information returns to client by standard output mouth, if continuous-query 3 times is the most undesirable, then explanation instruction performs mistake Lose, instruction is performed unsuccessfully information and returns to client by standard output mouth.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, the process of application process maintenance module comprises the steps:
A, application process maintenance module perform different sub-function module according to application level function code AFN difference: to acquisition terminal Parameter query, parameter arrange, remotely control, terminal resets, software upgrading, data query, manual framing;
B, form data after decoding obtain application level function code AFN, information point Pn, info class Fn and number of data units According to, carry out framing process according to the communication protocol between main website and the terminal of regulation;
Frame is sent to application process by interprocess communication mode and processes by c, CGI process;
D, CGI process receives the Echo Frame that application process returns, if time-out does not receives the Echo Frame of application process, then CGI process Return mistake;
The Frame that e, parsing receive, according to the application level function code AFN of this sub-function module performed, determines and needs weight Rebuilding, the data of parsing are loaded into that to return to client in corresponding list clear during web page contents by the web page contents built Look at device.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, the process of file system interaction module comprises the steps:
A, file interaction module perform different subfunction according to application level function code AFN difference: log file download, application journey The renewal of preface part, the renewal of cgi script file, driver update, user-defined file download, user-defined file are uploaded, but whole Mainly include two parts from the point of view of body: uploading and downloading of file, if files passe, then go to step b, if file download, then Go to step c;
B, first form data after decoding obtain this condition code and the catalogue of upper transmitting file and filename, it is determined that The end of condition code and the beginning of file data, then according to different subfunctions under corresponding catalogue newly-built corresponding interim File, is written to the file data read from standard input port in newly-built temporary file, data write after by original text Part is deleted, and temporary file name is modified as the filename of original, goes wrong then by temporary file during files passe Delete and return, to client browser, the prompting that files passe is failed;
C, first form data after decoding obtain the place catalogue of file and filename needing to download, then arrives finger Determine find corresponding file under catalogue and by standard output port, file content is sent to client browser.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, bottom layer driving interactive module performs different subfunctions according to application level function code AFN difference: to bottom hardware The inquiry of depositor, configuration and the Applied layer interface function providing each bsp driver are tested.
The most according to claim 1 realizing the method that terminal maintenance and information are issued based on embedded Linux, its feature exists In: in step 5, the process of debugging interface module is as follows: firstly the need of the target after being compiled by each multi-threaded program to be debugged Files passe is under acquisition terminal particular category, and then to notify that application process stops by interprocess communication mode to be debugged for CGI The operation of thread, CGI process is initiated a subprocess and the operation code of subprocess is replaced to thread code to be debugged, making Thread runs as a subprocess of CGI process, and is delivered to by standard output oral instructions by the Debugging message in running Client shows, by the analysis of Debugging message judges the problem source of this thread in client.
CN201610495093.9A 2016-06-28 2016-06-28 Embedded linux-based method for realizing terminal maintenance and information release Pending CN106060066A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610495093.9A CN106060066A (en) 2016-06-28 2016-06-28 Embedded linux-based method for realizing terminal maintenance and information release

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610495093.9A CN106060066A (en) 2016-06-28 2016-06-28 Embedded linux-based method for realizing terminal maintenance and information release

Publications (1)

Publication Number Publication Date
CN106060066A true CN106060066A (en) 2016-10-26

Family

ID=57166948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610495093.9A Pending CN106060066A (en) 2016-06-28 2016-06-28 Embedded linux-based method for realizing terminal maintenance and information release

Country Status (1)

Country Link
CN (1) CN106060066A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169024A (en) * 2017-04-11 2017-09-15 微梦创科网络科技(中国)有限公司 The operation system and service implementation method of a kind of compatible type
CN107733981A (en) * 2017-09-11 2018-02-23 积成电子股份有限公司 Measuring instrument adjustment method based on IEC62056 agreements
CN108667809A (en) * 2018-04-13 2018-10-16 三维通信股份有限公司 A realization method of multi-system DAS WEB interface account information synchronization management
CN109491839A (en) * 2018-11-07 2019-03-19 郑州云海信息技术有限公司 System manager's permission reset test method, apparatus, terminal and storage medium
CN110569473A (en) * 2019-09-12 2019-12-13 浪潮软件股份有限公司 A method of remotely operating linux server based on SSH protocol
CN110971606A (en) * 2019-12-05 2020-04-07 武汉大学 Construction method and application method of HACCP (Hadoop distributed control protocol) security system in Web application development
CN111414349A (en) * 2020-03-18 2020-07-14 江苏鸿程大数据技术与应用研究院有限公司 Interactive unified big data programming computing platform
CN111722938A (en) * 2020-05-08 2020-09-29 深圳市广和通无线股份有限公司 AT instruction processing method, AT instruction processing device, computer equipment and storage medium
CN112099679A (en) * 2020-08-30 2020-12-18 浪潮金融信息技术有限公司 TTU function packaging method based on software configuration
CN113050979A (en) * 2019-12-26 2021-06-29 阿里巴巴集团控股有限公司 Installation configuration method and device for installing operating system, installation method and device
CN113382038A (en) * 2021-04-25 2021-09-10 杭州玖欣物联科技有限公司 Lwm2m protocol-based gateway equipment user remote management method
CN113542249A (en) * 2021-07-08 2021-10-22 昆明学院 A multi-protocol data publishing system
WO2023169045A1 (en) * 2022-03-07 2023-09-14 Espressif Systems (Shanghai) Co., Ltd. Method, system, and development machine for evaluating embedded project using web browser

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409731A (en) * 2008-10-09 2009-04-15 上海第二工业大学 Remote control method for household electrical equipment through IE
CN102377792A (en) * 2010-08-07 2012-03-14 浙江工业大学 Home network monitoring system based on WEB
CN102387354A (en) * 2011-11-25 2012-03-21 中山大学 Video monitoring system based on embedded web server
CN102497452A (en) * 2011-12-28 2012-06-13 山东大学 Online streaming media service method based on embedded terminal
US20130104144A1 (en) * 2011-10-19 2013-04-25 International Business Machines Corporation Application Switching in a Graphical Operating System
CN103634353A (en) * 2012-08-27 2014-03-12 国网电力科学研究院 Electricity utilization information acquisition terminal and realizing method thereof
CN103795786A (en) * 2014-01-20 2014-05-14 杭州百富电子技术有限公司 Embedded concentrator system with web service function
CN105282175A (en) * 2015-11-13 2016-01-27 上海斐讯数据通信技术有限公司 Login method based on open source secure shell and login system thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409731A (en) * 2008-10-09 2009-04-15 上海第二工业大学 Remote control method for household electrical equipment through IE
CN102377792A (en) * 2010-08-07 2012-03-14 浙江工业大学 Home network monitoring system based on WEB
US20130104144A1 (en) * 2011-10-19 2013-04-25 International Business Machines Corporation Application Switching in a Graphical Operating System
CN102387354A (en) * 2011-11-25 2012-03-21 中山大学 Video monitoring system based on embedded web server
CN102497452A (en) * 2011-12-28 2012-06-13 山东大学 Online streaming media service method based on embedded terminal
CN103634353A (en) * 2012-08-27 2014-03-12 国网电力科学研究院 Electricity utilization information acquisition terminal and realizing method thereof
CN103795786A (en) * 2014-01-20 2014-05-14 杭州百富电子技术有限公司 Embedded concentrator system with web service function
CN105282175A (en) * 2015-11-13 2016-01-27 上海斐讯数据通信技术有限公司 Login method based on open source secure shell and login system thereof

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169024A (en) * 2017-04-11 2017-09-15 微梦创科网络科技(中国)有限公司 The operation system and service implementation method of a kind of compatible type
CN107733981A (en) * 2017-09-11 2018-02-23 积成电子股份有限公司 Measuring instrument adjustment method based on IEC62056 agreements
US11265333B2 (en) 2018-04-13 2022-03-01 Sunwave Communications Co., Ltd. Method of achieving synchronization management of account information of WEB interface in multi-system DAS
CN108667809A (en) * 2018-04-13 2018-10-16 三维通信股份有限公司 A realization method of multi-system DAS WEB interface account information synchronization management
CN109491839A (en) * 2018-11-07 2019-03-19 郑州云海信息技术有限公司 System manager's permission reset test method, apparatus, terminal and storage medium
CN110569473A (en) * 2019-09-12 2019-12-13 浪潮软件股份有限公司 A method of remotely operating linux server based on SSH protocol
CN110971606A (en) * 2019-12-05 2020-04-07 武汉大学 Construction method and application method of HACCP (Hadoop distributed control protocol) security system in Web application development
CN110971606B (en) * 2019-12-05 2021-05-04 武汉大学 A construction method and application method of HACCP security system in web application development
CN113050979A (en) * 2019-12-26 2021-06-29 阿里巴巴集团控股有限公司 Installation configuration method and device for installing operating system, installation method and device
CN113050979B (en) * 2019-12-26 2024-04-02 阿里巴巴集团控股有限公司 Installation configuration method and device for installing operating system, and installation method and device
CN111414349A (en) * 2020-03-18 2020-07-14 江苏鸿程大数据技术与应用研究院有限公司 Interactive unified big data programming computing platform
CN111722938A (en) * 2020-05-08 2020-09-29 深圳市广和通无线股份有限公司 AT instruction processing method, AT instruction processing device, computer equipment and storage medium
CN112099679A (en) * 2020-08-30 2020-12-18 浪潮金融信息技术有限公司 TTU function packaging method based on software configuration
CN112099679B (en) * 2020-08-30 2023-09-19 浪潮金融信息技术有限公司 TTU function packaging method based on software configuration
CN113382038B (en) * 2021-04-25 2022-08-12 杭州玖欣物联科技有限公司 Lwm2m protocol-based gateway equipment user remote management method
CN113382038A (en) * 2021-04-25 2021-09-10 杭州玖欣物联科技有限公司 Lwm2m protocol-based gateway equipment user remote management method
CN113542249A (en) * 2021-07-08 2021-10-22 昆明学院 A multi-protocol data publishing system
WO2023169045A1 (en) * 2022-03-07 2023-09-14 Espressif Systems (Shanghai) Co., Ltd. Method, system, and development machine for evaluating embedded project using web browser

Similar Documents

Publication Publication Date Title
CN106060066A (en) Embedded linux-based method for realizing terminal maintenance and information release
RU2486566C2 (en) Computer system of maintenance for airplane
CN102571396B (en) Communication network system and routing inspection subsystem and routing inspection method of communication equipment
US20080086540A1 (en) Method and system for executing a normally online application in an offline mode
CN101179429A (en) Remote exhibition and real-time edition method of configuration file
CN102053903A (en) Method and system for storing and querying scene data for on-line operation programs
CN109328339A (en) Inter-App Communication and Integration Brokers
CN103177200A (en) Method and system for configuring computing appliance
CN109660399A (en) A kind of method and system of remote debugging
CN110012096A (en) Mobile client service updates management method, apparatus and system
CN106354748A (en) Webpage generation method and device
CN108959939A (en) A kind of system permission open method, device, system and storage medium
CN109783355A (en) Page elements acquisition methods, system, computer equipment and readable storage medium storing program for executing
CN106790121A (en) Power system service network
WO2024139574A1 (en) Project development system and method based on cloud service, and computing device cluster
CN103634353A (en) Electricity utilization information acquisition terminal and realizing method thereof
CN109597952A (en) Web information processing method, system, electronic equipment and storage medium
CN106453561A (en) Remote control system
JP2014217186A (en) Electronic equipment, verification method and verification program
Rahmel Professional Joomla!
JP3821107B2 (en) CGI buffer overflow vulnerability verification apparatus and method, and program
CN117094842A (en) Intelligent management system and automatic verification method for transformer substation secondary circuit model file
CN115220974A (en) A system, method, device and medium for dynamic inspection of operating system network information
Min et al. Design of an Integrated Monitoring System for Constructional Structures Based on Mobile Cloud in Traditional Towns with Local Heritage
CN107018032A (en) A kind of monitoring system server and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161026