Page display method and device, equipment, medium and program product
By using the hashed large interface and small interface cache mechanism when the client application is started, the application startup lag and data loading problems in high concurrency scenarios are solved, and faster startup speed and better user experience are achieved.
Patent Information
- Application Number
- CN202411899385.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
AI Technical Summary
In high concurrency scenarios, a large number of background interfaces and database queries are called when the client application is started, resulting in a surge in the number of container CPUs and database connections, resulting in a stuttering application startup and slow loading of floor data, and poor user experience.
By obtaining the application's startup request, in response to the hash value of the application in the local cache, the hash interface is called to obtain the hash value of the small interface. If the cache data is consistent, the local cache data will be loaded for page display. Otherwise, the small interface will be called to obtain the cache data and stored in the local cache.
Reduces the number of interface calls and database queries when the application starts, reduces CPU pressure and database occupancy, and improves the application startup speed and user experience.
Smart Images

Figure CN119718522A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology or financial technology, and more specifically, to a page display method, device, equipment, medium and program product. Background Art
[0002] At present, the client usually includes multiple applications (APPs). When the application starts, the client will call a large number of background interfaces to record data, so as to realize the process of starting to display each floor. Since there are many interfaces called when the application starts, and the amount of data in the database table queried by each interface is large, in high concurrency scenarios, the number of CPU and database connections of the container will surge, resulting in application startup jams, slow loading of floor data, and poor user experience. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a page display method, apparatus, device, medium and program product.
[0004] According to the first aspect of the present disclosure, a page display method is provided, including: obtaining a startup request for an application of a startup client; in response to a hash value of the application included in a local cache, calling a large hash interface; obtaining a hash value of a small interface corresponding to the application from the large hash interface; and in response to the hash value of the application in the local cache being the same as the hash value of the small interface, loading the local cache data of the application for page display.
[0005] According to an embodiment of the present disclosure, in response to the local cache not including the hash value of the application, or in response to the hash value of the application in the local cache being different from the hash value of the small interface, the small interface corresponding to the application is called; the cache data of the application and the hash value of the cache data are obtained based on the return data of the small interface, and the cache data and the hash value of the cache data are stored in the local cache; and the cache data of the application is loaded for page display.
[0006] According to an embodiment of the present disclosure, calling a small interface corresponding to an application includes: querying a bipolar cache, which stores relevant query data of a database; in response to cache data of an application included in the bipolar cache, encapsulating the cache data, and calculating a hash value of the encapsulated cache data.
[0007] According to an embodiment of the present disclosure, in response to the bipolar cache not including the cache data of the application, the cache data of the application is obtained from the database; the cache data of the application is stored in the bipolar cache; and the cache data is encapsulated and a hash value of the encapsulated cache data is calculated.
[0008] According to an embodiment of the present disclosure, calling a small interface corresponding to an application further includes: encapsulating a hash value of the encapsulated cache data, and using the encapsulated cache data and the encapsulated hash value as return data.
[0009] According to an embodiment of the present disclosure, a cache area of a hash large interface stores names of small interfaces corresponding to multiple applications of a client and hash values corresponding to the names of the small interfaces, wherein each application corresponds to at least one small interface.
[0010] According to an embodiment of the present disclosure, the name of the small interface and the hash value corresponding to the name of the small interface are stored in the cache in the form of a key-value pair.
[0011] According to an embodiment of the present disclosure, after obtaining a startup request for an application of a startup client, it also includes: screening links in the network through a network monitoring algorithm; and forwarding the call request to the link selected by the network monitoring algorithm to process the call request.
[0012] According to an embodiment of the present disclosure, screening the links in the network by using the network monitoring algorithm includes: calculating the usage rate of each link by using the network monitoring algorithm; and selecting the link with the lowest usage rate among the links in the network.
[0013] The second aspect of the present disclosure provides a page display device, including: a startup module, used to obtain a startup request for an application of a startup client; a calling module, used to call a hash large interface in response to a hash value of the application included in a local cache; an extraction module, used to obtain a hash value of a small interface corresponding to the application from the hash large interface; and a display module, used to load the local cache data of the application for page display in response to the hash value of the application in the local cache being the same as the hash value of the small interface.
[0014] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0016] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 A schematic diagram showing an application scenario of a page display method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a page display method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A flowchart schematically shows a small interface processing flow according to an embodiment of the present disclosure;
[0021] Figure 4 A flowchart schematically shows a small interface processing flow according to another embodiment of the present disclosure;
[0022] Figure 5 The schematic diagram of the structure of the network monitoring model according to the embodiment of the present disclosure is shown;
[0023] Figure 6 A flowchart schematically shows a page display process according to an embodiment of the present disclosure;
[0024] Figure 7 A schematic diagram showing a structure of a page display device according to an embodiment of the present disclosure; and
[0025] Figure 8 A block diagram of an electronic device suitable for implementing a page display method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0028] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0029] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0030] To facilitate a better understanding of the page display method, apparatus, device, medium, and program product of the embodiments of the present disclosure, the relevant terms involved in the embodiments of the present disclosure are introduced as follows.
[0031] Hash interface: The interface name that encapsulates the hash value of the interface called when starting the client application.
[0032] Small interface: The abbreviation of the interface called when starting the client application.
[0033] Second level cache: stores relevant query data generated when querying the database.
[0034] It should be noted that the page display method and device disclosed herein can be used in the scenario of launching an application in the financial technology field, and can also be used in any field other than the financial technology field, such as the field of computer technology, etc. The application field of the page display method and device disclosed herein is not limited.
[0035] An embodiment of the present disclosure provides a page display method, including: obtaining a startup request for an application of a startup client; in response to a hash value of the application included in a local cache, calling a large hash interface; obtaining a hash value of a small interface corresponding to the application from the large hash interface; and in response to the hash value of the application in the local cache being the same as the hash value of the small interface, loading the local cache data of the application for page display.
[0036] The page display method provided in the embodiment of the present disclosure does not need to call a large number of interfaces and repeatedly query database data when the client APP is started. It speeds up the startup speed of the APP by encapsulating the data of each interface, monitoring the network link and intelligently forwarding the interface request.
[0037] Figure 1 The application scenario diagram of the page display method according to an embodiment of the present disclosure is schematically shown.
[0038] like Figure 1As shown, the application scenario 100 according to this embodiment may include a scenario of starting an application. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0039] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0040] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0041] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0042] It should be noted that the page display method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the page display device provided in the embodiment of the present disclosure can generally be set in the server 105. The page display method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the page display device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0044] The following will be based on Figure 1 The scene described by Figure 2~Figure 6 The page display method of the disclosed embodiment is described in detail.
[0045] Figure 2 The flowchart of the page display method according to the embodiment of the present disclosure is schematically shown.
[0046] like Figure 2 As shown, the page display method of this embodiment includes operations S210 to S240, and the method can be executed by a server.
[0047] It should be noted that, in the embodiments of the present disclosure, although the various steps of the method are described in a specific order in the specification, it should be understood that the execution order of these steps is not fixed and can be adjusted according to actual needs. Specifically, some steps can be executed in reverse order, or can be executed in parallel to improve efficiency without affecting the overall method effect. In addition, some steps may be optional and can be selectively executed according to specific application scenarios or requirements.
[0048] In operation S210, a start request for starting an application of a client is obtained.
[0049] According to an embodiment of the present disclosure, a user clicks on an application of a client, and the client obtains a start request for starting the application. It should be noted that starting an application of a client by clicking is only exemplary and is not a limitation of the embodiment of the present disclosure. In other embodiments, the application of the client may be started by other means, such as voice input, long press, etc.
[0050] In operation S220 , in response to the local cache including the hash value of the application, a hash interface is called.
[0051] A hash value, also known as a hash value, is a fixed-length numerical value obtained by calculating data (such as files, messages, strings, etc.) through a hash function. The hash value can uniquely identify the data.
[0052] In some embodiments, the hash value of an application refers to a hash value corresponding to the data required to start the application. Specifically, the cached data of the application can be calculated to obtain a hash value corresponding to the cached data as the hash value of the application. For example, the encapsulated cached data can be calculated through a hash function to obtain a corresponding hash value as the hash value of the application. The corresponding cached data can be located through the hash value, thereby calling the corresponding cached data.
[0053] According to an embodiment of the present disclosure, based on the application startup request, the hash value stored in the local cache is searched to determine whether the local cache includes the hash value of the application. Specifically, it is determined whether the local cache includes the hash value of the application corresponding to the startup request, and when the local cache includes the hash value of the application, the hash interface is called.
[0054] In operation S230, a hash value of a small interface corresponding to the application is acquired from the hashed large interface.
[0055] The cache area of the hash large interface stores the names of the small interfaces corresponding to multiple applications of the client and the hash values corresponding to the names of the small interfaces, wherein each application corresponds to at least one small interface.
[0056] In some embodiments, the hash large interface encapsulates all interfaces (i.e., small interfaces) called when starting the client application and the hash values corresponding to the interfaces. In response to the hash value of the application being included in the local cache, the hash large interface is called, and the hash value of the small interface corresponding to the small interface called by the application is obtained from the cache area of the hash large interface. The hash value of the small interface stored in the cache area of the hash large interface is the hash value of the small interface called by the latest version of the application.
[0057] Usually, each application corresponds to multiple small interfaces, and different applications correspond to different numbers and types of small interfaces. The application builds and displays floors (i.e., pages) by calling small interfaces. In existing scenarios, when an application starts, a large number of background interfaces are called to record data to realize the process of starting to display each floor. In high-concurrency scenarios, the number of connections between the container's CPU and the database will surge. The hash large interface provided in the embodiment of the present disclosure, by encapsulating the interface data corresponding to different applications, helps to load page content through a cache mechanism, and helps to start the application without calling a large number of interfaces and repeatedly querying database data, thereby reducing CPU pressure, reducing database occupancy, and speeding up application startup.
[0058] The local cache stores hash values corresponding to multiple applications on the client. When the client starts an application, the hash value corresponding to the application is obtained from the local cache. The hash value corresponding to the application stored in the local cache is the return data previously obtained by calling the small interface. If the application is not updated, the hash value is consistent with the hash value of the small interface obtained from the hash large interface.
[0059] According to an embodiment of the present disclosure, the name of the small interface and the hash value corresponding to the name of the small interface are stored in the cache in the form of a key-value pair.
[0060] In the cache area of the hash large interface, the "key" stores the name of the small interface and the "value" stores the hash value corresponding to the name of the small interface, so that the name of the small interface and the hash value of the small interface correspond one to one, so that the hash value of the small interface can be quickly determined by the name of the small interface.
[0061] After the hash value of the small interface corresponding to the application is obtained from the hash large interface, in operation S240, in response to the hash value of the application in the local cache being the same as the hash value of the small interface, the local cache data of the application is loaded for page display.
[0062] In some embodiments, it is necessary to obtain the hash value of the application from the local cache, specifically, to obtain the hash value of the application corresponding to the startup request from the local cache. By comparing the hash value of the application in the local cache with the hash value of the small interface obtained from the hash large interface, it is determined whether the hash value of the application in the local cache is the same as the hash value of the small interface. If the hash value of the application in the local cache is the same as the hash value of the obtained small interface, it is proved that the application in the local cache is consistent with the application version that calls the small interface in the hash large interface (the small interface obtained in operation S230), and the local cache data corresponding to the application in the local cache can be used to load the page. In other words, the hash value of the application in the local cache and the hash value of the small interface obtained from the hash large interface are compared to determine whether the application has been updated. If the application has not been updated, the local cache data is used for page display.
[0063] The local cache data related to the application in the local cache is the return data returned by calling the small interface when the application was previously started. Based on the local cache data in the local cache, the process from application startup to display on each floor is realized, which can reduce CPU pressure and speed up the APP startup speed.
[0064] The page display method provided in the embodiment of the present disclosure utilizes a data caching mechanism for page display, which solves the problem of excessive number of interface calls and too frequent database queries when the APP is started, resulting in excessive CPU pressure when the concurrency surges, a surge in the number of database threads, an extremely long interface response time, and a poor user experience.
[0065] Specifically, when the APP is started, data loading can be completed by accessing the hash interface only, without establishing a database connection. Loading page content through the cache mechanism reduces database access, reduces CPU pressure, shortens interface response time, and improves user experience.
[0066] According to an embodiment of the present disclosure, in response to the local cache not including a hash value of the application, or in response to the hash value of the application in the local cache being different from the hash value of the small interface, the small interface corresponding to the application is called.
[0067] In some embodiments, if the local cache does not include the hash value of the application corresponding to the start request, the relevant data required to start the application is obtained by calling the small interface corresponding to the application. If the hash value of the application corresponding to the start request in the local cache is different from the hash value of the small interface, the relevant data required to start the application is obtained by calling the small interface corresponding to the application. The number of small interfaces called can be multiple, and the data returned by multiple small interfaces is used to realize the start to each floor display. In the following, reference will be made to Figure 3 Describe the steps to call the small interface corresponding to the application.
[0068] In some embodiments, if the hash value of the small interface corresponding to the application is not included in the hash large interface, calling the hash large interface returns empty. At this time, calling the small interface corresponding to the application obtains the relevant data required to start the application.
[0069] According to an embodiment of the present disclosure, cache data of an application and a hash value of the cache data are obtained based on the return data of a small interface, the cache data and the hash value of the cache data are stored in a local cache; and the cache data of the application is loaded for page display.
[0070] Calling the small interface corresponding to the launched application will return the cached data of the application and the hash value of the cached data, and store the cached data in the local cache as the local cached data, and store the hash value of the cached data in the local cache as the hash value of the application. The stored information can be used for page display based on the local cached data at the next launch. For example, when the application is launched again, if the hash value of the application in the local cache is the same as the hash value of the small interface obtained from the hash large interface, the local cached data of the application is loaded for page display.
[0071] By calling a small interface to obtain the application's cache data and the hash value of the cache data, the application cache data and the hash value of the cache data are stored in the local cache. This helps the application to use the local cache data stored in the local cache for page display when it is started again, reducing access to the database and reducing CPU pressure.
[0072] Figure 3 The flowchart schematically shows the small interface processing flow according to an embodiment of the present disclosure.
[0073] The small interface processing flow of this embodiment includes operations S310 to S330.
[0074] In response to the client calling the small interface of the application, in operation S310, the secondary cache is queried, and the secondary cache stores relevant query data of the database.
[0075] The secondary cache is located between the database system and the application, storing frequently accessed data to improve data access performance and efficiency. Specifically, when an application requests the same query data multiple times, the query data is stored in the secondary cache during the first query. During the second query, the query data can be directly obtained from the secondary cache without accessing the database again. For example, in the scenario where the client calls a small interface of the application, the secondary cache will be queried first. If the cache data corresponding to the small interface exists in the secondary cache, the required cache data can be directly obtained from the secondary cache without accessing the database.
[0076] In operation S320, in response to the cache data of the application being included in the binary cache, the cache data is encapsulated, and a hash value of the encapsulated cache data is calculated.
[0077] According to the embodiments of the present disclosure, when querying the bipolar cache, it is necessary to determine whether the bipolar cache includes cache data of the application, that is, to determine whether the bipolar cache includes cache data of the application corresponding to the startup request. If the bipolar cache includes cache data of the application, the cache data of the application is obtained from the bipolar cache. Obtaining cache data corresponding to the small interface from the bipolar cache greatly reduces the scenarios of direct database query, reduces the occupancy of database threads, and reduces the pressure on the database.
[0078] According to an embodiment of the present disclosure, after the cache data of the application is acquired, the cache data is encapsulated, and a hash value of the encapsulated cache data is calculated.
[0079] It should be noted that the cache data can be encapsulated in any manner such as functional encapsulation, object-oriented encapsulation, etc., which is not limited in the present disclosure. By encapsulating the cache data, the specific information of the cache data is hidden.
[0080] In some embodiments, the encapsulated cache data may be calculated using a hash function to obtain an output of a fixed length as a hash value of the encapsulated cache data.
[0081] In operation S330 , the hash value of the encapsulated cache data is encapsulated, and the encapsulated cache data and the encapsulated hash value are used as return data.
[0082] Exemplarily, after encapsulating the cache data, the hash value of the encapsulated cache data may be encapsulated to ensure the security of the return data of the small interface. The manner of encapsulating the hash value of the encapsulated cache data may be the same as or different from the manner of encapsulating the cache data.
[0083] According to the embodiments of the present disclosure, cache data of an application and a hash value of the encapsulated cache data are encapsulated as return data of an interface, thereby achieving information hiding and improving data security.
[0084] For the case where the secondary cache does not include the cache data of the application when calling the small interface corresponding to the application, the following will refer to Figure 4 Give a description.
[0085] Figure 4 The flowchart schematically shows a small interface processing flow according to another embodiment of the present disclosure.
[0086] The small interface processing flow of this embodiment includes operations S340 to S370, and operations S340 to S370 are performed after operation S310.
[0087] In operation S340 , in response to the cache data of the application not being included in the secondary cache, the cache data of the application is acquired from the database.
[0088] In some embodiments, cache data of small interfaces called by applications are stored in the database.
[0089] In operation S350, cache data of the application is stored in a second-level cache.
[0090] After obtaining the cache data of the application from the database, the cache data is stored in the secondary cache so that the next time the client calls the small interface of the application, it can first query the data in the secondary cache, thereby reducing the number of database queries, reducing the occupancy of database threads, and reducing the pressure on the database.
[0091] In operation S360, the cache data is encapsulated, and a hash value of the encapsulated cache data is calculated.
[0092] The manner of encapsulating the cache data and the manner of calculating the hash value of the encapsulated cache data are the same as those of the above operation S320 and will not be elaborated on in detail herein.
[0093] In operation S370, the hash value of the encapsulated cache data is encapsulated, and the encapsulated cache data and the encapsulated hash value are used as return data.
[0094] According to an embodiment of the present disclosure, when the hash value of the application is not included in the local cache, or the hash value of the application in the local cache is different from the hash value of the small interface obtained from the hash large interface, the secondary cache data will be queried first by calling the small interface corresponding to the application, so that the scenarios of direct database queries are greatly reduced, the occupancy of database threads is reduced, and the pressure on the database is reduced.
[0095] To address the problem of slow APP startup, the disclosed embodiment also introduces a network monitoring method to speed up the APP startup.
[0096] Specifically, after obtaining the startup request of the application of the startup client, the page display method according to the embodiment of the present disclosure also includes: screening the links in the network through a network monitoring algorithm; and forwarding the call request to the link selected by the network monitoring algorithm to process the call request.
[0097] The network monitoring algorithm screens the links in the network to actually screen the idlest links or the best links. For example, the idlest link is used to call the interface to obtain cache data for building application pages.
[0098] By calculating through the network monitoring algorithm, selecting idle links, and forwarding interface calls to containers with better performance, the waiting time for calling the interface can be reduced, the pressure on the container can be reduced, and the return speed of the interface can be increased.
[0099] According to an embodiment of the present disclosure, screening the links in the network by using the network monitoring algorithm includes: calculating the usage rate of each link by using the network monitoring algorithm; and selecting the link with the lowest usage rate among the links in the network.
[0100] Exemplarily, calculating the utilization rate of each link through the network monitoring algorithm includes calculating the utilization rate of the link based on at least one of the link utilization rate, load balancing data, and the real-time traffic of the link. For example, the utilization rate of the link is calculated using the real-time traffic of the link, the real-time traffic of the link is positively correlated with the utilization rate of the link, and the link with the smallest real-time traffic is selected as the link; for another example, the utilization rate of the link is calculated by taking a weighted average of the link utilization rate, load balancing data, and the real-time traffic of the link. It should be noted that calculating the utilization rate of the link based on at least one of the link utilization rate, load balancing data, and the real-time traffic of the link is only exemplary and is not a limitation of the embodiments of the present disclosure. In other embodiments, the utilization rate of the link may be calculated in other ways.
[0101] When the application starts, the network monitoring algorithm is used to calculate the current optimal link in real time for forwarding, and the call request is processed with the optimal link, thereby speeding up the startup of the application.
[0102] Figure 5 The structural diagram of the network monitoring model according to the embodiment of the present disclosure is schematically shown.
[0103] like Figure 5As shown, the network monitoring model 500 includes a client module 510, a network monitoring module 520 and a server module 530. The client module 510 includes multiple clients, for example, client 1, client 2, client 3, etc. The server module 530 includes multiple servers, for example, server 1, server 2, server 3, etc. It should be noted that, Figure 5 The number of clients and the number of servers shown are merely exemplary and are not limitations of the embodiments of the present disclosure. In other embodiments, the network monitoring model may include more clients and / or more servers.
[0104] The network monitoring model 500 provided in the embodiment of the present disclosure is used to monitor network links and select the link with the best current performance.
[0105] In some embodiments, the network monitoring module 520 responds to a call request generated when starting an application of the client, screens the links in the network through a network monitoring algorithm, and selects the currently most idle link (or the link with the best performance) to process the call request. For example, a user clicks on the APP of client 1 to start the APP. The network monitoring module 520 responds to the call request generated by the startup operation, and selects the most idle server (for example, server 3) from the server module 530 to process the call request, thereby speeding up the startup speed of the APP and effectively utilizing server resources.
[0106] Figure 6 The flowchart schematically shows the page display process according to an embodiment of the present disclosure.
[0107] The following will describe the client process, network monitoring model process, small interface processing process, and hash large interface processing process. Figure 6 The page shown shows the process.
[0108] Client process: The user clicks to enter the APP, and the client determines whether the hash value of the APP in the local cache is empty; if the hash value of the APP in the local cache is not empty, a hash large interface call is initiated to determine whether the hash value of the small interface called by the APP returned from the hash large interface is consistent with the hash value stored in the local cache. If the comparison result is consistent, the local cache data is used for page display; if the comparison result is inconsistent, a call to the small interface corresponding to the APP is initiated, and the local cache is updated and the page is displayed according to the return data of the small interface; if the hash value of the APP in the local cache is empty, a call to the small interface corresponding to the APP is initiated, and the local cache is updated and the page is displayed according to the return data of the small interface.
[0109] Network monitoring model process: monitor network links, calculate the server (i.e., link) with the best current performance, and forward the call request to the server for processing.
[0110] Small interface processing flow: In response to a call request to call a small interface, query whether the secondary cache of the database is empty; if the secondary cache is empty, create a database connection, obtain the cache data corresponding to the small interface stored in the database table, and store the secondary cache; if the secondary cache is not empty, obtain the cache data corresponding to the small interface in the secondary cache; encapsulate the cache data corresponding to the small interface, and return the encapsulated cache data as the return data of the small interface; calculate the hash value of the encapsulated cache data, and synchronously return it as the return data of the small interface; store the obtained hash value in the cache area.
[0111] Hash large interface processing flow: Get the hash data (for example, hash value) of the small interface called by starting the APP from the cache, and return it in splicing; if the hash data of the small interface called by starting the APP does not exist in the cache, return empty.
[0112] The page display method provided in the embodiment of the present disclosure can complete data loading by accessing the large hash interface when starting the application, except for the case where there is no local cache when the client installs the application for the first time, or the business data is updated, without establishing a database connection; in the scenario where the client calls the small interface, the interface will first query the secondary cache data, and the scenario of direct database query is greatly reduced, thereby reducing the occupancy of database threads and reducing the pressure on the database.
[0113] In the embodiments of the present disclosure, the calls of the interfaces are calculated through the network monitoring model and forwarded to the container with better performance, which reduces the waiting time for calling the interface, alleviates the pressure on the container, and increases the return speed of the interface.
[0114] The page display method provided by the embodiment of the present disclosure reduces the startup time of the client, alleviates the pressure on the container and the database, and optimizes the user experience.
[0115] Based on the above page display method, the present disclosure also provides a page display device. Figure 7 The device is described in detail.
[0116] Figure 7 The structural block diagram of the page display device according to an embodiment of the present disclosure is schematically shown.
[0117] like Figure 7 As shown, the page display device 700 of this embodiment includes a starting module 710 , a calling module 720 , an extracting module 730 and a displaying module 740 .
[0118] The startup module 710 is used to obtain a startup request for starting an application of the client. In one embodiment, the startup module 710 can be used to perform the operation S210 described above, which will not be described in detail here.
[0119] The calling module 720 is used to call the hash interface in response to the hash value of the application included in the local cache. In one embodiment, the calling module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0120] The extraction module 730 is used to obtain the hash value of the small interface corresponding to the application from the hash large interface. In one embodiment, the extraction module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0121] The display module 740 is used to load the local cache data of the application for page display in response to the hash value of the application in the local cache being the same as the hash value of the small interface. In one embodiment, the display module 740 can be used to perform the operation S240 described above, which will not be repeated here.
[0122] According to an embodiment of the present disclosure, the calling module 720 is further configured to call the small interface corresponding to the application in response to the local cache not including the hash value of the application, or in response to the hash value of the application in the local cache being different from the hash value of the small interface.
[0123] According to an embodiment of the present disclosure, the display module 740 is also used to obtain the cache data of the application and the hash value of the cache data based on the return data of the small interface, store the cache data and the hash value of the cache data in the local cache; and load the cache data of the application for page display.
[0124] According to an embodiment of the present disclosure, the page display device 700 of this embodiment further includes a query module 750 , a calculation module 760 , and a packaging module 770 .
[0125] The query module 750 is used to query the second-level cache, which stores the relevant query data of the database. In one embodiment, the query module 750 can be used to perform the operation S310 described above, which will not be repeated here.
[0126] The calculation module 760 is used to calculate the hash value of the cache data in response to the cache data of the application included in the binary cache. In one embodiment, the calculation module 760 can be used to perform the operation S320 described above, which will not be described in detail here.
[0127] The encapsulation module 770 is used to encapsulate the cache data and the hash value of the cache data of the application, and use the encapsulated cache data and the hash value of the cache data as the return data. In one embodiment, the encapsulation module 770 can be used to perform the operation S330 described above, which will not be described in detail here.
[0128] The query module 750 is also used to obtain the cache data of the application from the database in response to the bipolar cache not including the cache data of the application; and store the cache data of the application in the bipolar cache. In one embodiment, the query module 750 can be used to perform the operations S340 and S350 described above, which will not be repeated here.
[0129] In one embodiment, the calculation module 760 may also be used to execute the operation S360 described above, which will not be described in detail here.
[0130] In one embodiment, the encapsulation module 770 may also be used to perform the operation S370 described above, which will not be described in detail here.
[0131] According to an embodiment of the present disclosure, the page display device 700 of this embodiment also includes a screening module 780 .
[0132] The screening module 780 is used to screen the links in the network through the network monitoring algorithm; forward the call request to the link selected by the network monitoring algorithm, and process the call request. Screening the links in the network through the network monitoring algorithm includes: calculating the utilization rate of each link through the network monitoring algorithm; and selecting the link with the lowest utilization rate among the links in the network.
[0133] According to an embodiment of the present disclosure, any multiple modules among the startup module 710, the call module 720, the extraction module 730, the display module 740, the query module 750, the calculation module 760, the encapsulation module 770 and the screening module 780 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the startup module 710, the call module 720, the extraction module 730, the display module 740, the query module 750, the calculation module 760, the encapsulation module 770 and the screening module 780 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the startup module 710, the calling module 720, the extraction module 730, the display module 740, the query module 750, the calculation module 760, the encapsulation module 770 and the screening module 780 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is executed.
[0134] Figure 8 A block diagram of an electronic device suitable for implementing a page display method according to an embodiment of the present disclosure is schematically shown.
[0135] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0136] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0137] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that the computer program read therefrom is installed into the storage portion 808 as needed.
[0138] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0139] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0140] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the page display method provided by the embodiment of the present disclosure.
[0141] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0142] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0143] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0144] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0145] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0147] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A page display method, characterized in that: The method comprises: Obtaining a start request for starting an application of the client; In response to the local cache including the hash value of the application, calling the hash interface; Acquire a hash value of a small interface corresponding to the application from the hash large interface; and In response to the hash value of the application in the local cache being the same as the hash value of the small interface, the local cache data of the application is loaded for page display.
2. The page display method according to claim 1, characterized in that: In response to the local cache not including the hash value of the application, or in response to the hash value of the application in the local cache being different from the hash value of the small interface, calling the small interface corresponding to the application; Acquire cache data of the application and a hash value of the cache data based on the return data of the small interface, and store the cache data and the hash value of the cache data in the local cache; as well as The cached data of the application is loaded for page display.
3. The page display method according to claim 2, characterized in that: The calling of the small interface corresponding to the application includes: querying a secondary cache, wherein the secondary cache stores relevant query data of the database; and In response to the fact that the second-level cache includes cache data of the application, the cache data is encapsulated, and a hash value of the encapsulated cache data is calculated.
4. The page display method according to claim 3, characterized in that: In response to the second-level cache not including the cache data of the application, acquiring the cache data of the application from the database; Storing the cache data of the application in the secondary cache; as well as The cache data is encapsulated, and a hash value of the encapsulated cache data is calculated.
5. The page display method according to claim 3 or 4, characterized in that: The calling of the small interface corresponding to the application also includes: The hash value of the encapsulated cache data is encapsulated, and the encapsulated cache data and the encapsulated hash value are used as the returned data.
6. The page display method according to claim 1, characterized in that: The cache area of the hash large interface stores the names of the small interfaces corresponding to the multiple applications of the client and the hash values corresponding to the names of the small interfaces, wherein each application corresponds to at least one small interface.
7. The page display method according to claim 6, characterized in that: The name of the small interface and the hash value corresponding to the name of the small interface are stored in the cache in the form of a key-value pair.
8. The page display method according to claim 1, characterized in that: After obtaining the start request for starting the application of the client, the method further includes: Screening links in the network through network monitoring algorithms; and The call request is forwarded to the link selected by the network monitoring algorithm, and the call request is processed.
9. The page display method according to claim 8, characterized in that: The screening of links in the network by using a network monitoring algorithm includes: Calculating the utilization rate of each link by the network monitoring algorithm; and A link with the lowest utilization rate among the links in the network is selected.
10. A page display device, characterized in that: The device comprises: A startup module, used to obtain a startup request for starting an application of the client; A calling module, configured to call a hash interface in response to a hash value of the application included in a local cache; an extraction module, configured to obtain a hash value of a small interface corresponding to the application from the hash large interface; and The display module is used for loading the local cache data of the application for page display in response to the hash value of the application in the local cache being the same as the hash value of the small interface.
11. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Page generation method, device and equipment
CN112905175A
Virtual network resource allocation method for intelligent power distribution service
CN113347589A
Client interface data processing method and device
CN116346313A
Interface content cache control method and system
CN117312191A
Webpage resource loading method and device of application program, equipment and storage medium
CN119003903A