CN113438325B - Meteorological visualization system based on client storage - Google Patents
Meteorological visualization system based on client storage Download PDFInfo
- Publication number
- CN113438325B CN113438325B CN202110987771.4A CN202110987771A CN113438325B CN 113438325 B CN113438325 B CN 113438325B CN 202110987771 A CN202110987771 A CN 202110987771A CN 113438325 B CN113438325 B CN 113438325B
- Authority
- CN
- China
- Prior art keywords
- data
- client
- module
- meteorological
- server
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a weather visualization system based on client storage.A client actively calls data of a server, and the server pushes the data to the client through a WebSocket object; the client comprises a meteorological data client storage module, a meteorological data client display module, a meteorological data monitoring module, a meteorological data front-end preprocessing module, an interface basic data module and a meteorological data client operation module, wherein the meteorological data client display module, the meteorological data monitoring module and the meteorological data client operation module are all connected with the meteorological data client storage module, the meteorological data monitoring module is connected with the interface basic data module, and the interface basic data module is connected with the meteorological data client storage module through the meteorological data front-end preprocessing module. The invention reduces the request times of the client and the server; the user can open the weather visual interface fast, has also improved holistic experience effect when saving the expense.
Description
Technical Field
The invention relates to a weather visualization system based on client storage, and belongs to the technical field of weather data visualization.
Background
With the development of modern science and technology, meteorological data as basic support information of each industry is inseparable from the operation development of each industry such as electric power, aviation, agriculture and the like, and inseparable from the life of people, and as the meteorological data has the characteristics of multiple sources, multiple dimensionality, huge data volume and the like, a meteorological visualization platform also needs to have the characteristics of easy expansibility, universality, hierarchy and the like. From the living perspective of people, the method has been successfully applied to the fields of electric power, aviation, agriculture and the like. From the meteorological field, set up an audio-visual data analysis platform and data display platform, for meteorological work, can help its more direct law of seeing out meteorological development to a prejudgement has been done. The weather visualization technology is relatively perfect up to now, however, in view of the data volume in the current global weather forecasting system, for example, the Global Forecast System of the national environmental Forecast center, the data updating time is normally once updated in 6 hours, the data amount per hour is about 300 million, if the data size calculated in this way for one month is a huge amount of data, the graphic data and image data provided in the corresponding formats after being processed by the server are also very large, thus, a great deal of bandwidth, CPU and memory are consumed during data interaction between the server and the client, and a great deal of time is consumed at the same time, meanwhile, when the user searches for the display according to the requirement of the user, the display is slow when the effect of the screening condition of the user is displayed, the visual interface is opened slowly, so that the user experience is poor, and the problems are all urgently to be solved.
At present, most meteorological data are mainly communicated by adopting an http protocol when displayed on a client, so that the meteorological data can only be initiated by the client, for example, when people want to know the display condition of the weather today, the client can only initiate a request to a server, and at present, the most adopted mode can only use polling to send out a query at intervals to know whether new information exists in the server, so that the overall efficiency is very low, and a large amount of resources are wasted. Secondly, the previous cookie and LocalStorage can only store a small amount of data, so that for a large amount of data such as weather, a client cannot store the data therein, so that the opening speed of the whole interface mainly depends on the transmission speed of data of the server and the client, which causes that in the case of a slightly poor network condition, the opening speed of the interface is very slow, and the overall experience effect is poor.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide a weather visualization system based on client storage, wherein a visualization part can directly acquire data at a client, so that data interaction with a server is reduced, and the request times of the client and the server are reduced.
In order to achieve the purpose, the invention is realized by the following technical scheme:
the invention relates to a weather visualization system based on client storage, which comprises a client and a server, wherein the client actively calls data of the server, and the server pushes the data to the client through a WebSocket object; the client comprises a meteorological data client storage module, a meteorological data client display module, a meteorological data monitoring module, a meteorological data front-end preprocessing module for classifying data, an interface basic data module and a meteorological data client operation module, wherein the meteorological data client operation module is used for inputting text information, voice information and resource information through an operation interface; the meteorological data client display module, the meteorological data monitoring module and the meteorological data client operation module are all connected with the meteorological data client storage module, the meteorological data monitoring module is connected with the interface basic data module, and the interface basic data module is connected with the meteorological data client storage module through a meteorological data front-end preprocessing module; the WebSocket object is a constructor and is used for newly building a WebSocket instance; returning the current state of an instance object through a readyState attribute in the WebSocket object, wherein the current state is used for judging whether the client side and the server side are connected, the connection is closed or the connection fails; the onopen attribute in the WebSocket object is used for setting a callback function after connection is successful, and sending a request to a server side in the callback function; and the onmessage attribute of the WebSocket object is used for receiving data returned by the server and closing the connection between the WebSocket object and the server through the onmessage attribute.
The meteorological data client storage module is used for storing meteorological data of different meteorological type tables in a classified mode in the form of an IndexDB database.
The weather data client display module displays the weather-changed graphics and images by calling the weather data of different weather type tables in the IndexDB database.
The meteorological data front-end preprocessing module is used for comparing data returned by the interface basic data module with data in the IndexedDB, and if the IndexedDB exists, the data are not stored, otherwise, the data are stored.
The meteorological data monitoring module monitors the change of data in a WebSocket mode.
The interface basic data module is used for receiving the data of temperature, pressure, wind power and humidity returned after the server side processes the data.
The weather visualization system based on the client storage is characterized in that the interaction method between the client and the server is as follows:
the client actively calls the data of the server and returns the data to the client after a request result is obtained;
preprocessing the data of the server side through a meteorological data front-end preprocessing module, comparing the data with an IndexDB database, if the IndexDB database has the data, not storing the data, and if the IndexDB does not have the data, storing the data;
the server side pushes data to a client side through WebSocket, if the data in the range displayed by the client side is changed, the server side informs the client side, meanwhile, the result is returned to the client side, and the client side simultaneously preprocesses the received data and then stores the data in an IndexedDB database;
the client side directly calls the data in the IndexDB database for displaying, and under the condition that the condition is not changed, the visualization part can directly acquire the data in the IndexDB database of the client side, so that data interaction with the server side can be reduced.
The invention has the following beneficial effects: the client can communicate with any server, and the server can push data to the client through Websocket, so that a mode of consuming a large amount of resources is abandoned, a mode of initiating a request by the client can also be adopted, data is stored in an IndexedDB database mode, a meteorological data client display module displays a meteorological-changed graph and an image by calling meteorological data in the IndexedDB database, and a visualization part can directly acquire data in the IndexedDB database of the client under the condition of unchanged conditions, so that data interaction with the server is reduced, a large amount of expenses are reduced, the request times of the client and the server are reduced, and a large amount of expenses of bandwidth, CPU and memory can be saved; meanwhile, a user can quickly open the weather visual interface, so that the cost is saved, and the overall experience effect is improved.
Drawings
FIG. 1 is a block diagram of a client according to the present invention;
FIG. 2 is a flowchart illustrating the interaction between the server and the client according to the present invention.
Detailed Description
The technical scheme of the invention is further explained by combining the attached drawings of the specification:
the technical scheme of the invention is further explained by combining the attached drawings of the specification:
interpretation of terms:
IndexedDB: the API is a client-side bottom layer API which is used for storing a large amount of structured data and files or binary large objects (blobs) at a client side, and the API uses indexes to realize high-performance search and storage of the data.
WebSocket: the network communication protocol is characterized in that a server can actively push information to a client, the client can also actively send information to the server, the network communication protocol is a real two-way equal conversation, and the network communication protocol belongs to a server pushing technology.
HTTP: the Hypertext Transfer Protocol (HTTP) is a simple request-response Protocol that specifies what messages a client may send to a server and what responses it gets.
As shown in fig. 1 and fig. 2, a weather visualization system based on client storage includes a client 7, a server 8, the client 7 actively calls the data of the server 8, the server 8 pushes the data to the client 7 through the WebSocket object, the client 7 comprises a meteorological data client storage module 1, a meteorological data client display module 2, a meteorological data monitoring module 3, a meteorological data front-end preprocessing module 4, an interface basic data module 5 and a meteorological data client operation module 6, the meteorological data client display module 2, the meteorological data monitoring module 3 and the meteorological data client operation module 6 are all connected with the meteorological data client storage module 1, the meteorological data monitoring module 3 is connected with the interface basic data module 5, and the interface basic data module 5 is connected with the meteorological data client storage module 1 through the meteorological data front-end preprocessing module 4. The WebSocket object is a construction function and used for building a WebSocket instance, the client 7 can be connected with the server 8 after the execution is successful, then the current state of the instance object is returned through a readyState attribute in the WebSocket object to judge whether the connection is in progress or the connection is closed and the connection is failed, the onopen attribute in the WebSocket object is used for appointing a callback function after the connection is successful, a request can be sent to the server 8 in the callback function, data returned by the server 8 is received through the onmessage attribute of the WebSocket object, and the connection between the WebSocket and the server 8 is closed through the onclose attribute in the WebSocket object.
As shown in fig. 1-2, the weather data client storage module 1 stores the weather data of different weather type tables in a classified manner in the form of an IndexedDB database, such as data with JSON format or url addresses of pictures. The weather data client display module 2 displays the graphics and images of weather changes by calling the weather data in the indexedDB database. The meteorological data monitoring module 3 monitors the change of data in a WebSocket mode, the server 8 can actively push the data to the client 7, and the client 7 can also actively send the data to the server 8, so that the communication can be carried out in real time. The meteorological data front-end preprocessing module 4 compares the data returned by the interface basic data module 5 with the data in the IndexedDB database, if the IndexedDB database already exists, the data are not stored, otherwise, the data are stored, the meteorological data front-end preprocessing module is also used for classifying the data, preparing for the later storage of the data such as wind, temperature and the like, carrying out differentiation processing simultaneously, if the data are the same as the previous data, carrying out no processing, and if the data are different from the previous data, updating and deleting the old data. The interface basic data module 5 is used for receiving returned data of temperature, pressure, wind power and humidity processed by the server 8, and the meteorological data client operation module 6 is used for a user to input text information, voice information and resource information through an operation interface.
Fig. 2 is a flowchart of the interaction between the server 8 and the client 7 of the present invention, which generally includes the following contents:
1. the client 7 can actively call the server 8 data, and when the request result is obtained, the data is returned to the client 7.
2. And preprocessing the data return result through a meteorological data front-end preprocessing module 4, comparing the data return result with an IndexDB database, and if the IndexDB database has the data, not storing the data, and if the IndexDB does not have the data, storing the data.
3. The server 8 can simultaneously push data to the client 7 directly through WebSocket, that is, the data within the range displayed by the client 7 is changed, the client 7 is informed to return the result to the client 7 at the same time, and the client 7 simultaneously preprocesses the received data and stores the preprocessed data in an indexedDB database.
4. The client 7 directly calls the data in the IndexDB database for displaying, so that under the condition of unchanging conditions, the visualization part can directly acquire the data in the IndexDB database of the client 7, the data interaction with the server 8 is reduced, and a large amount of expenses are reduced.
The invention supports the visual display of the meteorological data of the client through the Websocket technology and IndexDB, the Websocket is established on a TCP protocol and has good compatibility with the HTTP protocol, and the HTTP protocol is adopted in the handshake stage, so that the client is not easy to be shielded in the handshake process, the Websocket data format is lighter, the overall performance cost is relatively smaller, no homologous limitation exists, and the client can communicate with any server. Meanwhile, the server can push data to the client through the Websocket, so that the mode that a large amount of resources are consumed and a request can only be initiated by the client is abandoned. Meanwhile, a data storage mode of an IndexedDB client is adopted, the IndexedDB belongs to a non-relational database, data is stored in an object form, each object has a corresponding key name, and when the client displays a related meteorological data interface, the client firstly searches the IndexedDB database. If the data is directly displayed, if the data is not requested to the server side through the Websocket, the data is stored after the data is preprocessed by the client side. Meanwhile, under the current screening condition, the server side pushes data to the client side if the data are changed, and the client side processes the data in the same way after receiving the data, so that the request times of the client side and the server side are reduced, and a large amount of expenses of bandwidth, a CPU (Central processing Unit) and an internal memory can be saved. Meanwhile, a user can quickly open the weather visual interface, so that the cost is saved, and the overall experience effect is improved.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments or portions thereof without departing from the spirit and scope of the invention.
Claims (2)
1. The weather visualization system based on client storage is characterized by comprising a client (7) and a server (8), wherein the client (7) actively calls data of the server (8), and the server (8) pushes the data to the client (7) through a WebSocket object;
the client (7) comprises a meteorological data client storage module (1), a meteorological data client display module (2), a meteorological data monitoring module (3), a meteorological data front-end preprocessing module (4) for classifying data, an interface basic data module (5) and a meteorological data client operation module (6), wherein the meteorological data client operation module (6) is used for inputting text information, voice information and resource information through an operation interface; the meteorological data client display module (2), the meteorological data monitoring module (3) and the meteorological data client operation module (6) are all connected with the meteorological data client storage module (1), the meteorological data monitoring module (3) is connected with the interface basic data module (5), and the interface basic data module (5) is connected with the meteorological data client storage module (1) through a meteorological data front-end preprocessing module (4);
the WebSocket object is a constructor and is used for newly building a WebSocket instance; returning the current state of the instance object through a readyState attribute in the WebSocket object, wherein the current state is used for judging whether the client (7) and the server (8) are connected, the connection is closed or the connection fails; the onopen attribute in the WebSocket object is used for setting a callback function after connection is successful, and sending a request to a server (8) in the callback function; the onmessage attribute of the WebSocket object is used for receiving data returned by the server (8) and closing the connection between the WebSocket object and the server (8) through the onmessage attribute;
the meteorological data client storage module (1) is used for storing meteorological data of different meteorological type tables in a classified mode in the form of an IndexDB database;
the meteorological data client side display module (2) displays the meteorological change graphs and images by calling meteorological data of different meteorological type tables in an IndexDB database;
the meteorological data front-end preprocessing module (4) is used for comparing data returned by the interface basic data module (5) with data in an IndexedDB database, and if the IndexedDB database already exists, the data are not stored, otherwise, the data are stored;
the meteorological data monitoring module (3) monitors the change of data in a WebSocket mode;
the interface basic data module (5) is used for receiving the returned data of temperature, pressure, wind power and humidity after being processed by the server (8).
2. The weather visualization system based on the client storage according to claim 1, wherein the client (7) and the server (8) interact as follows:
the client (7) actively calls the data of the server (8), and returns the data to the client (7) after a request result is obtained;
preprocessing the data of the server (8) through a meteorological data front-end preprocessing module (4), comparing the data with an IndexDB database, if the IndexDB database has the data, not storing the data, and if the IndexDB does not have the data, storing the data;
the server (8) pushes data to the client (7) through WebSocket, if the data displayed by the client (7) changes, the client (7) is informed, and the result is returned to the client (7), and the client (7) preprocesses the received data and stores the data in an IndexedDB database;
the client (7) directly calls the data in the IndexDB database for displaying, and under the condition that the condition is not changed, the visualization part can directly acquire the data in the IndexDB database of the client (7), so that the data interaction with the server (8) can be reduced.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110987771.4A CN113438325B (en) | 2021-08-26 | 2021-08-26 | Meteorological visualization system based on client storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110987771.4A CN113438325B (en) | 2021-08-26 | 2021-08-26 | Meteorological visualization system based on client storage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113438325A CN113438325A (en) | 2021-09-24 |
CN113438325B true CN113438325B (en) | 2021-12-07 |
Family
ID=77798054
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110987771.4A Active CN113438325B (en) | 2021-08-26 | 2021-08-26 | Meteorological visualization system based on client storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113438325B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450776A (en) * | 2015-12-28 | 2016-03-30 | 北京华风创新网络技术有限公司 | Weather data visualization system |
CN108881456A (en) * | 2018-06-29 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of data interaction system, server-side and its data interactive method and system |
CN112182086A (en) * | 2020-09-29 | 2021-01-05 | 华能新能源股份有限公司 | Data transmission interaction system and method for rear-end interface of meteorological data warehouse |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP4398526A3 (en) * | 2013-09-30 | 2024-10-02 | Schneider Electric Buildings Americas, Inc. | Building automation management device, associated method and computer program |
CN109901938B (en) * | 2019-02-26 | 2021-11-19 | 北京华夏电通科技股份有限公司 | Interactive large-screen system based on WebSocket communication and visual display method |
-
2021
- 2021-08-26 CN CN202110987771.4A patent/CN113438325B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450776A (en) * | 2015-12-28 | 2016-03-30 | 北京华风创新网络技术有限公司 | Weather data visualization system |
CN108881456A (en) * | 2018-06-29 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of data interaction system, server-side and its data interactive method and system |
CN112182086A (en) * | 2020-09-29 | 2021-01-05 | 华能新能源股份有限公司 | Data transmission interaction system and method for rear-end interface of meteorological data warehouse |
Non-Patent Citations (1)
Title |
---|
"基于HTML5的本地数据库与服务端数据库的协同研究";张慧;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20131215;正文28页3.4节、第5-6章 * |
Also Published As
Publication number | Publication date |
---|---|
CN113438325A (en) | 2021-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220294850A1 (en) | Cloud storage methods and systems | |
CN106294798B (en) | Image sharing method and terminal based on thumbnail | |
US7580568B1 (en) | Methods and systems for identifying an image as a representative image for an article | |
US20080288486A1 (en) | Method and system for aggregate web site database price watch feature | |
US20140115282A1 (en) | Writing data from hadoop to off grid storage | |
CA2909257C (en) | Combinatorial business intelligence | |
CN103176825B (en) | The processing method and processing device of application program business more new data | |
CN110866204A (en) | Page processing method and device | |
CN108804445B (en) | Thermodynamic diagram generation method and device | |
CN112765152B (en) | Method and apparatus for merging data tables | |
CN113157947A (en) | Knowledge graph construction method, tool, device and server | |
CN108052661B (en) | Aggregation retrieval method and device in distributed environment and readable storage medium | |
CN114969113A (en) | Information searching method, device, storage medium and server | |
CN113438325B (en) | Meteorological visualization system based on client storage | |
WO2016032568A1 (en) | Job poster identification | |
CN107832342B (en) | Robot chatting method and system | |
CN116684378A (en) | Mail caching method, device, equipment and medium based on hierarchical management | |
CN112395109B (en) | Clipboard content processing method and device | |
CN116776030A (en) | Gray release method, device, computer equipment and storage medium | |
CN113656506B (en) | Electronic specification acquisition method and device and readable medium | |
CN116594709A (en) | Method, apparatus and computer program product for acquiring data | |
CN112328668B (en) | Data visualization realization method, device, equipment and storage medium | |
CN114707835A (en) | Data processing method and device, electronic equipment and computer readable medium | |
CN114625763A (en) | Information analysis method and device for database, electronic equipment and readable medium | |
WO2021097041A1 (en) | Operational anomaly feedback loop system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |