Internet of Things platform front-end page preloading method and device, electronic equipment and medium
Through the preloading method, the variant state transfer matrix and page state probability distribution are used to process the back-end business logic data in advance, solving the problem of slow page loading speed on the front-end Internet of Things platform and improving loading efficiency and user experience.
Patent Information
- Application Number
- CN202411692472.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The loading speed of the front-end page of the IoT platform depends on the speed of obtaining data from the back-end service, especially when the page content is complex and the back-end interface processes complicated business logic, resulting in the user waiting time being too long, affecting the loading efficiency and user experience.
Through the preload method, the variant state transfer matrix and page state probability distribution are used to predict the probability of users accessing slow-loaded pages, process the business logic data of the preloaded pages in advance on the backend, and return the callback interface ID to reduce the waiting time during user access.
It greatly reduces the waiting time when users access slow loading pages, improves the data loading efficiency of front-end pages and the user's browsing experience, especially when the content is complex and the back-end loading speed is slow.
Smart Images

Figure CN119788668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a method, device, electronic device and medium for preloading a front-end page of an Internet of Things platform. Background Art
[0002] The information display page of the current IoT connection management platform web client will show customers detailed information about the SIM card under their name, including product instance information, functional product details, and subscription package details. All information is stored in the database of the IoT platform. When a customer visits a specific page, the front end obtains detailed information by calling multiple query interfaces provided by the back end and displays it on the page. At the same time, customers can also reach other service pages provided by the IoT platform through various links on the page, such as machine card diagnosis, package subscription, and fault submission. Some pages display very complex content, and the required data information is distributed in dozens of data tables in different libraries. Dozens of back-end interfaces need to be called to obtain information. Some pages need to call external system interfaces to obtain information. Only when all the information displayed by the front-end page is obtained, the page will be loaded and available for customers to read. In other words, the loading speed of the front-end page depends on the speed of obtaining data from the back-end service. Some pages need to display complex content, and the back-end interface will take a lot of time to process complex business logic. The traditional real-time call back-end interface method will cause customers to wait for the back-end service to complete the business logic before they can see the page content after clicking to jump, which affects the loading efficiency of the front-end page of the IoT platform and the user's browsing experience. Summary of the invention
[0003] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0004] To this end, an object of an embodiment of the present invention is to provide a method for preloading a front-end page of an Internet of Things platform, which improves the loading efficiency of the front-end page of the Internet of Things platform and the browsing experience of users.
[0005] Another object of an embodiment of the present invention is to provide a front-end page preloading device for an Internet of Things platform.
[0006] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0007] On the one hand, an embodiment of the present invention provides a method for preloading a front-end page of an Internet of Things platform, comprising the following steps:
[0008] When the target user logs in to the Internet of Things platform, the variant state transition matrix of the Internet of Things platform and the page state probability distribution of the target user on each front-end page are obtained from the back-end and added to the page cache;
[0009] When the target user accesses the first front-end page, determining whether there is a first callback interface ID corresponding to the first front-end page in the page cache;
[0010] When the first callback interface ID exists in the page cache, the corresponding pre-processed data is obtained according to the first callback interface ID to load the page; otherwise, the conventional interface is called to process the business logic data and load the page;
[0011] 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;
[0012] The slow loading page whose k-step transfer probability is greater than a preset probability threshold is used as a preloading page, and the preloading asynchronous interface is called to process the business logic data of the preloading page in the backend, and the callback interface ID corresponding to the preloading page 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 by the following steps:
[0014] Obtain a first operation process record of each visit of all users to the Internet of Things platform within a first preset historical period;
[0015] Determine a plurality of first page state sequences corresponding to the Internet of Things platform according to the first operation process record, and determine the variant state transfer matrix of the Internet of Things platform according to the first page state sequence;
[0016] Obtain a second operation process record of each visit of the target user to the Internet of Things platform within a second preset historical period;
[0017] A plurality of second page state sequences corresponding to the target user are determined according to the second operation process record, and a probability distribution of the page states of the target user on each front-end page is determined according to the second page state sequences.
[0018] Further, in one embodiment of the present invention, determining a plurality of first page state sequences corresponding to the Internet of Things platform according to the first operation process record, and determining the variant state transition matrix of the Internet of Things platform according to the first page state sequence specifically includes:
[0019] Determine a plurality of front-end pages and corresponding page states and operation times according to the first operation process record, generate page-state elements according to the front-end pages and the corresponding page states, and then sort the page-state elements according to the operation time to obtain the first page state sequence;
[0020] According to the first page state sequence, the probability of jumping from each of the page-state elements to other front-end pages is counted to obtain a corresponding jump probability element;
[0021] The variant state transition matrix is generated according to the jump probability elements.
[0022] Further, in one embodiment of the present invention, determining a plurality of 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 sequence, specifically includes:
[0023] Determine a plurality of front-end pages and corresponding page states and operation times according to the second operation process record, generate page-state elements according to the front-end pages and the corresponding page states, and then sort the page-state elements according to the operation time to obtain the second page state sequence;
[0024] According to the second page state sequence, the probability of the front-end page being in each front-end page state when jumping to each front-end page is counted to obtain a corresponding probability distribution element;
[0025] The page status probability distribution of the target user on each front-end page is generated according to the probability distribution elements.
[0026] Further, in one embodiment of the present invention, 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, which specifically includes:
[0027] Obtaining a plurality of preset slow loading pages and corresponding k values;
[0028] Determine a first page-state element according to the first front-end page and the current page state;
[0029] The probability of reaching each of the slow-loading pages after k jumps from the first page-state element is calculated according to the variant state transition matrix and the page state probability distribution, and the k-step transition probability of each of the slow-loading pages is obtained.
[0030] Further, in one embodiment of the present invention, the slow loading page and the corresponding k value are obtained by the following steps:
[0031] Obtaining the first loading duration of each front-end page visited by all users during a third preset historical period;
[0032] Determine the historical average loading time of each front-end page according to the first loading time;
[0033] Determine the front-end page whose historical average loading time is greater than or equal to a preset time threshold as the slow loading page;
[0034] The corresponding k value is determined according to the historical average loading time of the slow loading page.
[0035] Furthermore, the k-step transition probability is calculated by the following formula:
[0036]
[0037] in, represents the probability of jumping from state l of page i to page j after 1+n steps, represents the probability of jumping from state l of page i to page m after one step, p m (x) represents the probability that page m is in state x when jumping to page m, represents the probability of jumping from state x of page m to page j after n steps, I represents the page set, L m Representing the state set 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, and recursively calculate through the above formula to obtain the k-step transfer probability of page j.
[0038] On the other hand, an embodiment of the present invention provides a front-end page preloading device for an Internet of Things platform, comprising:
[0039] A parameter acquisition module is used to obtain the variant state transfer matrix of the IoT platform and the page state probability distribution of the target user on each front-end page from the back-end and add them to the page cache when the target user logs in to the IoT platform;
[0040] A cache reading module, used for determining whether a first callback interface ID corresponding to the first front-end page exists in the page cache when a target user accesses the first front-end page;
[0041] A page loading module, configured to, when the first callback interface ID exists in the page cache, obtain corresponding pre-processed data according to the first callback interface ID to load the page, and vice versa, call a conventional interface to process business logic data and load the page;
[0042] A transition probability determination module, configured to determine, when the first front-end page is loaded, the k-step transition probability of each slow-loading page according to the current page state, the variant state transition matrix and the page state probability distribution;
[0043] The page preloading module is used to use the slow loading page whose k-step transfer probability is greater than a preset probability threshold as the preloading page, call the preloading asynchronous interface to process the business logic data of the preloading page at the back end, and return the callback interface ID corresponding to the preloading page to the page cache.
[0044] On the other hand, an embodiment of the present invention 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 realizing connection and communication between the processor and the memory. When the program is executed by the processor, the method for preloading the front-end page of the Internet of Things platform as described above is realized.
[0045] On the other hand, an embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the Internet of Things platform front-end page preloading method as described above.
[0046] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:
[0047] In an embodiment of the present invention, when a target user logs into the Internet of Things platform, a variant state transfer matrix of the Internet of Things platform and a page state probability distribution of the target user on each front-end page are obtained from the back-end and added to the page cache. When the target user accesses the first front-end page, it is determined whether there is a first callback interface ID corresponding to the first front-end page in the page cache. When the first callback interface ID exists in the page cache, corresponding pre-processing data is obtained according to the first callback interface ID to load the page. Otherwise, a conventional interface is called to process business logic data and load the page. When the first front-end page is loaded, the k-step transfer probability of each slow-loading page is determined according to the current page state, the variant state transfer matrix and the page state probability distribution. The slow-loading page with a k-step transfer probability greater than a preset probability threshold is used as a pre-loading page. The pre-loading asynchronous interface is called to process the business logic data of the pre-loading page at the back-end, and the callback interface ID corresponding to the pre-loading page is returned to the page cache. The embodiment of the present invention optimizes the data loading process of the front-end page, predicts the probability of the target user accessing the slow-loading page after several steps based on the variant state transition matrix of all users jumping between different front-end pages and the page state probability distribution of the target user on each front-end page, calls the preloading asynchronous interface according to the prediction result to process the business logic data of the preloaded page at the back end, and returns the callback interface ID, and calls the callback interface to obtain the preprocessed data for page loading when the target user actually accesses the slow-loading page, which greatly reduces the waiting time when the user accesses the slow-loading page, provides sufficient time for the front-end page to obtain data, and reduces the user's browsing jam even when the query content is numerous, the query logic is complex, and the back-end loading speed is slow, thereby improving the loading efficiency of the front-end page of the Internet of Things platform and the user's browsing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 A flowchart of a method for preloading a front-end page of an Internet of Things platform provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of instructions for a method for preloading a front-end page of an Internet of Things platform provided by an embodiment of the present invention;
[0051] Figure 3 A flowchart of steps for determining a variant state transition matrix and a page state probability distribution provided by an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of an operation flow record provided by an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of a user jumping between multiple front-end pages provided by an embodiment of the present invention;
[0054] Figure 6 A step flow chart of step S202 provided in an embodiment of the present invention;
[0055] Figure 7 A step flow chart of step S204 provided in an embodiment of the present invention;
[0056] Figure 8 A step flow chart of step S104 provided in an embodiment of the present invention;
[0057] Fig. 9 A flowchart of steps for determining a slow loading page and a corresponding k value provided by an embodiment of the present invention;
[0058] Fig.10 A schematic diagram of the structure of a front-end page preloading device for an Internet of Things platform provided by an embodiment of the present invention;
[0059] Fig.11 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;
[0060] Fig.12 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0062] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0063] The method for preloading the front-end page of the Internet of Things platform provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the method for preloading the front-end page of the Internet of Things platform, etc., but is not limited to the above forms.
[0064] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present 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. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0065] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0066] At present, the data displayed on most of the pages of the IoT connection management platform web user end depends on the back-end service to query in real time according to the business logic. When the user visits the page, the front end will send the query interface to the back end. Some pages need to display complex content, and the back-end interface will take a lot of time to process the complicated business logic. The traditional way of calling the back-end interface in real time will cause the user to wait for the back-end service to complete the business logic before seeing the page content after clicking the jump. However, all operations of the user logging into the IoT connection management platform have certain processes and regularities, and the user stays on the current interface for a certain period of time. If the system can infer what the user will do next, it can "notify" the back-end service to start preparing data in advance. When the user actually visits, since the back-end service has prepared the data in advance, it can directly return the data to the front end, omitting the intermediate process of business query and reducing the actual waiting time of the user.
[0067] The embodiment of the present invention optimizes the data loading process of the front-end page, predicts the probability of the target user accessing the slow-loading page after several steps based on the variant state transition matrix of all users jumping between different front-end pages and the page state probability distribution of the target user on each front-end page, calls the preloading asynchronous interface according to the prediction result to process the business logic data of the preloaded page at the back end, and returns the callback interface ID, and calls the callback interface to obtain the preprocessed data for page loading when the target user actually accesses the slow-loading page, which greatly reduces the waiting time when the user accesses the slow-loading page, provides sufficient time for the front-end page to obtain data, and reduces the user's browsing jam even when the query content is numerous, the query logic is complex, and the back-end loading speed is slow, thereby improving the loading efficiency of the front-end page of the Internet of Things platform and the user's browsing experience.
[0068] like Figure 1 FIG. 1 is a flowchart of a method for preloading a front-end page of an Internet of Things platform provided by an embodiment of the present invention, referring to FIG. Figure 1The embodiment of the present invention provides a method for preloading a front-end page of an Internet of Things platform, which specifically includes the following steps:
[0069] S101, when the target user logs in to the Internet of Things platform, the variant state transition matrix of the Internet of Things platform and the probability distribution of the page state of the target user on each front-end page are obtained from the back-end and added to the page cache;
[0070] S102: When a target user accesses a first front-end page, it is determined whether a first callback interface ID corresponding to the first front-end page exists in the page cache;
[0071] S103, when the first callback interface ID exists in the page cache, the corresponding pre-processed data is obtained according to the first callback interface ID to load the page, otherwise, the conventional interface is called to process the 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 according to the current page state, the variant state transition matrix and the page state probability distribution;
[0073] S105, taking the slow loading page whose k-step transfer probability is greater than the preset probability threshold as the preloading page, calling the preloading asynchronous interface to process the business logic data of the preloading page in the backend, and returning the callback interface ID corresponding to the preloading page to the page cache.
[0074] like Figure 2 The present invention provides an instruction diagram of a front-end page preloading method for an Internet of Things platform provided by an embodiment of the present invention. When a user logs in to the platform, the front-end page calls an interface to obtain a variant state transition matrix and a probability distribution of each page state of the user from the back-end. When the user accesses the front-end page, the page cache is first checked to see if there is a callback interface ID. If there is, it means that the preloading asynchronous interface has been called. Then, the callback interface is directly called through the ID to immediately obtain the processed data from the back-end for loading and display. If there is no callback interface ID or the callback interface fails to be called, the conventional process is followed, and the data is returned after the back-end processes the business logic. When 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 a threshold, the preloading asynchronous interface is called, and the back-end starts to process the business logic in advance and returns a callback ID. If the user really visits the page, the front-end can immediately obtain the prepared data from the back-end through the callback ID, thereby saving a lot of time for loading pages and optimizing the user experience.
[0075] like Figure 3FIG. 1 is a flowchart of a step of determining a variant state transition matrix and a page state probability distribution according to an embodiment of the present invention, referring to FIG. Figure 3 As an optional implementation, the variant state transition matrix and the page state probability distribution are obtained by the following steps:
[0076] S201, obtaining a first operation process record of each visit of all users to the Internet of Things platform within a first preset historical period;
[0077] S202, determining a plurality of first page state sequences corresponding to the Internet of Things platform according to the first operation process record, and determining a variant state transfer matrix of the Internet of Things platform according to the first page state sequences;
[0078] S203, obtaining a second operation process record of each visit of the target user to the Internet of Things platform within a second preset historical period;
[0079] S204: Determine multiple second page state sequences corresponding to the target user according to the second operation process record, and determine the page state probability distribution of the target user on each front-end page according to the second page state sequence.
[0080] Specifically, each time a user logs into the IoT connection management platform, the front end records the page state sequence visited during the period, and when the user logs out, it sends the sequence to the back end, which stores the sequence in the database. Every month, the variant state transition matrix is calculated using the records of all users in the library, and every 7 days, each user is traversed to calculate the probability distribution of their page states, ensuring that both are timely.
[0081] From logging into the IoT connection management platform to exiting the page, users will visit each page on the platform in turn according to their needs and the information fed back by the page, until they exit the platform after satisfying their needs. The tth page browsed by the user in this process is regarded as a random variable X t , the random variable sequence X after sequential arrangement is {X1,X2,...,X n} represents the entire operation process of the user logging into the platform this time, for example, X = {X1 = SIM card information details, X2 = product information details, X3 =
[0082] Card diagnosis, X4 = usage query, X5 = exit} records the entire process of a user using the platform, from logging in to viewing SIM-related information, to card diagnosis, finding problems, to querying usage, and finally exiting the platform. Since the services provided by the IoT connection management platform are limited, the pages that all users can access can be regarded as a finite set S, and each X tAll of them should be taken from the set S. By numbering each page, we can get a positive integer set I, where each page corresponds to a positive integer.
[0083] Although different users log in to the IoT connection management platform for different purposes, the user's browsing process has two characteristics. First, the next page the user wants to visit is only related to the page currently visited, and has nothing to do with his past browsing history. Take the machine card diagnosis as an example. No matter when the user visits this page, he will generally visit it directly from the homepage (this generally means that the user logs in to the platform for the machine card diagnosis function) or jump from some other page that may display the SIM card status (such as SIM card information query) (representing that the user logs in to the platform to check his SIM card status and finds a problem). If the user is currently browsing the product ordering page, the next page he jumps to is almost unlikely to be machine card binding, because he is unlikely to find that one of his SIM cards has a fault from the product ordering page. Second, different users will get different results when visiting the same page, and different content on the same page will affect the next page. This is obvious. It is also a SIM card status page. Obviously, when a card is deactivated, the user is more likely to visit the machine card diagnosis on the next page.
[0084] Therefore, based on this feature, it can be considered that each time a user visits the IoT connection management platform, the behavior is a variant Markov chain. Some states in this Markov chain will be concretized into different situations after actual arrival, resulting in an impact on the subsequent transition probability. After calculating the corresponding variant state transfer matrix, combined with the user's current page, it is possible to infer the page that the user may visit later.
[0085] A Markov chain is a random process in which the probability of state transition at any time depends only on the current state: X =
[0086] {X1,X2,...,X n}. When the state set S is finite, we call p ij =P(X t+1 =j|X t =i), i,j∈I is a Markov chain {X t}, called P = (p ij )i,j∈I is the one-step transition probability matrix (referred to as the state transfer matrix).
[0087] Now we introduce the concept of variant Markov chain: among all states, there are some states that form a state group: For these states, only p can be calculated ji and every But it is impossible to calculate each That is, we only know the probability of transferring from other states to the group, but we cannot know the probability of transferring to a specific state in the group. However, starting from each state in the group, the probability of transferring to other states is known. We call this feature one-way fuzziness. In this case, the state transfer matrix becomes a rectangle with unequal length and width, which we call the variant state transfer matrix.
[0088] In this case, each positive integer in I represents a state group in the Markov chain, and an additional positive integer subscript is used to represent each state in the state group. For a state group with only one state, the subscript can be omitted, which is called For a Markov chain {X t}, called is the variant state transfer matrix. For example, a Markov chain has 4 states, two of which form a state group, then these 4 states are recorded as {1, 2, 31, 32}, and its variant state transfer matrix can be expressed as:
[0089]
[0090] like Figure 4 The figure shows a schematic diagram of the operation process record provided by an embodiment of the present invention. A series of browsing behaviors of a user after logging into the platform can be recorded using Figure 4 The one-way graph containing status information is represented in . The page status of the IoT connection management platform is limited. According to the functions actually provided by the IoT connection management platform and the situations that users may face when accessing, the page names and corresponding integer numbers can be listed in an enumerated manner. Each page is a status group. For pages that do not provide data information (such as package subscription, SMS sending), it can be considered that there is only a single state, but for some pages with a large amount of information, it is necessary to further subdivide according to the business scenario and list different scenarios as specific states within the status group. For example, if the SIM card information query page has a downtime card and the SIM card information query page has all cards in use, they will be listed as two specific states within the SIM card information query page status group. If 1 is used to represent the SIM card information query page, the downtime card and all cards in use on the page will be represented as 11 and 12 respectively, and L will be used to represent the downtime card and all cards in use on the page. i To represent the set of all specific state subscripts of state group i.
[0091] like Figure 5The figure shows a schematic diagram of a user jumping between multiple front-end pages provided by an embodiment of the present invention. Based on the process in the above figure, the user repeatedly jumps from one page to another according to a certain probability until the result of a certain jump is exit ('exit' is also regarded as a page, and the probability of jumping from the 'exit' page to any other page is 0. Visiting the 'exit' page means the end of the random process and the user's visit is terminated).
[0092] The sequence of pages that each user traverses from the login page to the final exit from the platform can be expressed as During this period, a total of nt page jumps occurred, For sequence X (t) The number of jumps from the lth state of page i to page j in (for pages with only one state, the subscript is omitted), there are When the user clicks to log out, the front-end page can send the operation sequence of the user after logging into the platform to the back-end through the interface and store it in the database.
[0093] like Figure 6 FIG. 1 is a flow chart of step S202 provided in an embodiment of the present invention, referring to FIG. Figure 6 As an optional implementation, multiple first page state sequences corresponding to the Internet of Things platform are determined according to the first operation process record, and a variant state transition matrix of the Internet of Things platform is determined according to the first page state sequence, which specifically includes:
[0094] S2021. Determine a plurality of front-end pages and corresponding page states and operation times according to the first operation process record, generate page-state elements according to the front-end pages and the corresponding page states, and then sort the page-state elements according to the operation time to obtain a first page state sequence;
[0095] S2022, counting the probability of jumping from each page-state element to other front-end pages according to the first page state sequence, and obtaining a corresponding jump probability element;
[0096] S2023. Generate a variant state transfer matrix according to the jump probability elements.
[0097] Specifically, we collect the operation sequences of all users who logged into the platform in the past month and obtain a sequence set {X (t)}, summarize all members in the set to get a count matrix:
[0098]
[0099]
[0100] remember:
[0101]
[0102] Then we have:
[0103]
[0104] P is the variant state transition matrix of the Markov chain of user access platform, where each Represents the probability that a user jumps from state l of page i to page j.
[0105] like Figure 7 FIG. 1 is a flow chart of step S204 provided in an embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, multiple second page state sequences corresponding to the target user are determined according to the second operation process record, and the page state probability distribution of the target user on each front-end page is determined according to the second page state sequence, which specifically includes:
[0106] S2041, determining a plurality of front-end pages and corresponding page states and operation times according to the second operation process record, generating page-state elements according to the front-end pages and the corresponding page states, and then sorting the page-state elements according to the operation time to obtain a second page state sequence;
[0107] S2042, counting the probabilities 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, and obtaining corresponding probability distribution elements;
[0108] S2043. Generate a page status probability distribution of the target user on each front-end page according to the probability distribution elements.
[0109] Specifically, if it is a regular Markov chain, use the formula by recursion: The k-step transition probability can be easily calculated, but after the introduction of the state group and one-way fuzzy concepts, the variant state transition matrix alone cannot calculate the k-step transition probability of more than one step, because before reaching a page, we cannot know which state of the page we have reached. 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 state i l The probability of . In this case, the recursion uses a variation of the normal formula:
[0110]
[0111] You can calculate The probability of reaching page j after k steps from state l of page i.
[0112] For each user, based on the user's records of accessing the IoT connection management platform in the past 7 days, count the number of times each state of each multi-state page has been accessed by the user, and record is the number of times the page status is l when the user visits page i in the past 7 days. For this user, the probability distribution of the page status of page m is:
[0113] like Figure 8 FIG. 1 is a flowchart of step S104 provided in an embodiment of the present invention, referring to FIG. Figure 8 As an optional implementation, 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, which specifically includes:
[0114] S1041, obtaining a plurality of preset slow loading pages and corresponding k values;
[0115] S1042, determining a first page-state element according to the first front-end page and the current page state;
[0116] S1043. Calculate the probability of reaching each slow-loading page after k jumps from the first page-state element according to the variant state transition matrix and the 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 by the following formula:
[0118]
[0119] in, represents the probability of jumping from state l of page i to page j after 1+n steps, represents the probability of jumping from state l of page i to page m after one step, p m (x) represents the probability that page m is in state x when jumping to page m, represents the probability of jumping from state x of page m to page j after n steps, I represents the page set, L m Representing the state set 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 the above formula, we can get the k-step transition probability of page j.
[0120] Specifically, in the above formula, the variant state transfer matrix reflects the jump logic of the user group when using the IoT connection management platform, and the page state probability distribution calculated for a specific user reflects the information that the specific user may obtain when accessing the platform. Combining the two, for page j that usually loads slowly, the variant formula can be used to calculate the probability of the user accessing page j after k jumps when the page currently visited is i and the page state is l. If this probability exceeds a certain threshold, the system can load the page content in advance and achieve instant loading when the user actually visits it.
[0121] like Fig. 9 FIG. 1 is a flowchart of a step of determining a slow loading page and a corresponding k value provided by an embodiment of the present invention, referring to FIG. Fig. 9 As an optional implementation, the slow loading page and the corresponding k value are obtained by the following steps:
[0122] S301, obtaining the first loading duration of each front-end page visited by all users during a third preset historical period;
[0123] S302, determining the historical average loading time of each front-end page according to the first loading time;
[0124] S303: Determine that a front-end page whose historical average loading time is greater than or equal to a preset time threshold is a slow loading page;
[0125] S304: Determine a corresponding k value according to the historical average loading time of the slow loading page.
[0126] Specifically, the k value should be determined according to the specific loading speed. For pages with slower loading speeds, a larger k value should be used to reserve sufficient data processing time. Assuming that a slow loading page takes an average of 4 seconds to load and display completely, then when calculating the k-step transfer probability from other pages to this page, the k value should be set to at least 3, reserving time for 3 jumps and sending the asynchronous interface in advance to allow the backend to start loading data.
[0127] The above is a description of the method steps of the embodiment of the present invention. It can be recognized that the embodiment of the present invention optimizes the data loading process of the front-end page, predicts the probability of the target user accessing the slow-loading page after several steps based on the variant state transition matrix of all users jumping between different front-end pages and the page state probability distribution of the target user on each front-end page, calls the preload asynchronous interface according to the prediction result to process the business logic data of the preloaded page at the back end, and returns the callback interface ID, and calls the callback interface to obtain the preprocessed data for page loading when the target user actually accesses the slow-loading page, which greatly reduces the waiting time when the user accesses the slow-loading page, provides sufficient time for the front-end page to obtain data, and reduces the phenomenon of user browsing jams even when the query content is numerous, the query logic is complex, and the back-end loading speed is slow, thereby improving the loading efficiency of the front-end page of the Internet of Things platform and the browsing experience of the user.
[0128] like Fig.10 FIG. 1 is a schematic diagram of the structure of the front-end page preloading device of the Internet of Things platform provided by an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides a front-end page preloading device for an Internet of Things platform, comprising:
[0129] The parameter acquisition module is used to obtain the variant state transfer matrix of the IoT platform and the probability distribution of the page state of the target user on each front-end page from the back-end 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] A page loading module, used to obtain corresponding pre-processed data according to the first callback interface ID to load the page when the first callback interface ID exists in the page cache, and vice versa, call the regular interface to process business logic data and load the page;
[0132] A transition probability determination module is used to determine the k-step transition probability of each slow-loading page according to the current page state, the variant state transition matrix and the page state probability distribution when the first front-end page is loaded;
[0133] The page preloading module is used to use the slow-loading page with a k-step transfer probability greater than a preset probability threshold as the preloading page, call the preloading asynchronous interface to process the business logic data of the preloading page in the backend, and return the callback interface ID corresponding to the preloading page to the page cache.
[0134] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present 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] The embodiment of the present invention also provides 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 realizing connection and communication between the processor and the memory, and when the program is executed by the processor, the above-mentioned method for preloading the front-end page of the Internet of Things platform is realized. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0136] like Fig.11 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig.11 , an embodiment of the present invention provides an electronic device, including:
[0137] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an 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 in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the front-end page preloading method of the Internet of Things platform of the embodiment of the present invention;
[0139] Input / output interface 1103, used to implement information input and output;
[0140] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0141] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0142] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0143] like Fig.12 FIG. 1 is a schematic diagram of a storage medium according to an embodiment of the present invention. Fig.12 The embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs 1201, and the one or more programs 1201 can be executed by one or more processors to implement the above-mentioned Internet of Things platform front-end page preloading method.
[0144] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0145] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are 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, so that the computer device executes Figure 1 The method shown.
[0146] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0147] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can 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 present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0148] If the above functions are implemented in the form of 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 the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0149] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0150] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0151] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0152] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0153] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0154] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for preloading a front-end page of an Internet of Things platform, characterized in that: The following steps are involved: When the target user logs in to the Internet of Things platform, the variant state transition matrix of the Internet of Things platform and the page state probability distribution of the target user on each front-end page are obtained from the back-end and added to the page cache; When the target user accesses the first front-end page, determining whether there is a first callback interface ID corresponding to the first front-end page in the page cache; When the first callback interface ID exists in the page cache, the corresponding pre-processed data is obtained according to the first callback interface ID to load the page; otherwise, the conventional interface is called to process the 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; The slow loading page whose k-step transfer probability is greater than a preset probability threshold is used as a preloading page, and the preloading asynchronous interface is called to process the business logic data of the preloading page in the backend, and the callback interface ID corresponding to the preloading page is returned to the page cache.
2. A method for preloading a front-end page of an Internet of Things platform according to claim 1, characterized in that: The variant state transition matrix and the page state probability distribution are obtained by the following steps: Obtain a first operation process record of each visit of all users to the Internet of Things platform within a first preset historical period; Determine a plurality of first page state sequences corresponding to the Internet of Things platform according to the first operation process record, and determine the variant state transfer matrix of the Internet of Things platform according to the first page state sequence; Obtain a second operation process record of each visit of the target user to the Internet of Things platform within a second preset historical period; A plurality of second page state sequences corresponding to the target user are determined according to the second operation process record, and a probability distribution of the page states of the target user on each front-end page is determined according to the second page state sequences.
3. A method for preloading a front-end page of an Internet of Things platform according to claim 2, characterized in that: The determining of a plurality of first page state sequences corresponding to the Internet of Things platform according to the first operation process record, and determining the variant state transition matrix of the Internet of Things platform according to the first page state sequence specifically includes: Determine a plurality of front-end pages and corresponding page states and operation times according to the first operation process record, generate page-state elements according to the front-end pages and the corresponding page states, and then sort the page-state elements according to the operation time to obtain the first page state sequence; According to the first page state sequence, the probability of jumping from each of the page-state elements to other front-end pages is counted to obtain a corresponding jump probability element; The variant state transition matrix is generated according to the jump probability elements.
4. The method for preloading a front-end page of an Internet of Things platform according to claim 2, characterized in that: Determining a plurality of 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 sequence, specifically includes: Determine a plurality of front-end pages and corresponding page states and operation times according to the second operation process record, generate page-state elements according to the front-end pages and the corresponding page states, and then sort the page-state elements according to the operation time to obtain the second page state sequence; According to the second page state sequence, the probability of the front-end page being in each front-end page state when jumping to each front-end page is counted to obtain a corresponding probability distribution element; The page status probability distribution of the target user on each front-end page is generated according to the probability distribution elements.
5. The method for preloading a front-end page of an Internet of Things platform according to claim 1, characterized in that: 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, which specifically includes: Obtaining a plurality of preset slow loading pages and corresponding k values; Determine a first page-state element according to the first front-end page and the current page state; The probability of reaching each of the slow-loading pages after k jumps from the first page-state element is calculated according to the variant state transition matrix and the page state probability distribution, and the k-step transition probability of each of the slow-loading pages is obtained.
6. A method for preloading a front-end page of an Internet of Things platform according to claim 5, characterized in that: The slow loading page and the corresponding k value are obtained by the following steps: Obtaining the first loading duration of each front-end page visited by all users during a third preset historical period; Determine the historical average loading time of each front-end page according to the first loading time; Determine the front-end page whose historical average loading time is greater than or equal to a preset time threshold as the slow loading page; The corresponding k value is determined according to the historical average loading time of the slow loading page.
7. The method for preloading a front-end page of an Internet of Things platform according to claim 5, characterized in that: The k-step transition probability is calculated by the following formula: in, represents the probability of jumping from state l of page i to page j after 1+n steps, represents the probability of jumping from state l of page i to page m after one step, p m (x) represents the probability that page m is in state x when jumping to page m, represents the probability of jumping from state x of page m to page j after n steps, I represents the page set, L m Representing the state set 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, and recursively calculate through the above formula to obtain the k-step transfer probability of page j.
8. A front-end page preloading device for an Internet of Things platform, characterized in that: include: A parameter acquisition module is used to obtain the variant state transfer matrix of the IoT platform and the page state probability distribution of the target user on each front-end page from the back-end and add them to the page cache when the target user logs in to the IoT platform; A cache reading module, used for determining whether a first callback interface ID corresponding to the first front-end page exists in the page cache when a target user accesses the first front-end page; A page loading module, configured to, when the first callback interface ID exists in the page cache, obtain corresponding pre-processed data according to the first callback interface ID to load the page, and vice versa, call a conventional interface to process business logic data and load the page; A transition probability determination module, configured to determine, when the first front-end page is loaded, the k-step transition probability of each slow-loading page according to the current page state, the variant state transition matrix and the page state probability distribution; The page preloading module is used to use the slow loading page whose k-step transfer probability is greater than a preset probability threshold as the preloading page, call the preloading asynchronous interface to process the business logic data of the preloading page at the back end, and return the callback interface ID corresponding to the preloading page to the page cache.
9. 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 realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the front-end page preloading method of the Internet of Things platform as described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the Internet of Things platform front-end page preloading method as described in any one of claims 1 to 7.
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
Page display method and device, apparatus and storage medium
CN110889064A
Static resource preloading method and device
CN113392358A
Page access method and page access device
CN113779450A