CN108881373B - MVC (model view controller) framework based front-end data stream processing method - Google Patents
MVC (model view controller) framework based front-end data stream processing method Download PDFInfo
- Publication number
- CN108881373B CN108881373B CN201810392146.3A CN201810392146A CN108881373B CN 108881373 B CN108881373 B CN 108881373B CN 201810392146 A CN201810392146 A CN 201810392146A CN 108881373 B CN108881373 B CN 108881373B
- Authority
- CN
- China
- Prior art keywords
- request
- data
- controller
- service
- user
- 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/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
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
- H04L63/1458—Denial of Service
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
- H04L63/1466—Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/30—Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
- H04L63/306—Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information intercepting packet switched data communications, e.g. Web, Internet or IMS communications
-
- 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/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Technology Law (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention belongs to the technical field of computer software web development front ends, and particularly relates to a front end data flow processing method based on an MVC framework. The method comprises the following steps: the user distributes the request to the controller through the front-end route, and the controller receives the request and sends the request to the front-end request service; the front end request service sends a request to a background server; the background server verifies the authority of the request according to the background filter; when the request has the authority, the background interface acquires data corresponding to the user request; when the data are successfully acquired from the database, the controller sends the data to a user page to realize visualization; when the data acquisition from the database fails, the controller sends the failure information to the user page. The invention can replace the traditional heavyweight front-end frame by the lightweight frame, thereby shortening the response time of the system, greatly improving the analysis efficiency of the browser and effectively improving the use experience of users.
Description
Technical Field
The invention belongs to the technical field of computer software web development front ends, and particularly relates to a front end data flow processing method based on an MVC framework.
Background
Currently, in the internet, mainstream computer software web development uses a large amount of SpringMVC backend framework, and front-end data stream processing methods are all data stream processing and displaying of a passive specified path through a background server. Because the data stream processing mode needs to be carried out by a specified path, a large amount of resources are consumed for assistance when the data stream processing mode is started every time, the response speed of the server is generally low, and once errors occur, the errors are found and corrected passively according to the specified path by completely depending on the background server, so that the errors are obviously not convenient for research personnel to troubleshoot. Especially, the traditional Web framework runs more slowly in the mobile device, and compared with the desktop user, the user using the mobile end is also more intolerant to the problems of system and slow loading. In addition, when a developer writes a program each time, the developer must execute the program according to the flow specified by the path in the order of work, which is very troublesome and unintuitive, and is also easy to make mistakes, thus greatly affecting the actual operation experience of the software.
Disclosure of Invention
The present invention aims to overcome the defects of the prior art, and provides a modular and standardized front-end data stream processing method for MVC-based framework, so as to replace the traditional heavyweight front-end framework by its own lightweight framework which can be separated from the back-end server at any time, thereby shortening the system response time, greatly improving the analysis efficiency of the browser, and effectively improving the user experience.
In order to achieve the purpose, the invention adopts the following technical scheme:
a front-end data stream processing method based on MVC framework is characterized by comprising the following steps:
s1, the user clicks the event on the user page, so as to send the request for obtaining the data, the MVC frame at the front end intercepts the request and forwards the request to the front end route; the front-end route analyzes the request, distributes the request to a controller to which the request belongs according to different requests, and then executes the next operation;
s2, the controller receives the request and manages the request in a unified way, then sends the request to the front end request service, and waits for the response of the front end request service;
s3, the front end request service sends a request to the background server according to the http protocol so as to obtain a service instruction, and waits for the response of the background server;
s4, the background server verifies whether the request has the authority according to the background filter; if the user does not have the authority, rejecting the request, feeding back rejection information to the controller through the front-end request service, and sending the rejection information to a user page by the controller to realize visualization; if the authority exists, the next operation is continuously executed;
s5, when the request has the right, the background interface starts to acquire the data corresponding to the user request from the database of the background server; when the data is successfully acquired from the database, the data is packaged into JSON-format data through a background interface so as to respond to a front-end request service, the JSON-format data information is fed back to a controller through the front-end request service, and the controller sends the JSON-format data to a user page so as to realize visualization; when the data acquisition from the database fails, the failure information is still fed back to the controller through the front-end request service, and the controller sends the failure information to the visual user page.
Preferably, in step S4, when the background filter verifies that the request is not authorized, the data format of the response front-end request service has a flag field value as an unauthorized string identifier.
Preferably, in the step S5, when the background filter verifies that the request is successful and the data acquisition from the database fails, the data format of the response front-end request service has a flag field value as a character string identifier of the data acquisition failure; when the background filter verifies that the request is successful and the data acquisition from the database is successful, the data format responding to the front-end request service is provided with a flag field value as a character string identifier of the successful data acquisition.
The invention has the following beneficial effects:
1) compared with the traditional front-end application, the method is lighter in weight, and is suitable for research and development of various large web projects, so that the research and development cost can be effectively reduced. Through the visual user page, the user experience can be greatly improved.
2) And the traditional front-end frame and the back-end server have stronger coupling, namely once the front end and the back end are separated, the user page can report errors. The invention is completely separated from the back-end server, and only uses the background interface as an exchange port; in other words, the invention can fully apply the hardware of the user to realize the modularized management, as long as the background interface can be connected with the background server, any number of front-end frame structures of the invention can be loaded theoretically, namely, the active acceptance and active processing of the background server to the synchronization of a plurality of requests can be realized through any user hardware, the research and development personnel can also directly carry out active error troubleshooting operation at any time through the path, and the troubleshooting efficiency can be greatly improved.
3) The invention can make full use of the user hardware condition, and the front end data flow can be managed uniformly through the front end route and the controller, thereby completely liberating the server or only letting the server process the service logic and data storage; meanwhile, the front-end application can be greatly simplified by using the REST service in the JSON receiving and sending format, so that the speed of processing data by the front end and analyzing the front-end code of the browser is in millisecond level, the response speed of the system is greatly improved, and the system is particularly suitable for mobile end users.
4) In conclusion, the invention can be applied to not only the interior of the enterprise, but also the internet products, and is a reusable lightweight front-end data stream processing method. Research personnel build a front-end data flow processing framework, data flow processing is carried out through a unified and standard modular flow, and the data flow is standardized and managed through a unified route and a front-end service request, so that the costs of research and development, operation and maintenance and the like are greatly reduced, the bidirectional binding function of front-end data is met, and data change is synchronized in real time. The invention shortens the response time of the front-end system in the aspect of system request and improves the use experience of the user.
Drawings
FIG. 1 is a flow chart of the system of the present invention.
Detailed Description
For ease of understanding, the specific structure and operation of the present invention is further described herein with reference to FIG. 1:
the specific process flow of the present invention can be shown in fig. 1, which includes the following steps:
1) and event requests operated by the users are uniformly managed by the front-end route. Due to the huge size of the database, the derived requests for obtaining data are necessarily extremely numerous, and therefore, a plurality of controllers for different requests need to be established for processing. According to different request operations of users, the requests are distributed to the controllers corresponding to the requests through front-end routing.
2) And the controller sends the request to the background service after uniformly managing the request of the user.
3) The background server constantly monitors the front-end service request and verifies the front-end request through the background filter; if the verification fails, the background server directly intercepts the data; and if the verification is passed, performing subsequent operation.
4) After the verification is passed, the background server opens the data interface, and the data can be inquired in the database through the background interface. If the data acquisition is successful, the front end request service returns the responded JSON data to the controller; if the data acquisition fails, the background interface also feeds back failure information to the controller through the front-end request service.
5) Whether the verification is failed, the data acquisition is successful or the data acquisition is failed, the controller can visualize corresponding information to the user interface through data processing, and can bind the data to the user page in real time for browsing.
Specifically, in step 1), the user first performs operations such as clicking on an event on a user page to send a request for acquiring data, and the front-end MVC framework intercepts the request and forwards the request to the front-end router. The front end route analyzes the request, the request is distributed to a corresponding controller after the analysis, the controller sends a request for acquiring data to the front end request service, and then the controller waits for the response of the front end request service. After the front-end request service accepts the information, the front-end request service sends a request acquisition service instruction to the background server according to the http protocol, the background server verifies whether the request has the authority according to the background filter, if not, the request is rejected, and if so, the subsequent operation is continuously executed. The background interface is responsible for acquiring and responding to the user request, the data format is set to be the JSON format, and the JSON data are processed by the controller and displayed to the user in a visualized mode.
When the background filter verifies that the request is not authorized, the data format responding to the front end request service is marked with flag field value as an unauthorized character string, such as: nonpermission. When the background filter verifies that the request is successful and the data acquisition from the database fails, the data format responding to the front-end request service has a flag field value as a character string identifier of the data acquisition failure, such as: false. When the background filter verifies that the request is successful and the data acquisition from the database is successful, the data format responding to the front-end request service is provided with a character string identifier with a flag field value as the successful data acquisition, such as: success.
When the controller processes the feedback data and visually displays the feedback data on a user page, the display effect is as follows: when the request has no authority, the user can quickly see the information that the user page prompts that the operation performed by the user has no authority, and please contact an administrator and the like. When the request for acquiring the data fails, the user can quickly see information such as that the data is not found by the operation performed by the user prompted by the user page, or the data is empty or the reason for the failure in acquiring the data. When the request for acquiring the data is successful, the user can quickly see the data displayed on the user page, and the bidirectional binding of the data can be visualized in real time for the user to display.
Claims (3)
1. A front-end data stream processing method based on MVC framework is characterized by comprising the following steps:
s1, the user clicks the event on the user page, so as to send the request for obtaining the data, the MVC frame at the front end intercepts the request and forwards the request to the front end route; the front-end route analyzes the request, distributes the request to a controller to which the request belongs according to different requests, and then executes the next operation;
s2, the controller receives the request and manages the request in a unified way, then sends the request to the front end request service, and waits for the response of the front end request service;
s3, the front end request service sends a request to the background server according to the http protocol so as to obtain a service instruction, and waits for the response of the background server;
s4, the background server verifies whether the request has the authority according to the background filter; if the user does not have the authority, rejecting the request, feeding back rejection information to the controller through the front-end request service, and sending the rejection information to a user page by the controller to realize visualization; if the authority exists, the next operation is continuously executed;
s5, when the request has the right, the background interface starts to acquire the data corresponding to the user request from the database of the background server; when the data is successfully acquired from the database, the data is packaged into JSON-format data through a background interface so as to respond to a front-end request service, the JSON-format data information is fed back to a controller through the front-end request service, and the controller sends the JSON-format data to a user page so as to realize visualization; when the data acquisition from the database fails, the failure information is still fed back to the controller through the front-end request service, and the controller sends the failure information to the visual user page.
2. The MVC framework-based front-end data stream processing method according to claim 1, wherein: in step S4, when the background filter verifies that the request is not authorized, the data format of the response front-end request service has flag field value as an unauthorized string identifier.
3. The MVC framework-based front-end data stream processing method according to claim 2, wherein: in the step S5, when the background filter verifies that the request is successful and the data acquisition from the database fails, the data format of the response front-end request service has a flag field value as the character string identifier of the data acquisition failure; when the background filter verifies that the request is successful and the data acquisition from the database is successful, the data format responding to the front-end request service is provided with a flag field value as a character string identifier of the successful data acquisition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810392146.3A CN108881373B (en) | 2018-04-27 | 2018-04-27 | MVC (model view controller) framework based front-end data stream processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810392146.3A CN108881373B (en) | 2018-04-27 | 2018-04-27 | MVC (model view controller) framework based front-end data stream processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108881373A CN108881373A (en) | 2018-11-23 |
CN108881373B true CN108881373B (en) | 2021-07-06 |
Family
ID=64326710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810392146.3A Active CN108881373B (en) | 2018-04-27 | 2018-04-27 | MVC (model view controller) framework based front-end data stream processing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108881373B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110377656B (en) * | 2019-06-13 | 2023-04-25 | 中国地质大学深圳研究院 | Storm surge inundation early warning visualization method based on MVC architecture |
CN115934043B (en) * | 2023-01-04 | 2024-03-15 | 广州佰瑞医药有限公司 | PHP-based high-efficiency MVC framework |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102830973A (en) * | 2012-08-14 | 2012-12-19 | 无锡哲勤科技有限公司 | Method and layered structure for double-layer MVC (model, view and controller) developed by Web application with mass data |
CN104267944A (en) * | 2014-09-22 | 2015-01-07 | 浪潮软件集团有限公司 | Spring-based MVC (model view controller) mode optimization system |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
CN105867948A (en) * | 2016-04-26 | 2016-08-17 | 江苏物联网研究发展中心 | WEB development method based on AJAX (Asynchronous JavaScript and XML) and Spring MVC (model view controller) |
CN105955714A (en) * | 2016-04-15 | 2016-09-21 | 北京海尔广科数字技术有限公司 | Mixed development front end MVC frame implementation method and system |
CN105975465A (en) * | 2015-10-19 | 2016-09-28 | 霍亮 | Method for monitoring traditional Chinese medicine resources based on geographic national conditions |
CN106844428A (en) * | 2016-12-12 | 2017-06-13 | 安徽四创电子股份有限公司 | A kind of front end MVC management platform methods for designing based on RESTful interfaces |
CN107220294A (en) * | 2017-04-26 | 2017-09-29 | 努比亚技术有限公司 | A kind of method and terminal for asking to handle |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150067138A1 (en) * | 2013-08-27 | 2015-03-05 | International Business Machines Corporation | Optimize data exchange for mvc-based web applications |
-
2018
- 2018-04-27 CN CN201810392146.3A patent/CN108881373B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102830973A (en) * | 2012-08-14 | 2012-12-19 | 无锡哲勤科技有限公司 | Method and layered structure for double-layer MVC (model, view and controller) developed by Web application with mass data |
CN104267944A (en) * | 2014-09-22 | 2015-01-07 | 浪潮软件集团有限公司 | Spring-based MVC (model view controller) mode optimization system |
CN105975465A (en) * | 2015-10-19 | 2016-09-28 | 霍亮 | Method for monitoring traditional Chinese medicine resources based on geographic national conditions |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
CN105955714A (en) * | 2016-04-15 | 2016-09-21 | 北京海尔广科数字技术有限公司 | Mixed development front end MVC frame implementation method and system |
CN105867948A (en) * | 2016-04-26 | 2016-08-17 | 江苏物联网研究发展中心 | WEB development method based on AJAX (Asynchronous JavaScript and XML) and Spring MVC (model view controller) |
CN106844428A (en) * | 2016-12-12 | 2017-06-13 | 安徽四创电子股份有限公司 | A kind of front end MVC management platform methods for designing based on RESTful interfaces |
CN107220294A (en) * | 2017-04-26 | 2017-09-29 | 努比亚技术有限公司 | A kind of method and terminal for asking to handle |
Non-Patent Citations (1)
Title |
---|
"企业级WEB前端MVC框架设计";王海洋;《万方学位论文数据库》;20140917;第28-35页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108881373A (en) | 2018-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210232498A1 (en) | Method for testing edge computing, device, and readable storage medium | |
US7526680B2 (en) | Stress testing a website having a backend application | |
CN105681077B (en) | Fault handling method, apparatus and system | |
CN110689223B (en) | Robot batch management system based on RPA control | |
CN110389834A (en) | A kind of method and apparatus for submitting deep learning training mission | |
CN105872068A (en) | Cloud platform and automatic operation check method based on same | |
CN104636146A (en) | Online visual customizing method and system | |
CN101815013A (en) | Method for monitoring operation of satellite application system based on Ajax and Web service technology | |
CN107168844B (en) | Performance monitoring method and device | |
CN108881373B (en) | MVC (model view controller) framework based front-end data stream processing method | |
CN110781089B (en) | Method and device for automatically testing UI of equipment, electronic equipment and medium | |
CN107766509A (en) | A kind of method and apparatus of webpage static backup | |
CN105162632A (en) | Automatic processing system for server cluster failures | |
CN107133020A (en) | A kind of data processing method, system, interface end and server | |
CN107992392A (en) | A kind of automatic monitoring repair system and method for cloud rendering system | |
CN109800081A (en) | A kind of management method and relevant device of big data task | |
CN113419920B (en) | Real-time monitoring method for joint debugging test process of simulation test system of Internet of things management platform | |
CN112882863A (en) | Method, device and system for recovering data and electronic equipment | |
CN104239217A (en) | Method and system for testing railway signal software | |
CN111769979A (en) | Cloud resource arranging method, system, terminal and storage medium | |
CN114095343A (en) | Disaster recovery method, device, equipment and storage medium based on double-active system | |
CN111245917B (en) | Katalon-based work order entry device and implementation method thereof | |
CN113703973A (en) | Cloud task processing method, system, device, equipment and storage medium | |
US8438271B2 (en) | Performing services in a network data processing system | |
CN106354723B (en) | A kind of on-line data acquisition system |
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 |