Image loading method and device, equipment and storage medium

By formatting the image and generating address information on the terminal device, the problems of server resource consumption and development costs are solved, and a more efficient image loading process is achieved.

CN119719538APending Publication Date: 2025-03-28GUANGZHOU KUGOU COMP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411791742.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the server needs to receive an image acquisition request before performing compression processing, resulting in increased server resource consumption and increased development costs, which affects the image loading efficiency of the client.

Method used

The terminal device performs formatting processing on the original image of the first image, generates the first image corresponding to the at least one image format, and pre-creates the address information of the at least one image format, and sends it to the server.

Benefits of technology

It reduces the resource consumption and development costs of the server, shortens the image loading time of the server, and improves the image loading efficiency of the terminal device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719538A_ABST
    Figure CN119719538A_ABST
Patent Text Reader

Abstract

The invention discloses an image loading method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps that an image loading request sent by terminal equipment is received, the image loading request is used for requesting to load a first image, and the image loading request comprises equipment information of the terminal equipment; at least one piece of address information corresponding to the first image is acquired, each piece of address information is used for indicating an access address of the first image corresponding to one image format, and the first image corresponding to the image format is an image obtained by performing format processing on an original image of the first image by the terminal equipment; determining first address information matched with the equipment information of the terminal equipment from the at least one piece of address information; and sending the first image corresponding to the first image format identified by the first address information to the terminal equipment. According to the method, the format processing step is transferred to the terminal equipment for preprocessing, so that the resource consumption of the server can be reduced, and the image loading efficiency of the terminal equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image loading method, device, equipment and storage medium. Background Art

[0002] The size of images required for terminal devices to access web pages is usually around 800KB-1000KB, while the size of the corresponding image resources on the web page in the server is about 2000KB-2600KB. Therefore, the access speed of the terminal device can be significantly optimized by simply compressing the original image.

[0003] In the related technology, the server needs to develop additional functions of image compression and image mapping. When the server receives an image acquisition request, it determines the compatibility of the client of the terminal device based on the image acquisition request, compresses the image uploaded and stored by the user based on the compatibility, obtains a compressed image that matches the compatibility of the client, and then returns the compressed image to the client, which can reduce the client's traffic consumption.

[0004] However, the above method compresses the image after the server receives the image acquisition request, which increases the resource consumption and development cost of the server and affects the loading efficiency of the image on the client. Summary of the invention

[0005] The embodiment of the present application provides an image loading method, device, equipment and storage medium. The technical solution provided by the embodiment of the present application is as follows:

[0006] According to one aspect of an embodiment of the present application, a method for loading an image is provided, the method comprising:

[0007] receiving an image loading request sent by a terminal device, the image loading request being used to request loading of a first image, the image loading request including device information of the terminal device, the device information of the terminal device being used to indicate a device operation status of the terminal device;

[0008] Acquire at least one address information corresponding to the first image, each address information is used to indicate an access address of a first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on an original image of the first image, the image format is related to the storage format and storage quality of the first image, and the first image corresponding to at least one image format and the at least one address information are pre-generated by the terminal device and sent to the server;

[0009] Determine first address information matching the device information of the terminal device from the at least one address information;

[0010] Sending a first image corresponding to a first image format identified by the first address information to the terminal device.

[0011] According to one aspect of an embodiment of the present application, a method for uploading an image is provided, the method comprising:

[0012] In response to an upload operation on a first image, obtaining an original image of the first image;

[0013] Performing format processing on an original image of the first image to obtain a first image corresponding to at least one image format, wherein the image format is related to a storage format and storage quality of the first image;

[0014] generating, according to at least one image format of the first image, at least one address information corresponding to the at least one image format, wherein the address information corresponding to the image format is used to indicate an access address of the first image corresponding to the image format in the server;

[0015] The first image corresponding to the at least one image format and at least one address information corresponding to the at least one image format are sent to the server.

[0016] According to one aspect of an embodiment of the present application, there is provided an image loading device, the device comprising:

[0017] a request receiving module, configured to receive an image loading request sent by a terminal device, wherein the image loading request is used to request loading of a first image, and the image loading request includes device information of the terminal device, and the device information of the terminal device is used to indicate a device operation status of the terminal device;

[0018] an address acquisition module, used for acquiring at least one address information corresponding to the first image, each address information is used for indicating an access address of a first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on an original image of the first image, the image format is related to a storage format and storage quality of the first image, and the first image corresponding to at least one image format and the at least one address information are pre-generated by the terminal device and sent to the server;

[0019] An address matching module, used to determine first address information matching the device information of the terminal device from the at least one address information;

[0020] An image sending module is used to send a first image corresponding to a first image format identified by the first address information to the terminal device.

[0021] According to one aspect of an embodiment of the present application, a device for uploading an image is provided, the device comprising:

[0022] An image uploading module, configured to obtain an original image of a first image in response to an upload operation on the first image;

[0023] a format processing module, configured to perform format processing on an original image of the first image to obtain a first image corresponding to at least one image format, wherein the image format is related to a storage format and storage quality of the first image;

[0024] An address generating module, configured to generate, according to at least one image format of the first image, at least one address information corresponding to the at least one image format, wherein the address information corresponding to the image format is used to indicate an access address of the first image corresponding to the image format in the server;

[0025] The address sending module is used to send the first image corresponding to the at least one image format and at least one address information corresponding to the at least one image format to the server.

[0026] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned image loading method or image uploading method.

[0027] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned image loading method or image uploading method.

[0028] According to one aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being loaded and executed by a processor to implement the above-mentioned image loading method or image uploading method.

[0029] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:

[0030] The original image of the first image is formatted by the terminal device to generate at least one first image corresponding to each image format. Compared with the related art in which the formatting processing step is performed by the server, the present application transfers the formatting processing step to the terminal device for pre-processing. On the one hand, there is no need to use the image processing function of the server, which can reduce the resource consumption of the server and reduce the development cost of the server. On the other hand, by pre-generating at least one first image of the image format, the formatting processing time caused by performing the formatting processing step after receiving the image loading request can be omitted, shortening the image loading time of the server and improving the image loading efficiency of the terminal device. It can also avoid the server performing the formatting processing step multiple times when receiving the image loading request to load the first image multiple times in the related art, further reducing the resource consumption of the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0032] Figure 2 is a flow chart of an image uploading method provided by an embodiment of the present application;

[0033] Figure 3 is a flow chart of an image loading method provided by an embodiment of the present application;

[0034] Figure 4 is a flowchart of an address matching process provided by an embodiment of the present application;

[0035] Figure 5 is a flowchart of an image loading process provided by an embodiment of the present application;

[0036] Figure 6 is a block diagram of an image loading device provided by an embodiment of the present application;

[0037] Figure 7 is a block diagram of an image uploading device provided by an embodiment of the present application;

[0038] Figure 8 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0040] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as an image loading system. The solution implementation environment may include: a terminal device 10 and a server 20.

[0041] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a game console, an e-book reader, a multimedia player, a wearable device, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc.

[0042] The terminal device 10 may be installed with a client of a first application and a second application. The first application has an image compression function. The user can upload an image in the first application, compress the uploaded image through the client of the first application, and upload the original image and the compressed image to the server for storage. The second application has an image display function. The user can request to display an image in the second application. The second application requests the server to load the image, so the image displayed in the second application can be an image compressed by the first application and uploaded to the server. The present application does not limit the types of the first application and the second application, including but not limited to image processing applications, music applications, video applications, game applications, social applications, etc. Optionally, the first application and the second application can be applications that need to be downloaded and installed, or can be point-and-use applications, which are not limited in the present application.

[0043] Optionally, the first application and the second application can be combined into one application, which then has both image compression and image display functions. Users can upload images in the application, compress the uploaded images through the client of the application, and upload the original image and the compressed image to the server for storage. Then, the user can request to display the image in the application, the application sends an image loading request to the server, and the server returns the matching image for display based on the device information of the terminal device.

[0044] The server 20 is used to provide background services for the client of the target application installed and running in the terminal device 10. For example, the server 20 can be the background server of the above-mentioned target application. The server 20 can be an independent physical server, or a server cluster composed of multiple servers, or a cloud computing service center. Optionally, the server 20 provides background services for the target applications in multiple terminal devices 10 at the same time. The terminal device 10 and the server 20 can communicate with each other through the network.

[0045] In an embodiment of the present application, a user uploads a first image in advance in a client of a first application of a terminal device, and the client of the first application performs format processing on the original image of the first image to obtain a first image corresponding to at least one image format, and generates at least one address information corresponding to at least one image format according to at least one image format of the first image, and then the client of the first application sends the first image corresponding to at least one image format and at least one address information corresponding to at least one image format to a server for storage record. Then, the user requests to load the first image in a client of a second application of the terminal device, and the terminal device sends an image loading request to the server in response to the user operation. The server obtains at least one address information corresponding to the first image according to the image loading request, and determines the first address information matching the device information of the terminal device from the at least one address information, and then the server sends the first image corresponding to the first image format identified by the first address information to the terminal device, and displays it on the display interface of the second application.

[0046] Please refer to Figure 2 , which shows a flow chart of an image uploading method provided by an embodiment of the present application. The execution subject of each step of the method may be a terminal device. The method may include at least one of the following steps 210 to 240:

[0047] Step 210: In response to the upload operation on the first image, the original image of the first image is obtained.

[0048] The upload operation for the first image is an operation performed by the user to upload the original image of the first image to the client of the first application of the terminal device. For example, an image upload control is displayed in the display interface of the first application, and in response to the operation on the image upload control, the original image of the first image is uploaded to the client of the first application, so that the client of the first application obtains the original image of the first image.

[0049] The original image of the first image is the image uploaded by the user to the first application, that is, the first image that has not been formatted in step 220 .

[0050] Step 220 , performing format processing on the original image of the first image to obtain a first image corresponding to at least one image format, where the image format is related to the storage format and storage quality of the first image.

[0051] The first image corresponding to at least one image format is an image obtained by the client of the first application performing at least one format processing on the original image of the first image. After receiving the original image of the first image uploaded by the user, the client of the first application performs at least one format processing on the original image of the first image to obtain the first image corresponding to at least one image format. The image format is related to the storage format and storage quality of the first image, which means that each format processing is used to change the storage format of the first image or change the storage quality of the first image.

[0052] In some embodiments, format processing includes compression processing and resolution processing. The compression rate of the first image obtained by the compression processing is used to indicate the storage format of the first image, and the resolution of the first image obtained by the resolution processing is used to indicate the storage quality of the first image.

[0053] The compression process is used to indicate the compression rate of the first image. The compression rate refers to the ratio of the data size after compression to the data size before compression. The compression rate is positively correlated with the data volume of the first image. The greater the compression rate, the greater the data volume of the first image, and the smaller the compression rate, the smaller the data volume of the first image. For example, the data volume of the first image = the data volume of the original image of the first image × the compression rate. Different compression rates correspond to different storage formats. The storage formats of the first image include avif format, webp format, jpg format, png format and other storage formats. Among them, the storage formats of the first image are arranged in order from small to large compression rates as avif format, webp format, jpg format, and png format. The terminal device performs corresponding compression processing on the original image of the first image at different compression rates to obtain the first image after compression processing corresponding to the different compression rates. The compression rate of the first image after compression processing is used to indicate the storage format of the first image after compression processing. For example, if the compression rate of the avif format is 35%, the terminal device compresses the original image of the first image at a compression rate of 35% to obtain a first image corresponding to the compression rate of 35%. The storage format of the first image corresponding to the compression rate of 35% is the avif format.

[0054] Resolution processing is used to indicate the resolution of the first image. Resolution is used to indicate the number of pixels contained in the first image. Resolution is positively correlated with the amount of data of the first image. The higher the resolution, the larger the amount of data of the first image. The lower the resolution, the smaller the amount of data of the first image. Different resolutions correspond to different storage qualities. The higher the resolution, the more pixels contained in the first image, and the higher the storage quality of the first image. The lower the resolution, the fewer pixels contained in the first image, and the lower the storage quality of the first image. The terminal device performs corresponding resolution processing on the original image of the first image at different resolutions to obtain first images after resolution processing corresponding to different resolutions. The resolution of the first image after resolution processing is used to indicate the storage quality of the first image after resolution processing. For example, if the terminal device performs resolution processing on the original image of the first image at a resolution of 640×480 to obtain a first image corresponding to a resolution of 640×480, the storage quality of the first image corresponding to the resolution of 640×480 is low.

[0055] Optionally, the terminal device may first perform corresponding compression processing on the original image of the first image at different compression rates to obtain compressed first images corresponding to different compression rates, and then the terminal device may perform corresponding resolution processing on the original image of the first image and the compressed first image corresponding to different compression rates at different resolutions, respectively, to obtain the resolution-processed first image corresponding to the original image of the first image at different resolutions, and the resolution-processed first image corresponding to different resolutions at different compression rates, thereby obtaining a first image corresponding to at least one image format.

[0056] Optionally, the terminal device may first perform corresponding resolution processing on the original image of the first image at different resolutions to obtain first images after resolution processing corresponding to different resolutions, and then the terminal device may perform corresponding compression processing on the original image of the first image and the first image after resolution processing corresponding to different resolutions at different compression rates, respectively, to obtain the first image after compression rate processing corresponding to the original image of the first image at different compression rates, and the first image after compression rate processing corresponding to different compression rates at different resolutions, thereby obtaining a first image corresponding to at least one image format.

[0057] Among them, the first image corresponding to at least one image format includes first images corresponding to different compression rates and different resolutions, that is, first images corresponding to different resolutions at the same compression rate, and first images corresponding to different compression rates at the same resolution. For example, if the image format of the original image of the first image is a png storage format and a storage quality of 640×480 resolution, the terminal device can first perform resolution processing on the original image of the first image at a resolution of 1024×768 to obtain a first image corresponding to the png format and the resolution of 1024×768, and then the terminal device performs compression processing on the first image corresponding to the png format and the resolution of 640×480 and the first image corresponding to the png format and the resolution of 1024×768 in avif format, respectively, to obtain the first image corresponding to the avif format and the resolution of 640×480 and the first image corresponding to the avif format and the resolution of 1024×768, thereby obtaining the first image corresponding to at least one image format, and the at least one image format includes an image format of avif format and 640×480 resolution, an image format of png format and 640×480 resolution, an image format of avif format and 1024×768 resolution, and an image format of png format and 1024×768 resolution.

[0058] Step 230: Generate at least one address information corresponding to at least one image format according to at least one image format of the first image, where the address information corresponding to the image format is used to indicate an access address of the first image corresponding to the image format in the server.

[0059] After obtaining the first images corresponding to at least one image format, at least one address information corresponding to at least one image format is generated according to at least one image format of the first image, each image format corresponds to one address information, and the address information corresponding to each image format is used to indicate the access address of the first image corresponding to the image format in the server. Exemplarily, the address information may be a URL (uniform resource locator, uniform resource locator system).

[0060] In some embodiments, the address information includes at least one of the following: network protocol information, server domain name information, image name information, image quality information, and prefix identification information; wherein the prefix identification information is used to indicate that the first image is stored in at least two image formats, the image name information includes identification information of the first image and identification information of the image format, the identification information of the image format is used to indicate the storage format of the first image, and the image quality information is used to indicate the storage quality of the first image.

[0061] The network protocol information is a transmission protocol for secure communication over a network, for example, the network protocol information may be http or https. The server domain name information is a location identifier of a server on a network, and is used to access the address of the server through the domain name information, for example, the server domain name information may be imgcdn.com.

[0062] The image name information is used to identify the first image, including the identification information of the first image and the identification information of the image format of the first image. Exemplarily, the identification information of the first image can be a hash value. The identification information of the first images of different image formats is the same, that is, the hash values ​​of the first images of different image formats are the same. The first images of different image formats are distinguished by the identification information of the image format of the first image. The identification information of the image format of the first image is related to the storage format of the first image. For example, the first image with the image name information of 4cwdacwerasdr.png and the first image with the image name information of 4cwdacwerasdr.jpg, the identification information of the first images of the two are the same, both are 4cwdacwerasdr, and the identification information of the image format of the two first images is different, one is in png format and the other is in jpg format.

[0063] The image quality information is related to the storage quality of the first image. For example, if the image name information and image quality information of the first image are expressed as 4cwdacwerasdr.png?resolution=640×480, the image name information and the image quality information are separated by "?", and the image quality information is resolution=640×480.

[0064] The prefix identification information is used to indicate that the first image is stored in at least two image formats. The prefix identification information may be fmt_01. When the terminal device performs format processing on the original image of the first image to obtain the first image corresponding to at least two image formats, the prefix identification information is added to the address information corresponding to the at least two image formats. Therefore, if the address information contains the prefix identification information, it means that the first image corresponding to the address information has at least two image formats. If the address information does not contain the prefix identification information, it means that the first image corresponding to the address information does not have a first image of other image formats except the original image.

[0065] Exemplarily, the first image has two image formats, and the address information corresponding to the two image formats is https: / / imgcdn.com / fmt_01_4cwdacwerasdr.png?resolution=640×480 and https: / / imgcdn.com / fmt_01_4cwdacwerasdr.webp?resolution=640×480, wherein the network protocol information is https, the server domain name information is imgcdn.com, the prefix identification information is fmt_01, the image name information is 4cwdacwerasdr.png and 4cwdacwerasdr.webp, and the image quality information is resolution=640×480.

[0066] By generating corresponding address information for each image format and distinguishing first images corresponding to different image formats through image name information and image quality information, the corresponding first image can be found according to the address information, which facilitates the subsequent execution of the image loading method.

[0067] Step 240: Send the first image corresponding to at least one image format and at least one address information corresponding to at least one image format to the server.

[0068] The first images corresponding to at least one image format are sent to the server for storage, and at least one address information corresponding to at least one image format is sent to the server for subsequent access to the corresponding first image based on the address information.

[0069] The original image of the first image is formatted by the terminal device to generate at least one first image corresponding to each image format. Compared with the related art in which the formatting processing step is performed by the server, the present application transfers the formatting processing step to the terminal device for pre-processing. On the one hand, there is no need to use the image processing function of the server, which can reduce the resource consumption of the server and reduce the development cost of the server. On the other hand, by pre-generating at least one first image of the image format, the formatting processing time caused by performing the formatting processing step after receiving the image loading request can be omitted, shortening the image loading time of the server and improving the image loading efficiency of the terminal device. It can also avoid the server performing the formatting processing step multiple times when receiving the image loading request to load the first image multiple times in the related art, further reducing the resource consumption of the server.

[0070] Please refer to Figure 3 , which shows a flow chart of an image loading method provided by an embodiment of the present application. The execution subject of each step of the method may be a server. The method may include at least one of the following steps 310 to 340:

[0071] Step 310: receiving an image loading request sent by a terminal device, the image loading request is used to request loading of a first image, the image loading request includes device information of the terminal device, and the device information of the terminal device is used to indicate a device operation status of the terminal device.

[0072] The image loading request is request information generated by the terminal device in response to an image loading operation performed by a user. The image loading operation performed by the user is an operation performed after the image uploading operation performed by the user, and is used to request the client of the second application to display the first image on the display interface of the second application. After generating the image loading request, the terminal device sends the image loading request to the server to request the server to obtain the first image and return the first image to the terminal device for display.

[0073] The image loading request includes image information, request information, and device information of the terminal device. The image information is used to indicate the first image, the image information is identification information of the first image, the request information is used to request the server to load the first image, and the device information of the terminal device is used to indicate the device operation status of the terminal device, specifically, to indicate the operation speed of the terminal device.

[0074] In some embodiments, the device information of the terminal device includes: the storage and processing capabilities of the terminal device, and the network speed between the terminal device and the server. The storage capacity of the terminal device is related to the memory of the terminal device. The larger the memory of the terminal device, the stronger the storage capacity of the terminal device, thereby avoiding the terminal device being fully loaded and causing the terminal device to slow down. The processing capacity of the terminal device is related to the processor performance of the terminal device, and the processor performance is related to the type of processor. The better the processor performance of the terminal device, the stronger the processing capacity of the terminal device, and the faster the terminal device runs. The network speed between the terminal device and the server is related to factors such as the network environment, device differences, and bandwidth. The faster the network speed between the terminal device and the server, the faster the terminal device runs.

[0075] Step 320, obtaining at least one address information corresponding to the first image, each address information is used to indicate an access address of the first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on the original image of the first image, the image format is related to the storage format and storage quality of the first image, and the first image and at least one address information corresponding to at least one image format are pre-generated by the terminal device and sent to the server.

[0076] The specific process of generating the first image corresponding to at least one image format and the address information corresponding to at least one image format can refer to the above embodiment and will not be described here.

[0077] Step 330: Determine first address information that matches the device information of the terminal device from at least one address information.

[0078] In some embodiments, when at least one address information does not include prefix identification information, address information corresponding to an original image of the first image is determined as the first address information, and the original image of the first image is a first image that has not been formatted.

[0079] If the at least one address information does not include the prefix identification information, it means that the first image has not been formatted and does not have other image formats. For example, if the address information is https: / / imgcdn.com / 4cwdacwerasdr.png?resolution=640×480, the address information is the address information of the original image of the first image.

[0080] The address information corresponding to the original image of the first image is determined as the first address information, so that step 340 obtains the original image of the first image according to the address information corresponding to the original image of the first image, and sends the original image of the first image to the terminal device.

[0081] In some embodiments, when at least one address information includes prefix identification information, step 330 is performed. Exemplarily, if the address information is https: / / imgcdn.com / fmt_01_4cwdacwerasdr.png?resolution=640×480, it means that the first image corresponding to the address information has a first image of another image format other than the original image of the first image, and the first address information matching the device information of the terminal device is determined from at least one address information corresponding to the at least one image format.

[0082] The first address information is address information that matches the device information of the terminal device. The first address information is used to identify the first image corresponding to the first image format. Therefore, it can be understood that the storage format and storage quality of the first image indicated by the first image format match the device information of the terminal device. The specific address matching process can be referred to the following embodiment and will not be introduced here.

[0083] Step 340: Send the first image corresponding to the first image format identified by the first address information to the terminal device.

[0084] According to the first address information, a first image corresponding to the first image format is acquired, the first image corresponding to the first image format is sent to the terminal device, and is displayed on the display interface of the second application.

[0085] The technical solution provided by the embodiment of the present application is to perform format processing on the original image of the first image through the terminal device to generate at least one first image corresponding to the image format. Compared with the related art in which the format processing step is performed by the server, the present application transfers the format processing step to the terminal device for pre-processing. On the one hand, there is no need to use the image processing function of the server, which can reduce the resource consumption of the server and reduce the development cost of the server. On the other hand, by pre-generating at least one first image of the image format, the format processing time caused by performing the format processing step after receiving the image loading request can be omitted, shortening the image loading time of the server and improving the image loading efficiency of the terminal device. It can also avoid the server performing the format processing step multiple times when receiving the image loading request to load the first image multiple times in the related art, further reducing the resource consumption of the server.

[0086] In some embodiments, step 330 includes at least one of sub-steps 331 - 332 .

[0087] Sub-step 331, obtaining a device score of the terminal device according to the storage and processing capabilities of the terminal device.

[0088] The storage capacity of the terminal device is related to the memory of the terminal device, and the processing capacity of the terminal device is related to the processor performance of the terminal device. The device score of the terminal device is obtained according to the memory size of the terminal device and the processor performance of the terminal device. The device score of the terminal device can be obtained according to the scoring rules formulated by the developer, or it can be the score obtained by other developers obtained under big data, and this application does not limit this.

[0089] In some embodiments, a device score of the terminal device is obtained based on the storage and processing capabilities of the terminal device and the network speed between the terminal device and the server.

[0090] Sub-step 332, determining first address information from at least one address information according to the device score of the terminal device and the network speed between the terminal device and the server.

[0091] By comprehensively considering the device status of the terminal device and the device operating conditions of the terminal device, the first address information is determined from at least one address information to avoid incompatibility between the terminal device and the first image due to insufficient device conditions, and to avoid the inability of the first image to be displayed on the terminal device due to insufficient network speed. The finally determined first image can be displayed smoothly on the terminal device to meet the needs of users.

[0092] In some embodiments, sub-step 332 includes at least one of sub-steps 3321 - 3323 .

[0093] Sub-step 3321, when the device score of the terminal device is less than the first score threshold, determine the address information corresponding to the image format with the largest data volume in the at least one address information as the first address information.

[0094] The specific setting of the first scoring threshold is set by the technician according to the scoring range of the device scoring and the device display of the terminal device, and this application does not limit it. For example, if the device scoring of the terminal device is in the interval of 0 to 100, then according to the device display of the terminal device, the first scoring threshold can be set to 50. In the case that the device scoring of the terminal device is less than 50, the address information corresponding to the image format with the largest amount of data in at least one address information is determined as the first address information.

[0095] The image format with the largest data volume in at least one address information refers to the image format with the highest compression rate and the lowest resolution in at least one address information. Exemplarily, if at least one image format includes an image format with an avif format and a resolution of 640×480, an image format with a resolution of 640×480, an image format with an avif format and an image format with a resolution of 1024×768, and an image format with a resolution of 1024×768, then the image format with the largest data volume in at least one address information refers to an image format with a resolution of 640×480.

[0096] Sub-step 3322, when the device score of the terminal device is greater than or equal to the first score threshold and the device score of the terminal device is less than or equal to the second score threshold, determine the first address information according to the network speed between the terminal device and the server and the first network speed threshold.

[0097] The specific setting of the second scoring threshold is set by the technician according to the scoring range of the device score and the device display of the terminal device, and this application does not limit it. For example, if the device score of the terminal device is in the interval of 0 to 100, then according to the device display of the terminal device, the first scoring threshold can be set to 50, and the second scoring threshold can be set to 70. Then, when the device score of the terminal device is greater than or equal to 50, and the device score of the terminal device is less than or equal to 70, the first address information is determined according to the network speed between the terminal device and the server and the first network speed threshold.

[0098] In some embodiments, when the network speed between the terminal device and the server is less than a first network speed threshold, the address information corresponding to the image format with the largest data volume in at least one address information is determined as the first address information.

[0099] When the device score of the terminal device is greater than or equal to the first score threshold, and the device score of the terminal device is less than or equal to the second score threshold, if the network speed between the terminal device and the server is less than the first network speed threshold, then the address information corresponding to the image format with the largest data volume in at least one address information is determined as the first address information, specifically, the address information corresponding to the image format with the largest compression rate and the lowest resolution in at least one address information is determined as the first address information.

[0100] The specific setting of the first network speed threshold is set by the technician according to the device operation status of the terminal device, and this application does not limit it. For example, the first network speed threshold is 50KB / S, the first score threshold is 50, and the second score threshold is 70. If the device score of the terminal device is greater than or equal to 50, and the device score of the terminal device is less than or equal to 70, if the network speed between the terminal device and the server is less than 50KB / S, the address information corresponding to the image format with the largest compression rate and the lowest resolution in at least one address information is determined as the first address information.

[0101] In some embodiments, when the network speed between the terminal device and the server is greater than or equal to a first network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying a first condition in at least one address information is determined as the first address information, wherein the first condition includes that the resolution is the maximum value among at least one image format with the smallest compression rate, and the resolution is less than or equal to the first resolution.

[0102] In the case where the device score of the terminal device is greater than or equal to the first score threshold, and the device score of the terminal device is less than or equal to the second score threshold, if the network speed between the terminal device and the server is greater than or equal to the first network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution that meets the first condition in at least one address information is determined as the first address information. For example, if the first network speed threshold is 50KB / S, the first score threshold is 50, and the second score threshold is 70, then in the case where the device score of the terminal device is greater than or equal to 50, and the device score of the terminal device is less than or equal to 70, if the network speed between the terminal device and the server is greater than or equal to 50KB / S, the address information corresponding to the image format with the smallest compression rate and a resolution that meets the first condition in at least one address information is determined as the first address information.

[0103] The specific setting of the first resolution is set by the technician according to the operation of the device, and this application does not limit it. For example, the first resolution can be 1440×720, and the first address information is the address information corresponding to the image format with the smallest compression rate and a resolution less than or equal to 1440×720 in at least one address information.

[0104] For at least one image format with the smallest compression rate and a resolution satisfying the first condition in address information, check whether the image format satisfies the image format with the smallest compression rate and a resolution satisfying the first condition in order of compression rate from small to large and in order of resolution from large to small under each compression rate; if so, determine the address information corresponding to the current image format as the first address information; if not, check whether the next image format satisfies the image format with the smallest compression rate and a resolution satisfying the first condition, until an image format satisfying the condition is obtained, and determine the address information corresponding to the image format satisfying the condition as the first address information. Exemplarily, if at least one image format includes an avif format and an image format with a resolution of 640×480, a png format and an image format with a resolution of 640×480, an avif format and an image format with a resolution of 1920×1080, and a png format and an image format with a resolution of 1920×1080, and the first resolution is 1440×720, then in the order of compression rate from small to large and the order of resolution from large to small under each compression rate, the image format with the largest resolution when the compression rate is the smallest (the avif format and the image format with a resolution of 1920×1080) is first checked. Since the resolution of 1920×1080 is greater than 1440×720, the avif format and the image format with a resolution of 1920×1080 do not meet the condition. The image format with the second largest resolution when the compression rate is the smallest (the avif format and the image format with a resolution of 640×480) is checked. The test result meets the condition, so the address information corresponding to the avif format and the image format with a resolution of 640×480 is determined as the first address information.

[0105] When the device score of the terminal device is between the first score threshold and the second score threshold, the address information is matched according to the network speed, so that the first image corresponding to the first address information has the highest image quality under permitted conditions, thereby ensuring the image display quality of the terminal device.

[0106] Sub-step 3323, when the device score of the terminal device is greater than the second score threshold, determine the first address information according to the network speed between the terminal device and the server and the second network speed threshold, and the second network speed threshold is greater than the first network speed threshold.

[0107] Exemplarily, if the second score threshold is set to 70, when the device score of the terminal device is greater than 70, the first address information is determined according to the network speed between the terminal device and the server and the second network speed threshold.

[0108] In some embodiments, when the network speed between the terminal device and the server is less than a second network speed threshold, the address information corresponding to the image format with the largest amount of data in at least one address information is determined as the first address information.

[0109] When the device score of the terminal device is greater than the second score threshold, if the network speed between the terminal device and the server is less than the second network speed threshold, the address information corresponding to the image format with the largest data volume in at least one address information is determined as the first address information, specifically, the address information corresponding to the image format with the highest compression rate and the lowest resolution in at least one address information is determined as the first address information.

[0110] The specific setting of the second network speed threshold is set by the technician according to the device operation status of the terminal device, and this application does not limit it. For example, if the second network speed threshold is 200KB / S and the second score threshold is 70, then when the device score of the terminal device is greater than 70, if the network speed between the terminal device and the server is less than 200KB / S, the address information corresponding to the image format with the largest compression rate and the lowest resolution in at least one address information is determined as the first address information.

[0111] In some embodiments, when the network speed between the terminal device and the server is greater than or equal to a second network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying the second condition in at least one address information is determined as the first address information, wherein the second condition includes that the resolution is the maximum value of at least one image format with the smallest compression rate, and the resolution is less than or equal to the second resolution, and the second resolution is higher than the first resolution.

[0112] In the case where the device score of the terminal device is greater than the second score threshold, if the network speed between the terminal device and the server is greater than or equal to the second network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution that meets the second condition in at least one address information is determined as the first address information. For example, if the second network speed threshold is 200KB / S and the second score threshold is 70, then in the case where the device score of the terminal device is greater than 70, if the network speed between the terminal device and the server is greater than or equal to 200KB / S, the address information corresponding to the image format with the smallest compression rate and a resolution that meets the second condition in at least one address information is determined as the first address information.

[0113] The specific setting of the second resolution is set by the technician according to the operation of the device, and this application does not limit it. The second resolution is higher than the first resolution. For example, the first resolution can be 1440×720 and the second resolution can be 1500×3000. The first address information is the address information corresponding to the image format with the smallest compression rate and a resolution less than or equal to 1500×3000 in at least one address information.

[0114] For at least one image format with the smallest compression rate and a resolution satisfying the second condition in address information, check whether the image format satisfies the condition in order of compression rate from small to large and in order of resolution from large to small under each compression rate; if so, determine the address information corresponding to the current image format as the first address information; if not, check whether the next image format satisfies the condition in order of compression rate from small to large and the resolution satisfying the second condition, until an image format satisfying the condition is obtained, and determine the address information corresponding to the image format satisfying the condition as the first address information. Exemplarily, if at least one image format includes an avif format and an image format with a resolution of 640×480, a png format and an image format with a resolution of 640×480, an avif format and an image format with a resolution of 1920×1080, and a png format and an image format with a resolution of 1920×1080, and the first resolution is 1440×720, then in the order of compression rate from small to large and the order of resolution from large to small at each compression rate, the image format with the largest resolution when the compression rate is the smallest (avif format and image format with a resolution of 1920×1080) is first checked. The check result meets the conditions, so the address information corresponding to the avif format and the image format with a resolution of 1920×1080 is determined as the first address information.

[0115] By making the second network speed threshold greater than the first network speed threshold when the device score is greater than the second score threshold, the final first image can be consistent with the device operation status of the terminal device, and the first image corresponding to the first address information is the highest image quality when conditions permit, thereby ensuring the image display quality of the terminal device.

[0116] Figure 4A flow chart of the address matching process is shown. The component is set in the server, and the url (address information) is parsed by the component. After obtaining at least one address information corresponding to the first image, the component is initialized to start the component to parse at least one address information. It is judged whether the at least one address information contains prefix identification information. If the at least one address information does not contain prefix identification information, it means that the original image of the first image has not been formatted, and the first image does not have a first image of other image formats other than the original image. Then, according to the address information corresponding to the original image of the first image, the original image is requested to be returned to the terminal device. If at least one address information contains prefix identification information, it means that the first image has a first image of other image formats other than the original image, then it is judged according to the priority whether the client of the terminal device supports the current image format. The priority is in the order of compression rate from small to large, and the order of resolution from large to small under each compression rate. First, it is judged whether the image format with the smallest compression rate and the largest resolution meets the conditions. If the client supports the current image format, according to the address information corresponding to the current image format, the first image of the current image format is requested to be returned to the terminal device. If the client does not support the current image format, it will determine in turn whether the image format with the smallest compression rate and the second largest resolution meets the conditions. Until the client supports the currently determined image format, it will request the first image of the current image format to be returned to the terminal device based on the address information corresponding to the current image format.

[0117] In some embodiments, step 340 includes at least one of sub-steps 341 - 344 .

[0118] Sub-step 341: using an address parsing tool to parse the first address information, and loading a first image corresponding to a first image format according to the first address information.

[0119] Exemplarily, the address resolution tool may be a dns-prefetch tool. Parsing the first address information through dns-prefetch may reduce the delay of address resolution.

[0120] Sub-step 342, when the first image is configured with a preloading attribute, preload the first image corresponding to the second image format that is located after the first image corresponding to the first image format according to the priority order of the image formats, and the priority order of the image formats is from small to large compression rate, and from large to small resolution when the compression rate is the same.

[0121] Exemplarily, the preload attribute refers to a preload attribute, and when the first image is configured with the preload attribute, the first image corresponding to the second image format located after the first image corresponding to the first image format is preloaded according to the priority order of the image formats. With respect to the priority order of the image formats, exemplarily, if the compression rate indicated by at least one image format includes compression rate a and compression rate b, and the resolution indicated by at least one image format includes resolution a and resolution b, and the compression rate a is less than the compression rate b, and the resolution a is greater than the resolution b, then the priority order of the at least one image format is, in order, image format with compression rate a and resolution a, image format with compression rate a and resolution b, image format with compression rate b and resolution a, and image format with compression rate b and resolution b.

[0122] Therefore, optionally, the second image format may be an image format having the same compression rate as that indicated by the first image format, but a resolution smaller than that indicated by the first image format. For example, if the first image format is an image format having a compression rate a and a resolution a, the second image format is an image format having a compression rate a and a resolution b. Optionally, the second image format may also be an image format having a compression rate smaller than that indicated by the first image format, and a resolution that is the maximum resolution under the compression rate. For example, if the first image format is an image format having a compression rate a and a resolution b, the second image format is an image format having a compression rate b and a resolution a.

[0123] Sub-step 343 , when the loading time of the first image corresponding to the first image format is less than the time threshold, the first image corresponding to the first image format is sent to the terminal device.

[0124] The time threshold is set by the technicians according to the image loading situation of the server, and this application does not limit it.

[0125] Sub-step 344, when the loading time of the first image corresponding to the first image format is greater than or equal to the time threshold, the first image corresponding to the second image format is loaded according to the priority order of the image formats.

[0126] The above sub-steps 343 and 344 can also be understood as, if the first image corresponding to the first image format is loaded within the time threshold, the first image corresponding to the first image format is sent to the terminal device. If the first image corresponding to the first image format is not loaded within the time threshold, the first image corresponding to the second image format is loaded. If the first image is configured with a preload attribute, the first image corresponding to the second image format has been preloaded while the first image in the first image format is loaded, and the first image corresponding to the second image format can be directly sent to the terminal device.

[0127] If the first image is not configured with a preload attribute, and the first image corresponding to the second image format has not been loaded within the time threshold, the first image corresponding to the next image format continues to be loaded according to the priority order of the image formats until loading is successful.

[0128] When the loading time of the first image corresponding to the current image format exceeds the time threshold and is not loaded completely, the loading of the next image format is started, thereby avoiding consumption of extra traffic and saving server resources.

[0129] Figure 5 The flowchart of the image loading process is shown. After the component is initialized to start the component to parse at least one address information, the image resources are loaded in sequence according to the priority order of the image format corresponding to the at least one address information, and the image loading is waited for to be completed. If the loading of the first image of the current image format is not completed within the time threshold, the image resources of the second priority of the current image format are loaded according to the priority order of the image format until the loading is successful.

