Webpage multimedia resource loading method, electronic equipment and vehicle

By determining the current network speed in the vehicle and building a collection of multimedia resource addresses, and adapting multimedia resources to load web pages, the problem of slow web page loading caused by the increase in multimedia resource file capacity is solved, and fast web page loading in different locations is achieved, improving user experience.

CN119862337APending Publication Date: 2025-04-22GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411916039.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

As the interaction complexity and visual effects of web pages improve, the file capacity of multimedia resources increases, resulting in slow loading of web pages, affecting user experience. Especially when the vehicle moves, the network speed changes greatly, making it difficult to meet the page loading needs.

Method used

By determining the current network speed, a multimedia resource address collection is constructed, where the resources corresponding to each address are obtained by downgrading and compression based on the original multimedia resource. The target multimedia resource address is determined in the address collection based on the current network speed, and the original resource reference address in the web page is modified, and the adapted multimedia resource is called for web page loading.

Benefits of technology

It realizes adaptive calls to multimedia resources based on the current network speed, ensuring that web pages are loaded at different locations quickly, reducing multimedia resources loading time, improving overall web page loading speed, avoiding load waiting issues, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862337A_ABST
    Figure CN119862337A_ABST
Patent Text Reader

Abstract

According to the webpage multimedia resource loading method, the electronic equipment and the vehicle, the current network speed is determined through the test reference file, so that the current network condition is known, and data support is provided for loading of multimedia resources. Then, carrying out degradation compression on the original multimedia resource with the maximum file capacity to obtain network speed level resources corresponding to different network speeds, establishing a unique multimedia resource address for each network speed level resource to obtain a multimedia resource address set, and providing corresponding multimedia resource addresses for different network speeds; and hierarchical calling of multimedia resources is realized. The target multimedia resource address is determined in the multimedia resource address set according to the current network speed, so that multimedia resources are called according to the current network speed, and it is ensured that the current network speed can meet the loading requirement of the corresponding target multimedia resource; therefore, the problem of loading waiting can be avoided when the vehicle carries out webpage loading at different positions, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of web page resource loading, and in particular to a method for loading web page multimedia resources, an electronic device and a vehicle. Background Art

[0002] The content of a web page consists of Cascading Style Sheets (CSS), HyperText Markup Language (HTML), dynamic programming languages ​​(JavaScript, JS), multimedia resources, etc. When a web page is loading resources, the resources can be accelerated through gzip compression and Content Delivery Network (CDN). On the basis of the above optimization and speed-up, the limitation that affects the web page loading speed is mainly in the multimedia resources. With the demand for the improvement of the complexity of web page interaction and visual effects, the file capacity of multimedia resources is getting larger and larger, which causes the web page loading speed to be dragged down, resulting in slow web page loading speed and a bad user experience. Summary of the invention

[0003] In view of this, the purpose of the present application is to propose a method for loading multimedia resources of a web page, an electronic device and a vehicle, so as to ensure that the vehicle can have a faster page loading speed at different locations.

[0004] Based on the above purpose, the present application provides a method for loading multimedia resources on a web page, comprising:

[0005] Determine the current network speed and whether the currently loaded web page is a historical web page;

[0006] In response to the currently loaded web page not being a historical web page, determining a multimedia resource address set; wherein the network speed grade resource corresponding to each multimedia resource address in the multimedia resource address set is obtained by downgrading and compressing the original multimedia resource in the web page resource;

[0007] Determine a target multimedia resource address in the multimedia resource address set according to the current network speed, and modify the original resource reference address in the web page to a target reference address corresponding to the target multimedia resource address;

[0008] Based on the current network speed, a target multimedia resource corresponding to the target multimedia resource address is called according to the target reference address, and a web page is loaded according to the target multimedia resource.

[0009] Based on the same inventive concept, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.

[0010] Based on the same inventive concept, the present disclosure also provides a vehicle, comprising the electronic device as described above.

[0011] From the above, it can be seen that the web multimedia resource loading method, electronic device and vehicle provided by the present application determine the target multimedia resource address in the multimedia resource address set according to the current network speed, and realize the calling of multimedia resources according to the current network speed, so as to ensure that the current network speed can meet the loading requirements of the corresponding target multimedia resources, so as to ensure that the vehicle can quickly complete the loading of web pages at different locations, reduce the loading time of multimedia resources in the internal web pages of the vehicle, thereby improving the overall loading speed of the web page, avoiding the problem of loading waiting, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0013] Figure 1 This is a flow chart of a method for loading multimedia resources on a web page according to an embodiment of the present application;

[0014] Figure 2 A flow chart for determining the current network speed for an embodiment of the present application;

[0015] Figure 3 A flowchart of downgrading and compressing an embodiment of the present application;

[0016] Figure 4 A flowchart for establishing a unique multimedia resource address for an embodiment of the present application;

[0017] Figure 5 A flowchart for determining a target multimedia resource address for an embodiment of the present application;

