Methods, devices, electronic devices and media for preloading front-end pages of IoT platforms
By using a preloading method, which utilizes variant state transition matrices and page state probability distributions, we can predict user visits to slow-loading pages, process data in advance, solve the problem of slow front-end page loading speed on IoT platforms, and improve loading efficiency and user experience.
Patent Information
- Application Number
- CN202411692472.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The slow loading speed of the front-end page of the IoT platform results in long waiting times for users, affecting the browsing experience, especially when the content is complex and the logic is intricate.
By using a preloading method, the variant state transition matrix and page state probability distribution are used to predict slow-loading pages that users will visit in the future. Business logic data is processed in advance on the backend, and a callback interface ID is returned to achieve asynchronous loading.
It reduces the waiting time for users to access slow-loading pages, improves the loading efficiency of front-end pages and the user browsing experience, especially when there is a lot of query content and complex logic.
Smart Images

Figure CN119788668B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a method, apparatus, electronic device, and medium for preloading front-end pages of an Internet of Things (IoT) platform. Background Technology
[0002] The current IoT connectivity management platform's web client displays detailed information about the customer's SIM card, including product examples, functional details, and subscription package details. This information is stored in the IoT platform's database. When a customer visits a specific page, the front-end retrieves this detailed information by calling multiple query interfaces provided by the back-end and displays it on the page. Simultaneously, customers can also access other service pages provided by the IoT platform through various links on the page, such as SIM card diagnostics, subscription packages, and fault submission. Some of these pages display very complex content, requiring data distributed across dozens of tables in different databases, necessitating calls to dozens of back-end interfaces. Other pages require calls to external system interfaces. The page only loads and becomes available for customer viewing after all the information for the front-end has been retrieved. In other words, the front-end page loading speed depends on the speed of data retrieval from the back-end services. Some pages require complex content, and the back-end interfaces spend a significant amount of time processing complex business logic. Using traditional real-time calls to back-end interfaces means that after a customer clicks and navigates, they have to wait for the back-end service to complete its business logic process before seeing the page content, impacting the loading efficiency of the IoT platform's front-end pages and the user's browsing experience. Summary of the Invention
[0003] The purpose of this invention is to at least partially solve one of the technical problems existing in the prior art.
[0004] Therefore, one objective of this invention is to provide a method for preloading front-end pages of an IoT platform, which improves the loading efficiency of front-end pages and the user's browsing experience.
[0005] Another objective of this invention is to provide a front-end page preloading device for an Internet of Things (IoT) platform.
[0006] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of the present invention include:
[0007] On one hand, embodiments of the present invention provide a method for preloading the front-end page of an Internet of Things platform, including the following steps:
[0008] When a target user logs into the IoT platform, the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page are obtained from the backend and added to the page cache.
[0009] When a target user accesses the first front-end page, determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache;
[0010] If the first callback interface ID exists in the page cache, the corresponding preprocessed data is obtained according to the first callback interface ID and the page is loaded; otherwise, the regular interface is called to process business logic data and load the page.
[0011] Once the first front-end page has finished loading, the k-step transition probability of each slow-loading page is determined based on the current page state, the variant state transition matrix, and the page state probability distribution.
[0012] The slow-loading pages with a k-step transition probability greater than a preset probability threshold are used as preloaded pages. The preload asynchronous interface is called to process the business logic data of the preloaded pages in the backend, and the callback interface ID corresponding to the preloaded pages is returned to the page cache.
[0013] Furthermore, in one embodiment of the present invention, the variant state transition matrix and the page state probability distribution are obtained through the following steps:
[0014] Obtain the first operation process record of all users accessing the IoT platform each time within a first preset historical time period;
[0015] Based on the first operation process record, determine multiple first page state sequences corresponding to the IoT platform, and determine the variant state transition matrix of the IoT platform based on the first page state sequences;
[0016] Obtain the second operation process record of each time the target user accesses the Internet of Things platform within the second preset historical time period;
[0017] Based on the second operation process record, determine multiple second page state sequences corresponding to the target user, and determine the page state probability distribution of the target user on each front-end page based on the second page state sequences.
[0018] Further, in one embodiment of the present invention, the step of determining multiple first page state sequences corresponding to the IoT platform according to the first operation flow record, and determining the variant state transition matrix of the IoT platform according to the first page state sequences, specifically includes:
[0019] Based on the first operation process record, multiple front-end pages and their corresponding page states and operation times are determined, and page-state elements are generated based on the front-end pages and their corresponding page states. Then, the page-state elements are sorted according to the operation time to obtain the first page state sequence.
[0020] Based on the probability of jumping from each of the page-state elements to other front-end pages according to the first page state sequence, the corresponding jump probability elements are obtained;
[0021] The variant state transition matrix is generated based on the jump probability elements.
[0022] Furthermore, in one embodiment of the present invention, the step of determining multiple second page state sequences corresponding to the target user according to the second operation flow record, and determining the page state probability distribution of the target user on each front-end page according to the second page state sequence, specifically includes:
[0023] According to the second operation process record, multiple front-end pages and their corresponding page states and operation times are determined, and page-state elements are generated according to the front-end pages and their corresponding page states. Then, the page-state elements are sorted according to the operation time to obtain the second page state sequence.
[0024] Based on the probability of the front-end page being in each front-end page state when jumping to each front-end page according to the second page state sequence, the corresponding probability distribution elements are obtained.
[0025] The probability distribution of the target user's page state on each front-end page is generated based on the probability distribution elements.
[0026] Furthermore, in one embodiment of the present invention, determining the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution specifically includes:
[0027] Obtain the preset number of slow-loading pages and their corresponding k values;
[0028] Determine the first page-state element based on the first front-end page and the current page state;
[0029] The probability of arriving at each of the slow-loading pages after k jumps from the first page-state element is calculated based on the variant state transition matrix and the page state probability distribution, thus obtaining the k-step transition probability of each of the slow-loading pages.
[0030] Furthermore, in one embodiment of the present invention, the slow-loading page and the corresponding k value are obtained through the following steps:
[0031] Get the first loading time of each front-end page accessed by all users within the third preset historical time period;
[0032] The historical average loading time of each front-end page is determined based on the first loading time.
[0033] The front-end pages whose historical average loading time is greater than or equal to a preset time threshold are identified as slow-loading pages.
[0034] The corresponding k value is determined based on the historical average loading time of the slow-loading page.
[0035] Furthermore, the k-step transition probability is calculated using the following formula:
[0036]
[0037] in, Let represent the probability that a person from state l on page i will jump to page j in 1+n steps. p represents the probability of transitioning from state l of page i to page m in one step. m (x) represents the probability that page m is in state x when the user jumps to page m. Let L represent the probability of transitioning from state x on page m to page j in n steps, where I represents the set of pages, and L represents the set of pages. m Let m represent the set of states of page m. Let page i be the first front-end page, state l be the current page state, page j be the slow-loading page, and 1+n=k>1. By recursively calculating using the above formula, the k-step transition probability of page j can be obtained.
[0038] On the other hand, embodiments of the present invention provide a front-end page preloading device for an Internet of Things platform, comprising:
[0039] The parameter acquisition module is used to obtain the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page from the back end and add them to the page cache when the target user logs into the IoT platform.
[0040] The cache reading module is used to determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache when the target user accesses the first front-end page.
[0041] The page loading module is used to load the page by obtaining the corresponding preprocessed data according to the first callback interface ID when the first callback interface ID exists in the page cache, and otherwise, to call the regular interface to perform business logic data processing and page loading.
[0042] The transition probability determination module is used to determine the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution when the first front-end page has finished loading.
[0043] The page preloading module is used to take the slow-loading pages with a k-step transition probability greater than a preset probability threshold as preloaded pages, call the preload asynchronous interface to process the business logic data of the preloaded pages in the backend, and return the callback interface ID corresponding to the preloaded pages to the page cache.
[0044] On the other hand, embodiments of the present invention provide an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, it implements the IoT platform front-end page preloading method described above.
[0045] On the other hand, embodiments of the present invention also provide a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, which can be executed by one or more processors to implement the IoT platform front-end page preloading method as described above.
[0046] The advantages and beneficial effects of the present invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention:
[0047] In this embodiment of the invention, when a target user logs into the IoT platform, the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page are obtained from the backend and added to the page cache. When the target user accesses the first front-end page, it is determined whether the first callback interface ID corresponding to the first front-end page exists in the page cache. If the first callback interface ID exists in the page cache, the corresponding preprocessed data is obtained according to the first callback interface ID for page loading. Otherwise, the regular interface is called to process business logic data and load the page. When the first front-end page is loaded, the k-step transition probability of each slow-loading page is determined according to the current page state, the variant state transition matrix, and the page state probability distribution. Slow-loading pages with a k-step transition probability greater than a preset probability threshold are designated as preloaded pages. The preloaded asynchronous interface is called to process the business logic data of the preloaded page in the backend and the callback interface ID corresponding to the preloaded page is returned to the page cache. This invention optimizes the data loading process of front-end pages. Based on the variant state transition matrix of all users jumping between different front-end pages and the probability distribution of the target user's page state on each front-end page, it predicts the probability that the target user will access a slow-loading page after several steps. According to the prediction result, it calls the preloading asynchronous interface to process the business logic data of the preloaded page in the backend and returns a callback interface ID. When the target user actually accesses the slow-loading page, it calls the callback interface to obtain the preprocessed data for page loading. This greatly reduces the waiting time for users to access slow-loading pages and provides sufficient time for the front-end page to obtain data. Even when there is a lot of query content, complex query logic, and slow backend loading speed, it can reduce the phenomenon of user browsing lag and improve the loading efficiency of the front-end page of the IoT platform and the user's browsing experience. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments of the present invention are described below. It should be understood that the drawings described below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart illustrating the steps of a method for preloading the front-end page of an IoT platform provided in an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the instructions for the IoT platform front-end page preloading method provided in an embodiment of the present invention;
[0051] Figure 3 A flowchart illustrating the steps for determining the variant state transition matrix and page state probability distribution provided in this embodiment of the invention;
[0052] Figure 4 A schematic diagram of the operation process record provided in the embodiments of the present invention;
[0053] Figure 5 This is a schematic diagram illustrating how a user navigates between multiple front-end pages, as provided in an embodiment of the present invention.
[0054] Figure 6 A flowchart of step S202 provided in an embodiment of the present invention;
[0055] Figure 7 A flowchart of step S204 provided in an embodiment of the present invention;
[0056] Figure 8 A flowchart of step S104 provided in an embodiment of the present invention;
[0057] Figure 9 A flowchart illustrating the steps for determining a slow-loading page and its corresponding k value, provided in an embodiment of the present invention;
[0058] Figure 10 A schematic diagram of the structure of the IoT platform front-end page preloading device provided in an embodiment of the present invention;
[0059] Figure 11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention;
[0060] Figure 12 This is a schematic diagram of the structure of the storage medium provided in an embodiment of the present invention. Detailed Implementation
[0061] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. It should be noted that although functional modules are divided in the system schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system schematic diagram or the order in the flowchart. The step numbers in the following embodiments are only set for ease of explanation and do not limit the order between steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0062] In the description of this invention, "multiple" means two or more. The use of "first" and "second" is for distinguishing technical features only and should not be construed as indicating or implying relative importance, the number of indicated technical features, or the order of the indicated technical features. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0063] The IoT platform front-end page preloading method provided in this application embodiment can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, set-top box, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the IoT platform front-end page preloading method, but is not limited to the above forms.
[0064] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0065] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data for the proper functioning of the embodiments of this application obtained.
[0066] Currently, most pages on the web-based IoT connectivity management platform rely on backend services querying data in real-time based on business logic. The frontend only sends a query to the backend after a user visits the page. Some pages require complex content, and the backend interface spends considerable time processing this intricate business logic. Using the traditional real-time backend API call approach means that after a user clicks and navigates, they have to wait for the backend service to complete its entire business logic process before seeing the page content. However, a user's actions upon logging into the IoT connectivity management platform follow a certain process and regularity, and the user spends a certain amount of time on the current interface. If the system could predict the user's next action, it could "notify" the backend service to start preparing data in advance. When the user actually visits, since the backend service has already prepared the data, it can directly return the data to the frontend, eliminating the intermediate business query process and reducing the user's actual waiting time.
[0067] This invention optimizes the data loading process of front-end pages. Based on the variant state transition matrix of all users jumping between different front-end pages and the probability distribution of the target user's page state on each front-end page, it predicts the probability that the target user will access a slow-loading page after several steps. According to the prediction result, it calls the preloading asynchronous interface to process the business logic data of the preloaded page in the backend and returns a callback interface ID. When the target user actually accesses the slow-loading page, it calls the callback interface to obtain the preprocessed data for page loading. This greatly reduces the waiting time for users to access slow-loading pages and provides sufficient time for the front-end page to obtain data. Even when there is a lot of query content, complex query logic, and slow backend loading speed, it can reduce the phenomenon of user browsing lag and improve the loading efficiency of the front-end page of the IoT platform and the user's browsing experience.
[0068] like Figure 1 The diagram shows a flowchart of a method for preloading the front-end page of an IoT platform according to an embodiment of the present invention. (Refer to...) Figure 1This invention provides a method for preloading the front-end page of an IoT platform, specifically including the following steps:
[0069] S101. When the target user logs into the IoT platform, obtain the variant state transition matrix of the IoT platform from the backend and the probability distribution of the target user's page state on each front-end page and add it to the page cache.
[0070] S102. When the target user accesses the first front-end page, determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache.
[0071] S103. If the first callback interface ID exists in the page cache, the corresponding preprocessed data is obtained according to the first callback interface ID and the page is loaded. Otherwise, the regular interface is called to process business logic data and load the page.
[0072] S104. When the first front-end page is loaded, determine the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution.
[0073] S105. Use slow-loading pages with a k-step transition probability greater than a preset probability threshold as preloaded pages, call the preload asynchronous interface to process the business logic data of the preloaded pages in the backend, and return the callback interface ID corresponding to the preloaded page to the page cache.
[0074] like Figure 2 This is a schematic diagram of the instruction for the IoT platform front-end page preloading method provided in this embodiment of the invention. When a user logs into the platform, the front-end page calls an interface to obtain the variant state transition matrix and the probability distribution of each page state for the user from the back-end. When the user accesses the front-end page, it first checks the page cache for a callback interface ID. If it exists, it means that the preloading asynchronous interface has been called before. In this case, the callback interface is called directly through the ID to immediately retrieve the processed data from the back-end for loading and display. If there is no callback interface ID or the callback interface call fails, the normal process is followed, and the data is returned after the back-end finishes processing the business logic. After the current page accessed by the user is loaded, the front-end calculates the k-step transition probability of each slow-loading page through the current page state, the variant state transition matrix, and the page state probability distribution. If the k-step transition probability of a slow-loading page exceeds the threshold, the preloading asynchronous interface is called. The back-end begins to process the business logic in advance and returns a callback ID. If the user actually accesses the page afterward, the front-end can immediately retrieve the prepared data from the back-end through this callback ID, saving a lot of page loading time and optimizing the user experience.
[0075] like Figure 3The diagram shown is a flowchart illustrating the steps for determining the variant state transition matrix and page state probability distribution according to an embodiment of the present invention. (Refer to...) Figure 3 Furthermore, as an optional implementation, the variant state transition matrix and page state probability distribution are obtained through the following steps:
[0076] S201. Obtain the first operation process record of all users accessing the Internet of Things platform each time within the first preset historical time period;
[0077] S202. Determine multiple first page state sequences corresponding to the IoT platform according to the first operation process record, and determine the variant state transition matrix of the IoT platform according to the first page state sequence.
[0078] S203. Obtain the second operation process record of each time the target user accesses the Internet of Things platform within the second preset historical time period;
[0079] S204. Based on the second operation process record, determine multiple second page state sequences corresponding to the target user, and based on the second page state sequences, determine the probability distribution of the target user's page state on each front-end page.
[0080] Specifically, each time a user logs into the IoT connection management platform, the front end records the sequence of page states visited during that time. When the user logs out, this record is sent to the back end and stored in the database. Every month, a variant state transition matrix is calculated using all user records in the database. Every 7 days, each user is iterated through to calculate the probability distribution of their page states, ensuring that both are timely.
[0081] From logging into the IoT connectivity management platform to exiting, users will sequentially access various pages on the platform based on their needs and the information provided by the pages, until they exit the platform with their needs met. Let the t-th page viewed by the user during this process be considered a random variable X. t The sequence of random variables X = {X1, X2, ..., X...} after being arranged in order n} represents the entire process of a user logging into the platform this time. For example, X = {X1 = SIM card information details, X2 = product information details, X3 = ...}
[0082] The process of recording a user's journey through the platform—from logging in, viewing SIM-related information, performing SIM diagnostics, identifying problems, checking usage, and finally exiting the platform—is documented. Since the services provided by the IoT connectivity management platform are limited, all pages accessible to users can be considered a finite set S, where each X... tAll should take values from set S. Numbering each page in S will give us a set of positive integers I, with each page corresponding to a positive integer.
[0083] Although different users log in to the IoT connectivity management platform for different purposes, their browsing process has two characteristics. First, the next page a user visits is only related to the currently accessed page and not to their past browsing history. Taking SIM card diagnostics as an example, regardless of when a user accesses this page, they will generally access it directly from the homepage (which usually means the user logged in specifically for the SIM card diagnostics function) or jump from another page that might display SIM card status (such as SIM card information query) (meaning the user logged in to check their SIM card status and found a problem). If a user is currently browsing a product ordering page, their next page is almost certainly not about SIM card binding, because they are unlikely to discover a malfunction in one of their SIM cards from the product ordering page. Second, different users will get different results when accessing the same page, and different content on the same page will affect the next page. This is obvious; for example, on the same SIM card status page, it is clear that when a card is deactivated, the user is more likely to access SIM card diagnostics on the next page.
[0084] Therefore, based on this characteristic, each user's access to the IoT connection management platform can be considered a variant Markov chain. Some states in this Markov chain will be concretized into different situations after actual arrival, which will affect the subsequent transition probability. After calculating the corresponding variant state transition matrix, combined with the user's current page, the page that the user may visit next can be inferred.
[0085] A Markov chain is a stochastic process in which the probability of state transitions at any given time depends only on the current state: X =
[0086] {X1,X2,...,X n When the set of states S is finite, p is called... ij =P(X) t+1 =j|X t =i), i,j∈I is a Markov chain {X t The transition probability of} is called P = (p ij )i,j∈I is the one-step transition probability matrix (or simply the state transition matrix).
[0087] Now we introduce the concept of a variant Markov chain: among all the states, some states form a group of states: For these states, only p can be calculated. ji And each However, it is impossible to calculate each one. In other words, we only know the probability of transitioning from other states to the group, but we cannot know the probability of transitioning to which specific state within the group. However, the probability of transitioning from each state within the group to other states is known. We call this characteristic one-way fuzziness. In this case, the state transition matrix becomes a rectangle of unequal length and width, which we call a variant state transition matrix.
[0088] In this case, each positive integer in I represents a state group in the Markov chain. An additional positive integer index represents each state within the state group. For a state group with only one state, the index can be omitted. For a Markov chain {X} t The transition probability of} is called Let be the variant state transition matrix. For example, a Markov chain has 4 states, two of which form a state group. These 4 states are denoted as {1, 2, 31, 32}, and its variant state transition matrix can be represented as:
[0089]
[0090] like Figure 4 The diagram shown is a schematic representation of the operation flow record provided in an embodiment of the present invention. A series of browsing behaviors after a user logs into the platform can be recorded using this information. Figure 4 This is a one-way graph representation containing state information. The page states of an IoT connection management platform are finite. Based on the actual functions provided by the IoT connection management platform and the situations users may encounter during access, page names and corresponding integer numbers can be listed through enumeration. Each page is a state group. For pages that do not provide data information (such as package subscriptions or SMS sending), they can be considered to have only a single state. However, for pages with a large amount of information, further subdivision is needed based on the business scenario, listing different scenarios as specific states within the state group. For example, a SIM card data query page containing "suspended SIM card" and "all SIM cards in use" would be listed as two specific states within the "SIM card data query page" state group. If 1 represents the SIM card data query page, then "suspended SIM card" and "all SIM cards in use" would be represented as 11 and 12 respectively. Using L... i Let represent the set of all specific state indices of state group i.
[0091] like Figure 5The diagram illustrates how a user navigates between multiple front-end pages according to an embodiment of the present invention. Based on the process shown in the diagram, the user repeatedly navigates from one page to another with a certain probability until the result of a certain navigation is exit ('exit' is also considered a page, and the probability of navigating from the 'exit' page to any other page is 0. Accessing the 'exit' page means the random process ends and the user's visit terminates).
[0092] The sequence of pages that each user traverses from the login page to the final logout can be represented as follows: There were a total of nt page redirects during this period, recorded For sequence X (t) The number of times a jump occurs from the l-th state of page i to page j (for pages with only one state, the index is omitted), is: When a user clicks to log out, the front-end page can send the sequence of actions the user has performed since logging into the platform to the back-end via an API and store it in the database.
[0093] like Figure 6 The diagram shown is a flowchart of step S202 provided in an embodiment of the present invention. (Refer to...) Figure 6 As an optional implementation, multiple first page state sequences corresponding to the IoT platform are determined according to the first operation process record, and a variant state transition matrix of the IoT platform is determined according to the first page state sequences, specifically including:
[0094] S2021. Based on the first operation process record, determine multiple front-end pages and their corresponding page states and operation times, generate page-state elements based on the front-end pages and their corresponding page states, and then sort the page-state elements according to the operation time to obtain the first page state sequence.
[0095] S2022. Based on the state sequence of the first page, calculate the probability of jumping from each page-state element to other front-end pages, and obtain the corresponding jump probability elements.
[0096] S2023. Generate the variant state transition matrix based on the jump probability elements.
[0097] Specifically, we collect all user login sequence data generated within the past month to obtain a sequence set {X}. (t)}, summing up all members in the set yields a counting matrix:
[0098]
[0099]
[0100] remember:
[0101]
[0102] Then we have:
[0103]
[0104] P is a variant state transition matrix of the Markov chain for user access to the platform, where each This represents the probability that a user jumps from state l on page i to page j.
[0105] like Figure 7 The diagram shown is a flowchart of step S204 provided in an embodiment of the present invention. (Refer to...) Figure 7 As an optional implementation, the second operation process records and determines multiple second page state sequences corresponding to the target user, and determines the probability distribution of the target user's page state on each front-end page based on the second page state sequences, specifically including:
[0106] S2041. Based on the second operation process record, determine multiple front-end pages and their corresponding page states and operation times, generate page-state elements based on the front-end pages and their corresponding page states, and then sort the page-state elements according to the operation time to obtain the second page state sequence.
[0107] S2042. Based on the second page state sequence, calculate the probability that the front-end page is in each front-end page state when jumping to each front-end page, and obtain the corresponding probability distribution elements.
[0108] S2043. Generate the probability distribution of the target user's page state on each front-end page based on the probability distribution elements.
[0109] Specifically, for a regular Markov chain, the formula is used recursively: While k-step transition probabilities can be easily calculated, the introduction of state groups and unidirectional fuzzy logic makes it impossible to calculate k-step transition probabilities beyond one step using only the variant state transition matrix. This is because we cannot know which state of the page we have reached before arriving at a page. Therefore, we need to introduce the concept of probability distribution for page i and each state i of the page. l , note P i (l),l∈L i When arriving at page i, the specific arrival status i l The probability of . In this case, the recursion uses a variant of the regular formula:
[0110]
[0111] It can be calculated The probability of reaching page j from state l of page i after k steps.
[0112] For each user, based on their access records to the IoT connection management platform over the past 7 days, count the number of times each state of each multi-state page was accessed by the user. Let be the number of times a user accessed page i in the past 7 days when the page state was l. Then, for this user, the probability distribution of the page state of page m is as follows:
[0113] like Figure 8 The diagram shown is a flowchart of step S104 provided in an embodiment of the present invention. (Refer to...) Figure 8 As an optional implementation, the k-step transition probability of each slow-loading page is determined based on the current page state, the variant state transition matrix, and the page state probability distribution. Specifically, this includes:
[0114] S1041. Obtain multiple preset slow-loading pages and their corresponding k values;
[0115] S1042. Determine the first page-state element based on the first front-end page and the current page state;
[0116] S1043. Calculate the probability of arriving at each slow-loading page after k jumps from the first page-state element based on the variant state transition matrix and page state probability distribution, and obtain the k-step transition probability of each slow-loading page.
[0117] As an optional implementation, the k-step transition probability is calculated using the following formula:
[0118]
[0119] in, Let represent the probability that a person from state l on page i will jump to page j in 1+n steps. p represents the probability of transitioning from state l of page i to page m in one step. m (x) represents the probability that page m is in state x when the user jumps to page m. Let L represent the probability of transitioning from state x on page m to page j in n steps, where I represents the set of pages, and L represents the set of pages. m Let m represent the set of states of page m. Let page i be the first front-end page, state l be the current page state, page j be the slow-loading page, and 1+n=k>1. By recursively calculating using the above formula, the k-step transition probability of page j can be obtained.
[0120] Specifically, in the aforementioned formula, the variant state transition matrix reflects the navigation logic when a user group uses the IoT connection management platform, while the page state probability distribution calculated for a specific user reflects the information that the user may obtain when accessing the platform. Combining the two, for a page j that usually loads slowly, the variant formula can be used to calculate the probability of a user accessing page j after k navigations when the user is currently accessing page i and the page state is l. If this probability exceeds a certain threshold, the system can preload the page content so that it loads instantly when the user actually accesses it.
[0121] like Figure 9 The diagram shown is a flowchart illustrating the steps for determining a slow-loading page and its corresponding k value according to an embodiment of the present invention. (Refer to...) Figure 9 As an optional implementation, the slow-loading page and the corresponding k value are obtained through the following steps:
[0122] S301. Obtain the first loading time of each front-end page accessed by all users within the third preset historical time period.
[0123] S302. Determine the historical average loading time of each front-end page based on the first loading time;
[0124] S303. Determine that front-end pages with a historical average loading time greater than or equal to a preset time threshold are slow loading pages.
[0125] S304. Determine the corresponding k value based on the historical average loading time of slow-loading pages.
[0126] Specifically, the value of k should be determined based on the loading speed. Pages with slower loading speeds should use a larger value of k to allow sufficient time for data processing. For example, if a slow-loading page takes an average of 4 seconds to fully load, then when calculating the k-step transition probability from other pages to this page, the value of k should be set to at least 3, allowing time for 3 redirects and sending asynchronous interfaces in advance to allow the backend to start loading data.
[0127] The method steps of the embodiments of the present invention have been described above. It can be understood that the embodiments of the present invention optimize the data loading process of the front-end page. Based on the variant state transition matrix of all users jumping between different front-end pages and the probability distribution of the target user's page state on each front-end page, the probability of the target user accessing a slow-loading page after several steps is predicted. Based on the prediction result, a pre-loading asynchronous interface is called to process the business logic data of the pre-loaded page in the back-end, and a callback interface ID is returned. When the target user actually accesses the slow-loading page, the callback interface is called to obtain the pre-processed data for page loading. This greatly reduces the waiting time for users accessing slow-loading pages, providing sufficient time for the front-end page to obtain data. Even with numerous query contents, complex query logic, and slow back-end loading speeds, it can reduce user browsing lag, improving the loading efficiency of the IoT platform's front-end page and the user's browsing experience.
[0128] like Figure 10 The diagram shown is a structural schematic of the IoT platform front-end page preloading device provided in an embodiment of the present invention. (Refer to...) Figure 10 This invention provides a front-end page preloading device for an Internet of Things (IoT) platform, comprising:
[0129] The parameter acquisition module is used to obtain the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page from the backend and add them to the page cache when the target user logs in to the IoT platform.
[0130] The cache reading module is used to determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache when the target user accesses the first front-end page.
[0131] The page loading module is used to load the page if the first callback interface ID exists in the page cache, and to retrieve the corresponding preprocessed data based on the first callback interface ID. Otherwise, it calls the regular interface to process business logic data and load the page.
[0132] The transition probability determination module is used to determine the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution when the first front-end page has finished loading.
[0133] The page preloading module is used to preload slow-loading pages with a k-step transition probability greater than a preset probability threshold. It calls the asynchronous preloading interface to process the business logic data of the preloaded page on the backend and returns the corresponding callback interface ID of the preloaded page to the page cache.
[0134] The content of the above method embodiments is applicable to the device embodiments. The specific functions implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0135] This invention also provides an electronic device, comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned IoT platform front-end page preloading method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0136] like Figure 11 The diagram shown is a hardware structure schematic of an electronic device provided in an embodiment of the present invention. (Refer to...) Figure 11 This invention provides an electronic device, comprising:
[0137] The processor 1101 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0138] The memory 1102 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1102 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1102 and is called and executed by the processor 1101 to execute the IoT platform front-end page preloading method of the embodiments of this invention.
[0139] Input / output interface 1103 is used to implement information input and output;
[0140] The communication interface 1104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0141] Bus 1105 transmits information between various components of the device (e.g., processor 1101, memory 1102, input / output interface 1103, and communication interface 1104);
[0142] The processor 1101, memory 1102, input / output interface 1103 and communication interface 1104 are connected to each other within the device via bus 1105.
[0143] like Figure 12 The diagram shown is a structural schematic of the storage medium provided in an embodiment of the present invention. (Refer to...) Figure 12 The present invention also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs 1201, which can be executed by one or more processors to implement the above-mentioned IoT platform front-end page preloading method.
[0144] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0145] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform... Figure 1 The method shown.
[0146] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the aforementioned blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0147] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the aforementioned functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0148] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0149] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0150] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the aforementioned program can be printed, because the aforementioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or, if necessary, processing in other suitable ways, and then stored in computer memory.
[0151] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0152] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0153] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0154] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for preloading front-end pages of an Internet of Things (IoT) platform, characterized in that, Includes the following steps: When a target user logs into the IoT platform, the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page are obtained from the backend and added to the page cache. When a target user accesses the first front-end page, determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache; If the first callback interface ID exists in the page cache, the corresponding preprocessed data is obtained according to the first callback interface ID and the page is loaded; otherwise, the regular interface is called to process business logic data and load the page. Once the first front-end page has finished loading, the k-step transition probability of each slow-loading page is determined based on the current page state, the variant state transition matrix, and the page state probability distribution. The slow-loading page with a k-step transition probability greater than a preset probability threshold is used as the preloaded page. The preload asynchronous interface is called to process the business logic data of the preloaded page in the backend, and the callback interface ID corresponding to the preloaded page is returned to the page cache. The variant state transition matrix and the page state probability distribution are obtained through the following steps: Obtain the first operation process record of all users accessing the IoT platform each time within a first preset historical time period; Based on the first operation process record, determine multiple first page state sequences corresponding to the IoT platform, and determine the variant state transition matrix of the IoT platform based on the first page state sequences; Obtain the second operation process record of each time the target user accesses the Internet of Things platform within the second preset historical time period; Based on the second operation process record, determine multiple second page state sequences corresponding to the target user, and based on the second page state sequences, determine the probability distribution of the page state of the target user on each front-end page; The step of determining multiple first page state sequences corresponding to the IoT platform based on the first operation process record, and determining the variant state transition matrix of the IoT platform based on the first page state sequences, specifically includes: Based on the first operation process record, multiple front-end pages and their corresponding page states and operation times are determined, and page-state elements are generated based on the front-end pages and their corresponding page states. Then, the page-state elements are sorted according to the operation time to obtain the first page state sequence. Based on the probability of jumping from each of the page-state elements to other front-end pages according to the first page state sequence, the corresponding jump probability elements are obtained; The variant state transition matrix is generated based on the jump probability elements; The step of determining multiple second page state sequences corresponding to the target user according to the second operation process record, and determining the page state probability distribution of the target user on each front-end page according to the second page state sequences, specifically includes: According to the second operation process record, multiple front-end pages and their corresponding page states and operation times are determined, and page-state elements are generated according to the front-end pages and their corresponding page states. Then, the page-state elements are sorted according to the operation time to obtain the second page state sequence. Based on the probability of the front-end page being in each front-end page state when jumping to each front-end page according to the second page state sequence, the corresponding probability distribution elements are obtained. Generate the page state probability distribution of the target user on each front-end page based on the probability distribution elements; The k-step transition probability is calculated using the following formula: in, Indicates from page status l go through Step to jump to page The probability, Indicates from page status l After one step, you will be redirected to the page. The probability, This indicates a redirect to the page. Time Page In state The probability, Indicates from page status x go through Step to jump to page The probability, Represents a collection of pages. Page The set of states that make the page For the first front-end page, status l The current page state, page For the slow-loading page and By recursively calculating using the above formula, the page can be obtained. The k-step transition probability.
2. The method for preloading the front-end page of an IoT platform according to claim 1, characterized in that, The step of determining the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution specifically includes: Obtain the preset number of slow-loading pages and their corresponding k values; Determine the first page-state element based on the first front-end page and the current page state; The probability of arriving at each of the slow-loading pages after k jumps from the first page-state element is calculated based on the variant state transition matrix and the page state probability distribution, thus obtaining the k-step transition probability of each of the slow-loading pages.
3. The method for preloading the front-end page of an IoT platform according to claim 2, characterized in that, The slow-loading page and its corresponding k value are obtained through the following steps: Get the first loading time of each front-end page accessed by all users within the third preset historical time period; The historical average loading time of each front-end page is determined based on the first loading time. The front-end pages whose historical average loading time is greater than or equal to a preset time threshold are identified as slow-loading pages. The corresponding k value is determined based on the historical average loading time of the slow-loading page.
4. A front-end page preloading device for an Internet of Things (IoT) platform, characterized in that, The method for preloading the front-end page of an IoT platform as described in any one of claims 1 to 3 includes: The parameter acquisition module is used to obtain the variant state transition matrix of the IoT platform and the probability distribution of the target user's page state on each front-end page from the back end and add them to the page cache when the target user logs into the IoT platform. The cache reading module is used to determine whether the first callback interface ID corresponding to the first front-end page exists in the page cache when the target user accesses the first front-end page. The page loading module is used to load the page by obtaining the corresponding preprocessed data according to the first callback interface ID when the first callback interface ID exists in the page cache, and otherwise, to call the regular interface to perform business logic data processing and page loading. The transition probability determination module is used to determine the k-step transition probability of each slow-loading page based on the current page state, the variant state transition matrix, and the page state probability distribution when the first front-end page has finished loading. The page preloading module is used to take the slow-loading pages with a k-step transition probability greater than a preset probability threshold as preloaded pages, call the preloading asynchronous interface to process the business logic data of the preloaded pages in the backend, and return the callback interface ID corresponding to the preloaded pages to the page cache.
5. An electronic device, characterized in that, The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, it implements the steps of the IoT platform front-end page preloading method as described in any one of claims 1 to 3.
6. A storage medium, said storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the IoT platform front-end page preloading method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and equipment for realizing quick loading of webpage on the basis of big data
CN107943803A
Method and device for preloading webpage, storage medium and electronic device
CN109753615A