[0130] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0131] Please refer to Figure 6 , which shows a block diagram of an image loading device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned image loading method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the server introduced above, or it can be set in the server. Figure 6 As shown, the apparatus 600 may include: a request receiving module 610 , an address acquiring module 620 , an address matching module 630 and an image sending module 640 .

[0132] The request receiving module 610 is used to receive an image loading request sent by a terminal device, wherein the image loading request is used to request loading of a first image and includes device information of the terminal device, wherein the device information of the terminal device is used to indicate the device operation status of the terminal device.

[0133] The address acquisition module 620 is used to obtain at least one address information corresponding to the first image, each address information is used to indicate an access address of a first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on the original image of the first image, the image format is related to the storage format and storage quality of the first image, and the first image corresponding to at least one image format and the at least one address information are pre-generated by the terminal device and sent to the server.

[0134] The address matching module 630 is used to determine first address information matching the device information of the terminal device from the at least one address information.

[0135] The image sending module 640 is used to send the first image corresponding to the first image format identified by the first address information to the terminal device.

[0136] In some embodiments, the device information of the terminal device includes: the storage and processing capabilities of the terminal device, and the network speed between the terminal device and the server; the address matching module 630 is used to:

[0137] Obtaining a device score for the terminal device according to the storage and processing capabilities of the terminal device;

[0138] The first address information is determined from the at least one address information according to a device score of the terminal device and a network speed between the terminal device and the server.

[0139] In some embodiments, the address matching module 630 is used to:

[0140] When the device score of the terminal device is less than a first score threshold, determining the address information corresponding to the image format with the largest amount of data in the at least one address information as the first address information;

[0141] When the device score of the terminal device is greater than or equal to the first score threshold, and the device score of the terminal device is less than or equal to the second score threshold, determining the first address information according to the network speed between the terminal device and the server and the first network speed threshold;

[0142] When the device score of the terminal device is greater than the second score threshold, the first address information is determined according to the network speed between the terminal device and the server and a second network speed threshold, and the second network speed threshold is greater than the first network speed threshold.

[0143] In some embodiments, the format processing includes compression processing and resolution processing, the compression rate of the first image obtained by the compression processing is used to indicate the storage format of the first image, and the resolution of the first image obtained by the resolution processing is used to indicate the storage quality of the first image; the address matching module 630 is used to:

[0144] When the network speed between the terminal device and the server is less than the first network speed threshold, determining the address information corresponding to the image format with the largest data volume in the at least one address information as the first address information;

[0145] When the network speed between the terminal device and the server is greater than or equal to the first network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying the first condition in the at least one address information is determined as the first address information, wherein the first condition includes that the resolution is the maximum value among the at least one image format with the smallest compression rate, and the resolution is less than or equal to the first resolution.

[0146] In some embodiments, the address matching module 630 is used to:

[0147] When the network speed between the terminal device and the server is less than the second network speed threshold, determining the address information corresponding to the image format with the largest data volume in the at least one address information as the first address information;

[0148] When the network speed between the terminal device and the server is greater than or equal to the second network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying the second condition in the at least one address information is determined as the first address information, wherein the second condition includes that the resolution is the maximum value among the at least one image format with the smallest compression rate, the resolution is less than or equal to the second resolution, and the second resolution is higher than the first resolution.

[0149] In some embodiments, the image sending module 640 is used to:

[0150] parsing the first address information using an address parsing tool, and loading a first image corresponding to the first image format according to the first address information;

[0151] In the case where the first image is configured with a preload attribute, preloading a first image corresponding to a second image format located after a first image corresponding to the first image format according to a priority order of the image formats, the priority order of the image formats being from small to large compression rates and from large to small resolutions when the compression rates are the same;

[0152] When the loading time of the first image corresponding to the first image format is less than a time threshold, sending the first image corresponding to the first image format to the terminal device;

[0153] When the loading time of the first image corresponding to the first image format is greater than or equal to the time threshold, the first image corresponding to the second image format is loaded according to the priority order of the image formats.

[0154] In some embodiments, the address information includes prefix identification information, and the prefix identification information is used to indicate that the first image is stored in at least two image formats; the address matching module 630 is further used to:

[0155] In a case where the at least one address information does not include the prefix identification information, determining address information corresponding to an original image of the first image as the first address information, the original image of the first image being the first image that has not been processed by the format;

[0156] In a case where the prefix identification information is included in the at least one address information, a step of determining first address information matching the device information of the terminal device from the at least one address information is performed.

[0157] In some embodiments, the address information also includes at least one of the following: network protocol information, server domain name information, image name information, and image quality information; wherein the image name information includes identification information of the first image and identification information of the image format, the image format identification information is used to indicate the storage format of the first image, and the image quality information is used to indicate the storage quality of the first image.

[0158] Please refer to Figure 7 , which shows a block diagram of an image uploading device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned image uploading method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the terminal device introduced above, or it can be set in the terminal device. Figure 7 As shown, the device 700 may include: an image uploading module 710 , a format processing module 720 , an address generating module 730 and an address sending module 740 .

[0159] The image uploading module 710 is configured to obtain an original image of a first image in response to an upload operation on the first image.

[0160] The format processing module 720 is used to perform format processing on the original image of the first image to obtain a first image corresponding to at least one image format, where the image format is related to the storage format and storage quality of the first image.

[0161] The address generation module 730 is used to generate at least one address information corresponding to at least one image format according to at least one image format of the first image, and the address information corresponding to the image format is used to indicate the access address of the first image corresponding to the image format in the server.

[0162] The address sending module 740 is used to send the first image corresponding to the at least one image format and at least one address information corresponding to the at least one image format to the server.

[0163] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0164] Please refer to Figure 8 , which shows a block diagram of a computer device 800 provided in one embodiment of the present application. The computer device 800 may be any electronic device with data calculation, processing and storage functions. The computer device 800 may be used to implement the image loading method or image uploading method provided in the above embodiments.

[0165] Typically, the computer device 800 includes a processor 801 and a memory 802 .

[0166] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0167] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned image loading method or image uploading method.

[0168] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the computer device 800, and the computer device 800 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0169] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor of a computer device, the computer program implements the above-mentioned image loading method or image uploading method. Optionally, the above-mentioned computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0170] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned image loading method or image uploading method.

[0171] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0172] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image loading method, characterized in that: The method comprises: receiving an image loading request sent by a terminal device, the image loading request being used to request loading of a first image, the image loading request including device information of the terminal device, the device information of the terminal device being used to indicate a device operation status of the terminal device; Acquire at least one address information corresponding to the first image, each address information is used to indicate an access address of a first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on an original image of the first image, the image format is related to the storage format and storage quality of the first image, and the first image corresponding to at least one image format and the at least one address information are pre-generated by the terminal device and sent to the server; Determine first address information matching the device information of the terminal device from the at least one address information; Sending a first image corresponding to a first image format identified by the first address information to the terminal device.