[0018] Figure 6 A flowchart for determining a target reference address for an embodiment of the present application;

[0019] Figure 7 This is a flow chart of using local cache to load web pages in an embodiment of the present application;

[0020] Figure 8This is a schematic diagram of the structure of a device for loading multimedia resources on a web page according to an embodiment of the present application;

[0021] Fig. 9 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0023] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0024] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0025] Based on the description of the above background technology, the related technology also has the following situations:

[0026] Cascading Style Sheets is a style sheet language used to describe the presentation of HTML or XML documents. CSS can control the layout, font, color, size, etc. of web page elements, making the web page more beautiful and easy to maintain. CSS is mainly used to define the style and layout of web pages. For example, you can use CSS to change the font, color, size, and spacing of web page content, or divide the content into columns, or even add animation effects. CSS can not only modify web pages statically, but also dynamically format the elements of the web page in conjunction with various scripting languages. CSS provides a rich document style appearance, as well as the ability to set text and background properties. It can be seen that CSS controls the layout, font, color, size, etc. of web page elements, which are all resources with small file capacity and low requirements for network speed, and generally do not affect the loading speed of the page.

[0027] HTML includes a series of tags, which can unify the document format on the network and connect scattered Internet resources into a logical whole. HTML text is a descriptive text composed of HTML commands, which can describe text, graphics, animations, sounds, tables, links, etc. Hypertext is a way of organizing information. It associates text, graphics and other information media in the text through hyperlinks. These interrelated information media may be in the same text, or in other files, or files on a computer that is geographically far away. This way of organizing information connects information resources distributed in different locations in a random way, making it convenient for people to find and retrieve information.

[0028] HTML is a basic technology that is often used by many websites together with CSS and JavaScript to design web pages, web applications, and mobile application user interfaces. Web browsers can read HTML files and render them into visual web pages. HTML describes the structural semantics of a website as clues are presented, making it a markup language rather than a programming language. HTML elements are the cornerstones of building websites. HTML allows images and objects to be embedded, and can be used to create interactive forms. It is used to structure information - such as titles, paragraphs, and lists, etc. It can also be used to describe the appearance and semantics of documents to a certain extent. The language form of HTML is HTML elements surrounded by angle brackets (such as). Browsers use HTML tags and scripts to interpret web page content, but do not display them on the page. It can be seen that the file size of resources processed by HTML is also small, and the requirements for network speed are low, which generally does not affect the loading speed of the page.

[0029] JavaScript is a dynamic programming language that is widely used in web development, mainly to enhance the interactivity and dynamism of web pages. As one of the core technologies of web development, it works together with HTML and CSS. HTML is responsible for defining the content structure of the web page, CSS handles the style and layout, and JavaScript controls the behavior and interaction of the web page. Users can use JavaScript for event handling, form validation, animation creation and other functions. It can be seen that JavaScript itself does not have a large network speed requirement, but when JavaScript is used to create animations, it may also need to use multimedia resources. Multimedia resources include multiple media forms such as text, sound and images. In computer systems, multimedia refers to a human-computer interactive information exchange and communication media that combines two or more media. The multimedia resources used include text, pictures, photos, sounds, animations and videos, as well as the interactive functions provided by the program.

[0030] With the demand for improved complexity of web page interactions and visual effects, the file capacity of resources such as images, photos, sounds, animations and videos is getting larger and larger. The demand for network speed to ensure smooth page loading is getting higher and higher. Due to the frequent movement of vehicles, the network environment of the vehicle changes, resulting in large changes in the vehicle's network speed. It may cause the current network speed of the vehicle to be unable to meet the loading requirements of the current page, resulting in a waiting period while the page is loading, affecting the user experience.

[0031] The web page multimedia resource loading method, electronic device and vehicle provided in the embodiments of the present application determine the target multimedia resource address in the multimedia resource address set according to the current network speed, and call the multimedia resource according to the current network speed, so as to ensure that the current network speed can meet the loading requirements of the corresponding target multimedia resource, so as to ensure that the vehicle can quickly complete the loading of web pages at different locations, reduce the loading time of multimedia resources in the internal web pages of the vehicle, thereby improving the overall loading speed of the web page, avoiding the problem of loading waiting, and improving the user experience.

[0032] The following describes in detail the method for loading multimedia resources on a web page provided by the embodiments of the present application in conjunction with the accompanying drawings.

[0033] In some embodiments, Figure 1 As shown, a method for loading multimedia resources on a web page includes:

[0034] Step 101: Determine the current network speed and determine whether the currently loaded web page is a historical web page.

[0035] In specific implementation, during the web page loading process, HTML is responsible for defining the content structure of the web page, CSS handles the style and layout, and JavaScript controls the behavior and interaction of the web page. When implementing the above three processes, the corresponding multimedia resources need to be called. For multimedia resources with small file sizes (less than 1M) such as text and sound, a lower network speed can achieve their loading in the web page. However, for multimedia resources with large file sizes (greater than 1M) such as pictures, animations and videos, if the network speed is slow, the loading process will enter a waiting state, which is often called "stuck", for example, the web page displays "loading".

[0036] Because the network speed determines the loading rate of various resources in the web page, the loading time of the web page = file capacity / network speed. It can be seen that the key factors that determine the loading time are the network speed and the file capacity of the multimedia resources that need to be loaded. There are two ways to reduce the loading time of a web page. One is to increase the network speed, that is, to reduce the loading time and increase the web page loading rate by increasing the denominator. However, as the vehicle moves, the network speed will change, and the network speed is determined by the external environment. The vehicle side cannot unilaterally increase the network speed (generally it can only limit the speed, that is, reduce the network speed, but reducing the network speed will further increase the loading time, resulting in a decrease in the loading rate, and generally the network speed is not limited), so it is impossible to reduce the loading time by increasing the network speed.

[0037] Another way is to reduce the file size of multimedia resources, that is, to reduce the loading time and increase the web page loading rate by reducing the numerator. However, reducing the file size of multimedia resources will lead to a worse display effect of the media files. Therefore, when reducing the file size of multimedia resources, you first need to determine the current network speed, and then try to select multimedia files with relatively large file sizes within the range allowed by the current network speed, so as to maximize the display effect of multimedia resources in the web page while ensuring the loading rate.

[0038] The method to determine the current network speed is to use the current network speed to load the test benchmark file. In order to ensure the test efficiency of the current network speed, the file capacity of the test benchmark file is generally small, for example, 10KB. Then the loading time of the test benchmark file using the current network speed is recorded, and the ratio of the file capacity of the test benchmark file to the loading time is determined as the current network speed. Because the file capacity of the test benchmark file is a fixed value, the loading time can also be used directly to equivalently represent the current network speed, thereby reducing the calculation steps and improving the test efficiency.

[0039] Determining whether the currently loaded web page is a historical web page can determine the subsequent page loading strategy. If the currently loaded web page is a historical web page, it means that there are corresponding historical multimedia resources that have been loaded. These historical multimedia resources are cached locally. At this time, it can be determined whether the local cached multimedia resources can be directly used for loading based on the historical network speed level corresponding to the historical web page and the current network speed level. If the currently loaded web page is not a historical web page, it is necessary to call multimedia resources to load the page.

[0040] Step 102: In response to the currently loaded web page not being a historical web page, a multimedia resource address set is determined; wherein the network speed grade resource corresponding to each multimedia resource address in the multimedia resource address set is obtained by downgrading and compressing the original multimedia resource in the web page resource.

[0041] In specific implementation, if the currently loaded web page is not a historical web page, it is necessary to call multimedia resources to load the page. At this time, it is necessary to build a network speed grade resource corresponding to the network speed grade in advance. After determining the current network speed, the network speed grade resource that matches the current network speed can be used to load the page to reduce the page loading time. The call of the network speed grade resource needs to be implemented through a multimedia resource address set, where the network speed grade resource corresponding to each multimedia resource address in the multimedia resource address set is obtained by downgrading and compressing the original multimedia resource in the web page resource. The process of building the multimedia resource address set is as follows:

[0042] Step 1011: downgrade and compress the original multimedia resources in the web page resources to obtain a network speed grade resource set.

[0043] In specific implementation, when the network speed cannot be changed, the loading rate of multimedia resources in the web page can only be increased by reducing the file capacity of multimedia resources. In addition, in order to ensure the presentation of complete multimedia content, other attributes of multimedia resources cannot be changed when reducing the file capacity of multimedia resources, so compressing multimedia resources is the best processing method. Since the range of variation of the current network speed is uncertain, in order to cover as much network speed range as possible, it is necessary to downgrade and compress the original multimedia resources into multiple compressed multimedia resources of different file capacities, wherein the more compressed multimedia resources there are, the more accurate the adaptation to different network speeds, the more the display effect of the original multimedia resources is retained, and the better the display effect.

[0044] For example, if the file capacity of the original multimedia resource is 1000KB, after downgrade compression, the first compressed multimedia resource of 750KB, the second compressed multimedia resource of 500KB and the third pair of media resources of 200KB are obtained respectively. The original multimedia resources and the compressed multimedia resources are sorted in order from high to low. The sorting result is: 1000KB original multimedia resource > 750KB first compressed multimedia resource > 500KB second compressed multimedia resource > 200KB third compressed multimedia resource, achieving downgrade compression.

[0045] Downgrade compression is to compress the original multimedia resources into at least one compressed multimedia resource with a smaller file size. Downgrade compression can be implemented in two ways according to the computing power of the vehicle. One is a multi-threaded simultaneous compression method, and the other is a single-threaded step-by-step compression mode.

[0046] Among them, for the downgrade compression scheme of multi-threaded simultaneous compression, it is necessary to select a target compression ratio from the largest to the smallest in the preset compression ratio set, and use different threads to compress the original multimedia resources according to the target compression ratio to obtain multiple compressed multimedia resources. Exemplarily, for the case of three threads, the target compression ratios are 75%, 50%, and 20% respectively. The three target compression ratios are respectively assigned to three threads. The three threads simultaneously downgrade and compress the original multimedia resources according to the corresponding target compression ratios to obtain a first compressed multimedia resource of 750KB, a second compressed multimedia resource of 500KB, and a third pair of media resources of 200KB. Multi-threaded compression is performed simultaneously, which improves the compression efficiency.

[0047] For the single-threaded step-by-step compression mode, the original multimedia resource of 1000KB is first compressed into a first compressed multimedia resource of 750KB, then the first compressed multimedia resource of 750KB is compressed into a second compressed multimedia resource of 500KB, and then the second compressed multimedia resource of 500KB is compressed into a third compressed multimedia resource of 200KB, thereby realizing step-by-step downgrade compression, providing suitable multimedia resources for different current network speeds, and ensuring the smooth loading of multimedia resources in the web page.

[0048] By integrating compressed multimedia resources and original multimedia resources, we obtain a set of network speed level resources that are suitable for different network speed levels.

[0049] Step 1012: Establish a unique multimedia resource address for each network speed grade resource in the network speed grade resource set to obtain a multimedia resource address set.

[0050] During specific implementation, in order to facilitate the call of corresponding network speed grade resources when loading a web page, a unique multimedia resource address is established for each network speed grade resource in the network speed grade resource set. When loading a web page, the corresponding multimedia resource address is used to call the adapted network speed grade resource to achieve smooth loading of multimedia resources in the web page, avoid the occurrence of freezes and loading failures, and improve user experience.

[0051] Step 103: determine the target multimedia resource address in the multimedia resource address set according to the current network speed, and modify the original resource reference address in the web page to the target reference address corresponding to the target multimedia resource address.

[0052] In specific implementation, the multimedia resource address is a uniform resource locator (URL), which indicates the resource address on the Internet. For example, the multimedia resource address for locating a logo image file is logo.jpg. The reference address is a path, which indicates the resource address of the directory that references the multimedia resource. For example, the multimedia resource address logo.jpg of the logo image file is stored in the img folder, and the img folder is stored in the src folder. The directory that references the logo image file is src / img, and the reference address can be expressed as <img src=". logo.jpg"> Therefore, each reference address corresponds to a reference path of a multimedia resource. The multimedia resource address stored in the directory can be found through the reference address, thereby realizing the call of the multimedia resource.

[0053] After multimedia resources of different file capacities are prepared, it is necessary to determine the target multimedia resource address in the multimedia resource address set according to the current network speed. For example, the current network speed is divided into four network speed levels: greater than 1000kb / s, 400kb / s to 1000kb / s, 200kb / s to 400kb / s, and less than or equal to 200kb / s. If the current network speed is less than or equal to 200kb / s, it means that the current network speed is slow, and directly loading the original multimedia resource of 1000K will take a long time to load. Only by calling the third 200kb resource can the original multimedia resource be loaded. In order to avoid lag when compressing multimedia resources, the multimedia resource address corresponding to the third compressed multimedia resource is determined as the corresponding target multimedia resource address, and the original resource reference address in the web page is modified to the target reference address corresponding to the target multimedia resource address (if the target multimedia resource address is the multimedia resource address corresponding to the original multimedia resource, the original resource reference address is the same as the target reference address, and at this time, no change is required, or a replacement change is required, which will not affect the call to the resource), thereby realizing the use of the third compressed multimedia resource to load the multimedia content of the web page.

[0054] Step 104: Based on the current network speed, the target multimedia resource corresponding to the target multimedia resource address is called according to the target reference address, and the web page is loaded according to the target multimedia resource.

[0055] In the specific implementation, multimedia resources are called according to the current reference address. Since the current reference address corresponds to the target multimedia resource address, when multimedia resources are called according to the current reference address, the target multimedia resource corresponding to the target multimedia resource address will be called. Since the target multimedia resource is compatible with the current network speed, the current network speed can be used to smoothly and quickly complete the loading of the target multimedia resource in the web page, and there will be no loading jams or loading failures, avoiding the problem of loading waiting, thereby improving the user experience.

[0056] In summary, the method for loading multimedia resources on a web page provided by the embodiment of the present application can determine the current network speed by testing the benchmark file to understand the current network situation and provide data support for the loading of multimedia resources. Then, by downgrading and compressing the original multimedia resources with the largest file capacity, network speed grade resources corresponding to different network speeds are obtained, and a unique multimedia resource address is established for each network speed grade resource to obtain a multimedia resource address set, and corresponding multimedia resource addresses are provided for different network speeds to achieve hierarchical calling of multimedia resources. According to the current network speed, the target multimedia resource address is determined in the multimedia resource address set, and the calling of multimedia resources according to the current network speed is achieved, ensuring that the current network speed can meet the loading requirements of the corresponding target multimedia resource request, so as to ensure that the vehicle can quickly complete the loading of web pages at different locations, reducing the loading time of multimedia resources in the internal web pages of the vehicle, thereby improving the overall loading speed of the web page, avoiding the problem of loading waiting, and improving the user experience.

[0057] In some embodiments, Figure 2 As shown, determine the current network speed, including:

[0058] Step 201: Determine the loading time of the test benchmark file in the multimedia server according to the dynamic programming language.

[0059] In the specific implementation, a loading test benchmark file stored in the multimedia resource server is obtained, such as a 10KB picture, and the test benchmark file is loaded through the dynamic programming language Javascript, and the loading timing is performed. After the test benchmark file is loaded, the timing is stopped to obtain the loading time.

[0060] Step 202: Determine the current network speed based on the ratio of the file capacity of the test benchmark file to the loading time.

[0061] In specific implementation, network speed refers to the amount of data requested and returned per unit time when networked devices upload and download data. It can be understood as network speed = file capacity / loading time, so the ratio of the file capacity and loading time of the test benchmark file is the current network speed.

[0062] The current network speed is determined by testing the benchmark file to understand the current network situation and provide data support for the loading of multimedia resources so that the multimedia resources can adapt to the current network speed to reduce loading time.

[0063] In some embodiments, Figure 3 As shown, multimedia resources in web page resources are downgraded and compressed to obtain a network speed grade resource set, including:

[0064] Step 301: Determine the original multimedia resource with the largest file size among the multimedia resources.

[0065] During specific implementation, there may be resources with the same content but different file capacities in the multimedia resources. For example, for pictures with the same display content, there are picture resources with a file capacity of 1000KB and picture resources with a file capacity of 900KB. Since the larger the default file capacity, the better the display effect, the multimedia resource with the largest file capacity among the multimedia resources with the same content is determined as the original multimedia resource to ensure a better display effect after the page is loaded.

[0066] Step 302: Select a target compression ratio from the preset compression ratio set in descending order, and compress the original multimedia resource according to the target compression ratio to obtain a compressed multimedia resource.

[0067] In specific implementation, downgrade compression is to compress the original multimedia resources into at least one compressed multimedia resource with a smaller file size. The downgrade compression can be implemented in two ways according to the computing power of the vehicle, one is a multi-threaded simultaneous compression method, and the other is a single-threaded step-by-step compression mode.

[0068] Among them, for the downgrade compression scheme of multi-threaded simultaneous compression, it is necessary to select a target compression ratio from the largest to the smallest in the preset compression ratio set, and use different threads to compress the original multimedia resources according to the target compression ratio to obtain multiple compressed multimedia resources. Exemplarily, for the case of three threads, the target compression ratios are 75%, 50%, and 20% respectively. The three target compression ratios are respectively assigned to three threads. The three threads simultaneously downgrade and compress the original multimedia resources according to the corresponding target compression ratios to obtain a first compressed multimedia resource of 750KB, a second compressed multimedia resource of 500KB, and a third pair of media resources of 200KB. Multi-threaded compression is performed simultaneously, which improves the compression efficiency.

[0069] For the single-threaded step-by-step compression mode, the original multimedia resource of 1000KB is first compressed into a first compressed multimedia resource of 750KB, then the first compressed multimedia resource of 750KB is compressed into a second compressed multimedia resource of 500KB, and then the second compressed multimedia resource of 500KB is compressed into a third compressed multimedia resource of 200KB, thereby realizing step-by-step downgrade compression, providing suitable multimedia resources for different current network speeds, and ensuring the smooth loading of multimedia resources in the web page.

[0070] By integrating the compressed multimedia resources and the original multimedia resources, we can obtain network speed grade resources that are adapted to different network speed levels. Then, in order to facilitate the call of the corresponding network speed grade resources when loading the web page, a unique multimedia resource address is established for each network speed grade resource. When loading the web page, the adapted network speed grade resource is called through the corresponding multimedia resource address to achieve smooth loading of the multimedia resources in the web page, avoid the occurrence of freezes and loading failures, and improve the user experience.

[0071] Step 303: Integrate multiple compressed multimedia resources and original multimedia resources to obtain a network speed grade resource set.

[0072] During specific implementation, multiple compressed multimedia resources and original multimedia resources are integrated to obtain a network speed grade resource set, which is used to adapt to the current network speed of different network speed grades.

[0073] For example, taking picture multimedia resources as an example, the network speed level resource set after downgrading and compression is shown in Table 1:

[0074] Table 1 Network speed level resource collection

[0075] Internet Speed ​​Rating Resources Resolution File capacity file name Optimal Internet Speed ​​Resources 1000*1000 pixels 1000KB name.jpg Superior internet speed resources 1000*1000 pixels 750KB name.high.jpg Medium speed internet resources 1000*1000 pixels 500KB name.mid.jpg Low-speed Internet resources 1000*1000 pixels 200KB name.low.jpg

[0076] Keeping the resolution unchanged can ensure that resources of different network speed levels have the same display effect. The compression process cannot perform operations such as scaling. Among them, the name.jpg image file corresponding to the best network speed resource is the original multimedia resource, the name.high.jpg file corresponding to the excellent network speed resource, the name.mid.jpg file corresponding to the medium network speed resource, and the name.low.jpg file corresponding to the low network speed resource are compressed multimedia resources.

[0077] In some embodiments, Figure 4 As shown, a unique multimedia resource address is established for each network speed grade resource in the network speed grade resource set, and a multimedia resource address set is obtained, including:

[0078] Step 401: Determine a unique network speed grade identifier corresponding to each compressed multimedia resource in a network speed grade resource set.

[0079] During specific implementation, the compressed multimedia resources in the network speed grade resource set are newly created resource files, which are only used to adapt to page loading of different network speed grades. The corresponding reference addresses can be created by themselves. However, in order to distinguish different compressed multimedia resources, it is necessary to confirm the unique network speed grade identifier corresponding to each compressed multimedia resource, which is used to determine the network speed grade adapted by the corresponding compressed multimedia resource.

[0080] For example, the name.high.jpg file corresponding to the superior network speed resource, the name.mid.jpg file corresponding to the medium network speed resource, and the name.low.jpg file corresponding to the low network speed resource are compressed multimedia resources. In order to distinguish different levels, the corresponding network speed level (for example, high, mid, low) can be directly used as the corresponding unique network speed level identifier.

[0081] Step 402: Determine the original multimedia resource address corresponding to the original multimedia resource.

[0082] In specific implementation, since the original multimedia resources in the network speed grade resource set are original files and have original multimedia resource addresses corresponding to the original multimedia resources, there is no need to change the original multimedia resource addresses to avoid other functions being unable to call the original multimedia resources through the original multimedia resource addresses. Exemplarily, the original multimedia resource address can be in the form of [name].[extname].

[0083] Step 403: modify the original multimedia resource address according to the unique network speed grade identifier to obtain a compressed multimedia resource address.

[0084] In specific implementation, the main structure of the original multimedia resource address is retained, and the corresponding unique network speed level identifier is added to the main structure, so that the construction of the compressed multimedia resource address can be realized. The specific construction process is as follows:

[0085] The high-speed network resource corresponds to the name.high.jpg file, and the corresponding unique network speed grade identifier is high. The original multimedia resource address is modified according to the unique network speed grade identifier, and the compressed multimedia resource address is [name].high.[extname]. The medium-speed resource corresponds to the name.mid.jpg file, and the corresponding unique network speed grade identifier is mid. The original multimedia resource address is modified according to the unique network speed grade identifier, and the compressed multimedia resource address is [name].mid.[extname]. The low-speed resource corresponds to the name.low.jpg file, and the corresponding unique network speed grade identifier is low. The original multimedia resource address is modified according to the unique network speed grade identifier, and the compressed multimedia resource address is [name].low.[extname].

[0086] Keeping [name] in the main frame can ensure that the file name will not change and that other files will not be applied when the web page references multimedia resources. Keeping .[extname] in the main frame ensures that the reference function can find the corresponding multimedia resources.

[0087] Step 404: Integrate the original multimedia resource address and the compressed multimedia resource address to obtain a multimedia resource address set.

[0088] During the specific implementation, the original multimedia resource address and the compressed multimedia resource address are integrated to obtain a multimedia resource address set, which is used to adapt to the current network speed of different network speed levels, provide corresponding multimedia resource addresses for different network speeds, and realize hierarchical calling of multimedia resources.

[0089] For example, taking picture multimedia resources as an example, the multimedia resource address set is shown in Table 2:

[0090] Table 2 Multimedia resource address set

[0091]

[0092]

[0093] Since the file capacity of the test benchmark file is a fixed value, the value of the current network speed is mainly determined by the loading time, so the loading time can be used to equivalently represent the current network speed. Among them, for a 10kb test benchmark file, the current network speed greater than 1000kb / s can be equivalently represented by [0,100), the current network speed between 400kb / s and 1000kb / s can be equivalently represented by [100,250), the current network speed between 200kb / s and 400kb / s can be equivalently represented by [250,500), and the current network speed less than or equal to 200kb / s can be equivalently represented by [500,+∞).

[0094] In some embodiments, Figure 5 As shown, determining the target multimedia resource address in the multimedia resource address set according to the current network speed includes:

[0095] Step 501: Determine the loading time interval corresponding to each network speed level and the loading time corresponding to the current network speed.

[0096] In specific implementation, for a 10kb test benchmark file, the loading time interval corresponding to the best network speed level greater than 1000kb / s is [0,100), the loading time interval corresponding to the high network speed level of 400kb / s to 1000kb / s is [100,250), the loading time interval corresponding to the mid network speed level of 200kb / s to 400kb / s is [250,500), and the loading time interval corresponding to the low network speed level is [500,+∞). The loading time of the current network speed is determined according to the value of the timer when the test benchmark file is loaded.

