CN113901359A - Webpage local dynamic refreshing method for embedded operating system - Google Patents
Webpage local dynamic refreshing method for embedded operating system Download PDFInfo
- Publication number
- CN113901359A CN113901359A CN202111175405.5A CN202111175405A CN113901359A CN 113901359 A CN113901359 A CN 113901359A CN 202111175405 A CN202111175405 A CN 202111175405A CN 113901359 A CN113901359 A CN 113901359A
- Authority
- CN
- China
- Prior art keywords
- operating system
- embedded operating
- webpage
- browser
- web page
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000004044 response Effects 0.000 claims abstract description 6
- 230000008569 process Effects 0.000 claims description 5
- 230000006870 function Effects 0.000 abstract description 5
- 230000008859 change Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003032 molecular docking Methods 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/972—Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to a webpage local dynamic refreshing method for an embedded operating system, which is characterized in that html and javascript webpage codes with AJAX functions are embedded into the embedded operating system without a file system in an ASCII code mode; when the browser requests a webpage from the device, the embedded operating system converts the ASCII code webpage into a UNICODE code and sends the UNICODE code to the browser; displaying content in the browser according to the html, and running a javascript program; the javascript program requests data from the embedded operating system at regular time; the embedded operating system answers corresponding data according to the request type; and the javascript program carries out local refreshing according to the corresponding relation between the ID of the html control and the response data. The method realizes local refreshing of the webpage, and the phenomenon of screen flashing is avoided when the content of the webpage changes.
Description
Technical Field
The invention relates to the technical field of computer operating systems, in particular to a method for dynamically refreshing local webpage of an embedded operating system without file management.
Background
With the development of networks, the popularization of personal computers and the increasing maturity of BS software architectures, browsers are adopted to display operation information of protection terminals or RTUs, and the application of checking and modifying operation parameters is more and more extensive.
The webpage display technology of the protection terminal without file management or the RTU in the current market mainly aims at regularly pushing the whole webpage to the browser, and when the webpage is regularly refreshed, the browser has a flickering phenomenon, and the flickering frequency is consistent with the pushing frequency. In addition, in the prior art, programming is complicated, code readability is poor, transportability is not good, and the flicker phenomenon is difficult to remove.
Disclosure of Invention
The present invention is directed to a method for dynamically refreshing local web pages of an embedded operating system, so as to solve the above-mentioned problems encountered in the background art.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a webpage local dynamic refreshing method for an embedded operating system comprises the following steps:
s1, embedding the html and javascript webpage codes with the AJAX function into an embedded operating system without a file system in an ASCII code mode;
s2, when the browser requests the device for the webpage, the embedded operating system converts the ASCII code webpage into a UNICODE code and sends the UNICODE code to the browser;
s3, displaying the content in the browser according to the html, and running a javascript program;
s4, the javascript program requests data from the embedded operating system at regular time;
s5, the embedded operating system answers the corresponding data according to the request type;
and S6, locally refreshing the javascript program according to the corresponding relation between the ID of the html control and the response data.
Compared with the prior art, the invention has the beneficial effects that: by the local dynamic refreshing method for the webpage, the local refreshing of the webpage is realized, and the phenomenon of screen flashing is avoided when the content of the webpage changes. Because the webpage codes in the scheme are independently designed and then are integrally embedded into the C codes of the device in an ASCII code mode, the difficulty of directly designing the webpage by the original C language is simplified.
Drawings
The disclosure of the present invention is illustrated with reference to the accompanying drawings. It is to be understood that the drawings are designed solely for the purposes of illustration and not as a definition of the limits of the invention. In the drawings, like reference numerals are used to refer to like parts. Wherein:
FIG. 1 is a schematic view of the working process of the present invention.
Detailed Description
In order to make the technical means, the creation features, the achievement purposes and the effects of the invention easy to understand, the invention is further described in detail with reference to the attached drawings. These drawings are simplified schematic views illustrating only the basic structure of the present invention in a schematic manner, and thus show only the constitution to which the present invention relates.
According to the technical scheme of the invention, a plurality of alternative structural modes and implementation modes can be provided by a person with ordinary skill in the art without changing the essential spirit of the invention. Therefore, the following detailed description and the accompanying drawings are merely illustrative of the technical aspects of the present invention, and should not be construed as all of the present invention or as limitations or limitations on the technical aspects of the present invention.
The technical solution of the present invention is further described in detail with reference to the accompanying drawings and examples.
As shown in fig. 1, a method for partial dynamic refreshing of a web page of an embedded operating system includes the following steps:
and S1, embedding the html and javascript webpage codes with the AJAX function into an embedded operating system without a file system in an ASCII code mode.
After the html and javascript programming languages compile the AJAX function, the AJAX mainly realizes the asynchronous transmission of data between the page and the web server, so that the AJAX can be conveniently embedded into an operating system and the page.
Since most embedded operating systems have no file system and no server similar to boa, the designed web page code can only be embedded in the const variable of the embedded operating system in the form of C language character string. The variables english characters of the embedded C language are stored in the ASCII code form, the chinese characters are stored in the GB2312 code, and the web page code designed through step S1 is converted into character strings of ASCII and GB2312 and stored in the const variable named as the web page.
A task is designed in an embedded operating system program, the task opens a TCP-80 port of a TCP/IP protocol stack, and the task can receive and respond to commands and requests of 80-port 'GET' or 'POST' methods. The IP address of the device is input in the browser of the PC, so that the data transmission connection is convenient.
And S2, when the browser requests the webpage from the device, the embedded operating system converts the webpage with ASCII code into UNICODE code and sends the UNICODE code to the browser.
Of course, the corresponding web page may also be converted into the format of UTF-8 code for conveniently docking the browser, and the device sends the web page to the 80 port.
And S3, displaying the content in the browser according to the html, and running a javascript program.
When the PC and the device are in the same network and can establish network communication, the IP address of the device is input in the browser of the PC, and the browser requests a webpage from the device. Since the javascript language in the netpage program can only process the characters of the UTF-8 code, the embedded operating system converts the ASCII code netpage character string into the UTF-8 code character string, and then the TCP protocol is sent to the 80 port of the PC.
The PC browser receives the webpage codes, the html and css parts of the webpage codes distribute the areas needing to be displayed to the designated positions of the browser, and the javascript program runs in the browser.
S4, the javascript program requests data from the embedded operating system at regular time;
and a timer designed by the javascript program requests the device for data needing to be refreshed in real time from the page by a GET method.
And S5, the embedded operating system answers the corresponding data according to the request type.
After receiving the request, the embedded operating system sends the data and the English name of the response data to the 80 port of the PC according to the content of the request.
And S6, locally refreshing the javascript program according to the corresponding relation between the ID of the html control and the response data.
After the javascript program receives the data and the English name returned by the device, the display area named by the English name is found according to the English name, and the latest data is refreshed to the display area. And (4) finishing the local dynamic refreshing of the webpage, and jumping to the step S4 to operate the javascript program.
By the technical scheme, Adobe Dreamwaver or other webpage design and editing software is used as a development tool, HTML5, CSS and javascript programming languages are used, and pages with AJAX (local asynchronous refresh) functions, such as telemetering, remote communication, telepulse, fixed value and the like, are designed. Taking a telemetry page as an example, the telemetry page can display all telemetry data of the device, each telemetry data comprises four attributes of a telemetry English name, a telemetry Chinese name, telemetry data and a telemetry unit to be displayed, and each attribute of each telemetry is designed to be a fixed display area through html and css languages. The Chinese name, English name and unit display area of telemetering do not change after the device works normally, and telemetering data reflect the working conditions of voltage, current and the like of a power supply network in real time and can change continuously, so that the English name which is not repeatedly telemetered is used as an ID in each telemetering data display area. A timer is set by using javascript language, and telemetering data and a corresponding English name are requested to a server, namely a device at regular time. And simultaneously, designing a request response processing program by using a javascript language, acquiring a telemetering data display area by the program according to the English name, then reducing new data by the program and refreshing the data to the display area, and keeping the original display content of other display areas unchanged.
In the traditional embedded webpage design, the CCGI technology is basically adopted, only static webpages can be designed, when the webpages need to display pages which are refreshed in real time, such as remote measurement, remote signaling, remote pulse and the like, the CCGI program regularly generates the static webpages taking current data as display contents and pushes the webpages to a PC browser, after the browser receives the whole webpage contents, the original webpages are emptied completely, new webpage contents are displayed, and at the moment, a user can see the flickering effect that the webpages are blank firstly and then have the contents.
By the webpage local dynamic refreshing method, the main body frame of the webpage does not change any more, only the local area is refreshed regularly, and the webpage does not have the phenomenon of screen flashing. Because the webpage codes in the scheme are independently designed and then are integrally embedded into the C codes of the device in an ASCII code mode, the difficulty of directly designing the webpage by the original C language is simplified.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (6)
1. A webpage local dynamic refreshing method for an embedded operating system is characterized by comprising the following steps:
s1, embedding the html and javascript webpage codes with the AJAX function into an embedded operating system without a file system in an ASCII code mode;
s2, when the browser requests the device for the webpage, the embedded operating system converts the ASCII code webpage into a UNICODE code and sends the UNICODE code to the browser;
s3, displaying the content in the browser according to the html, and running a javascript program;
s4, the javascript program requests data from the embedded operating system at regular time;
s5, the embedded operating system answers the corresponding data according to the request type;
and S6, locally refreshing the javascript program according to the corresponding relation between the ID of the html control and the response data.
2. The method for local dynamic refreshing of web page of embedded operating system according to claim 1, wherein: in step S1, the IP address of the device needs to be input in the browser.
3. The method for local dynamic refreshing of web page of embedded operating system according to claim 1, wherein: in step S2, when the browser requests the device for a web page, the device receives the web page request from the browser, and may convert the corresponding web page into the format of UTF-8 code, and the device sends the web page to the 80 port and then to the browser.
4. The method for local dynamic refreshing of web page of embedded operating system according to claim 1, wherein: in step S5, the corresponding data answered by the embedded operating system includes the requested data and the english name corresponding to the requested data.
5. The method for local dynamic refreshing of web page of embedded operating system according to claim 1, wherein: in step S6, the browser receives the data and the english name, finds the display area based on the english name, and refreshes the latest data in the display area.
6. The method for local dynamic refreshing of web page of embedded operating system according to claim 1, wherein: after the end of step S6, the process returns to step S4 to perform the partial dynamic refresh for the next time period when the timer expires.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111175405.5A CN113901359A (en) | 2021-10-09 | 2021-10-09 | Webpage local dynamic refreshing method for embedded operating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111175405.5A CN113901359A (en) | 2021-10-09 | 2021-10-09 | Webpage local dynamic refreshing method for embedded operating system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113901359A true CN113901359A (en) | 2022-01-07 |
Family
ID=79190731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111175405.5A Pending CN113901359A (en) | 2021-10-09 | 2021-10-09 | Webpage local dynamic refreshing method for embedded operating system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113901359A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040205564A1 (en) * | 2002-01-04 | 2004-10-14 | Brayton Robert S. | Method to serve real-time data in embedded web server |
CN1987850A (en) * | 2005-12-20 | 2007-06-27 | 腾讯科技(深圳)有限公司 | Method for realizing AJAX webpage |
US20070234195A1 (en) * | 2006-04-03 | 2007-10-04 | National Instruments Corporation | Simultaneous update of a plurality of user interface elements displayed in a web browser |
CN101963984A (en) * | 2010-09-28 | 2011-02-02 | 北京伟库电子商务科技有限公司 | Method and system for rendering page partial block |
CN103634376A (en) * | 2013-11-13 | 2014-03-12 | 王锦忠 | Embedded thin web server system module based on AJAX (asynchronous JavaScript and XML) and CGI (common gateway interface) |
CN106202230A (en) * | 2016-06-29 | 2016-12-07 | 深圳市驰云科技发展有限公司 | Revise the method for web page contents on the router and realize system |
CN109375962A (en) * | 2018-10-23 | 2019-02-22 | 北京计算机技术及应用研究所 | The implementation method of chinese character mixing output display based on embedded OS |
CN110278263A (en) * | 2019-06-18 | 2019-09-24 | 重庆鲲量科技有限公司 | Embedded B/S framework implementation method and platform based on AJAX and BOA |
CN111597483A (en) * | 2020-05-22 | 2020-08-28 | 山东汇贸电子口岸有限公司 | Method for automatically refreshing webpage during webpage development |
US10977425B1 (en) * | 2013-03-13 | 2021-04-13 | Sprint Communications Company L.P. | Dynamic resource refresh |
-
2021
- 2021-10-09 CN CN202111175405.5A patent/CN113901359A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040205564A1 (en) * | 2002-01-04 | 2004-10-14 | Brayton Robert S. | Method to serve real-time data in embedded web server |
CN1987850A (en) * | 2005-12-20 | 2007-06-27 | 腾讯科技(深圳)有限公司 | Method for realizing AJAX webpage |
US20070234195A1 (en) * | 2006-04-03 | 2007-10-04 | National Instruments Corporation | Simultaneous update of a plurality of user interface elements displayed in a web browser |
CN101963984A (en) * | 2010-09-28 | 2011-02-02 | 北京伟库电子商务科技有限公司 | Method and system for rendering page partial block |
US10977425B1 (en) * | 2013-03-13 | 2021-04-13 | Sprint Communications Company L.P. | Dynamic resource refresh |
CN103634376A (en) * | 2013-11-13 | 2014-03-12 | 王锦忠 | Embedded thin web server system module based on AJAX (asynchronous JavaScript and XML) and CGI (common gateway interface) |
CN106202230A (en) * | 2016-06-29 | 2016-12-07 | 深圳市驰云科技发展有限公司 | Revise the method for web page contents on the router and realize system |
CN109375962A (en) * | 2018-10-23 | 2019-02-22 | 北京计算机技术及应用研究所 | The implementation method of chinese character mixing output display based on embedded OS |
CN110278263A (en) * | 2019-06-18 | 2019-09-24 | 重庆鲲量科技有限公司 | Embedded B/S framework implementation method and platform based on AJAX and BOA |
CN111597483A (en) * | 2020-05-22 | 2020-08-28 | 山东汇贸电子口岸有限公司 | Method for automatically refreshing webpage during webpage development |
Non-Patent Citations (3)
Title |
---|
KIKOOK: "[WEB] 详解Ajax实现网页数据异步更新并实时自动刷新", Retrieved from the Internet <URL:https://blog.csdn.net/chenhanxuan1999/article/details/100531830> * |
在路上 努力着: "STM32 网页服务器 LWIP websever ajax实时刷新 (一)", Retrieved from the Internet <URL:https://blog.csdn.net/sl18383334062/article/details/112803134> * |
胡俊祥: "在嵌入式系统中实现AJAX动态网页技术", 《现代计算机》, no. 16, 5 June 2014 (2014-06-05) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106991154B (en) | Webpage rendering method and device, terminal and server | |
CN106371844B (en) | A kind of method and system with primary user interface components displayed web page | |
CN102915375B (en) | A kind of webpage loading method based on layout subregion | |
US9195525B2 (en) | Method and apparatus for generating a web-based user interface | |
CN107229633A (en) | Static page generation method, Web access method and device | |
CN107808010A (en) | A kind of pop-up page generation method, device, browser and storage medium | |
CN103631578B (en) | Method for exhibiting data in a kind of distribution automation system | |
US20060248166A1 (en) | System and method for client side rendering of a web page | |
CN105518633A (en) | Web server system, application development assistance system, multilingual support method in web server system, multi-device support method in web server system, and application development assistance method | |
CN102779167A (en) | Method and system for displaying webpage in mobile terminal | |
US20110145299A1 (en) | Offline Gadgets IDE | |
CN102663050B (en) | Method and device for processing electronic book data | |
CN102831190B (en) | A kind of method that CML files are browsed in low side devices | |
CN104063401A (en) | Webpage style address merging method and device | |
CN101441631A (en) | Data access method for asynchronous web page browsing | |
Suzanti et al. | REST API implementation on android based monitoring application | |
CN109933751B (en) | Image-text drawing method and device, computer-readable storage medium and computer equipment | |
CN103135977A (en) | Information-inputting method in browser and device using the same | |
CN102957681A (en) | Embedded browser, intelligent household appliance and intelligent system of internet of things | |
CN103488735A (en) | Method and terminal for refreshing and displaying pages of terminal browser | |
CN113901359A (en) | Webpage local dynamic refreshing method for embedded operating system | |
CN1804830A (en) | Simplified Chinese and traditional Chinese input conversion system and method | |
CN104021177A (en) | Information integration method with combination of semantic network and geographic information features | |
CN103885988B (en) | Export method and device, the content output system of content | |
TWI493365B (en) | Input and instant displaying method with multiple character-set character codes, system and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |