Object loading method and system
By obtaining the identification and path information from the server when loading the target object on the terminal, establishing an association relationship, and preferentially obtaining the target object file from the local area, the problem of slow loading speed of the terminal is solved, the loading speed and reliability are improved, and user traffic is saved.
Patent Information
- Application Number
- CN202111590188.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-23
AI Technical Summary
In the prior art, the terminal loads the target object slowly, resulting in a long wait time for the user and a poor experience.
By obtaining the identification and path information of the target object from the server of the target application, establishing an association relationship, and after receiving the running command, obtaining the file of the target object from the local or server based on the identification and path information, loading the target object, and obtaining it from the local area first to save traffic and Increase the speed.
It improves the loading speed of the target object, avoids slow loading speed caused by network problems, saves user traffic, and improves the reliability of the system.
Smart Images

Figure CN114217878B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of resource management technology, and in particular to an object loading method and system. Background Art
[0002] With the rapid growth of China's economy, the number of applications on terminals such as mobile phones, tablets, and smart wearable devices has gradually increased. In existing technologies, when a user opens a target object in an application (such as a webpage or a mini-program), the application must request the corresponding server to load the target object's resources before it can be displayed, resulting in long wait times and a poor user experience.
[0003] How to improve the speed at which the terminal loads the target object is an issue that needs to be addressed urgently. Summary of the Invention
[0004] The present application provides an object loading method and system to solve the problem of slow loading of target objects by a terminal.
[0005] In a first aspect, the present application provides an object loading method, which includes: obtaining the identification and path information of a target object in a target application from a server corresponding to the target application; wherein the path information of the target object is used to indicate the storage location of a target file corresponding to the target object on the server; the target file corresponding to the target object is used to load the resources of the target object; establishing an association relationship between the identification of the target object and the path information of the target object; receiving an instruction for running the target object, wherein the instruction includes the identification of the target object; in response to the instruction, determining the path information of the target object based on the identification of the target object and the association relationship, and obtaining the target file corresponding to the target object from the local or the server based on the path information of the target object; and loading the target object based on the target file corresponding to the target object.
[0006] This method allows you to retrieve the target object's file locally and run it, speeding up the loading process and avoiding network issues that can cause slow file downloads and slow loading times. Furthermore, retrieving the target object's file locally effectively saves user data.
[0007] Optionally, obtaining the identification and path information of the target object in the target application from the server corresponding to the target application includes: after detecting that the target application is started, obtaining the identification and path information of several target objects in the target application from the server corresponding to the target application, the several target objects including the target object.
[0008] In this approach, after the target application is started, it obtains the identification and path information of the target object from the server, which effectively improves the reliability of this solution.
[0009] Optionally, the target file corresponding to the target object has a mapping relationship in the local storage location and the target file corresponding to the target object has a mapping relationship in the server storage location; obtaining the target file corresponding to the target object from the local or the server according to the path information of the target object includes: determining the local storage location of the target file corresponding to the target object according to the path information of the target object and the mapping relationship; if the target file corresponding to the target object exists in the local, obtaining the target file corresponding to the target object from the local; if the target file corresponding to the target object does not exist in the local, obtaining the target file corresponding to the target object from the server.
[0010] In this method, the target file is first searched locally. If the target file exists locally, the local target file is directly used to load the resources of the target object, which effectively saves the user's traffic and also improves the loading speed of the target object to a certain extent. If the target file corresponding to the target object does not exist locally, the target file corresponding to the target object is obtained from the server to ensure that the target object can be presented, thereby improving the reliability of the solution.
[0011] Optionally, after obtaining the target file corresponding to the target object from the server, the target file corresponding to the target object is saved locally according to the mapping relationship.
[0012] This method saves the target file locally, providing a basis for subsequent loading of the target object from the local computer.
[0013] Optionally, the target object file includes HTML tags, JS code and CSS files. It is understandable that the above types are only examples and not limitations, and there may be other types in practice.
[0014] Optionally, the target object is a page in the target application or a mini-program associated with the target application.
[0015] In a second aspect, an object loading system is provided, which includes: a first module for obtaining the identification and path information of a target object in a target application from a server corresponding to the target application; wherein the path information of the target object is used to indicate the storage location of the target file corresponding to the target object on the server; the target file corresponding to the target object is used to load the resources of the target object; an association relationship between the identification of the target object and the path information of the target object is established; a second module for receiving an instruction for running the target object, wherein the instruction includes the identification of the target object; in response to the instruction, determining the path information of the target object according to the identification of the target object and the association relationship, and obtaining the target file corresponding to the target object from the local or the server according to the path information of the target object; a third module for loading the target object according to the target file corresponding to the target object.
[0016] Optionally, when the first module is used to obtain the identification and path information of the target object in the target application from the server corresponding to the target application, it is specifically used to: after detecting that the target application is started, obtain the identification and path information of several target objects in the target application from the server corresponding to the target application, and the several target objects include the target object.
[0017] Optionally, the local storage location of the target file corresponding to the target object and the storage location of the target file corresponding to the target object on the server have a mapping relationship; when the second module is used to obtain the target file corresponding to the target object from the local or the server according to the path information of the target object, it is specifically used to: determine the local storage location of the target file corresponding to the target object according to the path information of the target object and the mapping relationship; if the target file corresponding to the target object exists in the local, obtain the target file corresponding to the target object from the local; if the target file corresponding to the target object does not exist in the local, obtain the target file corresponding to the target object from the server.
[0018] Optionally, the second module is further configured to: after obtaining the target file corresponding to the target object from the server, save the target file corresponding to the target object to the local device according to the mapping relationship.
[0019] Optionally, the target object file includes HTML tags, JS codes and CSS files.
[0020] Optionally, the target object is a page in the target application or a mini-program associated with the target application.
[0021] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor executes the instructions stored in the memory, thereby enabling the device to execute the method described in the first aspect or any optional embodiment of the first aspect.
[0022] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store instructions, and when the instructions are executed, the method in the first aspect or any optional embodiment of the first aspect is implemented.
[0023] In a fifth aspect, a computer program product comprising instructions is provided, wherein the computer program product stores instructions that, when executed on a computer, enable the computer to execute the method described in the first aspect or any optional embodiment of the first aspect.
[0024] The technical effects or advantages of one or more technical solutions provided in the second, third, fourth and fifth aspects of the embodiments of this application can be explained by the technical effects or advantages of the corresponding one or more technical solutions provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 This is a flowchart of an object loading method provided by an embodiment of the present application;
[0027] Figure 2 This is a schematic structural diagram of an object loading device provided in an embodiment of the present application;
[0028] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solution of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. Unless there is a conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0030] It should be understood that in the description of the embodiments of this application, the terms "first" and "second" are used only for the purpose of distinguishing the description and should not be understood to indicate or imply relative importance or order. In the description of the embodiments of this application, "plurality" means two or more.
[0031] The term "and / or" in the embodiments of this application is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0032] In the embodiments of this application, the collection, dissemination, and use of data are in compliance with relevant national laws and regulations.
[0033] See also Figure 1 , is a flowchart of an object loading method provided in an embodiment of the present application. The method can be executed by an electronic device with networking capabilities, such as a mobile phone, tablet, etc., and the present application does not limit this. The specific steps of the method are as follows:
[0034] S101: Acquire the identifier and path information of the target object in the target application from the server corresponding to the target application.
[0035] The path information of the target object is used to indicate the storage location of the target file corresponding to the target object on the server; the target file corresponding to the target object is used to load the resources of the target object.
[0036] Optionally, the target object may include a page in the target application or a mini-program associated with the target application.
[0037] The target application page refers to the interface within the application, for example, the account page, transfer page, security center page, etc. in a banking app.
[0038] For a web page, the target file includes the Hypertext Markup Language (HTML) tags, JS code, and Cascading Style Sheets (CSS) files required to render the page. Among them, the full name of html is Hypertext Markup Language, which is a markup language. It includes a series of tags, through which the document format on the Internet can be unified, so that scattered network resources can be connected into a logical whole. CSS is a computer language used to express the style of files such as HTML. CSS can not only modify web pages statically, but also dynamically format various elements of the web page in conjunction with various scripting languages. CSS can accurately control the layout of the position of elements in the web page at the pixel level, supports almost all font and font size styles, and has the ability to edit web page objects and model styles.
[0039] The target application-associated mini-program is a mini-program that can run within an application and provides third-party services. For example, a food delivery mini-program associated with a banking app. For a mini-program associated with a target application, the target file includes the code files required to load the mini-program.
[0040] Optionally, obtaining the identification and path information of the target object in the target application from the server corresponding to the target application includes: after detecting that the target application is started, obtaining the identification and path information of several target objects in the target application from the server corresponding to the target application, the several target objects including the target object.
[0041] Exemplarily, the target object is a page. Assume that the user opens the target application. At this time, the electronic device detects that the target application is started, and obtains the identification and path information of all pages in the target application from the server corresponding to the target application, and saves it to the local cache. Among them, the identification of the page can be the identity identification number (Identity document, ID) corresponding to the page, and the path information of the page can be the routing information of the page. In this way, after obtaining the ID and routing information of the page, the electronic device can obtain the corresponding page file from the storage location corresponding to the server according to the ID and routing information. It should be understood that since the identification and path information of the page are both saved in the local cache, each time the target application process is ended, the identification and path information of the page will be deleted. Therefore, each time the user opens the target application, it is necessary to obtain the above information from the server.
[0042] For example, after detecting that the target application has been launched, the identification and path information of some pages can be obtained from the server. The selection of these pages can be filtered based on the usage frequency of each page in the target application. For example, pages with a usage frequency of more than 80% can be selected. After detecting that the target application has been launched, the identification and path information of all pages with a usage frequency of more than 80% can be obtained and stored in the local cache. This not only improves the application loading speed and ensures the user experience, but also saves user data usage.
[0043] S102: Establishing an association relationship between the identifier of the target object and the path information of the target object.
[0044] Optionally, the existence form of the above-mentioned association relationship can be determined according to actual needs. For example, the above-mentioned association relationship can be saved in a table, or saved in a text, or saved in a relationship diagram. This application does not impose any restrictions.
[0045] S103: Receive an instruction for running the target object, wherein the instruction includes an identifier of the target object.
[0046] Alternatively, different methods may be used for how the electronic device receives the instruction to run the target object. For example, a user may open the target application and perform an operation (click a page icon or a page link), thereby causing the electronic device to receive the instruction to run the page; or, for another example, after the target application is started, the instruction to run a page may be automatically triggered, causing the electronic device to receive the instruction.
[0047] S104: Determine the path information of the target object according to the identifier and the association relationship of the target object, and obtain the target file corresponding to the target object from the local computer or the server according to the path information of the target object.
[0048] In an embodiment of the present application, a mapping relationship exists between the local storage location of the target file corresponding to the target object and the storage location of the target file corresponding to the target object on the server. This mapping relationship is configured by the target application to ensure that the target file can be saved to the correct local location. This mapping relationship is unique and cannot be modified by the user of the target application. Therefore, through the mapping relationship configured in the target application, the electronic device can save the target file to the correct location and also retrieve the target file from the correct location.
[0049] Based on the above mapping relationship, the implementation process of step S104 includes: first, the electronic device obtains the path information corresponding to the target object from the locally stored association relationship based on the identifier of the target object in the instruction. Then, the electronic device obtains the target file corresponding to the target object based on the path information corresponding to the target object. The electronic device can obtain the target file corresponding to the target object based on the path information corresponding to the target object in the following ways:
[0050] Method 1: Acquire the target file from the server and locally at the same time. For example, after receiving the instruction, the electronic device requests the target file from the server while searching for the target file locally. Once the target file is obtained from either of the two paths, the operation on the other path is immediately stopped.
[0051] When obtaining a target file from a server, the target file can be obtained from the location where the target file is stored on the server based on the target file identifier and its corresponding path information. When searching for a target file locally, the location of the target file in the local storage can be determined based on the target file path information and the above mapping relationship, and then the target file can be obtained from that location.
[0052] In this way, the electronic device can obtain the target file more quickly and save the user the time of waiting for the target object to load.
[0053] Method 2: First search for the target file locally. If the target file does not exist locally, request the target file from the server. For example, when the electronic device receives the instruction, it first searches for the target file locally. If it determines that the target file does not exist locally, it requests the target file from the server based on the path information of the target object.
[0054] Optionally, after the electronic device finds that the target file does not exist locally and requests the server to obtain the target file, the obtained target file can be saved locally. According to the above mapping relationship, the electronic device can save the target file in the cache or in local storage.
[0055] Specifically, after the electronic device obtains the target file from the server, it determines the local storage location of the target file according to the path information of the target file and the mapping relationship set by the target application, and saves the target file in the storage location.
[0056] In this method, after the electronic device obtains the target file from the server, it saves the target file locally, providing a basis for subsequently loading the target object from the local.
[0057] Through this method, the target file is first searched locally. If the target file exists locally, the local target file is directly used to load the resources of the target object, which effectively saves the user's traffic and also improves the loading speed of the target object to a certain extent; if the target file corresponding to the target object does not exist locally, the target file corresponding to the target object is obtained from the server to ensure that the target object can be presented, thereby improving the reliability of the solution.
[0058] S105: Load the target object according to the target file corresponding to the target object.
[0059] For example, when the target object is a page, the target file obtained includes HTML tags, JS code and CSS files. At this time, the electronic device will insert the JS code into the body in sequence through the script tag, execute the JS code, and then wrap the HTML content in a div, and add the style part of the CSS of this page to the head tag, and finally compile all the codes and render them into the page.
[0060] This method allows you to retrieve the target object's file locally and run it, speeding up the loading process and avoiding network issues that can cause slow file downloads and slow loading times. Furthermore, retrieving the target object's file locally effectively saves user data.
[0061] The following two examples are used to introduce possible applications of the above solution.
[0062] Example 1: Load any page of the target application.
[0063] S201: Detecting that a target application is started, requesting the server for identification and path information of all pages in the target application.
[0064] S202: Save the obtained identifiers and path information of all pages to a local cache, and establish a first association relationship between the identifier and path information of each page in all pages.
[0065] S203: Receive an instruction for running a target page, where the instruction includes an identifier of the target page.
[0066] S204: In response to the instruction, the path information of the target page is obtained according to the identifier of the target page and the first association relationship stored in the cache.
[0067] S205: Determine a storage location of a target file corresponding to the target page in the local cache according to the path information of the target page and the first mapping relationship set by the target application.
[0068] S206: Search for the target file from the storage location in the local cache. If the target file exists, execute step S207a; if the target file does not exist, execute step S207b.
[0069] S207a: Rendering the target page according to the acquired target file.
[0070] S207b: According to the path information of the target page, the target file is obtained from the server and saved to the local cache, and the target page is rendered according to the target file.
[0071] In the above method, when the user opens the target page of the target application for the second time, the target file for rendering the page can be directly retrieved from the local cache, which saves the traffic of obtaining the target file from the server and also improves the speed of page rendering.
[0072] Example 2: Load any applet associated with the target application.
[0073] S301: Detecting that a target application is started, requesting the server for the identifier and path information of the mini-program in the target application whose usage frequency exceeds a threshold.
[0074] S302: The obtained identifiers and path information of the mini-programs are stored locally, and a second association relationship between the identifiers and path information of the mini-programs is established.
[0075] S303: Receive an instruction for running a target applet, where the instruction includes an identifier of the target applet.
[0076] S304: In response to the instruction, the path information of the target applet is obtained according to the identifier of the target applet and the second association relationship stored locally.
[0077] S305: Determine the local storage location of the code file corresponding to the target applet according to the path information of the target applet and the second mapping relationship set by the target application.
[0078] S306: Search for the code file from the local storage location. If the code file exists, execute step S307a; if the code file does not exist, execute step S307b.
[0079] S307a: Load and run the target applet according to the code file.
[0080] S307b: According to the path information of the code file, the code file is obtained from the server and downloaded to the local computer, and the target applet is loaded and run according to the code file.
[0081] In the above method, when the user runs the target applet for the second time, the code file for running the target applet can be directly obtained locally, which saves the traffic of obtaining the code file from the server and also improves the running speed of the target applet.
[0082] The above describes the method provided by the embodiment of the present application, and the following describes the device provided by the embodiment of the present application.
[0083] See also Figure 2 , an embodiment of the present application provides an object loading system, which includes modules / units / technical means for executing the method in the above method embodiment.
[0084] Exemplarily, the system 200 may include:
[0085] The first module 201 is configured to obtain, from a server corresponding to a target application, an identifier and path information of a target object in the target application; wherein the path information of the target object is used to indicate a storage location of a target file corresponding to the target object on the server; the target file corresponding to the target object is used to load resources of the target object; and establish an association between the identifier of the target object and the path information of the target object;
[0086] The second module 202 is configured to receive an instruction for executing the target object, wherein the instruction includes an identifier of the target object; in response to the instruction, determine path information of the target object based on the identifier of the target object and the association relationship, and obtain a target file of the target object from a local computer or the server based on the path information of the target object;
[0087] The third module 203 is configured to load the target object according to the target file of the target object.
[0088] It should be understood that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0089] As a possible product form of the above device, see Figure 3 , an embodiment of the present application further provides an electronic device 300, including:
[0090] At least one processor 301; and a communication interface 303 communicatively connected to the at least one processor 301; the at least one processor 301 executes instructions stored in the memory 302, so that the electronic device 300 executes the method steps performed by any device in the above method embodiment through the communication interface 303.
[0091] Optionally, the memory 302 is located outside the electronic device 300 .
[0092] Optionally, the electronic device 300 includes the memory 302, the memory 302 is connected to the at least one processor 301, and the memory 302 stores instructions that can be executed by the at least one processor 301. Figure 3 The dashed lines indicate that the memory 302 is optional for the electronic device 300 .
[0093] The processor 301 and the memory 302 may be coupled via an interface circuit or may be integrated together, which is not limited here.
[0094] The specific connection medium between the processor 301, the memory 302 and the communication interface 303 is not limited in the embodiment of the present application. Figure 3 The processor 301, the memory 302 and the communication interface 303 are connected via a bus 304. Figure 3 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0095] It should be understood that the processors mentioned in the embodiments of the present application can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that is implemented by reading software code stored in a memory.
[0096] Exemplarily, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0097] It should be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0098] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.
[0099] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0100] As another possible product form, an embodiment of the present application also provides a computer-readable storage medium, which is used to store instructions. When the instructions are executed, the computer executes the method steps performed by any device in the above method example.
[0101] As another possible product form, an embodiment of the present application also provides a computer program product containing instructions, wherein the computer program product stores instructions that, when executed on a computer, enable the computer to execute the method steps performed by any device in the above method embodiment.
[0102] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0103] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0106] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. An object loading method, characterized in that: include: After detecting that the target application is started, obtaining the identifiers and path information of several target objects in the target application from the server corresponding to the target application; wherein the several target objects include the target object; the path information of the target object is used to indicate the storage location of the target file corresponding to the target object on the server; the target file corresponding to the target object is used to load the resource of the target object; and establishing an association relationship between the identifier of the target object and the path information of the target object; receiving an instruction for running the target object, wherein the instruction includes an identifier of the target object; in response to the instruction, determining path information of the target object according to the identifier of the target object and the association relationship, acquiring a target file corresponding to the target object from a local device and the server simultaneously according to the path information of the target object, and when the target file is acquired from the local device or the server, stopping acquiring the target file from another path; The target object is loaded according to the target file corresponding to the target object.
2. The method according to claim 1, characterized in that There is a mapping relationship between the local storage location of the target file corresponding to the target object and the storage location of the target file corresponding to the target object on the server; Acquiring a target file corresponding to the target object from a local computer or the server according to the path information of the target object includes: Determine a local storage location of a target file corresponding to the target object according to the path information of the target object and the mapping relationship; If the target file corresponding to the target object exists in the local location, obtaining the target file corresponding to the target object from the local location; If the target file corresponding to the target object does not exist locally, the target file corresponding to the target object is obtained from the server.
3. The method according to claim 2, characterized in that Also includes: After obtaining the target file corresponding to the target object from the server, the target file corresponding to the target object is saved to the local according to the mapping relationship.
4. The method according to any one of claims 1 to 3, characterized in that: The target file includes a hypertext markup language HTML tag, a JS code and a cascading style sheet CSS file.
5. The method according to any one of claims 1 to 3, characterized in that: The target object is a page in the target application or a mini-program associated with the target application.
6. An object loading system, characterized in that: include: The first module is used to obtain the identifiers and path information of several target objects in the target application from the server corresponding to the target application after detecting that the target application is started; wherein the several target objects include the target object; the path information of the target object is used to indicate the storage location of the target file corresponding to the target object on the server; the target file corresponding to the target object is used to load the resource of the target object; and establish an association relationship between the identifier of the target object and the path information of the target object; The second module is configured to receive an instruction for running the target object, wherein the instruction includes an identifier of the target object; in response to the instruction, determine path information of the target object according to the identifier of the target object and the association relationship, obtain a target file corresponding to the target object from both the local and the server according to the path information of the target object, and when the target file is obtained from the local or the server, stop obtaining the target file from another path; The third module is used to load the target object according to the target file corresponding to the target object.
7. The system according to claim 6, characterized in that There is a mapping relationship between the local storage location of the target file corresponding to the target object and the storage location of the target file corresponding to the target object on the server; When the second module is used to obtain the target file corresponding to the target object from the local or the server according to the path information of the target object, it is specifically used to: Determine a local storage location of a target file corresponding to the target object according to the path information of the target object and the mapping relationship; If the target file corresponding to the target object exists in the local location, obtaining the target file corresponding to the target object from the local location; If the target file corresponding to the target object does not exist locally, the target file corresponding to the target object is obtained from the server.
8. The system according to claim 7, characterized in that The second module is also used for: After obtaining the target file corresponding to the target object from the server, the target file corresponding to the target object is saved to the local according to the mapping relationship.
9. The system according to any one of claims 6 to 8, characterized in that: The target file includes HTML tags, JS codes and CSS files.
10. The system according to any one of claims 6 to 8, characterized in that: The target object is a page in the target application or a mini-program associated with the target application.
11. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions stored in the memory, so that the device executes the method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is implemented.
13. A computer program product comprising instructions, characterized in that The computer program product stores instructions, and when the computer program product is run on a computer, the computer is enabled to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Electronic device, terminal page loading method and storage medium
CN108763525A