2. The method according to claim 1, characterized in that The device information of the terminal device includes: the storage and processing capabilities of the terminal device, and the network speed between the terminal device and the server; The determining, from the at least one address information, first address information matching the device information of the terminal device comprises: Obtaining a device score for the terminal device according to the storage and processing capabilities of the terminal device; The first address information is determined from the at least one address information according to a device score of the terminal device and a network speed between the terminal device and the server.

3. The method according to claim 2, characterized in that The determining the first address information from the at least one address information according to the device score of the terminal device and the network speed between the terminal device and the server includes: When the device score of the terminal device is less than a first score threshold, determining the address information corresponding to the image format with the largest amount of data in the at least one address information as the first address information; When the device score of the terminal device is greater than or equal to the first score threshold, and the device score of the terminal device is less than or equal to the second score threshold, determining the first address information according to the network speed between the terminal device and the server and the first network speed threshold; When the device score of the terminal device is greater than the second score threshold, the first address information is determined according to the network speed between the terminal device and the server and a second network speed threshold, and the second network speed threshold is greater than the first network speed threshold.

4. The method according to claim 3, characterized in that The format processing includes compression processing and resolution processing, the compression rate of the first image obtained by the compression processing is used to indicate the storage format of the first image, and the resolution of the first image obtained by the resolution processing is used to indicate the storage quality of the first image; The determining the first address information according to the network speed between the terminal device and the server and a first network speed threshold includes: When the network speed between the terminal device and the server is less than the first network speed threshold, determining the address information corresponding to the image format with the largest data volume in the at least one address information as the first address information; When the network speed between the terminal device and the server is greater than or equal to the first network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying the first condition in the at least one address information is determined as the first address information, wherein the first condition includes that the resolution is the maximum value among the at least one image format with the smallest compression rate, and the resolution is less than or equal to the first resolution.

5. The method according to claim 4, characterized in that The determining the first address information according to the network speed between the terminal device and the server and the second network speed threshold includes: When the network speed between the terminal device and the server is less than the second network speed threshold, determining the address information corresponding to the image format with the largest data volume in the at least one address information as the first address information; When the network speed between the terminal device and the server is greater than or equal to the second network speed threshold, the address information corresponding to the image format with the smallest compression rate and a resolution satisfying the second condition in the at least one address information is determined as the first address information, wherein the second condition includes that the resolution is the maximum value among the at least one image format with the smallest compression rate, the resolution is less than or equal to the second resolution, and the second resolution is higher than the first resolution.

6. The method according to claim 4, characterized in that The sending the first image corresponding to the first image format identified by the first address information to the terminal device includes: parsing the first address information using an address parsing tool, and loading a first image corresponding to the first image format according to the first address information; In the case where the first image is configured with a preload attribute, preloading a first image corresponding to a second image format located after a first image corresponding to the first image format according to a priority order of the image formats, the priority order of the image formats being from small to large compression rates and from large to small resolutions when the compression rates are the same; When the loading time of the first image corresponding to the first image format is less than a time threshold, sending the first image corresponding to the first image format to the terminal device; When the loading time of the first image corresponding to the first image format is greater than or equal to the time threshold, the first image corresponding to the second image format is loaded according to the priority order of the image formats.

7. The method according to claim 1, characterized in that The address information includes prefix identification information, and the prefix identification information is used to indicate that the first image is stored in at least two image formats; the method further includes: In a case where the at least one address information does not include the prefix identification information, determining address information corresponding to an original image of the first image as the first address information, the original image of the first image being the first image that has not been processed by the format; In a case where the prefix identification information is included in the at least one address information, a step of determining first address information matching the device information of the terminal device from the at least one address information is performed.

8. The method according to claim 7, characterized in that The address information also includes at least one of the following: network protocol information, server domain name information, image name information, and image quality information; wherein the image name information includes identification information of the first image and identification information of the image format, the identification information of the image format is used to indicate the storage format of the first image, and the image quality information is used to indicate the storage quality of the first image.

9. A method for uploading an image, characterized in that: The method comprises: In response to an upload operation on a first image, obtaining an original image of the first image; Performing format processing on an original image of the first image to obtain a first image corresponding to at least one image format, wherein the image format is related to a storage format and storage quality of the first image; generating, according to at least one image format of the first image, at least one address information corresponding to the at least one image format, wherein the address information corresponding to the image format is used to indicate an access address of the first image corresponding to the image format in the server; The first image corresponding to the at least one image format and at least one address information corresponding to the at least one image format are sent to the server.

10. An image loading device, characterized in that: The device comprises: a request receiving module, configured to receive an image loading request sent by a terminal device, wherein the image loading request is used to request loading of a first image, and the image loading request includes device information of the terminal device, and the device information of the terminal device is used to indicate a device operation status of the terminal device; an address acquisition module, used for acquiring at least one address information corresponding to the first image, each address information is used for indicating an access address of a first image corresponding to an image format, the first image corresponding to the image format is an image obtained by the terminal device performing format processing on an original image of the first image, the image format is related to a storage format and storage quality of the first image, and the first image corresponding to at least one image format and the at least one address information are generated in advance by the terminal device and sent to the server; An address matching module, used to determine first address information matching the device information of the terminal device from the at least one address information; An image sending module is used to send a first image corresponding to a first image format identified by the first address information to the terminal device.

11. An image uploading device, characterized in that: The device comprises: An image uploading module, configured to obtain an original image of a first image in response to an upload operation on the first image; a format processing module, configured to perform format processing on an original image of the first image to obtain a first image corresponding to at least one image format, wherein the image format is related to a storage format and storage quality of the first image; An address generating module, configured to generate, according to at least one image format of the first image, at least one address information corresponding to the at least one image format, wherein the address information corresponding to the image format is used to indicate an access address of the first image corresponding to the image format in the server; The address sending module is used to send the first image corresponding to the at least one image format and at least one address information corresponding to the at least one image format to the server.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the image loading method according to any one of claims 1 to 8, or to implement the image uploading method according to any one of claim 9.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the image loading method according to any one of claims 1 to 8, or to implement the image uploading method according to any one of claim 9.

14. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the image loading method according to any one of claims 1 to 8, or to implement the image uploading method according to any one of claim 9.