Web page external logical data acquisition method, system, device and storage medium
By judging whether the web page loads resource data successfully or not, and switching the source address to try again when it fails, the web page loading failure caused by network problems or resource failure is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202210538212.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-05-18
AI Technical Summary
In the prior art, due to network problems or resource failure, web pages cannot be displayed, resulting in poor user experience.
By loading the resource data, we judge whether it is loaded successfully. If it is not successful, switch the source address and repeat the loading process until the resource data is loaded successfully.
Improves the user's web page experience and ensures that the web page can successfully load and display the correct content.
Smart Images

Figure CN114943049B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet information processing technology, and in particular to a method, system, device and storage medium for acquiring external logical data of a web page. Background Art
[0002] In web development projects or when users browse the web, web pages often need to obtain external logical data under the https protocol. Due to the fact that the server is set up overseas and is affected by the uncertain network environment and resource failure problems, sometimes the website page fails to obtain data and components or the acquisition speed is slow, which will cause the website page to load incorrectly, display garbled characters or blank pages, resulting in a poor user experience. Summary of the invention
[0003] The main purpose of this application is to provide a method, system, device and storage medium for obtaining external logical data of a web page, aiming to solve the technical problem of low efficiency in web page development in the prior art.
[0004] To achieve the above objectives, the present application provides a method for obtaining external logical data of a web page, the method comprising:
[0005] Load resource data;
[0006] Determining whether the resource data is loaded successfully;
[0007] If unsuccessful, switch the source address and return to the step of loading resource data until the resource data is loaded successfully.
[0008] Optionally, the step of switching the source address and returning to the step of loading resource data includes:
[0009] Select a new data source address;
[0010] Creating an address label at the new data source address, and importing the resource data based on the address label;
[0011] Return the loaded resource data, and load the resource data.
[0012] Optionally, the step of selecting a new data source address includes:
[0013] Get the preset backup data source;
[0014] The new data source address is selected from the preset backup data sources.
[0015] Optionally, the step of loading resource data includes:
[0016] Access external databases;
[0017] Importing resource data files from the external database;
[0018] The resource data in the resource data file is loaded on demand.
[0019] Optionally, the step of loading the resource data in the resource data file on demand includes:
[0020] Determine the required resource data in the resource data file;
[0021] The required resource data is loaded.
[0022] Optionally, the step of determining whether the resource data is loaded successfully includes:
[0023] Monitoring the loading of the resource data to obtain loading information;
[0024] Based on the loading information, it is determined whether the resource data is loaded successfully.
[0025] Optionally, the step of judging whether the resource data is loaded successfully based on the loading information includes:
[0026] Determine whether the loading information contains information about resource loading failure or resource loading timeout;
[0027] If the loading information includes information about resource loading failure or resource loading timeout, it is determined that the resource data loading has failed.
[0028] The present application also provides a web page external logic data acquisition system, the web page external logic data acquisition system comprising:
[0029] Loading module, used to load resource data;
[0030] A judgment module, used to judge whether the resource data is loaded successfully;
[0031] The switching module is used to switch the source address if it is unsuccessful and return to the step of loading the resource data until the resource data is loaded successfully.
[0032] The present application also provides a web page external logic data acquisition device, the web page external logic data acquisition device comprising: a memory, a processor, and a program stored in the memory for implementing the web page external logic data acquisition method,
[0033] The memory is used to store a program for implementing a method for acquiring external logical data of a web page;
[0034] The processor is used to execute a program for implementing the method for acquiring external logical data of a web page, so as to implement the steps of the method for acquiring external logical data of a web page.
[0035] The present application also provides a storage medium, on which is stored a program for implementing a method for acquiring external logical data of a web page, and the program for implementing a method for acquiring external logical data of a web page is executed by a processor to implement the steps of the method for acquiring external logical data of a web page.
[0036] The present application provides a method, system, device and storage medium for acquiring external logical data of a web page. Compared with the prior art in which a web page cannot be displayed due to network problems or resource failure, resulting in poor user experience, in the present application, resource data is loaded; it is determined whether the resource data is loaded successfully; if unsuccessful, the source address is switched, and the step of loading resource data is returned until the resource data is loaded successfully. That is, in the present application, after the resource data is loaded on the web page, it is determined whether the resource data is loaded successfully. In the case of failure to load the resource data, the source address of the acquisition source is automatically switched until the resource data is successfully acquired and the web page is successfully loaded, thereby improving the user's web page usage experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0038] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application;
[0039] Figure 2 This is a flow chart of the first embodiment of the method for acquiring external logic data of a web page of the present application;
[0040] Figure 3 This is a flow chart of the second embodiment of the method for acquiring external logical data of a web page of the present application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] like Figure 1As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present application.
[0044] The terminal in the embodiment of the present application can be a PC, or it can be a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a portable computer, or other portable terminal devices with display function.
[0045] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0046] Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal may also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which will not be repeated here.
[0047] Those skilled in the art will understand that Figure 1The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0048] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating device, a network communication module, a user interface module, and a web page external logic data acquisition program.
[0049] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the web page external logic data acquisition program stored in the memory 1005.
[0050] Reference Figure 2 , an embodiment of the present application provides a method for obtaining external logical data of a web page, the method for obtaining external logical data of a web page comprising:
[0051] Step S100, loading resource data;
[0052] Step S200, determining whether the resource data is loaded successfully;
[0053] Step S300, if unsuccessful, switch the source address and return to the step of loading resource data until the resource data is loaded successfully.
[0054] In this embodiment, the specific application scenario may be:
[0055] When a user browses a web page, the web page needs to obtain external logical data to construct the web page. During the browsing process of the web page, due to network problems or resource failures, the external logical data cannot be obtained or the acquisition speed is slow, resulting in the inability to display the web page, resulting in a poor user experience.
[0056] The specific steps are as follows:
[0057] Step S100, loading resource data;
[0058] In this embodiment, the system loads resource data, which is external logic data. The resource data includes logic data and interface components required for web page construction, and is used for website web page construction.
[0059] In this embodiment, the development framework of the website webpage can be React, Vue, Angular, Alpine, Preact, LitElement, Stimulus and Ember, etc. Among them, the Vue framework is preferred in this embodiment. Vue is a progressive framework for building user interfaces. Vue has a bottom-up layer-by-layer application. The core library of Vue is in the view layer, which is easy to integrate with third-party libraries or existing projects. On the other hand, when used in combination with a modern tool chain and various supporting libraries, Vue can provide drivers for complex single-page applications.
[0060] Specifically, the step S100 includes the following steps S110-S130:
[0061] Step S110, obtaining an external database;
[0062] In this embodiment, the system obtains an external database, wherein the external database is an open source database whose source code is open to the outside world, and developers can modify or use it based on its original design. Specifically, the open source database includes: MSSQL server, MySQL, Oracle, PostgreSQL, MongoDB, etc.
[0063] In this embodiment, the system may obtain the external database by pre-connecting the web page to the external database, wherein the pre-connection may be a corresponding access standard for accessing the database or a corresponding access component.
[0064] Step S120, importing the resource data file in the external database;
[0065] In this embodiment, the resource data file is a file that carries the logical data and interface components required for web page construction. Preferably, in the website page developed by the front-end VUE framework, the system introduces the resource data file in the external database by introducing the required logical data and interface components in the open source database through the link tag. The external introduction link will become a monitorable dynamic file on the browser.
[0066] Step S130: Load the resource data in the resource data file on demand.
[0067] In this embodiment, the system loads the resource data in the resource data file on demand based on the construction requirements of the website webpage. Since the resource data required for the construction of different webpages is different, the resource data is loaded according to the requirements of the webpage, thereby speeding up the acquisition of resource data. For example, a website includes two webpages A and B, and the external database includes files X, Y, and Z. The resource files required to be loaded by webpage A are files X and Y in the external database, and the resource files required to be loaded by webpage B are files Y and Z in the external database. When the user opens webpage A, the system loads files X and Y in the external database.
[0068] In this embodiment, the system loads the resource data in the resource data file on demand by polling. For example, the system uses IF function polling judgment to load data on demand.
[0069] Specifically, the step S130 includes the following steps S131-S132:
[0070] Step S131, determining the required resource data in the resource data file;
[0071] In this embodiment, the system determines the required resource data in the resource data file by polling. Preferably, in the website page developed by the front-end VUE framework, the system uses IF function polling to determine the required resource data in the resource data file.
[0072] Step S132: loading the required resource data.
[0073] In this embodiment, the system loads the required resource data. For example, a website includes web page A, and the external database includes files X, Y, and Z. The resource files required to be loaded by web page A are files X and Y in the external database. When a user opens web page A, the system loads files X and Y in the external database.
[0074] Step S200, determining whether the resource data is loaded successfully;
[0075] In this embodiment, the system determines whether the resource data is loaded successfully. If the resource data is loaded successfully, the web page interface is loaded normally; if the resource data fails to load, the process proceeds to step S300.
[0076] In this embodiment, the system determines whether the resource data is loaded successfully by determining whether the resource data is loaded successfully or by determining whether the resource data is loaded overtime. In this embodiment, the system uses a custom algorithm to determine whether the data source has timed out or has failed.
[0077] Specifically, the step S200 includes the following steps S210-S220:
[0078] Step S210, monitoring the loading of the resource data to obtain loading information;
[0079] In this embodiment, the system monitors the loading of the resource data to obtain the loading information, wherein the loading information includes information of successful loading, information of failed loading and information of loading timeout. Preferably, on the website page developed by the front-end VUE framework, the watch monitoring property of the VUE framework is used to monitor whether the data component has been loaded successfully.
[0080] Step S220: Based on the loading information, determine whether the resource data is loaded successfully.
[0081] In this embodiment, the loading information includes information on successful loading, information on failed loading, and information on timed loading. If the loading information is information on successful loading, it is determined that the resource data has been loaded successfully; if the loading information is information on failed loading or timed loading, it is determined that the resource data has been loaded unsuccessfully.
[0082] Specifically, the step S220 includes the following steps S221-S222:
[0083] Step S221, determining whether the loading information contains information of resource loading failure or resource loading timeout;
[0084] In this embodiment, the resource loading timeout information is when the system monitors the loading of the resource data and exceeds the preset time without obtaining other loading information, it is determined that the resource loading timeout has occurred. The preset time can be set according to needs, such as 10 seconds, and no specific limitation is made here.
[0085] Step S222: If the loading information includes information about resource loading failure or resource loading timeout, it is determined that the resource data loading has failed.
[0086] In this embodiment, if the loading information is information indicating a successful loading, it is determined that the resource data has been loaded successfully; if the loading information is information indicating a failed loading or a timed-out loading, it is determined that the resource data has been loaded unsuccessfully.
[0087] Step S300, if unsuccessful, switch the source address and return to the step of loading resource data until the resource data is loaded successfully.
[0088] In this embodiment, if the system determines that the resource data is successfully acquired, the web page interface is loaded normally; if the resource data fails to load, the system switches the source address and reloads the resource data that failed to be acquired. The source address is a preset data source address, and the source address also includes the resource data required by the website web page. In reloading the resource data that failed to be acquired, the resource data that failed to be acquired is loaded on demand, and the necessary files are loaded on demand to speed up the loading speed.
[0089] Specifically, the step S300 includes the following steps S310-S330:
[0090] Step S310, selecting a new data source address;
[0091] In this embodiment, the new data source address is a preset data source address, and the new data source address also includes resource data required by the website webpage, wherein the external database includes a preset number of data source addresses, and the new data source address is selected from the preset number of data source addresses. The preset number of data source addresses includes more than two, and the preset number can be set according to the needs, and is not specifically limited here.
[0092] Specifically, the step S310 includes the following steps S311-S312:
[0093] Step S311, obtaining a preset backup data source;
[0094] In this embodiment, the preset backup data source is a preset data source address, and the system obtains the preset backup data source, wherein the preset backup data source also includes resource data required by the website webpage.
[0095] Step S312: selecting the new data source address from the preset backup data sources.
[0096] In this embodiment, the external database includes a preset number of preset backup data sources, and the new data source address is selected from the preset backup data sources, wherein the preset backup data sources also include resource data required by the website webpage.
[0097] Step S320, creating an address tag at the new data source address, and importing the resource data based on the address tag;
[0098] In this embodiment, the system creates an address tag at the new data source address, and based on the address tag, introduces the resource data, that is, introduces the resource data that failed to be obtained above at the new data source address. Preferably, under the website page developed by the front-end VUE framework, a file is re-created to introduce the address tag, insert the head tag, and introduce the resource data.
[0099] Step S330, returning to the loading resource data, loading the resource data.
[0100] In this embodiment, similar to step S100 above, the system reloads the resource data in the new data source address.
[0101] In this embodiment, the system determines whether the resource data loaded at the new data source address is loaded successfully. If successful, the web page interface is loaded normally. If the resource data fails to load, the system switches the source address and reloads the resource data that failed to be acquired, until the resource data is successfully acquired and the web page is successfully loaded, which effectively reduces the error probability of the website page and improves the user experience.
[0102] The present application provides a method, system, device and storage medium for acquiring external logical data of a web page. Compared with the prior art in which a web page cannot be displayed due to network problems or resource failure, resulting in poor user experience, in the present application, resource data is loaded; it is determined whether the resource data is loaded successfully; if unsuccessful, the source address is switched, and the step of loading resource data is returned until the resource data is loaded successfully. That is, in the present application, after the resource data is loaded on the web page, it is determined whether the resource data is loaded successfully. In the case of failure to load the resource data, the source address of the acquisition source is automatically switched until the resource data is successfully acquired and the web page is successfully loaded, thereby improving the user's web page usage experience.
[0103] Based on the first embodiment, the present application further provides another embodiment. In the another embodiment, referring to Figure 3, under the HTML static website page developed by the front-end VUE framework, build a loadJsCss function, in which the script tag and link tag are initialized by the document.createElement method. In this way, the script and link introduced from the outside will become a dynamic file that can be monitored on the browser. After that, the IE browser will provide the onload attribute and the webkit kernel browser will provide the sheet attribute to determine whether the file is loaded successfully. At this time, you can make an if judgment in the watch monitoring hook function of the VUE.js framework to confirm whether the js and css imported files in onload and sheet are loaded successfully. If the import is successful, it will return a true logical value to skip this step and load the web page normally; if it is unsuccessful, build a poll function to make an if judgment. When the obtained logical value is not true, it will enter the failed if judgment and change a source file address. Among them, the source file address is changed using three function methods: document.createElement, setAttribute, document.getElementsByTagName("head")[0].appendChild(link). Recreate a file import address tag and insert it into the head tag. The browser will load the head tag first. Then call the loadJsCss function again to start initializing the loading of the web page, and use the document.write method in JavaScript to load the necessary files on demand. The watch hook function will continue to monitor whether the onload and sheet attributes return a true logical value. If not, the poll function will continue to be called to perform polling and source switching operations until the external source file is successfully loaded and then skip polling and no longer call the poll function.
[0104] It should be noted that according to the order in which HTML files are loaded by a web page, the main content of the website in the body tag will not be loaded until the script tag and link tag in the head tag are loaded. Therefore, under this rule, you can use external source files (script tags and link tags in the source code) that are introduced by continuous polling to optimize the web page loading process.
[0105] The present application also provides a web page external logic data acquisition system, the web page external logic data acquisition system comprising:
[0106] Loading module, used to load resource data;
[0107] A judgment module, used to judge whether the resource data is loaded successfully;
[0108] The switching module is used to switch the source address if it is unsuccessful and return to the step of loading the resource data until the resource data is loaded successfully.
[0109] Optionally, the switching module includes:
[0110] The address selection module is used to select a new data source address;
[0111] A source changing module, used for creating an address label at the new data source address, and introducing the resource data based on the address label;
[0112] The loop loading module is used to return the loaded resource data and load the resource data.
[0113] Optionally, the site selection module includes:
[0114] A data source acquisition module is used to acquire a preset backup data source;
[0115] A selection module is used to select the new data source address from the preset backup data sources.
[0116] Optionally, the loading module includes:
[0117] Database acquisition module, to acquire external database;
[0118] An import module, used for importing resource data files in the external database;
[0119] The on-demand loading module is used to load the resource data in the resource data file on-demand.
[0120] Optionally, the on-demand loading module includes:
[0121] A determination module, used to determine the required resource data in the resource data file;
[0122] The demand loading module is used to load the resource data of the demand.
[0123] Optionally, the judging module includes:
[0124] A monitoring module, used to monitor the loading of the resource data and obtain loading information;
[0125] The loading judgment module is used to judge whether the resource data is loaded successfully based on the loading information.
[0126] Optionally, the loading judgment module includes:
[0127] An information determination module, used to determine whether the loading information contains information about resource loading failure or resource loading timeout;
[0128] The determination module is configured to determine that the resource data loading has failed if the loading information contains information indicating that the resource loading has failed or that the resource loading has timed out.
[0129] The specific implementation of the web page external logic data acquisition system of the present application is basically the same as the various embodiments of the web page external logic data acquisition method described above, and will not be repeated here.
[0130] Reference Figure 1 , Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0131] like Figure 1 As shown, the web page external logic data acquisition device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0132] Optionally, the web page external logic data acquisition device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0133] Those skilled in the art will understand that Figure 3 The structure of the web page external logic data acquisition device shown in the figure does not constitute a limitation of the web page external logic data acquisition device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0134] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, and a web page external logic data acquisition program. The operating system is a program that manages and controls the hardware and software resources of the web page external logic data acquisition device, and supports the operation of the web page external logic data acquisition program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the web page external logic data acquisition system.
[0135] exist Figure 1 In the web page external logic data acquisition device shown, the processor 1001 is used to execute the web page external logic data acquisition program stored in the memory 1005 to implement the steps of any of the above-mentioned web page external logic data acquisition methods.
[0136] The specific implementation of the web page external logic data acquisition device of the present application is basically the same as the various embodiments of the above-mentioned web page external logic data acquisition method, and will not be repeated here.
[0137] The present application also provides a storage medium, on which is stored a program for implementing a method for acquiring external logical data of a web page, and the program for implementing a method for acquiring external logical data of a web page is executed by a processor to implement the steps of the method for acquiring external logical data of a web page.
[0138] The specific implementation of the storage medium of the present application is basically the same as the embodiments of the above-mentioned web page external logic data acquisition method, and will not be repeated here.
[0139] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for obtaining external logical data of a web page when executed by a processor.
[0140] The specific implementation of the computer program product of the present application is basically the same as the various embodiments of the above-mentioned web page external logic data acquisition method, and will not be repeated here.
[0141] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0142] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0144] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for acquiring external logical data of a web page, characterized in that: The webpage external logic data acquisition method comprises: Load resource data; The step of loading resource data includes: Obtaining the external database based on a preset access standard for accessing the external database; Importing resource data files from the external database; Loading the resource data in the resource data file on demand; The step of loading the resource data in the resource data file on demand comprises: Determine the required resource data in the resource data file; Loading the required resource data; Determining whether the resource data is loaded successfully; If unsuccessful, switch the source address and return to the step of loading resource data until the resource data is loaded successfully; The step of switching the source address and returning to the step of loading resource data comprises: Select a new data source address; Creating an address label at the new data source address, and importing the resource data based on the address label; Return the loaded resource data, and load the resource data; The step of selecting a new data source address includes: Get the preset backup data source; The new data source address is selected from the preset backup data sources.
2. The method for acquiring external logical data of a web page according to claim 1, characterized in that: The step of determining whether the resource data is loaded successfully comprises: Monitoring the loading of the resource data to obtain loading information; Based on the loading information, it is determined whether the resource data is loaded successfully.
3. The method for acquiring external logical data of a web page according to claim 2, characterized in that: The step of judging whether the resource data is loaded successfully based on the loading information comprises: Determine whether the loading information contains information about resource loading failure or resource loading timeout; If the loading information includes information about resource loading failure or resource loading timeout, it is determined that the resource data loading has failed.
4. A web page external logic data acquisition system, characterized in that: The webpage external logic data acquisition system comprises: Loading module, used to load resource data; The loading module further includes: A database acquisition module, used for acquiring an external database based on a preset access standard for accessing the external database; An import module, used for importing resource data files in the external database; An on-demand loading module, used for loading the resource data in the resource data file on-demand; The on-demand loading module further includes: A determination module, used to determine the required resource data in the resource data file; A demand loading module, used to load the resource data of the demand; A judgment module, used to judge whether the resource data is loaded successfully; A switching module, used for switching the source address if unsuccessful, and returning to the step of loading the resource data until the resource data is loaded successfully; The switching module further includes: The address selection module is used to select a new data source address; A source changing module, used for creating an address label at the new data source address, and introducing the resource data based on the address label; A loop loading module, used for returning the loaded resource data and loading the resource data; The site selection module further includes: A data source acquisition module is used to acquire a preset backup data source; A selection module is used to select the new data source address from the preset backup data sources.
5. A web page external logic data acquisition device, characterized in that: The webpage external logic data acquisition device comprises: a memory, a processor, and a program stored in the memory for implementing the webpage external logic data acquisition method. The memory is used to store a program for implementing a method for acquiring external logical data of a web page; The processor is used to execute a program for implementing the method for acquiring external logical data of a web page, so as to implement the steps of the method for acquiring external logical data of a web page as claimed in any one of claims 1 to 3.
6. A storage medium, characterized in that: The storage medium stores a program for implementing a method for acquiring external logical data of a web page, and the program for implementing a method for acquiring external logical data of a web page is executed by a processor to implement the steps of the method for acquiring external logical data of a web page as claimed in any one of claims 1 to 3.
Citation Information
Patent Citations
Resource acquisition method, client, computer equipment and readable medium
CN108737532A