CN111273964A - Data loading method and device - Google Patents

Data loading method and device Download PDF

Info

Publication number
CN111273964A
CN111273964A CN202010093271.1A CN202010093271A CN111273964A CN 111273964 A CN111273964 A CN 111273964A CN 202010093271 A CN202010093271 A CN 202010093271A CN 111273964 A CN111273964 A CN 111273964A
Authority
CN
China
Prior art keywords
data
url
service
service data
acquisition request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010093271.1A
Other languages
Chinese (zh)
Other versions
CN111273964B (en
Inventor
黄辉泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010093271.1A priority Critical patent/CN111273964B/en
Publication of CN111273964A publication Critical patent/CN111273964A/en
Application granted granted Critical
Publication of CN111273964B publication Critical patent/CN111273964B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a data loading method and device, including: responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL; and after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface.

Description

Data loading method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data loading method and apparatus.
Background
After a user clicks a link, the user side can obtain a hypertext Markup Language (html) document corresponding to the link from a server according to the link clicked by the user, analyze the html document, obtain page data, and load a page according to the obtained page data; after the page data is loaded, the server obtains corresponding service data according to a Uniform Resource Locator (URL) obtained by analyzing the html document, and loads the returned service data in the page after receiving the service data returned by the server.
However, in this process, the user parses the html document, loads the page according to the page data, and acquires the service data are sequentially executed, and after the user initiates a service data acquisition request to the server, the user still needs to wait for the server to return the service data, so this method is likely to cause slow loading of the service data.
Disclosure of Invention
The embodiment of the disclosure at least provides a data loading method and device.
In a first aspect, an embodiment of the present disclosure provides a data loading method, including:
responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
and after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface.
In a possible implementation manner, the determining, according to the target link, at least one first URL corresponding to the target link includes:
and searching the at least one first URL configured for the target link in advance according to the target link.
In a possible implementation manner, after the service template interface is loaded according to the html document and service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface includes:
after the service template interface corresponding to the html document is loaded, determining a second URL corresponding to the html document; the second URL belongs to the at least one first URL;
and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation manner, the loading, on the service template interface, the received service data corresponding to the second URL includes:
after a data resource acquisition request is initiated based on the at least one first URL, acquiring service data corresponding to the second URL from service data corresponding to the data resource acquisition request cached to the local, and loading the received service data corresponding to the second URL on the service template interface.
In a possible embodiment, the method further comprises:
and if the time interval between the receiving moment of the service data corresponding to the second URL cached to the local and the current moment is detected to be larger than the preset time interval, initiating a data resource acquisition request again based on the second URL, and loading the received service data on the service template interface.
In a possible embodiment, the method further comprises:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
In a second aspect, an embodiment of the present disclosure further provides a data loading apparatus, including:
the processing module is used for responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
and the loading module is used for loading the service data on the service template interface after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received.
In a possible implementation manner, when determining, according to the target link, at least one first URL corresponding to the target link, the processing module is configured to:
and searching the at least one first URL configured for the target link in advance according to the target link.
In a possible implementation manner, after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, the loading module is configured to, when the service data is loaded on the service template interface:
after the service template interface corresponding to the html document is loaded, determining a second URL corresponding to the html document; the second URL belongs to the at least one first URL;
and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation manner, when the service template interface loads the received service data corresponding to the second URL, the loading module is configured to:
after a data resource acquisition request is initiated based on the at least one first URL, acquiring service data corresponding to the second URL from service data corresponding to the data resource acquisition request cached to the local, and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation, the processing module is further configured to:
and if the time interval between the receiving moment of the service data corresponding to the second URL cached to the local and the current moment is detected to be larger than the preset time interval, initiating a data resource acquisition request again based on the second URL, and loading the received service data on the service template interface.
In a possible implementation, the processing module is further configured to:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
According to the data loading method provided by the embodiment of the disclosure, after a click operation for a target link is detected, an html document corresponding to the target link is obtained from a server, a service template interface is loaded according to the html document, a URL corresponding to the target link is determined while the html document is obtained, a data resource obtaining request is initiated according to the URL, and service data can be directly loaded according to the received service data after the service template interface is loaded.
In an implementation manner of the embodiment of the present disclosure, when a time interval between a receiving time of service data and a current time is greater than a preset time interval, the service data cached locally is deleted, and a request for obtaining the service data is re-issued, so that the real-time performance of the service data loaded on the interface is ensured.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 shows a flowchart of a data loading method provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating a service template page provided by an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a data loading apparatus provided in an embodiment of the present disclosure;
fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Generally, after clicking a link of a user terminal, a user may initiate a page data loading request to a server, and the server may return corresponding page data to the user terminal according to the page data loading request, where the page data is in the form of an html document in general, and after receiving the html document, the user terminal may load a corresponding page according to the html document, but the page does not include specific service data, for example, the page loaded by the html document may include personal information, but only has attributes such as name, gender, age, and the like, and does not include specific attribute values; therefore, the user side is also required to parse the html document to obtain the URL, and then initiate a data obtaining request according to the URL to obtain the corresponding service data.
In the process, since the loading of the page data and the acquisition of the service data are sequentially executed, after the user initiates the data acquisition request, the server searches and returns the corresponding service data according to the received data acquisition request, and in the process, the user clicks the link, and waiting time is needed between the time when the user initiates the data acquisition request and the time when the server receives the data acquisition request and the time when the server returns the service data to the user, so that the method easily causes slow loading of the service data.
Based on this, according to the data loading method provided by the disclosure, after the click operation for the target link is detected, the html document corresponding to the target link is obtained from the server, the service template interface is loaded according to the html document, the URL corresponding to the target link is determined while the html document is obtained, the data resource obtaining request is initiated according to the URL, the service data can be directly loaded according to the received service data after the service template interface is loaded, and the loading of the service template interface and the request of the service data are performed synchronously, so that the waiting time in the data loading process is reduced, and the data loading efficiency is improved.
In addition, in order to improve data loading efficiency in the related art, a preloading mode is adopted, service data of all links corresponding to the current page are stored locally in advance, and when a user clicks any link in the current page, the service data stored locally is directly acquired. In this implementation manner, if the user browses the current page for too long time, since the service data cached in the local area cannot be updated, when the data loaded by the link clicked by the user after browsing for a period of time is pre-stored in the local area, the real-time performance of the data is poor.
In an implementation manner of the embodiment of the present disclosure, when a time interval between a receiving time of service data and a current time is greater than a preset time interval, the service data cached locally is deleted, and a request for obtaining the service data is re-issued, so that the real-time performance of the service data loaded on the interface is ensured.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
The technical solutions in the present disclosure will be described clearly and completely with reference to the accompanying drawings in the present disclosure, and it is to be understood that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. The components of the present disclosure, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
To facilitate understanding of the present embodiment, first, a data loading method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the data loading method provided in the embodiments of the present disclosure is generally an electronic device with a display capability and a certain computing capability, and the electronic device may be, for example, a smart phone, a personal computer, a tablet computer, and the like.
Referring to fig. 1, a flowchart of a data loading method provided in the embodiment of the present disclosure is shown, where the method is applied to a user side, and includes the following steps:
step 101, responding to a click operation of a target link, acquiring a html document of a hypertext markup language corresponding to the target link, and loading a service template interface according to the html document; and determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL.
And step 102, after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface.
The clicking operation on the target link includes, but is not limited to, clicking, double clicking, long pressing, re-pressing, and the like. After the click operation for the target link is detected, a hypertext link html document corresponding to the target link can be obtained from the server according to the target link, and the html document contains page data of a page corresponding to the target link. And after receiving the html document returned by the server, the user side can analyze the html document and load a corresponding service template page according to the analyzed html document.
In a possible implementation manner, the html document corresponding to each link can be stored locally at the user terminal, and after a click operation for the target link is detected, the html document corresponding to the target link can be searched locally.
Specifically, the user side can create a Webview container, then parse the html document based on Webview, and load page data contained in the html document.
The business template page includes an attribute corresponding to the target link, but the business template page does not include an attribute specific attribute value, for example, the business template page may be as shown in fig. 2, where attributes "name", "gender", and "age" are shown in the graph, but an attribute value under each attribute belongs to business data, and the attribute value is null when the business template page is loaded.
When determining the at least one first uniform resource locator URL corresponding to the target link based on the target link, the at least one first URL configured for the target link in advance may be searched according to the target link. Specifically, the user side may parse the URL of the currently displayed page, and then determine at least one first URL configured for the target link.
It should be noted that, acquiring an html document corresponding to a target link, loading a service template interface according to the html document, determining at least one first uniform resource cost URL corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL are executed in parallel at a user side.
After the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, when the service data is loaded on the service template interface, the method may be specifically executed, after the service template interface corresponding to the html document is loaded, a second URL corresponding to the html document is determined, and then the received service data corresponding to the second URL is loaded in the service template interface. Wherein the second URL belongs to one of the first URLs.
In practical application, there may be M types of service data in the page corresponding to the target link, but after the user clicks the target link, the service data that needs to be currently displayed in the page may only be N of the M types of service data, and therefore, the method provided by the embodiment of the present disclosure only loads the service data corresponding to the second URL when loading the service data.
After initiating the data resource acquisition request based on the first URL, the user side may cache the initiated data resource acquisition request locally, and if service data corresponding to any data resource request is received, cache the received service data locally.
In a possible implementation manner, the loading of the received service data corresponding to the second URL in the service template page may be that after initiating a data resource acquisition request based on at least one first URL, the service data corresponding to the second URL is acquired from service data corresponding to the data resource acquisition request cached in the local, and the received service data corresponding to the second URL is loaded in the service template interface.
The service data corresponding to the data resource obtaining request cached locally includes two possible situations, one possible situation is that the data resource obtaining request is initiated based on the second URL, and the service data corresponding to the second URL is already received before the service template page is loaded, and the received service data is cached locally (the first URL includes the second URL, so that initiating the data resource obtaining request based on the first URL includes initiating the data resource obtaining request based on the second URL); another possible situation is that a data resource acquisition request is initiated based on the second URL, and the service data corresponding to the second URL is not received before the service template page is loaded, and after waiting for a period of time, the user side receives the service data corresponding to the second URL and caches the service data to the local, and acquires the service data from the local.
For the first situation, when the service data corresponding to the second URL is loaded in the service template interface, the service data corresponding to the second URL may be directly obtained from the locally cached service data; for the second case, the user side may wait for the server to return the service data, and after receiving the returned service data, when it is needed to load in the service template interface, obtain the service data from the local cache.
In a possible implementation manner, when the user side acquires the service data corresponding to the second URL that needs to be loaded into the service template interface from the service data cached locally, the user side may periodically acquire the service data corresponding to the second URL, and directly acquire the service data corresponding to the second URL and load the acquired service data in the service template interface if the service data corresponding to the second URL is stored in the local cache; if the service data cached in the local cache does not include the service data corresponding to the second URL, but the local cache stores a data resource acquisition request initiated based on the second URL, in this case, it may be detected whether the service data corresponding to the data resource acquisition request is received from the local cache every preset time duration.
Illustratively, if the time required by the client to load the service template interface is 10ms, the time required by initiating the data resource acquisition request until the service data returned by the server is received is 20ms, and if the service template interface is loaded first and the data resource acquisition request is initiated, the time required by the client to receive the service data is 10ms +20ms, which is 30 ms; based on the method provided by the disclosure, when the user side loads the service template interface, the user side initiates a data resource acquisition request, and after the user side finishes loading the service template interface, the user side only needs to wait for 10ms to acquire service data, and the time required for the user side to receive the service data is 20ms, so that the method provided by the disclosure can improve the data loading efficiency.
In practical application, after the Webview finishes loading the service template interface, the Webview can request service data through the JS based on the second URL, but at the same time, the client intercepts the JS request, and then judges whether the data resource acquisition request cached in the local is matched with the JS request, if a data resource acquisition request matched with the JS request exists in the local and service data corresponding to the data resource acquisition request is cached in the local, the service data is directly used as the service data corresponding to the JS request, and the service data is loaded in the service template interface; if a data resource acquisition request matched with the JS request exists locally but service data corresponding to the data resource acquisition request is not cached locally, the user side may wait for the server to return the service data corresponding to the data resource acquisition request, and load the received service data in the service template interface after receiving the service data returned by the server.
In another possible implementation manner of the present disclosure, if a data resource acquisition request is initiated based on a second URL and service data corresponding to the second URL is not received before the service template page is loaded, if a time interval between an initiation time corresponding to the data resource acquisition request and a current time exceeds a preset time interval, the data resource acquisition request is initiated based on the second URL again.
In another implementation manner, if it is detected that a time interval between the receiving time of the service data corresponding to the second URL cached to the local location and the current time is greater than a preset time interval, in order to ensure real-time performance of the data, the data resource acquisition request is initiated based on the second URL again, and the received service data is loaded on the service template interface.
In summary, the service data loaded on the service template interface may include the following situations:
in case one, a data resource acquisition request has been initiated based on the second URL, and service data fed back by the server based on the data resource acquisition request is not received.
And in the second situation, a data resource acquisition request is initiated based on the second URL, the service data corresponding to the data resource acquisition request is stored in the local cache, and the time interval between the receiving time of the service data and the current time is less than or equal to the preset time interval.
And a third situation, a data resource acquisition request is initiated based on the second URL, service data corresponding to the data resource acquisition request is stored in the local cache, and a time interval between the receiving time of the service data and the current time is greater than a preset time interval.
Because the acquiring of the service data and the loading of the service template interface are performed synchronously, if the loading time process of the service template interface is, for example, 10S, and the time required for acquiring the service data is 2S, when the service template interface loads the service data, the service data cached locally is 8S before the current time, and since data changes frequently, when the time interval between the receiving time of the service data and the current time is greater than the preset time interval, the data resource acquisition request can be initiated based on the second URL again to acquire the service data corresponding to the second URL again, so that the real-time performance of the service data is ensured.
In a possible implementation manner, after receiving the service data corresponding to any data resource request, the service data corresponding to the data resource acquisition request may be cached locally, and in order to improve the utilization rate of the service data cached locally, when the time interval between the time when the service data is received and the current time is greater than the preset time interval, the cached service data and the data resource acquisition request corresponding to the service data may be deleted.
According to the data loading method provided by the embodiment of the disclosure, after a click operation for a target link is detected, an html document corresponding to the target link is obtained from a server, a service template interface is loaded according to the html document, a URL corresponding to the target link is determined while the html document is obtained, a data resource obtaining request is initiated according to the URL, and service data can be directly loaded according to the received service data after the service template interface is loaded.
In an implementation manner of the embodiment of the present disclosure, when a time interval between a receiving time of service data and a current time is greater than a preset time interval, the service data cached locally is deleted, and a request for obtaining the service data is re-issued, so that the real-time performance of the service data loaded on the interface is ensured.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, a data loading device corresponding to the data loading method is also provided in the embodiments of the present disclosure, and as the principle of solving the problem of the device in the embodiments of the present disclosure is similar to the data loading method in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not described.
Referring to fig. 3, a schematic diagram of a data loading apparatus provided in an embodiment of the present disclosure is shown, where the apparatus includes: a processing module 301 and a loading module 302; wherein,
the processing module 301 is configured to respond to a click operation of a target link, obtain an html document of a hypertext markup language corresponding to the target link, and load a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
a loading module 302, configured to load the service data on the service template interface after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received.
In a possible implementation manner, the processing module 301, when determining, according to the target link, at least one first URL corresponding to the target link, is configured to:
and searching the at least one first URL configured for the target link in advance according to the target link.
In a possible implementation manner, after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, the loading module 302 is configured to, when the service data is loaded on the service template interface:
after the service template interface corresponding to the html document is loaded, determining a second URL corresponding to the html document; the second URL belongs to the at least one first URL;
and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation manner, when the service template interface loads the received service data corresponding to the second URL, the loading module 302 is configured to:
after a data resource acquisition request is initiated based on the at least one first URL, acquiring service data corresponding to the second URL from service data corresponding to the data resource acquisition request cached to the local, and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation, the processing module 301 is further configured to:
and if the time interval between the receiving moment of the service data corresponding to the second URL cached to the local and the current moment is detected to be larger than the preset time interval, initiating a data resource acquisition request again based on the second URL, and loading the received service data on the service template interface.
In a possible implementation, the processing module 301 is further configured to:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the application also provides the electronic equipment. Referring to fig. 4, a schematic structural diagram of an electronic device provided in the embodiment of the present application includes a processor 401, a memory 402, and a bus 403. The memory 402 is used for storing execution instructions and includes a memory 4021 and an external memory 4022; the memory 4021 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 401 and data exchanged with the external memory 4022 such as a hard disk, the processor 401 exchanges data with the external memory 4022 through the memory 4021, and when the electronic device 400 operates, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:
responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
and after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface.
In a possible implementation manner, the determining, according to the target link, at least one first URL corresponding to the target link in the instructions executed by the processor 401 includes:
and searching the at least one first URL configured for the target link in advance according to the target link.
In a possible implementation manner, in an instruction executed by the processor 401, after the loading of the service template interface according to the html document and receiving service data corresponding to the data resource acquisition request, the loading of the service data on the service template interface includes:
after the service template interface corresponding to the html document is loaded, determining a second URL corresponding to the html document; the second URL belongs to the at least one first URL;
and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation manner, in the instructions executed by the processor 401, the loading, in the service template interface, the received service data corresponding to the second URL includes:
after a data resource acquisition request is initiated based on the at least one first URL, acquiring service data corresponding to the second URL from service data corresponding to the data resource acquisition request cached to the local, and loading the received service data corresponding to the second URL on the service template interface.
In a possible implementation manner, in the instructions executed by the processor 401, the method further includes:
and if the time interval between the receiving moment of the service data corresponding to the second URL cached to the local and the current moment is detected to be larger than the preset time interval, initiating a data resource acquisition request again based on the second URL, and loading the received service data on the service template interface.
In a possible implementation manner, in the instructions executed by the processor 401, the method further includes:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the data loading method in the foregoing method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product of the data loading method provided in the embodiments of the present disclosure includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the data loading method in the above method embodiments, which may be referred to specifically in the above method embodiments, and are not described herein again.
The embodiments of the present disclosure also provide a computer program, which when executed by a processor implements any one of the methods of the foregoing embodiments. The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for loading data, comprising:
responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
and after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received, loading the service data on the service template interface.
2. The method according to claim 1, wherein the determining, according to the target link, at least one first URL corresponding to the target link comprises:
and searching the at least one first URL configured for the target link in advance according to the target link.
3. The method according to claim 1, wherein the loading the service data on the service template interface after the loading of the service template interface according to the html document and the receiving of the service data corresponding to the data resource acquisition request includes:
after the service template interface corresponding to the html document is loaded, determining a second URL corresponding to the html document; the second URL belongs to the at least one first URL;
and loading the received service data corresponding to the second URL on the service template interface.
4. The method according to claim 3, wherein the loading the received service data corresponding to the second URL on the service template interface includes:
after a data resource acquisition request is initiated based on the at least one first URL, acquiring service data corresponding to the second URL from service data corresponding to the data resource acquisition request cached to the local, and loading the received service data corresponding to the second URL on the service template interface.
5. The method of claim 4, further comprising:
and if the time interval between the receiving moment of the service data corresponding to the second URL cached to the local and the current moment is detected to be larger than the preset time interval, initiating a data resource acquisition request again based on the second URL, and loading the received service data on the service template interface.
6. The method of claim 1, further comprising:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
7. A data loading apparatus, comprising:
the processing module is used for responding to the clicking operation of a target link, acquiring a hypertext markup language html document corresponding to the target link, and loading a service template interface according to the html document; determining at least one first Uniform Resource Locator (URL) corresponding to the target link based on the target link, and initiating a data resource acquisition request based on the at least one first URL;
and the loading module is used for loading the service data on the service template interface after the service template interface is loaded according to the html document and the service data corresponding to the data resource acquisition request is received.
8. The method of claim 1, wherein the processing module is further configured to:
the data resource acquisition request is cached locally; after receiving the service data corresponding to the data resource acquisition request, caching the service data corresponding to the data resource acquisition request in a local area;
and deleting the cached service data and the data resource acquisition request corresponding to the service data when detecting that the time interval between the time of receiving the service data and the current time is greater than the preset time interval.
9. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the data loading method of any one of claims 1 to 6.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the data loading method according to any one of claims 1 to 6.
CN202010093271.1A 2020-02-14 2020-02-14 Data loading method and device Active CN111273964B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010093271.1A CN111273964B (en) 2020-02-14 2020-02-14 Data loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010093271.1A CN111273964B (en) 2020-02-14 2020-02-14 Data loading method and device

Publications (2)

Publication Number Publication Date
CN111273964A true CN111273964A (en) 2020-06-12
CN111273964B CN111273964B (en) 2024-03-08

Family

ID=70997139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010093271.1A Active CN111273964B (en) 2020-02-14 2020-02-14 Data loading method and device

Country Status (1)

Country Link
CN (1) CN111273964B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN112395533A (en) * 2020-11-18 2021-02-23 北京字节跳动网络技术有限公司 Page loading method and device, computer equipment and readable storage medium

Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020188633A1 (en) * 2001-06-06 2002-12-12 Craig Davis Generating HTML using templates and cached files
US7093193B1 (en) * 2000-10-30 2006-08-15 Microsoft Corporation String template pages for generating HTML document
CN101165685A (en) * 2006-10-19 2008-04-23 国际商业机器公司 Dynamic web page generation method and system
KR20090069589A (en) * 2007-12-26 2009-07-01 (주) 디아이지 커뮤니케이션 System and method for transcoding webpage by mobile environment
CN103455473A (en) * 2012-05-30 2013-12-18 刘继业 WEB form definition and application method based on hypertext markup language (HTML)
CN103500199A (en) * 2013-09-24 2014-01-08 北京大学 Webpage rendering accelerating method and system based on pre-loaded Cloud template
CN103984686A (en) * 2013-02-07 2014-08-13 阿里巴巴集团控股有限公司 Page-switching method and device
US20150188981A1 (en) * 2013-12-31 2015-07-02 Huawei Technologies Co., Ltd. Page processing method, apparatus, and system
CN104933020A (en) * 2015-07-17 2015-09-23 北京奇虎科技有限公司 Method and device for generating target documents based on template
CN105630992A (en) * 2015-12-25 2016-06-01 网易(杭州)网络有限公司 Scene display method and device in static page
WO2017107620A1 (en) * 2015-12-23 2017-06-29 北京奇虎科技有限公司 Method and system for loading page data
CN107122398A (en) * 2017-03-17 2017-09-01 武汉斗鱼网络科技有限公司 A kind of data display chart generation method and system
CN107291940A (en) * 2017-07-07 2017-10-24 腾讯科技(深圳)有限公司 Content of pages management method, device and associated server
US20170371974A1 (en) * 2016-06-22 2017-12-28 Guangzhou Ucweb Computer Technology Co., Ltd. Method for loading webpage, client and programmable device
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN109036397A (en) * 2018-06-29 2018-12-18 百度在线网络技术(北京)有限公司 The method and apparatus of content for rendering
CN109684586A (en) * 2018-11-21 2019-04-26 平安科技(深圳)有限公司 Page layout optimization display methods, device, computer equipment and storage medium
CN110162720A (en) * 2019-04-16 2019-08-23 平安科技(深圳)有限公司 Webpage loading method, device, computer equipment and storage medium
CN110168539A (en) * 2017-01-13 2019-08-23 微软技术许可有限责任公司 Fast Page load in mixing application
CN110297999A (en) * 2019-05-09 2019-10-01 京东方科技集团股份有限公司 A kind of web page template generation method and device, webpage loading method and front-end server and Website server
CN110618850A (en) * 2019-08-30 2019-12-27 北京浪潮数据技术有限公司 UI (user interface) loading method and system and related device
CN110688600A (en) * 2019-09-09 2020-01-14 平安普惠企业管理有限公司 Online editing method, device and equipment based on HTML (Hypertext markup language) page and storage medium

Patent Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7093193B1 (en) * 2000-10-30 2006-08-15 Microsoft Corporation String template pages for generating HTML document
US20020188633A1 (en) * 2001-06-06 2002-12-12 Craig Davis Generating HTML using templates and cached files
CN101165685A (en) * 2006-10-19 2008-04-23 国际商业机器公司 Dynamic web page generation method and system
KR20090069589A (en) * 2007-12-26 2009-07-01 (주) 디아이지 커뮤니케이션 System and method for transcoding webpage by mobile environment
CN103455473A (en) * 2012-05-30 2013-12-18 刘继业 WEB form definition and application method based on hypertext markup language (HTML)
CN103984686A (en) * 2013-02-07 2014-08-13 阿里巴巴集团控股有限公司 Page-switching method and device
CN103500199A (en) * 2013-09-24 2014-01-08 北京大学 Webpage rendering accelerating method and system based on pre-loaded Cloud template
US20150188981A1 (en) * 2013-12-31 2015-07-02 Huawei Technologies Co., Ltd. Page processing method, apparatus, and system
CN104933020A (en) * 2015-07-17 2015-09-23 北京奇虎科技有限公司 Method and device for generating target documents based on template
WO2017107620A1 (en) * 2015-12-23 2017-06-29 北京奇虎科技有限公司 Method and system for loading page data
CN105630992A (en) * 2015-12-25 2016-06-01 网易(杭州)网络有限公司 Scene display method and device in static page
US20170371974A1 (en) * 2016-06-22 2017-12-28 Guangzhou Ucweb Computer Technology Co., Ltd. Method for loading webpage, client and programmable device
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN110168539A (en) * 2017-01-13 2019-08-23 微软技术许可有限责任公司 Fast Page load in mixing application
CN107122398A (en) * 2017-03-17 2017-09-01 武汉斗鱼网络科技有限公司 A kind of data display chart generation method and system
CN107291940A (en) * 2017-07-07 2017-10-24 腾讯科技(深圳)有限公司 Content of pages management method, device and associated server
CN109036397A (en) * 2018-06-29 2018-12-18 百度在线网络技术(北京)有限公司 The method and apparatus of content for rendering
CN109684586A (en) * 2018-11-21 2019-04-26 平安科技(深圳)有限公司 Page layout optimization display methods, device, computer equipment and storage medium
CN110162720A (en) * 2019-04-16 2019-08-23 平安科技(深圳)有限公司 Webpage loading method, device, computer equipment and storage medium
CN110297999A (en) * 2019-05-09 2019-10-01 京东方科技集团股份有限公司 A kind of web page template generation method and device, webpage loading method and front-end server and Website server
CN110618850A (en) * 2019-08-30 2019-12-27 北京浪潮数据技术有限公司 UI (user interface) loading method and system and related device
CN110688600A (en) * 2019-09-09 2020-01-14 平安普惠企业管理有限公司 Online editing method, device and equipment based on HTML (Hypertext markup language) page and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
追梦路上前行: "Django简介", pages 1 - 2 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN112395533A (en) * 2020-11-18 2021-02-23 北京字节跳动网络技术有限公司 Page loading method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN111273964B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
EP3518124A1 (en) Webpage rendering method and related device
CN104572843B (en) The loading method and device of a kind of page
CN110245069B (en) Page version testing method and device and page display method and device
CN112115396B (en) Webpage rendering method, device, equipment and storage medium
US9934206B2 (en) Method and apparatus for extracting web page content
CN110866204A (en) Page processing method and device
CN111638922A (en) Page resource loading method and device
CN106951270B (en) Code processing method, system and server
CN105488205A (en) Page generation method and page generation apparatus
CN110795697A (en) Logic expression obtaining method and device, storage medium and electronic device
CN111273964A (en) Data loading method and device
CN113392358A (en) Static resource preloading method and device
CN110909155B (en) Book order generation method, calculation device and computer storage medium
US10574773B2 (en) Method, device, terminal, server and storage medium of processing network request and response
CN111431767A (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN113330432A (en) Asynchronous predictive caching of content listed in search results
US10095791B2 (en) Information search method and apparatus
CN113742551A (en) Dynamic data capture method based on script and puppeteer
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
CN110858238B (en) Data processing method and device
CN111177600A (en) Built-in webpage loading method and device based on mobile application
CN113032702A (en) Page loading method and device
CN114116096B (en) Information processing method, device, equipment and storage medium
CN116776030A (en) Gray release method, device, computer equipment and storage medium
CN104794165B (en) A kind of webpage representation method, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant