CN104536837B - The implementation method of the multi-platform data of embedded type web server access based on Linux - Google Patents

The implementation method of the multi-platform data of embedded type web server access based on Linux Download PDF

Info

Publication number
CN104536837B
CN104536837B CN201410766920.4A CN201410766920A CN104536837B CN 104536837 B CN104536837 B CN 104536837B CN 201410766920 A CN201410766920 A CN 201410766920A CN 104536837 B CN104536837 B CN 104536837B
Authority
CN
China
Prior art keywords
data
platform
page
request
httpd
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
CN201410766920.4A
Other languages
Chinese (zh)
Other versions
CN104536837A (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.)
SHANGHAI TAIYU INFORMATION TECHNOLOGY Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410766920.4A priority Critical patent/CN104536837B/en
Publication of CN104536837A publication Critical patent/CN104536837A/en
Application granted granted Critical
Publication of CN104536837B publication Critical patent/CN104536837B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides the implementation method that a kind of embedded web server based on Linux accesses multi-platform data, embedded device calls httpd processes to receive request of data, and request of data is parsed and decomposed by CGI, obtain the control type of message of requested data and corresponding decomposition data;According to the control type of message of requested data, platform where data is determined;Judge whether platform where data is current platform;If so, directly obtaining required data from current platform, and return to embedded device;If it is not, client corresponding to platform where accessing data, client visit again corresponding service end, service end obtains data on platform, and is back to client, and client returns data to embedded device.The implementation method of the multi-platform data of the access of the embedded web server based on Linux of the present invention does not destroy the framework of current each platform;Access of the web server to the data message of multiple different platforms is realized, is easy to transplant, it is easy to maintain.

Description

