A method for implementing a secure and fast mobile web page container for the financial sector
By using private TCP protocol, CRC and DES3 encryption algorithms in mobile web page loading in the financial field, the security risks and loading speed problems in mobile web page loading are solved, and safer and faster web page loading is achieved.
Patent Information
- Application Number
- CN202411726776.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-04
AI Technical Summary
There are problems with security risks and limited loading speed for existing financial industry mobile web pages.
The private TCP protocol is used to transmit web page content, ensure data security and uniqueness through cyclic redundant verification code (CRC) and DES3 encryption algorithms, and implement key callbacks of web components on the client to complete the loading of all web page files.
It has achieved higher security and speed in the mobile web page loading process in the financial field, and is faster, safer and more reliable than other mobile web page loading technologies on the market.
Smart Images

Figure CN119760698A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of mobile Internet financial technology, and in particular relates to a method for implementing a secure and fast mobile terminal web page container for the financial field. Background Art
[0002] There are countless types of Internet financial services. With the rapid development and popularization of mobile Internet, the use of mobile terminals has become an indispensable part of people's securities trading services. The mobile terminal and the web security communication mechanism realize the secure interaction of mobile terminal and embedded web page data. The development of mobile terminals is accompanied by the popularization of smart terminal devices. The development of functions is mainly based on the native coding language of mobile terminals, which realizes a good interactive experience of applications. At present, the mobile terminals in the financial industry load web pages mainly through the Web components provided by the mobile operating system, directly loading HTTP / HTTPS protocol URLs to complete the request of web resources, data download, cache and page update.
[0003] There are several problems with the method of directly loading HTTP / HTTPS URLs on mobile devices: 1. Security risks, such as man-in-the-middle attacks, where the content or data of the page may be intercepted or tampered with by a third party. 2. Loading speed, especially when multiple requests are made concurrently, due to the limitations of Webkit itself, only 6 requests can be made at the same time, and the content size of a single request is limited, resulting in slow page loading or even a white screen. Summary of the invention
[0004] The purpose of the present invention is to provide a method for implementing a secure and fast mobile web page container for the financial field, which solves the problems of security risks and limited loading speed in the existing mobile terminal loading of web pages in the financial industry.
[0005] The technical solution adopted by the present invention is: a method for implementing a secure and fast mobile web page container in the financial field, which is characterized by being implemented specifically according to the following steps: Step 1, write an encryption function in the file and encrypt the product file; Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 5: The client adds a JSBridge function for the web page to call; Step 6: Delete the locally expired cached content to achieve timely update of web page content.
[0006] The present invention is also characterized in that: In step 1, a cyclic redundancy algorithm is used to calculate the webpage content to obtain a cyclic redundancy check code that can determine the uniqueness of the file, that is, a CRC value. The CRC value is appended to the end of the original data file, and then the file is encrypted using the DES3 algorithm to obtain a finished file.
[0007] In steps 2 and 3, two new interfaces are added on the App server, namely Interface I and Interface II. Interface I receives the input parameter as a single file relative path and returns the encrypted product file in the corresponding directory of the server.
[0008] Interface II receives input parameters as a string consisting of multiple file relative paths and corresponding CRC values, searches for CRC according to the relative path, returns all relative paths with inconsistent CRC to the caller, and updates the expired cache files on the client side.
[0009] Step 4 is as follows: Step 4.1: The mobile operating system will call back the relative path of the web page being loaded. After the client obtains the path, it will first return to the cache in the local sandbox, and use the web page loading component of the mobile operating system to intercept and obtain the relative path of the web page being loaded, and give priority to matching the local cache file to accelerate the display of the web page; Step 4.2: If there is no local cache and no cache is matched, the interface I of step 2 is called through a private communication protocol with the relative path as a parameter to obtain the corresponding product and obtain the latest product from the server. Step 4.3, after getting the product, decrypt it according to the agreed key to obtain the original web page content and CRC value, take out the CRC value at the end of the file and store it in the sandbox in association with the relative path, and create the same directory in the mobile phone sandbox according to the relative path for cache, and synchronously call back the decrypted web page content to the Web component through WebResourceResponse and WKURLSchemeTask, and the Web component will continue to load the web page content, call back the web page content to the system Web component for rendering, and cache the product and CRC value at the same time, and repeat steps 4.1-4.3 in a loop to complete the loading of all web page files.
[0010] If the mobile phone operating system is iOS, use the StartURLSchemeTask method of WKURLSchemeHandler; if the mobile phone operating system is Android, use the shouldInterceptRequest method.
[0011] The web page initiates an interface request through the JSBridge function. The client forwards the request to the server via a private communication protocol, and the client then forwards the result returned by the server back to the web page.
[0012] When the client starts the App, it calls interface II in step 3. The client compares the CRC value of the local cache with the CRC table of the server, and passes in the relative path and CRC value of the local cache. The client deletes the expired local cache files and updates the CRC table synchronously according to the content returned by the interface. When the user opens the deleted page again, the latest page will be loaded according to step 4 to update the display of the web page content.
[0013] The beneficial effects of the present invention are as follows: the present invention is a method for realizing a secure and fast mobile web page container in the financial field. Based on a private communication protocol, the method realizes the display and update of web page content on the mobile phone through the Web component provided by the mobile phone operating system. Compared with other mobile web page loading technologies on the market, the method is faster, safer and more reliable. The method has important theoretical research significance and industrial practice research value for mobile data application and optimization and improvement of mobile terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a flowchart of loading web page content on a mobile terminal according to Embodiment 4 of the present invention; Figure 2 This is a flowchart of updating local cache resources on a mobile terminal according to Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0015] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] Example 1 The method for implementing a secure and fast mobile web page container in the financial field of the present invention is specifically implemented according to the following steps: Step 1, write an encryption function in the file and encrypt the product file; Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 5: The client adds a JSBridge function for the web page to call; Step 6: Delete the locally expired cached content to achieve timely update of web page content.
[0017] Example 2 The method for implementing a secure and fast mobile web page container in the financial field of the present invention is specifically implemented according to the following steps: Step 1, write an encryption function in the file and encrypt the product file; The web page content is calculated using a cyclic redundancy algorithm to obtain a cyclic redundancy check code (CRC value) that can determine the uniqueness of the file. The CRC value is appended to the end of the original data file, and then the file is encrypted using the DES3 algorithm to obtain the finished file.
[0018] Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; In step 2 and step 3, two new interfaces are added on the App server, namely interface I and interface II. Interface I receives the input parameter as a single file relative path and returns the encrypted product file in the corresponding directory of the server. Interface II receives the input parameter as a string consisting of multiple file relative paths and corresponding CRC values, searches for CRC according to the relative path, returns all relative paths with inconsistent CRC to the caller, and updates the expired cache files on the client.
[0019] Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 5: The client adds a JSBridge function for the web page to call; Step 6: Delete the locally expired cached content to achieve timely update of web page content.
[0020] Example 3 The method for implementing a secure and fast mobile web page container in the financial field of the present invention is specifically implemented according to the following steps: Step 1, write an encryption function in the file and encrypt the product file; The web page content is calculated using a cyclic redundancy algorithm to obtain a cyclic redundancy check code (CRC value) that can determine the uniqueness of the file. The CRC value is appended to the end of the original data file, and then the file is encrypted using the DES3 algorithm to obtain the finished file.
[0021] Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; In step 2 and step 3, two new interfaces are added on the App server, namely interface I and interface II. Interface I receives the input parameter as a single file relative path and returns the encrypted product file in the corresponding directory of the server. Interface II receives the input parameter as a string consisting of multiple file relative paths and corresponding CRC values, searches for CRC according to the relative path, returns all relative paths with inconsistent CRC to the caller, and updates the expired cache files on the client.
[0022] Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 4 is as follows: Step 4.1: The mobile operating system will call back the relative path of the web page being loaded. After the client obtains the path, it will first return to the cache in the local sandbox, and use the web page loading component of the mobile operating system to intercept and obtain the relative path of the web page being loaded, and give priority to matching the local cache file to accelerate the display of the web page; Step 4.2: If there is no local cache and no cache is matched, the interface I of step 2 is called through a private communication protocol with the relative path as a parameter to obtain the corresponding product and obtain the latest product from the server. Step 4.3, after getting the product, decrypt it according to the agreed key to get the original web page content and CRC value, take out the CRC value at the end of the file and store it in the sandbox in association with the relative path, and create the same directory in the mobile phone sandbox according to the relative path for caching, and synchronously call back the decrypted web page content to the Web component through WebResourceResponse and WKURLSchemeTask, and the Web component will continue to load the web page content, call back the web page content to the system Web component for rendering, and cache the product and CRC value. Repeat steps 4.1-4.3 to complete the loading of all web page files.
[0023] This embodiment uses the DES3 decryption algorithm to decrypt the content.
[0024] If the mobile phone operating system is iOS, use the StartURLSchemeTask method of WKURLSchemeHandler; if the mobile phone operating system is Android, use the shouldInterceptRequest method.
[0025] Step 5: The client adds a JSBridge function for the web page to call; Step 6: Delete the locally expired cached content to achieve timely update of web page content.
[0026] Example 4 The method for implementing a secure and fast mobile web page container in the financial field of the present invention is specifically implemented according to the following steps: Step 1, write an encryption function in the file and encrypt the product file; The web page content is calculated using a cyclic redundancy algorithm to obtain a cyclic redundancy check code (CRC value) that can determine the uniqueness of the file. The CRC value is appended to the end of the original data file, and then the file is encrypted using the DES3 algorithm to obtain the finished file.
[0027] Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; In step 2 and step 3, two new interfaces are added on the App server, namely interface I and interface II. Interface I receives the input parameter as a single file relative path and returns the encrypted product file in the corresponding directory of the server. Interface II receives the input parameter as a string consisting of multiple file relative paths and corresponding CRC values, searches for CRC according to the relative path, returns all relative paths with inconsistent CRC to the caller, and updates the expired cache files on the client.
[0028] Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 4 is as follows: Step 4.1: The mobile operating system will call back the relative path of the web page being loaded. After the client obtains the path, it will first return to the cache in the local sandbox, and use the web page loading component of the mobile operating system to intercept and obtain the relative path of the web page being loaded, and give priority to matching the local cache file to accelerate the display of the web page; Step 4.2: If there is no local cache and no cache is matched, the interface I of step 2 is called through a private communication protocol with the relative path as a parameter to obtain the corresponding product and obtain the latest product from the server. Step 4.3, after getting the product, decrypt it according to the agreed key to get the original web page content and CRC value, take out the CRC value at the end of the file and store it in the sandbox in association with the relative path, and create the same directory in the mobile phone sandbox according to the relative path for caching, and synchronously call back the decrypted web page content to the Web component through WebResourceResponse and WKURLSchemeTask, and the Web component will continue to load the web page content, call back the web page content to the system Web component for rendering, and cache the product and CRC value. Repeat steps 4.1-4.3 to complete the loading of all web page files.
[0029] This embodiment uses the DES3 decryption algorithm to decrypt the content.
[0030] If the mobile phone operating system is iOS, use the StartURLSchemeTask method of WKURLSchemeHandler; if the mobile phone operating system is Android, use the shouldInterceptRequest method.
[0031] Step 5: The client adds a JSBridge function for the web page to call; The web page initiates an interface request through the JSBridge function, and the client forwards the request to the server through a private communication protocol, and the client then forwards the result returned by the server back to the web page. By replacing the web page XMLHTTPRequest request, the maximum concurrent request limit of Webkit cannot exceed 6, which improves the loading speed of the web page.
[0032] Step 6: Delete the locally expired cached content to achieve timely update of web page content.
[0033] When the client starts the App, it calls interface II in step 3. The client compares the CRC value of the local cache with the CRC table of the server, and passes in the relative path and CRC value of the local cache. The client deletes the expired local cache files and updates the CRC table synchronously according to the content returned by the interface. When the user opens the deleted page again, the latest page will be loaded according to step 4 to update the display of the web page content.
[0034] Example 5 On the basis of Example 4, Figure 1 As shown, the process of loading web page content on the mobile terminal is: web page loading URL (HTML) -> web page container (client) loading file -> judging whether to cache; If there is a local cache->web component rendering; If there is no local cache -> download from the server -> call interface I of step 2 with the relative path as a parameter to obtain the corresponding product, obtain the latest product from the server -> the web container (client) receives the server data -> cache the product locally -> update the local CRC file -> decrypt it at the same time and return to the web component rendering.
[0035] Web page business request -> Web page container (client) JSBridge call -> Request sent -> Server-side business service received -> Business processing -> Business service returned -> Web page container (client) request received -> JSBridge callback.
[0036] Repeat the above loading process to complete the remaining business requests and resource loading.
[0037] Example 6 On the basis of Example 4, Figure 2 As shown, the mobile terminal local cache resource update process is: App starts -> web container (client) merges local CRC file and sends it to server -> checks whether local resources need to be updated -> server compares the CRC value of local cache with the CRC table of server through interface II in step 3 -> returns inconsistent paths, client deletes local cache and updates CRC value according to the directory returned by server, when the client opens the page again, it downloads the latest file from server to update and display web content.
[0038] The present invention changes the transmission mode of web page content to the private TCP protocol transmission within the company. At the protocol design level, different authentication support is provided to ensure high compatibility and stability. The web page content is first calculated using a cyclic redundancy algorithm to obtain a CRC value that can determine the uniqueness of the file, and then the CRC value is appended to the end of the file, and the product is obtained through the DES encryption algorithm. Two new interface programs are added to the server side of the App, one of which is responsible for updating the web resource product and the corresponding CRC table; the other interface program is responsible for matching the relative path transmitted by the client and returning the corresponding encrypted product. The transmission mode of web page content is changed to the private TCP protocol transmission within the company. When the web page loading component of the mobile phone operating system is used to intercept and obtain the relative path of the web page loading, the local cache file is matched first to accelerate the web page display. If the cache is not matched, the latest product is obtained from the server. After obtaining the product, the original web page content and CRC value are obtained by decrypting according to the agreed key, and the web page content is called back to the system Web component to render the web page content. The product and CRC value are cached at the same time. The client adds JSBridge to replace the traditional XMLHTTPRequest to circumvent the limitation that Webkit can only send 6 requests at a time and the content of a single request cannot be too large. The request between the web page and the server is forwarded through JSBridge calls. The client compares the CRC value of the local cache with the CRC table of the server, deletes the local cache content that has expired, and realizes the timely update of the web page content, which is more compatible, flexible, secure, faster responsive, and more scalable.
[0039] The present invention uses a private protocol to replace the HTTP protocol to ensure the security of the transmission process, and uses CRC and DES encryption and decryption algorithms to ensure the consistency of the web page content. The Web component hook function and the sandbox cache mechanism are used to improve the loading speed, and the CRC and the file relative path association are used to realize the real-time update of the cached web page content. It effectively resists the tampering attack on the display frame buffer, and has a good promotion and application value; it has greatly improved in performance, stability, and function; the network adaptation support is good, more efficient and more reliable; it is close to the native experience, and almost no additional development of native functions and H5 interactive functions is required, so as to achieve maximum performance and maximum compatibility; it can not only reduce the development difficulty, but also write the core code once and it can be directly deployed to multiple platforms, saving cross-platform development time and development cost, so as to facilitate the rapid conversion of web page information into mobile applications. It has strong compatibility and a wide range of applications, which greatly improves work efficiency; the platform's visual interface is accessed and called in a variety of ways, which improves the platform's applicability and convenience.
Claims
1. A method for implementing a secure and fast mobile web page container in the financial field, characterized in that: Follow the steps below to implement it: Step 1, write an encryption function in the file and encrypt the product file; Step 2: Add an interface on the App server to match the relative path of the client and return the corresponding encrypted artifact file; Step 3: Add an interface on the App server to update the web resource artifacts and the corresponding CRC table; Step 4: The web page content is transmitted using the company's private internal TCP protocol, and the client implements the key callback of the Web component to complete the loading of all web page files; Step 5: The client adds a JSBridge function for the web page to call; Step 6: Delete the locally expired cached content to achieve timely update of web page content.
2. The method for implementing a secure and fast mobile web page container for the financial field according to claim 1, characterized in that: In step 1, a cyclic redundancy algorithm is used to calculate the webpage content to obtain a cyclic redundancy check code that can determine the uniqueness of the file, that is, a CRC value. The CRC value is appended to the end of the original data file, and then the file is encrypted using the DES3 algorithm to obtain a finished file.
3. The method for implementing a secure and fast mobile web page container for the financial field according to claim 1, characterized in that: In steps 2 and 3, two new interfaces are added on the App server, namely Interface I and Interface II. Interface I receives the input parameter as a single file relative path and returns the encrypted product file in the corresponding directory of the server.
4. The method for implementing a secure and fast mobile web page container for the financial field as claimed in claim 3, characterized in that: Interface II receives input parameters as a string consisting of multiple file relative paths and corresponding CRC values, searches for CRC according to the relative path, returns all relative paths with inconsistent CRC to the caller, and updates the expired cache files on the client side.
5. The method for implementing a secure and fast mobile web page container for the financial field according to claim 4, characterized in that: Step 4 is as follows: Step 4.1: The mobile operating system will call back the relative path of the web page being loaded. After the client obtains the path, it will first return to the cache in the local sandbox, and use the web page loading component of the mobile operating system to intercept and obtain the relative path of the web page being loaded, and give priority to matching the local cache file to accelerate the display of the web page; Step 4.2: If there is no local cache and no cache is matched, the interface I of step 2 is called through a private communication protocol with the relative path as a parameter to obtain the corresponding product and obtain the latest product from the server. Step 4.3, after getting the product, decrypt it according to the agreed key to obtain the original web page content and CRC value, take out the CRC value at the end of the file and store it in the sandbox in association with the relative path, and create the same directory in the mobile phone sandbox according to the relative path for cache, and synchronously call back the decrypted web page content to the Web component through WebResourceResponse and WKURLSchemeTask, and the Web component will continue to load the web page content, call back the web page content to the system Web component for rendering, and cache the product and CRC value at the same time, and repeat steps 4.1-4.3 in a loop to complete the loading of all web page files.
6. The method for implementing a secure and fast mobile web page container for the financial field according to claim 4, characterized in that: If the mobile phone operating system is iOS, use the StartURLSchemeTask method of WKURLSchemeHandler; if the mobile phone operating system is Android, use the shouldInterceptRequest method.
7. The method for implementing a secure and fast mobile web page container for the financial field according to claim 6, characterized in that: The web page initiates an interface request through the JSBridge function. The client forwards the request to the server via a private communication protocol, and the client then forwards the result returned by the server back to the web page.
8. The method for implementing a secure and fast mobile web page container for the financial field according to claim 7, characterized in that: When the client starts the App, it calls interface II in step 3. The client compares the CRC value of the local cache with the CRC table of the server, and passes in the relative path and CRC value of the local cache. The client deletes the expired local cache files and updates the CRC table synchronously according to the content returned by the interface. When the user opens the deleted page again, the latest page will be loaded according to step 4 to update the display of the web page content.