A method and system for optimizing smooth display of homepage data under weak client network conditions
By detecting server delays in real time and making parallel requests to multiple servers, optimizing data module display and shutting down non-essential modules, the problem of data display lag on the software homepage in a weak network environment is solved, achieving faster data display and improving user experience.
Patent Information
- Application Number
- CN202211460765.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-11-17
AI Technical Summary
In a weak network environment, existing technologies cannot effectively optimize the data display on the software homepage, resulting in a poor user experience.
By detecting server delays in real time, allocating threads to parallelly request multiple servers, optimizing data module display and shutting down non-essential modules, and utilizing multi-threaded processing and server delay sorting to optimize data reading and display.
In weak network conditions, shorten the homepage data display time and improve user experience.
Smart Images

Figure CN115858033B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer communication technology, and in particular to a method and system for optimizing the smooth display of homepage data under a weak network condition of a client. Background Art
[0002] When users use software systems, network conditions are an uncontrollable factor, and network speed largely determines the software experience. In today's era of rapidly developing internet infrastructure, most users have good internet speeds, which leads to software developers displaying a lot of additional information. For example, the software homepage may display not only basic homepage data but also recommendations, advertisements, and so on. However, this richer homepage data can cause lag for users with slow internet speeds, a very small percentage of whom make up the user base. Therefore, there is a lack of a mechanism to provide this type of user experience, resulting in a poor user experience for users with slow internet speeds. Summary of the Invention
[0003] To overcome the above problems, the present invention provides a method and system for optimizing the smooth display of homepage data under weak client network conditions, which can optimize data reading and display under weak client network conditions, thereby improving user experience.
[0004] The present invention is implemented by the following scheme: a method for optimizing the smooth display of homepage data in a weak network of a client, the method comprising the following steps:
[0005] Step S1: read the server configuration list interface to obtain n server addresses, cyclically request the n server addresses to obtain delay time, and sort the n server addresses from low to high according to delay time;
[0006] Step S2: Determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state. Then, n threads are started to request n servers in parallel, and multiple data modules on the homepage are shared among the n thread requests and displayed in combination. The data modules are the modules to be displayed on the homepage. If not, execute the data recovery module.
[0007] Step S3: If the lowest delay time in the server list is greater than a preset value B, then the display of unnecessary data modules is closed, and only the data of the data modules that are not closed are displayed; the preset value B is greater than the preset value A;
[0008] Step S4: After checking that the delay time is less than the preset value A, the weak network state is turned off, the data display of all data modules on the home page is turned on, and only the server with the lowest delay time is requested to be read.
[0009] Furthermore, step S1 is further specified as follows: reading the server configuration list interface / servers / config to obtain n available server addresses; then cyclically requesting n server delay test addresses / ping to obtain the delay time of each server; sorting the returned server delay times from low to high to obtain the lowest delay time among the n servers.
[0010] Furthermore, step S3 is further specified as follows: if the minimum delay obtained in step S1 is greater than the preset value B, then threads equal to the number n in the server list are started, and the data display of non-essential data modules is closed; n threads only need to request the data module interface that is not closed and wait for the data of all data modules to be returned; the client combines all the returned data into the homepage data and displays it to the user.
[0011] The present invention also provides a system for optimizing the smooth display of homepage data under weak network conditions on a client, the system comprising a server delay testing module, a display processing module A, a display processing module B, and a data recovery module;
[0012] The server delay test module is used to read the server configuration list interface to obtain n server addresses, cyclically request the n server addresses to obtain delay times, sort the delay times of the returned servers from low to high, and obtain the lowest delay time among the n servers;
[0013] The display processing module A is used to determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state, and then n threads are started to request n servers in parallel, sharing multiple data modules on the homepage among the n thread requests and combining them for display. The data modules are the modules whose data are to be displayed on the homepage; if not, the data recovery module is executed;
[0014] The display processing module B is used to process if the lowest delay time in the server list is greater than a preset value B, then close the display of unnecessary data modules and only display the data of the data modules that are not closed; the preset value B is greater than the preset value A;
[0015] The data recovery module is used to check that the delay time is less than the preset value A, turn off the weak network state, turn on the display of all module data on the home page, and only request to read the server with the lowest delay time.
[0016] Furthermore, the server delay test module is further specified as follows: reading the server configuration list interface / servers / config to obtain n available server addresses; then cyclically requesting n server delay test addresses / ping to obtain the delay time of each server; sorting the returned server delay times from low to high to obtain the lowest delay time among the n servers.
[0017] Furthermore, the display processing module B is further specified as follows: if the minimum delay obtained in the server delay test module is greater than the preset value B, then threads equal to the number n of server lists are started, and data display of non-essential data modules is closed; n threads only need to request the data module interface that is not closed and wait for data from all data modules to be returned; the client combines all the returned data into homepage data and displays it to the user.
[0018] The beneficial effect of the present invention is that: the method and system designed by the present invention can detect the delay of the client's request to the server in real time, and according to the difference in delay, optimize the reading and display of home page data in the case of weak client network, shorten the home page data display time, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Schematic diagram of the process of the present invention;
[0020] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION
[0021] The present invention will be further described below with reference to the accompanying drawings.
[0022] like Figure 1 As shown: A method of optimizing the smooth display of homepage data in a weak network environment of a client according to the present invention, the method comprises the following steps:
[0023] Step S1: read the server configuration list interface to obtain n server addresses, cyclically request the n server addresses to obtain delay time, and sort the n server addresses from low to high according to delay time;
[0024] Step S2: Determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state. Then, n threads are started to request n servers in parallel, and multiple data modules on the homepage are shared among the n thread requests and displayed in combination. The data modules are the modules to be displayed on the homepage. If not, proceed to step S4.
[0025] Step S3: If the lowest delay time in the server list is greater than a preset value B, then the display of unnecessary data modules is closed, and only the data of the data modules that are not closed are displayed; the preset value B is greater than the preset value A;
[0026] Step S4: After checking that the delay time is less than the preset value A, the weak network state is turned off, the data display of all data modules on the home page is turned on, and only the server with the lowest delay time is requested to be read.
[0027] The present invention will be further described below in conjunction with a specific embodiment:
[0028] Step 1: Read the server configuration list interface / servers / config to obtain the n available server addresses; then loop through n server delay test addresses / ping to obtain the delay time of each server; sort the returned server delay times from low to high to obtain the lowest delay time among the n servers;
[0029] Read the server configuration list interface / servers / config to obtain n available server addresses ["121.100.220.1", "150.200.220.1"]. These n server addresses may be located in different data centers, and the client will experience different latency in different data centers. Then, loop through n server latency test addresses / ping to obtain the latency of each server. The returned latency is sorted from low to high: 150.200.220.1, 300ms; 121.100.220.1, 500ms. Based on the sorting, it is determined that among the n servers, the server with address 150.200.220.1 has the lowest latency, at 300ms.
[0030] Step 2: Determine whether the lowest delay time in the server list is greater than a preset value A. If yes, it indicates a weak network state, and then start n threads to request n servers in parallel. Each server can start n threads, and then share multiple data modules on the homepage among the n thread requests and combine them for display. The data modules are the modules to be displayed on the homepage. If no, proceed to step S4.
[0031] Given the minimum latency of the known server list, if the maximum latency of the server list is greater than a preset value A, which is 200ms, and the client is currently in a weak network state, then threads equal to the number n in the server list will be started. Assuming that there are m data modules that need to be displayed on the homepage, each thread will request data from m / n data modules. After waiting for the data from all m data modules to be returned, the client will combine the data for the homepage and display it to the user. For example, given that the minimum latency of the known server list is 300ms, if the maximum latency of the server list is greater than 200ms, and the client is currently in a weak network state, then threads equal to the number n in the server list will be started. Each server can start n threads, that is, each server starts 2 threads. Assuming that there are 4 data modules that need to be displayed on the homepage, each thread will request data from 2 data modules. After waiting for the data from all 4 data modules to be returned, the client will combine the data for the homepage and display it to the user.
[0032] Step 3: If the minimum delay obtained in step S1 is greater than the preset value B, start a number of threads equal to the number of server lists n, and disable the data display of non-essential data modules; n threads only need to request the open data module interface and wait for the data of all data modules to be returned; the client combines all the returned data into the homepage data and displays it to the user;
[0033] If the minimum delay of the server list at this time is greater than the preset value B, and the preset value B is 500ms, then x non-essential modules among the m data modules on the homepage are closed and hidden. Then n threads only need to request mx data module interfaces, and after waiting for the data of mx data modules to be returned, the client will combine them into the homepage data and display them to the user. This will shorten the time required for the overall homepage display. For example: close and hide 2 non-essential modules among the 4 data modules on the homepage. Then 2 threads only need to request 2 data module interfaces, and after waiting for the data of the 2 data modules to be returned, the client will combine them into the homepage data and display them to the user.
[0034] Step 4: After checking that the delay time is less than the preset value A, turn off the weak network state, turn on the data display of all data modules on the homepage, and only request to read the server with the lowest delay time;
[0035] If the minimum server delay detected in step 1 is less than 200ms, the client network returns to normal, the client closes the weak network state, the home page restores the data of all data modules, and requests the server address with the lowest delay according to the server delay sorting.
[0036] like Figure 2 As shown, the present invention also provides a system for optimizing the smooth display of homepage data in a weak network environment of a client, the system comprising a server delay testing module, a display processing module A, a display processing module B, and a data recovery module;
[0037] The server delay test module is used to read the server configuration list interface to obtain n server addresses, cyclically request the n server addresses to obtain delay times, sort the delay times of the returned servers from low to high, and obtain the lowest delay time among the n servers;
[0038] The display processing module A is used to determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state, and then n threads are started to request n servers in parallel, sharing multiple data modules on the homepage among the n thread requests and combining them for display. The data modules are the modules whose data are to be displayed on the homepage; if not, the data recovery module is executed;
[0039] The display processing module B is used to process if the lowest delay time in the server list is greater than a preset value B, then close the display of unnecessary data modules and only display the data of the data modules that are not closed; the preset value B is greater than the preset value A;
[0040] The data recovery module is used to detect that the delay time is less than the preset value A, turn off the weak network state, turn on the display of all module data on the home page, and only request to read the server with the lowest delay time.
[0041] The server delay test module is further specifically as follows: reading the server configuration list interface / servers / config to obtain n available server addresses; then cyclically requesting n server delay test addresses / ping to obtain the delay time of each server; sorting the returned server delay times from low to high to obtain the lowest delay time among the n servers.
[0042] The display processing module B is further specified as follows: if the lowest delay obtained in the server delay test module is greater than a preset value B, then threads equal to the number n in the server list are started, and data display of non-essential data modules is closed; n threads only need to request the data module interface that is not closed and wait for data from all data modules to be returned; the client combines all the returned data into homepage data and displays it to the user.
[0043] In summary, the present invention designs a method and system for optimizing the smooth display of homepage data under weak client network conditions, which can detect the delay of client requests to the server in real time. According to the difference in delay, data reading and display are optimized under weak client network conditions, shortening the homepage data display time to improve user experience.
[0044] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
Claims
1. A method for optimizing the smooth display of homepage data in a weak network environment of a client, characterized in that: The display method comprises the following steps: Step S1: read the server configuration list interface to obtain n server addresses, cyclically request the n server addresses to obtain delay time, and sort the n server addresses from low to high according to delay time; Step S2: Determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state. Then, n threads are started to request n servers in parallel, and multiple data modules on the homepage are shared among the n thread requests and displayed in combination. The data modules are the modules whose data are to be displayed on the homepage. If not, proceed to step S4; Step S3: If the lowest delay time in the server list is greater than a preset value B, then the display of unnecessary data modules is closed, and only the data of the data modules that are not closed are displayed; the preset value B is greater than the preset value A; Step S4: After checking that the delay time is less than the preset value A, the weak network state is turned off, the data display of all data modules on the home page is turned on, and only the server with the lowest delay time is requested to read; The step S3 is further specified as follows: if the minimum delay obtained in step S1 is greater than a preset value B, threads equal to the number n in the server list are started, and the data display of non-essential data modules is closed; n threads only need to request the data module interface that is not closed and wait for the data of all data modules to be returned; the client combines all the returned data into homepage data and displays it to the user.
2. According to claim 1, a method for optimizing the smooth display of homepage data in a weak network environment of a client, characterized in that: The step S1 is further specifically as follows: reading the server configuration list interface / servers / config to obtain n available server addresses; then cyclically requesting n server delay test addresses / ping to obtain the delay time of each server; sorting the returned server delay times from low to high to obtain the lowest delay time among the n servers.
3. A system for optimizing the smooth display of homepage data in a weak network environment, characterized in that: The system includes a server delay testing module, a display processing module A, a display processing module B, and a data recovery module; The server delay test module is used to read the server configuration list interface to obtain n server addresses, cyclically request n server addresses to obtain delay time, and sort them from low to high according to delay; The display processing module A is used to determine whether the lowest delay time in the server list is greater than a preset value A. If so, it indicates a weak network state, and then starts n threads to request n servers in parallel, sharing multiple data modules on the homepage among the n thread requests and combining them for display. The data modules are the modules whose data are to be displayed on the homepage; If not, execute the data recovery module; The display processing module B is used to process if the lowest delay time in the server list is greater than a preset value B, then close the display of unnecessary data modules and only display the data of the data modules that are not closed; the preset value B is greater than the preset value A; The data recovery module is used to detect that the delay time is less than the preset value A, close the weak network state, open the home page to display all module data, and only request to read the server with the lowest delay time; The display processing module B is further specified as follows: if the lowest delay obtained in the server delay test module is greater than a preset value B, then threads equal to the number n in the server list are started, and data display of non-essential data modules is closed; n threads only need to request the data module interface that is not closed and wait for data from all data modules to be returned; the client combines all the returned data into homepage data and displays it to the user.
4. The system for optimizing smooth display of homepage data in weak network conditions according to claim 3 is characterized in that: The server delay test module is further specifically as follows: reading the server configuration list interface / servers / config to obtain n available server addresses; then cyclically requesting n server delay test addresses / ping; sorting the returned server delays from low to high to obtain the lowest server delay.
Citation Information
Patent Citations
Method and system of Web application service
CN103259870A
Methods and devices for obtaining network resource for loading web page and method and device for caching network resource
CN105760405A