Embedded web server based on Linux accesses the implementation method of multi-platform data
Technical field
The present invention relates to a kind of method of web server access platform data, more particularly to a kind of based on the embedding of Linux Enter the implementation method that formula web server accesses multi-platform data.
Background technology
Be used as using Linux in the embedded device of operating system, each functional module process of linux system offer it Between and thread between communication.How to realize that accurate and efficient data acquisition turns into the emphasis in research and development under Linux environment Place.
In the research and development of embedded device, for quick operational outfit and efficient function is provided, it will usually will be multiple flat The framework of platform is put to be run in the same apparatus, and used data are then respectively stored in corresponding platform, Ge Geping Platform has the data processing mechanism of oneself.Therefore, when adding web functions, it is necessary to obtain the data of each platform.Due to each flat The data processing mechanism of platform is different, and platform can not direct access platform data, it may appear that each platform processes data load is not Consistent situation, cause the operation that have impact on whole equipment, situation as shown in Figure 1.
In addition, in the prior art, number of the embedded device simply by httpd processes by one platform of access after parsing According to the data of multiple platforms can not be accessed.
The content of the invention
In view of the above the shortcomings that prior art, it is an object of the invention to provide a kind of based on the embedded of Linux Web server accesses the implementation method of multi-platform data, is realizing preferably transplanting and is not destroying the framework of current each platform On the basis of, by the data of the multiple different platforms of httpd processes acquisition in linux system, to reach the mesh of page access 's.
In order to achieve the above objects and other related objects, the present invention provides a kind of embedded web server based on Linux The implementation method of multi-platform data is accessed, is comprised the following steps:Step S1, it is embedded when accessing the web page of embedded device Formula equipment calls httpd processes receive request of data, and request of data is parsed and decomposed by CGI, and acquisition is asked The control type of message of data and corresponding decomposition data;Step S2, embedded device is according to the control report of requested data Literary type, determine platform where data;Judge whether platform where data is current platform;If so, it is transferred to step S3;If it is not, It is transferred to step S4;Step S3, required data are directly obtained from current platform, and return to embedded device;Step S4, Client corresponding to platform where accessing data, client corresponding to platform where data visit again corresponding service end, corresponding Service end required data are being obtained where data on platform, and client corresponding to platform where being back to data, number Required data are returned into embedded device according to client corresponding to the platform of place.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:With The web page for the browser access embedded device that family end passes through equipment.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:Obtain When taking the control type of message of requested data, matched by the name of the page to determine.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:Institute State in step S1, CGI processing procedure comprises the following steps:
CGI receives the request of data that httpd processes receive;
Whether the heading for judging request of data is to set operation;
If setting operation, receive httpd and request of data is set, parsed according to the page of request of data, and by page The given data page in face and data structure table is matched;If the page of matching be present, the function number that needs are set According to being stored in temporal cache, by page index by the page preservation in need performance data be sent to it is corresponding flat Platform, platform receives data and handled, and result is returned;If in the absence of the page of matching, the request of data is abandoned, CGI sends result to httpd, then the http clients of request data are sent to by httpd;
If not setting operation, receive httpd and obtain request of data, page data is received, according to the page of request of data Parsed, and the given data page in the page and data structure table is matched;If the page of matching be present, pass through Page index obtains all data of page needs from the platform at place, by the data storage of acquisition in temporal cache, solution The functional parameter needed in the analysis page, by functional parameter table, obtains data from temporal cache, and returns to httpd, Httpd is then forwarded to the http clients of request data;If in the absence of the page of matching, the request of data is abandoned, CGI will be tied Fruit is sent to httpd, then the http clients of request data are sent to by httpd.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:Institute State in step S4, it is required when required data are returned to embedded device by client corresponding to platform where data Data return to the httpd processes of embedded device, and required data are returned to browser by httpd processes again, so as to See the page info of embedded device in family.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:Institute State in step S4, the communication mechanism between client and service end is completed using Linux ipc communication mechanisms.
The implementation method of multi-platform data is accessed according to the above-mentioned embedded web server based on Linux, wherein:Institute State in step S4, the process of client to service end is thread to process, process-to-process, thread to thread or process to line Journey.
As described above, the embedded web server based on Linux of the present invention accesses the implementation method of multi-platform data, Have the advantages that:
(1) realize preferably transplanting and do not destroy the framework of current each platform;
(2) access of the web server to the data message of multiple different platforms is realized;
(3) it is easy to transplant, it is easy to maintain.
Brief description of the drawings
Fig. 1 is shown as the schematic diagram that multiple platforms in the prior art each carry out data processing;
Fig. 2 is shown as the implementation method of the multi-platform data of the access of the embedded web server based on Linux of the present invention Block flow diagram;
Fig. 3 is shown as the process chart of CGI in the present invention;
Fig. 4 is shown as the implementation method of the multi-platform data of the access of the embedded web server based on Linux of the present invention Detail flowchart;
Fig. 5 is shown as in the present invention schematic diagram of the communication mechanism between client and service end.
Embodiment
Illustrate embodiments of the present invention below by way of specific instantiation, those skilled in the art can be by this specification Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through specific realities different in addition The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from Various modifications or alterations are carried out under the spirit of the present invention.
It should be noted that the diagram provided in the present embodiment only illustrates the basic conception of the present invention in a schematic way, Then the component relevant with the present invention is only shown in schema rather than is painted according to component count, shape and the size during actual implement System, kenel, quantity and the ratio of each component can be a kind of random change during its actual implementation, and its assembly layout kenel also may be used Can be increasingly complex.
In the present invention, web server needs cross-platform access of the realization to data, wherein it is cross-platform refer to operate in it is a variety of Process or thread on different frameworks.
Reference picture 2, the embedded web server of the invention based on Linux access the implementation method bag of multi-platform data Include following steps:
Step S1, when user terminal accesses the web page of embedded device, embedded device calls httpd processes to receive Request of data, and by CGI(Common gateway interface) (Common Gateway Interface, CGI) to request of data carry out parsing and Decompose, obtain the control type of message of requested data and corresponding decomposition data.
Specifically, the web page that user terminal passes through equipment such as PC browser access embedded device.In embedded device The httpd processes of current platform receive the http request of data, and are parsed and decomposed by CGI, the number of request to obtain According to control type of message.Wherein, when obtaining the control type of message of requested data, by the name of the page matched come It is determined that.
Reference picture 3, CGI processing procedure comprise the following steps:
CGI receives the request of data that httpd processes receive.
Whether the heading for judging request of data is to set (set) to operate.
If set is operated, receive httpd and request of data is set, parsed according to the page of request of data, and by the page Matched with the given data page in data structure table;If the page of matching be present, the performance data that needs are set Be stored in temporal cache, by page index by the page the performance data of preservation in need be sent to corresponding platform, Platform receives data and handled, and result is returned;If in the absence of the page of matching, the request of data, CGI are abandoned Httpd is sent result to, then the http clients of request data are sent to by httpd.
If not set is operated, receive httpd and obtain request of data, receive page data, entered according to the page of request of data Row parsing, and the given data page in the page and data structure table is matched;If the page of matching be present, pass through page Face index obtains all data that the page needs from the platform at place, by the data storage of acquisition in temporal cache, parsing The functional parameter needed in the page, by functional parameter table, data are obtained from temporal cache, and return to httpd, httpd It is then forwarded to the http clients of request data;If in the absence of the page of matching, the request of data is abandoned, CGI sends out result Httpd is given, then the http clients of request data are sent to by httpd.
Step S2, embedded device determines platform where data according to the control type of message of requested data;Judge number Whether it is current platform according to place platform;If so, it is transferred to step S3;If it is not, it is transferred to step S4.
Step S3, required data are directly obtained from current platform, and return to embedded device.
Step S4, client corresponding to platform where accessing data, client corresponding to platform where data visit again pair The service end answered, corresponding service end is obtaining required data on platform where data, and be back to platform where data Corresponding client, client corresponding to platform where data are finally returned to embedded device.
For example, referring to Fig. 4, when being searched by the name of the page, the data of the page are matched in platform a, that The request data into docking platform a client;When the client for docking a receives request of data, platform a can be sent to Service end, after platform a service end receives the request of data, the data required by middle taking-up in a platforms, and data are returned To docking platform a client, docking platform a client returns again to the httpd processes to embedded device after receiving data, Httpd processes finally return data to web browser so that user can see the page info of embedded device.Equally, It is same to obtain the data of b platforms, will not be repeated here.
, wherein it is desired to illustrate, the communication mechanism in step S4 between client and service end is the ipc using Linux Communication mechanism is completed, as shown in Figure 5.Specifically, the process of client to service end can be thread to process, process to entering Journey, thread to thread or process are to thread.The framework form of each platform is specifically dependent upon, linux system provides these sides The communication mechanism of formula.
In summary, the embedded web server of the invention based on Linux accesses the implementation method reality of multi-platform data Show more preferable transplanting and do not destroy the framework of current each platform;Realize data of the web server to multiple different platforms The access of information, it is easy to transplant, it is easy to maintain.So the present invention effectively overcomes various shortcoming of the prior art and has height Spend industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, not for the limitation present invention.It is any ripe Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as Into all equivalent modifications or change, should by the present invention claim be covered.

