Resource loading prompting method and device, equipment, storage medium and program product
By obtaining resource transfer speed and file size, estimating the loading time in real time and outputting prompt information and progress bars, the white screen problem caused by too long resource loading time in web applications is solved, and the user experience is optimized.
Patent Information
- Application Number
- CN202510351097.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-08-01
AI Technical Summary
In web application development, when the user's network environment is poor or the resource files are large, the resource loading time is too long, resulting in a white screen phenomenon, affecting the user experience.
By obtaining the resource transfer speed and file size corresponding to the resource request, the loading time is estimated in real time, and when the preset threshold is exceeded, the resource loading prompt information is output, including image and text prompts, and the transmission progress bar is generated, and the resource loading image is obtained using CDN to obtain resource loading and resource files are cached.
It effectively avoids the problem that users mistakenly think that page resources cannot be loaded due to long-term white screens, optimizes the user experience, reduces anxiety through real-time feedback and progress bars, and improves the transparency and efficiency of the loading process.
Smart Images

Figure CN120407967A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of resource loading, and particularly to a resource loading prompt method, device, equipment, storage medium and program product. Background Art
[0002] In Web (World Wide Web) application development, it is necessary to deploy a Web project to an online server, and the user side sends a network request to the server to access Web page resources.
[0003] However, when the network environment where the user is located is poor or the resource file requested by the user is large, the loading of page resources often takes a long time, and there will be a long white screen state. The white screen phenomenon not only causes the user to wait too long, but also makes the user think that the page resources cannot be loaded normally, thus seriously affecting the user experience. Summary of the Invention
[0004] The main purpose of this application is to provide a resource loading prompt method, device, equipment, storage medium and program product, aiming to solve the technical problem that the white screen phenomenon caused by too long resource loading time in related technologies affects the user experience.
[0005] To achieve the above object, this application proposes a resource loading prompt method, which includes:
[0006] In response to a user's resource request, obtain resource information corresponding to the resource request; the resource information includes resource transmission speed and resource file size;
[0007] Based on the resource information, determine the loading duration of the resource file;
[0008] In the case where the loading duration exceeds a preset threshold, output a resource loading prompt message.
[0009] In one embodiment, the resource loading prompt message includes a resource loading image;
[0010] In the case where the loading duration exceeds a preset threshold, the step of outputting a resource loading prompt message includes:
[0011] In the case where the loading duration exceeds a preset threshold, obtain a resource loading image through a Content Delivery Network (CDN); at least one resource loading image is cached in the CDN;
[0012] Output the resource loading image.
[0013] In one embodiment, after the step of determining the loading duration of the resource file based on the resource information, the following steps are further included:
[0014] Generate a resource transfer progress bar based on the resource transfer speed and the size of the resource file;
[0015] Output the resource transfer progress bar.
[0016] In one embodiment, the step of generating a resource transfer progress bar based on the resource transfer speed and the size of the resource file includes:
[0017] Determine the size of the loaded resource based on the resource transfer speed and the elapsed transfer duration;
[0018] Determine the resource loading ratio based on the size of the loaded resource and the size of the resource file;
[0019] Generate a resource transfer progress bar based on the resource loading ratio.
[0020] In one embodiment, the resource loading prompt information further includes text prompt information.
[0021] In one embodiment, the resource loading prompt method further includes:
[0022] After the resource loading is completed, cache the resource file corresponding to the resource request to the local server.
[0023] In addition, to achieve the above object, the present application also proposes a resource loading prompt device, and the resource loading prompt device includes:
[0024] An information acquisition module, configured to acquire resource information corresponding to a resource request in response to a user's resource request; the resource information includes the resource transfer speed and the size of the resource file;
[0025] A duration determination module, configured to determine the loading duration of the resource file based on the resource information;
[0026] A loading prompt module, configured to output resource loading prompt information when the loading duration exceeds a preset threshold.
[0027] In addition, to achieve the above object, the present application also proposes a resource loading prompt device, and the resource loading prompt device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the resource loading prompt method as described above.
[0028] In addition, to achieve the above object, the present application also proposes a storage medium, the storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the resource loading prompt method as described above.
[0029] In addition, to achieve the above object, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the resource loading prompt method as described above are implemented.
[0030] One or more technical solutions proposed by the present application have at least the following technical effects:
[0031] In the resource loading prompt method proposed by the present application, a user can initiate a resource request on the web page of the resource loading prompt device. In response to the resource request initiated by the user, the device can obtain the resource information corresponding to the resource request. Among them, the resource information includes the resource transmission speed and the resource file size. Thus, the loading duration required for the resource file corresponding to the resource request can be estimated in real time according to the obtained resource information such as the resource transmission speed and the resource file size. If the loading duration exceeds a preset threshold, the resource loading prompt device will output a resource loading prompt message to remind the user that the current resource is being loaded. This can avoid the problem that the user mistakes that the page resources cannot be loaded normally due to facing the blank page during the loading process for a long time, and optimize the user's resource loading experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0033] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0034] Figure 1 It is a schematic flowchart provided for Embodiment 1 of the resource loading prompt method of the present application;
[0035] Figure 2 It is a schematic flowchart of the resource loading prompt method provided for Embodiment 1 of the present application;
[0036] Figure 3 It is a schematic module structure diagram of the resource loading prompt device for the embodiments of the present application;
[0037] Figure 4 It is a schematic device structure diagram of the hardware operating environment involved in the resource loading prompt method for the embodiments of the present application.
[0038] The implementation, functional features, and advantages of the object of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of this application and are not used to limit this application.
[0040] To better understand the technical solutions of this application, the following will be described in detail in combination with the accompanying drawings of the specification and specific implementation manners.
[0041] The main solution of the embodiment of this application is that: the resource loading prompt device responds to the user's resource request and obtains the resource information corresponding to the resource request; wherein, the resource information includes the resource transmission speed and the resource file size; based on the resource information, the loading duration of the resource file is determined; and when the loading duration exceeds a preset threshold, a resource loading prompt information is output.
[0042] In Web (World Wide Web) application development, it is necessary to deploy the Web project to an online server, and the user side sends a network request to the server to access the Web page resources. However, when the network environment where the user is located is poor or the resource file requested by the user is large, the page resource loading often takes a long time, and there will be a long white screen state. The white screen phenomenon not only causes the user to wait for too long, but also makes the user think that the page resources cannot be loaded normally, thus seriously affecting the user experience.
[0043] This application provides a solution. The resource loading prompt device responds to the resource request initiated by the user and obtains resource information such as the resource transmission speed and the resource file size corresponding to the resource request; thereby, the loading duration required for the corresponding resource file can be estimated in real time according to the resource information; if the loading duration exceeds the preset threshold, the resource loading prompt device will output a resource loading prompt information to remind the user that the current resource is being loaded. Thus, the problem that the user thinks that the page resources cannot be loaded normally due to facing the white screen during the loading process for a long time can be avoided, and the user's resource loading experience is optimized.
[0044] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of implementing the above functions. Hereinafter, taking the resource loading prompt device as an example, hereinafter referred to as the device for short, this embodiment and the following embodiments will be described.
[0045] Based on this, the embodiment of this application provides a resource loading prompt method, referring to Figure 1 , Figure 1 is the flow schematic diagram of the first embodiment of the resource loading prompt method of this application.
[0046] In this embodiment, the resource loading prompt method includes steps S100 to S300:
[0047] Step S100: In response to a user's resource request, obtain the resource information corresponding to the resource request.
[0048] Among them, the resource information includes the resource transmission speed and the resource file size.
[0049] Step S200: Based on the resource information, determine the loading duration of the resource file.
[0050] Step S300: When the loading duration exceeds a preset threshold, output a resource loading prompt message.
[0051] Specifically, the resource loading prompt device may include a front end and a back-end server; the front end is available for users to initiate resource requests, and the back-end server is used to store resource files, etc.; users can initiate a resource request for a certain resource through a front-end client (such as a browser, an application, etc.). After detecting the operation of the user initiating the resource request, the device can respond to the user's resource request and obtain the resource information corresponding to the resource request. For example, a user can initiate a resource request in the front-end web page in the form of entering a website address into a browser or clicking on a link on the browser web page to obtain the resource file corresponding to the website address or the link. The front-end web page will send the user's resource request to the back-end server, and the device determines the resource transmission speed of the resource file corresponding to the resource request and relevant resource information such as the resource file size through the back-end server. Among them, the resource transmission speed is the transmission rate of the resource file in the current network environment, and the resource transmission speed can be obtained through a network bandwidth measurement tool; or it can also be obtained by monitoring with a pre-embedded script on the front-end web page. The pre-embedded script is a script written in the front-end web page for detecting the downstream speed of the resource server (i.e., the back-end server); the resource file size is the total data volume size of the resource file, which can be obtained from the metadata of the resource file or from the resource management system in the back-end server.
[0052] After obtaining the resource information, the estimated loading duration of the resource file can be determined according to the resource transmission speed and the resource file size. For example, the calculation formula for the loading duration can be: loading duration = resource file size / resource transmission speed; the resource file size can be in bytes, and the resource transmission speed can be in bytes per second. Depending on different network conditions and resource file sizes, the determined loading duration will be different. After determining the estimated loading duration of the resource file, it is necessary to further determine whether the loading duration exceeds the preset threshold. If the loading duration exceeds the preset threshold, the device can output a resource loading prompt message on the front-end page to remind the user that the current resource is being loaded and may require a certain waiting time, so as to prevent the user from mistakenly thinking that the page resource loading has failed.
[0053] It should be noted that the above preset threshold can be a fixed value or a variable value set according to the user's experience requirements or network environment. The resource loading prompt information can include text prompt information, and the resource loading prompt information can be output in the form of a pop-up window. For example, the text prompt information "Loading slowly, please wait" is popped up on the front-end page. Or as a feasible implementation, the resource loading prompt information can also include a resource loading image; in this implementation, step S300 can specifically include steps S310 to S320:
[0054] Step S310, when the loading duration exceeds the preset threshold, obtain the resource loading image through the Content Delivery Network (CDN).
[0055] Among them, at least one resource loading image is cached in the CDN.
[0056] Step S320, output the resource loading image.
[0057] Specifically, the CDN (Content Delivery Network) is a distributed network architecture that can cache files such as resource loading images in edge servers closer to users in advance. Thus, the resource loading image can be obtained relatively quickly through the CDN, and the obtained resource loading image file is usually smaller. In theory, it will be loaded and completed earlier than the resource file corresponding to the resource request being loaded. The above resource loading image can be a static image full of interest or a dynamic image; after obtaining the resource loading image through the CDN, it can be parsed and echoed back to the front-end for output to inform the user that the resource is being loaded in the form of an image. Through the feedback mechanism in the form of an image, the user's sense of uncertainty can be reduced, and at the same time, the resource loading image full of interest can relieve the boredom of the user during the waiting for resource loading and enhance the user experience.
[0058] In addition, in order to further optimize the user experience and enable the user to clearly understand the implementation process of resource loading, in a feasible implementation, after step S200, steps A100 to A200 can also be included:
[0059] Step A100, generate a resource transmission progress bar based on the resource transmission speed and the resource file size.
[0060] Step A200, output the resource transmission progress bar.
[0061] It is not difficult to understand that, based on the resource transmission speed and the size of the resource file, the progress of file loading can be calculated. The resource transmission progress bar can be updated in real time according to the currently transmitted data volume and the total size of the resource file, showing the percentage of the current loading completed by the user. Specifically, step A100 may include: determining the size of the loaded resources based on the resource transmission speed and the transmitted duration; determining the resource loading ratio based on the size of the loaded resources and the size of the resource file; generating a resource transmission progress bar based on the resource loading ratio.
[0062] The resource transmission speed can be the amount of data transmitted per second, and the transmitted duration refers to the time elapsed from the start of resource loading to the current moment, usually in seconds; the size of the loaded resources can be determined according to the calculation formula for the size of the loaded resources, and the calculation formula is: size of the loaded resources = resource transmission speed × transmitted duration; it should be noted that in the case of a relatively stable current network environment (i.e., no large fluctuations occur during the transmission process), the transmission speed measured at a certain moment can be used as the resource transmission speed to calculate the size of the loaded resources constantly; while in an unstable network environment (i.e., the transmission rate fluctuates greatly every moment), the real-time measured transmission speed is used as the resource transmission speed to calculate the size of the loaded resources in real time. The current resource loading ratio can be determined according to the size of the loaded resources at the current moment and the size of the resource file; then the resource loading ratio is converted into the display length of the progress bar to generate the corresponding resource transmission progress bar; for example, if the total length of the progress bar is 100 pixels and the resource loading ratio is 25%, then the progress bar shows 25 pixels of the filled part, and the remaining 75 pixels can be the blank part.
[0063] The resource loading progress bar can be output by the front end of the device, so that the user can understand the overall state of resource loading through the change of the progress bar on the front-end page. The update of the progress bar is real-time, and this real-time dynamic update effect can effectively reduce the user's sense of anxiety. Especially when the loading time is relatively long, the user can know that the resource is being loaded and can roughly estimate when it will be completed, which can effectively improve the user experience.
[0064] It is worth mentioning that, in order to improve the user's secondary access speed and reduce network bandwidth consumption, the resource file corresponding to the resource request can be cached to the local server after the resource loading is completed. That is to say, when the user initiates the first resource request for a certain resource file, after the device completes the resource file loading operation corresponding to the first resource request, the resource file can be cached to the local server. Thus, when the user makes a secondary resource request for the resource file, it can be directly obtained from the local server without repeated loading, which can effectively improve the secondary access speed.
[0065] It can be understood that in the resource loading prompt method provided by the embodiments of the present application, the device can respond to a resource request initiated by a user and obtain resource information such as the resource transmission speed and the resource file size corresponding to the resource request; thereby, the loading duration required for the corresponding resource file can be estimated in real time according to the resource information; if the loading duration exceeds a preset threshold, the resource loading prompt device will output a resource loading prompt message to remind the user that the current resource is being loaded. Thus, the problem that the user may mistake that the page resources cannot be loaded normally due to facing the white screen of the page during the loading process for a long time can be avoided, and the user's resource loading experience is optimized.
[0066] Exemplarily, to facilitate understanding of the implementation process of the resource loading prompt method of this embodiment, please refer to Figure 2 , Figure 2 which provides a schematic diagram of the brief process of a resource loading prompt method. Specifically:
[0067] When developing a Web page project, developers can first build a Web page project according to the task requirements, and then write a script (hereinafter referred to as an automated script) in the Web page to detect the downstream speed of the resource server for subsequent resource transmission speed monitoring. After completing the construction of the Web project, users can use the Web page to make resource requests. Users can start the Web page and then use the API (Application Programming Interface) to initiate a resource request to the resource server for data transmission. Generally, after the life cycle of the API resource request is triggered on the Web page, three-way handshake interaction can be performed to establish data transmission to obtain the corresponding resource file from the resource server. By starting the automated script, the speed of data transmission (i.e., resource transmission speed) can be obtained in real time and recorded, and then the size of the resource file requested from the resource server can be obtained. Thus, the loading duration required to obtain the resource file can be determined based on the transmission speed and the resource file size. At the same time, a progress bar animation can be constructed by comparing the resource downstream speed (i.e., resource transmission speed) and the resource file. The progress bar animation can display the loading status of the resource file in real time. Then, a judgment program is set through the JS script: set a timeout threshold (preset threshold), and determine whether the loading duration exceeds the timeout threshold. If it exceeds the threshold, it is considered that the resource acquisition speed is slow and it takes a long time to load. At this time, the JS script will also trigger a mechanism to obtain a LOADING gif (i.e., resource loading image) at another CDN address; accelerated by the CDN content delivery network, the acquisition speed of the LOADING gif is faster, and the obtained picture file is relatively small. In theory, it will be loaded and completed earlier than the ongoing network request. The obtained LOADING gif can be echoed back to the browser page after data parsing in the browser to prompt the user that this web page is loading, please wait patiently. For example, when the timeout threshold is 30s, when the loading duration exceeds 30s, the device will trigger the above mechanism to obtain the LOADING gif through the CDN for output to prompt the user. In addition, when the normal resource request of the Web page is completed, the browser cache mechanism can be started, that is, the resource file is cached on the local server of the Web browser, and there is no need to request the resource file again during the second loading. Combining the above content can achieve the purpose of real-time display of the loading progress, eliminating the white screen of the web page during the first loading, and optimizing the user experience.
[0068] It should be noted that the above example is only for understanding the present application and does not constitute a limitation on the resource loading prompt method of the present application. Based on this technical concept, more forms of simple transformations are within the protection scope of the present application.
[0069] The present application also provides a resource loading prompt device, please refer to Figure 3, the resource loading prompt device includes:
[0070] An information acquisition module 10, configured to acquire resource information corresponding to a resource request in response to a user's resource request; the resource information includes a resource transmission speed and a resource file size;
[0071] A duration determination module 20, configured to determine a loading duration of the resource file based on the resource information;
[0072] A loading prompt module 30, configured to output a resource loading prompt message when the loading duration exceeds a preset threshold.
[0073] The resource loading prompt device provided by this application adopts the resource loading prompt method in the above embodiment, and can solve the technical problem that the white screen phenomenon caused by too long resource loading time in the related art affects the user experience. Compared with the related art, the beneficial effects of the resource loading prompt device provided by this application are the same as those of the resource loading prompt method provided by the above embodiment, and other technical features in the above resource loading prompt device are the same as the features disclosed in the above embodiment method, and will not be elaborated here.
[0074] This application provides a resource loading prompt device, which includes: 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 instructions are executed by the at least one processor to enable the at least one processor to execute the resource loading prompt method in the first embodiment above.
[0075] Next, refer to Figure 4 , which shows a schematic structural diagram of a resource loading prompt device suitable for implementing the embodiments of this application. The resource loading prompt device in the embodiments of this application may include, but is not limited to, mobile terminals such as laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as desktop computers. Figure 4 The shown resource loading prompt device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of this application.
[0076] Such as Figure 4As shown, the resource loading prompt device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the resource loading prompt device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the resource loading prompt device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a resource loading prompt device with various systems, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems can be implemented or had.
[0077] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.
[0078] The resource loading prompt device provided by the present application adopts the resource loading prompt method in the above embodiments, and can solve the technical problem that the white screen phenomenon caused by too long resource loading time in the related art affects the user experience. Compared with the related art, the beneficial effects of the resource loading prompt device provided by the present application are the same as those of the resource loading prompt method provided by the above embodiments, and other technical features in the resource loading prompt device are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.
[0079] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0080] As described above, the above are only specific embodiments of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0081] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the resource loading prompt method in the above embodiments.
[0082] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0083] The above computer-readable storage medium can be included in the resource loading prompt device; or it can exist separately without being assembled into the resource loading prompt device.
[0084] The above computer-readable storage medium stores one or more programs. When the one or more programs are executed by a resource loading prompt device, the resource loading prompt device is caused to: in response to a user's resource request, obtain resource information corresponding to the resource request; the resource information includes a resource transmission speed and a resource file size; based on the resource information, determine a loading duration of the resource file; and when the loading duration exceeds a preset threshold, output a resource loading prompt message.
[0085] Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, executed as a stand-alone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by connecting through an Internet service provider using the Internet).
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0087] The modules described in the embodiments of the present application may be implemented in software or in hardware. In some cases, the name of the module does not constitute a limitation on the unit itself.
[0088] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned resource loading prompt method, which can solve the technical problem that the blank screen phenomenon caused by too long resource loading time in the related art affects the user experience. Compared with the related art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the resource loading prompt method provided by the above embodiment, and will not be elaborated here.
[0089] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the resource loading prompt method as described above are implemented.
[0090] The computer program product provided by this application can solve the technical problem that the blank screen phenomenon caused by too long resource loading time in the related art affects the user experience. Compared with the related art, the beneficial effects of the computer program product provided by this application are the same as those of the resource loading prompt method provided by the above embodiment, and will not be elaborated here.
[0091] The above are only partial embodiments of this application, and thus do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application by using the content of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A resource loading prompt method, characterized in that, The resource loading prompt method includes: In response to a user's resource request, obtaining resource information corresponding to the resource request; the resource information includes a resource transmission speed and a resource file size; Based on the resource information, determining the loading duration of the resource file; When the loading duration exceeds a preset threshold, outputting a resource loading prompt message.
2. The resource loading prompt method according to claim 1, wherein The resource loading prompt message includes a resource loading image; The step of outputting a resource loading prompt message when the loading duration exceeds a preset threshold includes: When the loading duration exceeds a preset threshold, obtaining the resource loading image through a content delivery network (CDN); at least one resource loading image is cached in the CDN; Outputting the resource loading image.
3. The resource loading prompt method according to claim 1, wherein After the step of determining the loading duration of the resource file based on the resource information, the following is further included: Generating a resource transmission progress bar based on the resource transmission speed and the resource file size; Outputting the resource transmission progress bar.
4. The resource loading prompt method according to claim 3, wherein, The step of generating a resource transmission progress bar based on the resource transmission speed and the resource file size includes: Based on the resource transmission speed and the elapsed transmission duration, determining the size of the loaded resource; Based on the size of the loaded resource and the resource file size, determining the resource loading ratio; Generating the resource transmission progress bar based on the resource loading ratio.
5. The resource loading prompt method according to claim 1, wherein The resource loading prompt message further includes a text prompt message.
6. The resource loading prompt method according to any one of claims 1 to 5, characterized in that, The resource loading prompt method further includes: After the resource is loaded, caching the resource file corresponding to the resource request to a local server.
7. A resource loading prompt device, characterized in that, The resource loading prompt device includes: An information acquisition module, configured to obtain resource information corresponding to the resource request in response to a user's resource request; the resource information includes a resource transmission speed and a resource file size; A duration determination module, configured to determine the loading duration of the resource file based on the resource information; A loading prompt module, configured to output a resource loading prompt message when the loading duration exceeds a preset threshold.
8. A resource loading prompt device, characterized in that, The resource loading prompt device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the resource loading prompt method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the resource loading prompt method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps of the resource loading prompt method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Loading prompting method and loading prompting device
CN106815036A
Page resource loading method and device and storage medium
CN110162726A
Page processing method, object processing method and device and equipment
CN113127788A