[0097] Step 502: Determine the loading time interval including the loading time as the target time interval, and determine the target network speed level corresponding to the target time interval.

[0098] In specific implementation, as shown in Table 2, if the loading time is 50ms, the target time interval including the loading time is [0,100), and the corresponding target network speed level is best. If the loading time is 150ms, the target time interval including the loading time is [100,250), and the corresponding target network speed level is high. If the loading time is 400ms, the target time interval including the loading time is [250,500), and the corresponding target network speed level is mid. If the loading time is 600ms, the target time interval including the loading time is [500,+∞), and the corresponding target network speed level is low.

[0099] Step 503: Determine a target multimedia resource address in the multimedia resource address set according to the target network speed level.

[0100] In specific implementation, each multimedia resource address in the multimedia resource address set has a unique network speed grade identifier, and the target multimedia resource address can be determined by matching the unique network speed grade identifier and the target network speed grade. Exemplarily, if the target network speed grade is low, the corresponding target multimedia resource address is [name].low.[extname]; if the target network speed grade is mid, the corresponding target multimedia resource address is [name].mid.[extname]; if the target network speed grade is high, the corresponding target multimedia resource address is [name].high.[extname]; if the target network speed grade is best, the corresponding target multimedia resource address is [name].[extname].

[0101] According to the current network speed, the target multimedia resource address is determined in the multimedia resource address set, and the multimedia resources are called according to the current network speed. It is ensured that the current network speed can meet the loading requirements of the corresponding target multimedia resources, so as to ensure that the vehicle can quickly complete the loading of web pages at different locations, reduce the loading time of multimedia resources in the vehicle's internal web pages, and thus improve the overall loading speed of the web page, avoid the problem of loading waiting, and improve the user experience.

[0102] In some embodiments, Figure 6 As shown, the original resource reference address in the web page is modified to a target reference address corresponding to the target multimedia resource address, including:

[0103] Step 601: Determine a target network speed level identifier corresponding to a target multimedia resource address.

[0104] During specific implementation, if the target multimedia resource address is [name].low.[extname], the target network speed level is identified as low; if the target multimedia resource address is [name].mid.[extname], the target network speed level is identified as mid; if the target multimedia resource address is [name].high.[extname], the target network speed level is identified as high; if the target multimedia resource address is [name].[extname], the target network speed level is identified as empty.

[0105] Step 602: Modify the original resource reference address according to the network speed grade identifier to obtain the target reference address.

[0106] In the specific implementation, after obtaining the current network speed, the original resource reference address is modified using javascript. For example, assuming that the current network speed is mid, the file name of the logo image (a multimedia resource in a picture format) that the current web page needs to reference is logo.jpg, and the corresponding original resource reference address is <img src=". logo.jpg"> The HTML page dynamically modifies the code part of the original resource reference address that references the logo image to<imgsrc=". / logo.mid.jpg" / > . Realize the construction of reference addresses of multimedia resources that adapt to the current network speed.

[0107] In some embodiments, Figure 7 As shown, before determining the target multimedia resource address in the multimedia resource address set according to the current network speed, it also includes:

[0108] Step 701: In response to the currently loaded web page being a historical web page, determining a historical network speed level corresponding to the historical web page, and determining a current network speed level according to the current network speed.

[0109] In specific implementation, if the currently loaded web page is a historical web page, it means that there are corresponding historical multimedia resources that have been loaded, and these historical multimedia resources are cached locally. At this time, it is necessary to determine the network speed level required to load the multimedia resources in the historical web page based on the historical network speed level corresponding to the historical web page. Determining the current network speed level can determine the network speed level that can be provided at present, and by comparing the historical network speed level with the current network speed level, it is determined whether the locally cached multimedia resources can be directly used for loading.

[0110] Step 702: In response to the current network speed level being less than or equal to the historical network speed level and there being a local cached multimedia resource corresponding to the historical web page, the local cached multimedia resource is determined as a target multimedia resource, and the web page is loaded according to the target multimedia resource.

[0111] In specific implementation, if the current network speed level is less than or equal to the historical network speed level, it means that the display effect of the local cached multimedia resources is better than the display effect of the target media resources corresponding to the current network speed, and the use of local cached multimedia resources does not require the target media resources to be loaded, and there will be no loading lag or stop problems. At this time, the local cached multimedia resources are determined as the target multimedia resources, and the local cached multimedia resources with better display effects are directly used to load the page, ensuring the display effect while avoiding the page loading problem caused by the current network speed fluctuation. And the use of local cached multimedia resources for page loading will not be affected by the network speed and vehicle location, and the web page loading can be completed quickly, improving the user experience.

[0112] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0113] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0114] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a device for loading multimedia resources on a web page.

[0115] refer to Figure 8 , the webpage multimedia resource loading device comprises:

[0116] The network speed test module 10 is configured to: determine the current network speed, and determine whether the currently loaded web page is a historical web page;