Claims (6)

1. a kind of embedded web server based on Linux accesses the implementation method of multi-platform data, it is characterised in that:Including Following steps:
Step S1, when accessing the web page of embedded device, embedded device calls httpd processes to receive request of data, and Request of data is parsed and decomposed by CGI, the control type of message of requested data is obtained and decomposes number accordingly According to;
In the step S1, CGI processing procedure comprises the following steps:
CGI receives the request of data that httpd processes receive;
Whether the heading for judging request of data is to set operation;
If setting operation, receive httpd and request of data be set, parsed according to the page of request of data, and by the page and The given data page in data structure table is matched;If the page of matching be present, the performance data for needing to set is deposited Be stored in temporal cache, by page index by the page the performance data of preservation in need be sent to corresponding platform, put down Platform receives data and handled, and result is returned;If in the absence of the page of matching, the request of data is abandoned, CGI will As a result httpd is sent to, then the http clients of request data are sent to by httpd;
If not setting operation, receive httpd and obtain request of data, receive page data, carried out according to the page of request of data Parsing, and the given data page in the page and data structure table is matched;If the page of matching be present, pass through the page Index and all data that the page needs are obtained from the platform at place, by the data storage of acquisition in temporal cache, parse page The functional parameter needed in face, by functional parameter table, data are obtained from temporal cache, and return to httpd, httpd is again It is sent to the http clients of request data;If in the absence of the page of matching, the request of data is abandoned, CGI sends result To httpd, then it is sent to by httpd the http clients of request data;
Step S2, embedded device determines platform where data according to the control type of message of requested data;Judge data institute Whether it is current platform in platform;If so, it is transferred to step S3;If it is not, it is transferred to step S4;
Step S3, required data are directly obtained from current platform, and return to embedded device;
Step S4, client corresponding to platform where accessing data, client corresponding to platform where data visit again corresponding Service end, corresponding service end are obtaining required data on platform where data, and it is corresponding to be back to data place platform Client, required data return to embedded device by client corresponding to platform where data.
2. the embedded web server according to claim 1 based on Linux accesses the implementation method of multi-platform data, It is characterized in that:The web page for the browser access embedded device that user terminal passes through equipment.
3. the embedded web server according to claim 1 based on Linux accesses the implementation method of multi-platform data, It is characterized in that:When obtaining the control type of message of requested data, matched by the name of the page to determine.
4. the embedded web server according to claim 1 based on Linux accesses the implementation method of multi-platform data, It is characterized in that:In the step S4, required data are returned to embedded set by client corresponding to platform where data When standby, required data return to the httpd processes of embedded device, and httpd processes again return to required data Browser, so that user sees the page info of embedded device.
5. the embedded web server according to claim 1 based on Linux accesses the implementation method of multi-platform data, It is characterized in that:In the step S4, the communication mechanism between client and service end be using Linux ipc communication mechanisms come Complete.
6. the embedded web server according to claim 1 based on Linux accesses the implementation method of multi-platform data, It is characterized in that:In the step S4, the process of client to service end is thread to process, process-to-process, thread to line Journey or process are to thread.
CN201410766920.4A 2014-12-12 2014-12-12 The implementation method of the multi-platform data of embedded type web server access based on Linux Active CN104536837B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410766920.4A CN104536837B (en) 2014-12-12 2014-12-12 The implementation method of the multi-platform data of embedded type web server access based on Linux

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410766920.4A CN104536837B (en) 2014-12-12 2014-12-12 The implementation method of the multi-platform data of embedded type web server access based on Linux

Publications (2)

Publication Number Publication Date
CN104536837A CN104536837A (en) 2015-04-22
CN104536837B true CN104536837B (en) 2017-11-21

Family

ID=52852368

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410766920.4A Active CN104536837B (en) 2014-12-12 2014-12-12 The implementation method of the multi-platform data of embedded type web server access based on Linux

Country Status (1)

Country Link
CN (1) CN104536837B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113662446A (en) * 2021-09-22 2021-11-19 深圳康佳电子科技有限公司 Internet of things-based cooking assistance method and device, intelligent terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202684A (en) * 2006-12-15 2008-06-18 中国电信股份有限公司 Method for close judgment of user in content distributing network
CN101237449A (en) * 2008-02-01 2008-08-06 中国建设银行股份有限公司 A method and system for access to IMS database
CN102215228A (en) * 2011-05-31 2011-10-12 北京亿赞普网络技术有限公司 Web service unique user identification method based on carrier-class network platform
CN103685300A (en) * 2013-12-23 2014-03-26 蓝盾信息安全技术股份有限公司 Embedded web server
CN103856446A (en) * 2012-11-30 2014-06-11 腾讯科技(深圳)有限公司 Login method and device, and open platform system
CN103985019A (en) * 2014-06-06 2014-08-13 山东超越数控电子有限公司 Embedded type server data management system based on ten gigabit exchanger

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010049796A1 (en) * 2000-06-01 2001-12-06 Roth Mark L. Authentication-technology independent, non-programmatic method and apparatus for bootstrapping a user database from the WEB tier
US20030028577A1 (en) * 2001-04-30 2003-02-06 Chia-Chu Dorland HTTP distributed XML-based automated event polling for network and E-service management

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202684A (en) * 2006-12-15 2008-06-18 中国电信股份有限公司 Method for close judgment of user in content distributing network
CN101237449A (en) * 2008-02-01 2008-08-06 中国建设银行股份有限公司 A method and system for access to IMS database
CN102215228A (en) * 2011-05-31 2011-10-12 北京亿赞普网络技术有限公司 Web service unique user identification method based on carrier-class network platform
CN103856446A (en) * 2012-11-30 2014-06-11 腾讯科技(深圳)有限公司 Login method and device, and open platform system
CN103685300A (en) * 2013-12-23 2014-03-26 蓝盾信息安全技术股份有限公司 Embedded web server
CN103985019A (en) * 2014-06-06 2014-08-13 山东超越数控电子有限公司 Embedded type server data management system based on ten gigabit exchanger

Also Published As

Publication number Publication date
CN104536837A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
US10303522B2 (en) System and method for distributed graphics processing unit (GPU) computation
CN104579822B (en) Mobile application automated performance testing system and method based on Http agreements
CN103778236B (en) Web data distribution processing method and device and auto-building html files treating method and apparatus
CN105429858A (en) Real-time message transmission method among multiple robots
CN107241372A (en) Configuration information generation, sending method and resource loading method and apparatus and system
CN103390244B (en) A kind of user's friend relation polymerization and aggregation platform with operator's characteristic
CN103268319A (en) Cloud browser based on webpages
CN103312661A (en) Method and device for service accessing
CN108055312A (en) Method for routing and its device and computer installation and its readable storage medium storing program for executing
CN107332857B (en) Network data transmission method, device, system and storage medium
CN104954894A (en) Video traffic guiding method and device as well as electronic equipment
CN101799847A (en) Method and system for equipment changing of webpage game role
CN107220259A (en) A kind of database extension system, equipment and the method for extending database
CN104376056B (en) A kind of method and apparatus of data processing
CN104536837B (en) The implementation method of the multi-platform data of embedded type web server access based on Linux
CN104580127B (en) Method for processing business, server and client
CN105791011A (en) System and method for realizing unified network management platform based on Docker
CN107070978A (en) A kind of inter-network acts on behalf of the method, system and proxy server of web map service
CN106412003A (en) Information pushing method and device, and information request device
CN105245535B (en) Multi-client Explore of Unified Management Ideas and system
CN105338104B (en) Service request response method, parsing method and system
CN115022397B (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN106970872A (en) Information buries point methods and device
CN103186405A (en) Method and device for implementing unified control of equipment
CN110032499A (en) Analysis method, device, server and the readable storage medium storing program for executing that Page user is lost

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201103

Address after: 318015 no.2-3167, zone a, Nonggang City, no.2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee after: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210623

Address after: 201100 room 509, building 2, No. 508, Chundong Road, Minhang District, Shanghai

Patentee after: SHANGHAI TAIYU INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 318015 no.2-3167, area a, nonggangcheng, 2388 Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee before: Taizhou Jiji Intellectual Property Operation Co.,Ltd.