[0117] The address set determination module 20 is configured to: determine a multimedia resource address set in response to the currently loaded web page not being a historical web page; wherein the network speed grade resource corresponding to each multimedia resource address in the multimedia resource address set is obtained by downgrading and compressing the original multimedia resource in the web page resource;

[0118] The reference address determination module 30 is configured to: determine the target multimedia resource address in the multimedia resource address set according to the current network speed, and modify the original resource reference address in the web page to a target reference address corresponding to the target multimedia resource address;

[0119] The webpage resource loading module 40 is configured to: based on the current network speed, call the target multimedia resource corresponding to the target multimedia resource address according to the target reference address, and load the webpage according to the target multimedia resource.

[0120] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0121] The device of the above embodiment is used to implement the corresponding webpage multimedia resource loading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0122] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for loading web multimedia resources described in any of the above embodiments is implemented.

[0123] Fig. 9 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0124] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0125] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0126] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0127] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0128] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0129] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0130] The electronic device of the above embodiment is used to implement the corresponding webpage multimedia resource loading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0131] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for loading web page multimedia resources as described in any of the above embodiments.

[0132] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0133] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method for loading webpage multimedia resources as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0134] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a vehicle, including an electronic device or a web multimedia resource loading device of the above-mentioned embodiment, and the web multimedia resource loading method described in any of the above embodiments is executed through the electronic device or the web multimedia resource loading device of the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0135] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0136] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0137] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0138] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0139] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0140] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0141] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0142] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A method for loading multimedia resources on a web page, characterized in that: include: Determine the current network speed and whether the currently loaded web page is a historical web page; In response to the currently loaded web page not being a historical web page, determining a multimedia resource address set; wherein the network speed grade resource corresponding to each multimedia resource address in the multimedia resource address set is obtained by downgrading and compressing the original multimedia resource in the web page resource; Determine a target multimedia resource address in the multimedia resource address set according to the current network speed, and modify the original resource reference address in the web page to a target reference address corresponding to the target multimedia resource address; Based on the current network speed, a target multimedia resource corresponding to the target multimedia resource address is called according to the target reference address, and a web page is loaded according to the target multimedia resource.

2. The method according to claim 1, characterized in that: Determining the current network speed includes: Determine the loading time of the test benchmark file in the multimedia server according to the dynamic programming language; The current network speed is determined according to the ratio of the file capacity of the test benchmark file to the loading time.

3. The method according to claim 1, characterized in that Constructing the network speed level resource set, including: Degrading and compressing the original multimedia resources in the webpage resources to obtain a network speed grade resource set; A unique multimedia resource address is established for each network speed grade resource in the network speed grade resource set to obtain a multimedia resource address set.

4. The method according to claim 3, characterized in that The step of downgrading and compressing the original multimedia resources in the webpage resources to obtain the network speed grade resource set includes: Determining the original multimedia resource having the largest file capacity among the multimedia resources; Selecting a target compression ratio from a preset compression ratio set in descending order, and compressing the original multimedia resource according to the target compression ratio to obtain a compressed multimedia resource; Integrate multiple compressed multimedia resources and the original multimedia resources to obtain the network speed grade resource set.

5. The method according to claim 3, characterized in that: The step of establishing a unique multimedia resource address for each network speed grade resource in the network speed grade resource set to obtain a multimedia resource address set includes: Determine a unique network speed grade identifier corresponding to each compressed multimedia resource in the network speed grade resource set; Determining an original multimedia resource address corresponding to the original multimedia resource; Modifying the original multimedia resource address according to the unique network speed grade identifier to obtain a compressed multimedia resource address; The original multimedia resource address and the compressed multimedia resource address are integrated to obtain the multimedia resource address set.

6. The method according to claim 1, characterized in that The determining the target multimedia resource address in the multimedia resource address set according to the current network speed includes: Determine a loading time interval corresponding to each network speed level and a loading time corresponding to the current network speed; Determine a loading time interval including the loading time as a target time interval, and determine a target network speed level corresponding to the target time interval; The target multimedia resource address is determined in the multimedia resource address set according to the target network speed level.

7. The method according to claim 1, characterized in that The modifying of the original resource reference address in the webpage into a target reference address corresponding to the target multimedia resource address includes: Determine a target network speed level identifier corresponding to the target multimedia resource address; The original resource reference address is modified according to the standard network speed grade identifier to obtain the target reference address.

8. The method according to claim 1, characterized in that Also includes: In response to the currently loaded web page being a historical web page, determining a historical network speed level corresponding to the historical web page, and determining a current network speed level according to the current network speed; In response to the current network speed level being less than or equal to the historical network speed level and there being a local cache multimedia resource corresponding to the historical web page, the local cache multimedia resource is determined as the target multimedia resource, and the web page is loaded according to the target multimedia resource.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.

10. A vehicle, characterized in that: Comprising the electronic device as claimed in claim 9.