CN109992406B - Picture request method, picture request response method and client - Google Patents

Picture request method, picture request response method and client Download PDF

Info

Publication number
CN109992406B
CN109992406B CN201711499082.9A CN201711499082A CN109992406B CN 109992406 B CN109992406 B CN 109992406B CN 201711499082 A CN201711499082 A CN 201711499082A CN 109992406 B CN109992406 B CN 109992406B
Authority
CN
China
Prior art keywords
client
picture
size
request
application server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711499082.9A
Other languages
Chinese (zh)
Other versions
CN109992406A (en
Inventor
张之硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711499082.9A priority Critical patent/CN109992406B/en
Priority to PCT/CN2018/108753 priority patent/WO2019128357A1/en
Publication of CN109992406A publication Critical patent/CN109992406A/en
Application granted granted Critical
Publication of CN109992406B publication Critical patent/CN109992406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The disclosure provides a picture request method, which is applied to an electronic device, wherein a client is installed on the electronic device, and the method comprises the following steps: in the process of requesting pictures by a client, determining the size of a memory allocated to the client by electronic equipment; and enabling the client to request the picture with the corresponding size from the application server according to the size of the memory of the electronic equipment distribution client. The present disclosure also provides a method of responding to a picture request, a client, an application server, a computer system, and a computer-readable storage medium.

Description

Picture request method, picture request response method and client
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a picture request method, a method for responding to a picture request, a client, an application server, a computer system, and a computer-readable storage medium.
Background
At present, memory overflow (oom) is often encountered on some low-end communication devices, for example, oom of pictures in a list due to too high quality is often encountered on some low-end models of android. Even if the width and height of imageview defined in the program are small, but the size of the picture issued by the server is large, in the process of loading the list, because the pictures to be displayed are all loaded into the memory, even if the picture display is small, the pixel of the picture is large, the size of the picture loaded into the memory occupies the memory according to the pixel of the picture, so a large amount of memory is occupied, and even if the program normally recycles and moves out the memory occupied by the screen bitmap, the problem of oom is caused because the current picture occupies too large memory. Oom is easily encountered in the mobile development process, for example, android faces oom problem in the client development process, and the final solution is to reduce the picture quality uniformly at the server side, and the client optimizes the memory recovery for oom again.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: the quality of pictures is reduced on the server side, and although the problem of oom can be reduced to a certain extent by the low-end communication equipment, the high-end communication equipment cannot use high-quality pictures, so that the user experience is affected.
Disclosure of Invention
In view of the above, the present disclosure provides a picture request method, a picture request response method, a client and an application server for preventing oom problems on the client.
One aspect of the present disclosure provides a picture request method, which is applied to an electronic device, where a client is installed on the electronic device, and the method includes: in the process that the client requests for the pictures, determining the size of a memory allocated to the client by the electronic equipment; and enabling the client to request the picture with the corresponding size from the application server according to the size of the memory allocated to the client by the electronic equipment.
According to an embodiment of the present disclosure, making the client request a picture of a corresponding size from an application server according to a size of a memory allocated to the client by the electronic device includes: when the client is started, the client sends identification information of the client and related information of the memory size allocated to the client by the electronic equipment to the application server, so that the application server can calculate a picture size compression ratio corresponding to the client according to the related information of the memory size allocated to the client by the electronic equipment, and stores the picture size compression ratio, the identification information of the client and a corresponding relation between the picture size compression ratio and the identification information of the client in a database; in the process that the client requests the picture, the client carries identification information of the client when sending the picture request, so that the application server can respond based on the identification information carried in the picture request and return a corresponding response result to the client; and enabling the client to obtain the picture with the corresponding size according to the response result.
According to an embodiment of the present disclosure, enabling the client to obtain the picture with the corresponding size according to the response result includes: and when the application server returns the URL with the picture size to the client, the client requests the picture with the corresponding size to the picture server based on the URL with the picture size information.
Another aspect of the present disclosure also provides a method for responding to a picture request, which is applied to an application server, where the method includes: in the process of responding to a picture request sent by a client of electronic equipment, acquiring related information of the memory size allocated to the client by the electronic equipment; and enabling the application server to respond to the picture request sent by the client according to the relevant information of the memory size allocated to the client by the electronic equipment.
According to an embodiment of the present disclosure, causing the application server to respond to the picture request sent by the client according to the information about the memory size allocated to the client by the electronic device includes: in the process of requesting pictures by the client, enabling the application server to search a database based on identification information carried in the picture request sent by the client so as to find out a picture size compression ratio corresponding to the identification information; enabling the application server to generate a URL with picture size information based on the picture size compression ratio; and returning the URL with the picture size information to the client by the application server, so that the client can request a picture of a corresponding size from the picture server based on the URL with the picture size information.
According to an embodiment of the present disclosure, the method further includes: acquiring self identification information sent by the client when the client is started and related information of the memory size allocated to the client by the electronic equipment; calculating the picture size compression ratio corresponding to the client according to the relevant information of the memory size allocated to the client by the electronic equipment; and storing the picture size compression ratio, the identification information of the client and the corresponding relation between the picture size compression ratio and the identification information in the database.
Another aspect of the present disclosure provides a client installed on an electronic device for making a picture request, where the client includes: the determining module is used for determining the size of the memory allocated to the client by the electronic equipment in the process of requesting pictures by the client; and the request module is used for enabling the client to request the picture with the corresponding size from the application server according to the size of the memory allocated to the client by the electronic equipment.
According to an embodiment of the present disclosure, the request module includes: a first sending unit, configured to send, when the client is started, identification information of the client and information related to a size of a memory allocated to the client by the electronic device to the application server, so that the application server can calculate, according to the information related to the size of the memory allocated to the client by the electronic device, a picture size compression ratio corresponding to the client, and store, in a database, the picture size compression ratio, the identification information of the client, and a correspondence relationship between the picture size compression ratio and the identification information of the client; a second request unit, configured to, in a process that the client requests an image, enable the client to carry identification information of the client when sending an image request, so that the application server can respond based on the identification information carried in the image request, and return a corresponding response result to the client; and the acquisition unit is used for enabling the client to acquire the picture with the corresponding size according to the response result.
According to an embodiment of the present disclosure, the obtaining unit is further configured to: and when the application server returns the URL with the picture size to the client, the client requests the picture with the corresponding size to the picture server based on the URL with the picture size information.
Another aspect of the present disclosure provides an application server for responding to a picture request of a client of an electronic device, including: a first obtaining module, configured to obtain, in a process of responding to a picture request sent by the client, information related to a size of a memory allocated to the client by the electronic device; and a response module, configured to enable the application server to respond to the picture request sent by the client according to the information about the size of the memory allocated to the client by the electronic device.
According to an embodiment of the present disclosure, the response module includes: a searching unit, configured to, in a process of requesting a picture by the client, enable the application server to search a database based on identification information carried in the picture request sent by the client, so as to find a picture size compression ratio having a correspondence with the identification information; a generation unit configured to cause the application server to generate a URL with picture size information based on the picture size compression ratio; and a feedback unit, configured to enable the application server to return the URL with the picture size information to the client, so that the client can request a picture of a corresponding size from a picture server based on the URL with the picture size information.
According to an embodiment of the present disclosure, the application server further includes: a second obtaining module, configured to obtain identification information of the client that is sent when the client is started and related information of a size of a memory allocated to the client by the electronic device; a calculating module, configured to calculate, according to information about a size of a memory allocated to the client by the electronic device, the picture size compression ratio corresponding to the client; and the storage module is used for storing the picture size compression ratio, the identification information of the client and the corresponding relation between the picture size compression ratio and the identification information in the database.
Another aspect of the present disclosure provides a computer system comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-described picture request methods and methods for responding to a picture request.
Another aspect of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to implement any one of the above-described picture request method and method of responding to a picture request.
Through the embodiment of the disclosure, the client requests the picture with the corresponding size based on the size of the memory allocated by the client, so that not only can the oom problem of the low-end equipment be prevented, but also the high-end communication equipment can use the picture with high quality as usual, and the user experience cannot be influenced.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture to which a picture request method and a method of responding to a picture request may be applied, according to an embodiment of the present disclosure;
FIG. 2A schematically illustrates a flow chart of a picture request method according to an embodiment of the present disclosure;
fig. 2B schematically shows a flowchart for enabling a client to request a picture of a corresponding size according to the size of memory allocated by the client according to an embodiment of the present disclosure;
FIG. 3A schematically illustrates a flow chart of a method of responding to a picture request according to an embodiment of the present disclosure;
fig. 3B schematically shows a flowchart for enabling the application server to respond to the picture request sent by the client according to the information about the memory size allocated by the client according to the embodiment of the present disclosure;
fig. 3C schematically shows a flow chart of a method of responding to a picture request according to another embodiment of the present disclosure;
fig. 4A schematically illustrates a block diagram of a client according to an embodiment of the present disclosure;
FIG. 4B schematically shows a block diagram of a request module according to an embodiment of the disclosure;
FIG. 5A schematically illustrates a block diagram of an application server, in accordance with an embodiment of the present disclosure;
FIG. 5B schematically shows a block diagram of a response module according to an embodiment of the disclosure;
fig. 5C schematically shows a block diagram of an application server according to another embodiment of the present disclosure; and
FIG. 6 schematically shows a block diagram of a computer system suitable for implementing a picture request method and a method of responding to a picture request according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). It will be further understood by those within the art that virtually any disjunctive word and/or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase "a or B" should be understood to include the possibility of "a" or "B", or "a and B".
Embodiments of the present disclosure provide a picture request method for preventing a client from presenting an oom problem, a method for responding to a picture request, and a client and an application server capable of applying the corresponding method. The picture request method comprises the steps of determining the size of a memory allocated to a client in the process of requesting pictures by the client; and enabling the client to request the pictures with the corresponding sizes according to the size of the memory allocated by the client.
Fig. 1 schematically shows an exemplary system architecture to which a picture request method and a method of responding to a picture request may be applied according to an embodiment of the present disclosure.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the method for responding to the picture request provided by the embodiment of the present disclosure may be generally executed by the server 105. The method for responding to the picture request provided by the embodiment of the present disclosure may also be performed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be noted that the picture request method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the client provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2A schematically shows a flowchart of a picture request method according to an embodiment of the present disclosure. As shown in fig. 2A, the method is applied to an electronic device having a client installed thereon, and includes operations S201 to S202, in which:
in operation S201, in a process of requesting a picture by a client, determining a size of a memory allocated to the client by an electronic device; and
in operation S202, the client is caused to request a picture of a corresponding size from the application server according to the size of the memory allocated to the client by the electronic device.
In the embodiment of the present disclosure, the process of requesting pictures by the client may include a preparation phase and a request phase.
In one case, the client may send the size of the memory allocated to the client and a Unique Device Identifier (UDID) of the client to the http server in advance in the preparation stage, the http server forwards the information to the application server, the application server calculates the picture size corresponding to the memory of the client according to the information, and further stores the calculation result in the database, based on the calculation result, when the client sends a data request containing a picture request to the http server in the request phase, the http server will forward the data request to the application server, and the application server will read the above calculation result from the database, and generate the URL with the picture size information according to the read information, and returning the URL to the client, wherein the client can use the URL to request the picture with the corresponding size from the picture server.
In another case, the client may send the size of the memory allocated by the client and the UDID of the client to the http server in a data request including a picture request in a request phase, the http server forwards the information to the application server, the application server calculates the picture size adapted to the memory of the client according to the information, generates a URL with picture size information according to a calculation result, and returns the URL to the client, where the client may use the URL to request a picture of a corresponding size from the picture server.
Preferably, the former case may be selected, and the size of the picture adapted to the memory of the client is determined in the preparation stage, so that the waiting time for requesting to determine the size of the picture adapted to the memory of the client in real time may be reduced, thereby improving the working efficiency and improving the user experience.
Through the embodiment of the disclosure, the client requests the picture with the corresponding size based on the size of the memory allocated by the client, so that not only can the oom problem of the low-end equipment be prevented, but also the high-end communication equipment can use the picture with high quality as usual, and the user experience cannot be influenced.
Referring now to FIG. 2B, the method of FIG. 2A is further described in conjunction with specific embodiments.
Fig. 2B schematically shows a flowchart for enabling the client to request a picture of a corresponding size according to the size of the memory allocated by the client according to an embodiment of the present disclosure. As shown in fig. 2B, as an alternative embodiment, making the client request the picture with the corresponding size according to the size of the memory allocated to the client includes:
in operation S2021, when the client is started, the client sends the identification information of the client and the related information of the memory size allocated to the client by the electronic device to the application server, so that the application server can calculate the picture size compression ratio corresponding to the client according to the related information of the memory size allocated to the client by the electronic device, and store the picture size compression ratio, the identification information of the client, and the correspondence between the picture size compression ratio and the identification information of the client in the database.
In the embodiment of the present disclosure, the operation may be performed when the client is started for the first time, or may be performed once when the client is started each time.
Since the size of the memory allocated to each client is dynamically modifiable, in order to ensure that the memory information uploaded by the client is up-to-date, the operation may preferably be performed once each time the client is started. And if the UDID and the picture size compression ratio are the same as those stored before, ending the process if the UDID and the picture size compression ratio are not stored in the database, and storing the UDID and the picture size compression ratio in the database if the UDID and the picture size compression ratio are not stored in the database.
Specifically, each time the client is started, a handshake request is sent to the http server, so that the client can send the size of the memory allocated by the client and the UDID of the client to the http server in a data request including a picture request, the http server forwards the information to the application server, the application server calculates the picture size compression ratio corresponding to the client according to the information, and then the calculation result is stored in the database.
Because the request head generally carries the UDID by default, only the relevant information of the memory size of the client is needed to be taken as parameters and transmitted to the http server, the http server does not process the parameters, the information uploaded by the client is continuously transmitted to the application server, the application server calculates the picture size compression ratio of the client according to the memory size, and the UDID and the corresponding picture size compression ratio are stored in a database.
In addition, the corresponding relationship between the memory range and the picture size compression ratio can be configured in advance, when the size of the memory falls within a certain memory range, the picture size compression ratio corresponding to the memory range is the required picture size compression ratio, and when the memory exceeds the maximum value of the preset memory range, the client uses the picture on the default url, namely the original picture. So that all memory sizes can correspond to a picture size compression ratio.
In operation S2022, in the process of requesting a picture by the client, the client carries its own identification information when sending the picture request, so that the application server can respond based on the identification information carried in the picture request, and return a corresponding response result to the client.
Specifically, when a client sends a data request containing a picture request to an http server in a request stage, a request header carries a UDID, and after the http server forwards the data request to an application server, the application server reads a picture size compression ratio corresponding to the UDID from a database, generates a URL with picture size information according to the read information, and returns the URL to the client.
For example, the size of the artwork is 720x 720, the picture size compression ratio of a client is 50%, and the picture URL in the artwork response data is assumed to be:
https://m.360buying.com/imp/default.jfs/testPic.jpg,
then the URL of the picture processed by the application server based on the picture size compression ratio of 50% is:
https://m.360buying.com/imp/360x 360.jfs/testPic.Jpg。
in operation S2023, the client acquires a picture of a corresponding size according to the response result.
As already explained above, the client is given the following picture URL:
https://m.360buying.com/imp/360x 360.jfs/testPic.Jpg,
the URL address generated in the previous step can request a picture with a size of 360x 360, and the size of the picture is generated based on the size compression ratio of the picture generated in the previous step, so that the size of the picture is consistent with the memory size of the client.
It should be noted that, a client generally has one or more list page interfaces, so that in practical applications, a flexible configuration mode may be adopted, and only a certain or some common list page interfaces are subjected to picture URL processing, instead of having to perform picture URL processing on data requests of all list page interfaces of the client.
According to the embodiment of the disclosure, the size of the memory is generally in positive correlation with the configuration of the mobile phone, that is, the configuration of the mobile phone with a small memory is not high, so that it is very reasonable to load the same picture with different dimensions according to the size of the memory, so that the picture with a proper size can be requested without affecting the user experience, and the oom problem of the mobile terminal with a small memory is solved.
As an optional embodiment, the causing the client to obtain the picture with the corresponding size according to the response result includes: and in the case that the application server returns the URL with the picture size to the client, enabling the client to request the picture with the corresponding size from the picture server based on the URL with the picture size information.
After the picture URL address in the response data requested by the client is sent to the application server, the server specially processes the picture URL in the response data, namely, the picture URL address with the proper size according with the size of the memory is generated according to the stored picture size compression ratio, and the client can request the picture with the corresponding size from the picture server in sequence.
When the client requests the picture server for the picture with the corresponding size based on the URL with the picture size information, the response logic of the picture server is as follows:
(1) for the picture uploaded by the user, the picture server does not perform any processing, for example, the storage path of the uploaded picture is as follows:
https://m.360buying.com/imp/default.jfs/testPic.jpg,
(1) when someone requests a picture through the following path:
https://m.360buying.com/imp/726x450.jfs/testPic.jpg,
if the picture exists, the picture server sends the picture to the corresponding client, if the picture does not exist, the picture server does not process the picture, the original picture is immediately returned to the corresponding client, and besides, the picture server also records a file for explaining that someone makes the picture request. Therefore, the apache cache on the side of the picture server can pick up the file, process the original picture according to the required size, and finally obtain the picture meeting the required size.
Further, since the disk space of the server is limited, if someone uses a URL, which is a program that keeps generating pictures of different sizes, to request maliciously, the disk space may soon be filled with the generated pictures. Based on this, in order to prevent malicious attacks, the number of pictures with different sizes that the apache camel is allowed to process can be set for one original picture, for example, only the apache camel is allowed to process 6 pictures with different sizes, and if the number exceeds the number, the earliest generated picture is replaced.
The following specific example illustrates the disclosure in detail:
operation 1, a client sends a data request, and the head of the request is defaulted to carry UDID;
operation 2, the application server judges whether the response data of the request has a picture URL, if not, the response data is returned to the client, and if so, the following processing flow is carried out;
operation 3, the application server queries the image size compression ratio in the database according to the UDID carried in the request;
operation 4, the application server regenerates the URL address with the proper size of the picture according to the picture size compression ratio;
operation 5, the application server returns the newly generated picture URL address to the client;
operation 6, the client requests the picture server for the picture according to the picture URL address;
in operation 7, the picture server determines whether a picture exists according to the URL address of the requested picture, and based on the foregoing example, here, the picture server may search for a picture to be requested that does not have a size of 360x 360. If yes, performing operation 8 and ending, and if not, performing operation 9 and operation 10 successively;
operation 8, the picture server returns the picture to the client;
operation 9, the picture server returns the original picture to the client and records the requested picture;
in operation 10, the picture server performs apache camel processing on the pictures, and generates the pictures recorded in the previous step according to the original pictures, that is, the pictures with the size of 360 × 360, to prepare for the next request, although the server does not generate pictures with unlimited apache camel, but has a number limitation, for example, only allowing to generate 6 pictures with different sizes, and if the number exceeds the number, the earliest generated picture is replaced.
It should be noted that apache camel is an open-source framework and is a rule and processing based engine, which enables a user to request a server side to provide a multi-size picture through a change of a parameter in a picture URL address.
By the embodiment of the disclosure, under the condition that user experience is not influenced, pictures with proper sizes are dynamically requested according to the size of the memory occupied by the client in the process that some clients with smaller memory request the pictures, so that the memory of the mobile terminal is saved, and the oom problem which easily occurs on the mobile terminal is solved. Further, the scheme provided by the disclosure is dynamically adaptive, because the size of the memory allocated by the client can be changed, for example, the android mobile phone terminal can modify the default maximum memory of the client, and when the user modifies the default maximum memory of the client, the scheme can re-request the picture suitable for the memory according to the new modification value.
Fig. 3A schematically shows a flow chart of a method of responding to a picture request according to an embodiment of the present disclosure. As shown in fig. 3A, the method is applied to an application server, and includes operations S301 to S302, where:
in operation S301, in a process of responding to a picture request sent by a client of an electronic device, obtaining relevant information of a memory size allocated to the client by the electronic device; and
in operation S302, the application server is enabled to respond to the picture request sent by the client according to the information about the memory size allocated to the client by the electronic device.
In the embodiment of the present disclosure, the process of requesting pictures by the client may include a preparation phase and a request phase.
In one case, the client may send the size of the memory allocated to the client and a Unique Device Identifier (UDID) of the client to the http server in advance in the preparation stage, the http server forwards the information to the application server, the application server calculates the picture size corresponding to the memory of the client according to the information, and further stores the calculation result in the database, based on the calculation result, when the client sends a data request containing a picture request to the http server in the request phase, the http server will forward the data request to the application server, and the application server will read the above calculation result from the database, and generate the URL with the picture size information according to the read information, and returning the URL to the client, wherein the client can use the URL to request the picture with the corresponding size from the picture server.
In another case, the client may send the size of the memory allocated by the client and the UDID of the client to the http server in a data request including a picture request in a request phase, the http server forwards the information to the application server, the application server calculates the picture size adapted to the memory of the client according to the information, generates a URL with picture size information according to a calculation result, and returns the URL to the client, where the client may use the URL to request a picture of a corresponding size from the picture server.
Preferably, the former case may be selected, and the picture size adapted to the memory of the client is determined in the preparation stage, so that the waiting time for requesting to determine the picture size adapted to the memory of the client in real time may be reduced, thereby improving the working efficiency and improving the user experience.
Through the embodiment of the disclosure, the client requests the picture with the corresponding size based on the size of the memory allocated by the client, so that not only can the oom problem of the low-end equipment be prevented, but also the high-end communication equipment can use the picture with high quality as usual, and the user experience cannot be influenced. Correspondingly, the application server can dynamically issue pictures with different sizes according to the memory size of the client so as to save the limited memory of the mobile terminal, and the problem of oom can be effectively solved.
The method illustrated in fig. 3A is further described below in conjunction with specific embodiments with reference to fig. 3B and 3C.
Fig. 3B schematically shows a flowchart for enabling the application server to respond to the picture request sent by the client according to the information about the memory size allocated by the client according to the embodiment of the present disclosure. As shown in fig. 3B, as an alternative embodiment, the causing the application server to respond to the picture request sent by the client according to the information about the memory size allocated to the client by the electronic device includes:
in operation S3021, in the process of requesting a picture by the client, the application server searches the database based on the identification information carried in the picture request sent by the client to find a picture size compression ratio corresponding to the identification information;
in operation S3022, causing the application server to generate a URL with picture size information based on the picture size compression ratio; and
in operation S3023, the application server is caused to return the URL with the picture size information to the client, so that the client can request a picture of a corresponding size from the picture server based on the URL with the picture size information.
Specifically, when a client sends a data request containing a picture request to an http server in a request stage, a request header carries a UDID, and after the http server forwards the data request to an application server, the application server reads a picture size compression ratio corresponding to the UDID from a database, generates a URL with picture size information according to the read information, and returns the URL to the client.
For example, the size of the artwork is 720x 720, the picture size compression ratio of a client is 50%, and the picture URL in the artwork response data is assumed to be:
https://m.360buying.com/imp/default.jfs/testPic.jpg,
then the URL of the picture processed by the application server based on the picture size compression ratio of 50% is:
https://m.360buying.com/imp/360x 360.jfs/testPic.Jpg。
in operation S2023, the client acquires a picture of a corresponding size according to the response result.
As already explained above, the client is given the following picture URL:
https://m.360buying.com/imp/360x 360.jfs/testPic.Jpg,
the URL address generated in the previous step can request a picture with a size of 360x 360, and the size of the picture is generated based on the size compression ratio of the picture generated in the previous step, so that the size of the picture is consistent with the memory size of the client.
It should be noted that, a client generally has one or more list page interfaces, so that in practical applications, a flexible configuration mode may be adopted, and only a certain or some common list page interfaces are subjected to picture URL processing, instead of having to perform picture URL processing on data requests of all list page interfaces of the client.
According to the embodiment of the disclosure, the size of the memory is generally in positive correlation with the configuration of the mobile phone, that is, the configuration of the mobile phone with a small memory is not high, so that it is very reasonable to load the same picture with different dimensions according to the size of the memory, so that the picture adapting to the size of the memory can be issued without affecting the user experience, and the oom problem of the mobile terminal with a small memory is solved.
Fig. 3C schematically shows a flowchart of a method of responding to a picture request according to another embodiment of the present disclosure. As an alternative embodiment, as shown in fig. 3C, the method may include, in addition to the operations in fig. 3A and 3B:
in operation S303, acquiring identification information of the client and related information of a memory size allocated to the client by the electronic device, where the identification information is sent when the client is started;
in operation S304, a picture size compression ratio corresponding to the client is calculated according to information related to the size of the memory allocated to the client by the electronic device; and
in operation S305, the picture size compression ratio and the identification information of the client and the correspondence relationship between the two are stored in the database.
In the embodiment of the present disclosure, the operation may be performed when the client is started for the first time, or may be performed once when the client is started each time.
Since the size of the memory allocated to each client is dynamically modifiable, in order to ensure that the memory information uploaded by the client is up-to-date, the operation may preferably be performed once each time the client is started. And if the UDID and the picture size compression ratio are the same as those stored before, ending the process if the UDID and the picture size compression ratio are not stored in the database, and storing the UDID and the picture size compression ratio in the database if the UDID and the picture size compression ratio are not stored in the database.
Specifically, each time the client is started, a handshake request is sent to the http server, so that the client can send the size of the memory allocated by the client and the UDID of the client to the http server in a data request including a picture request, the http server forwards the information to the application server, the application server calculates the picture size compression ratio corresponding to the client according to the information, and then the calculation result is stored in the database.
Because the request head generally carries the UDID by default, only the relevant information of the memory size of the client is needed to be taken as parameters and transmitted to the http server, the http server does not process the parameters, the information uploaded by the client is continuously transmitted to the application server, the application server calculates the picture size compression ratio of the client according to the memory size, and the UDID and the corresponding picture size compression ratio are stored in a database.
In addition, the corresponding relationship between the memory range and the picture size compression ratio can be configured in advance, when the size of the memory falls within a certain memory range, the picture size compression ratio corresponding to the memory range is the required picture size compression ratio, and when the memory exceeds the maximum value of the preset memory range, the client uses the picture on the default url, namely the original picture. So that all memory sizes can correspond to a picture size compression ratio.
According to the embodiment of the disclosure, since the size of the memory is generally in positive correlation with the configuration of the mobile phone, that is, the configuration of the mobile phone with a small memory is not high, the picture compression size of the client is calculated according to the size of the memory, so that a picture matched with the size of the memory can be provided based on the picture compression size when the client requests the picture, and therefore, the picture adapting to the size of the memory can be issued without affecting user experience, and the oom problem of the mobile terminal with a small memory is solved.
Fig. 4A schematically illustrates a block diagram of a client according to an embodiment of the present disclosure. As shown in fig. 4A, the client 400 is installed on an electronic device for making a picture request, and the client 400 includes: a determination module 410 and a request module 420. The determining module 410 is configured to determine, in a process that a client requests a picture, a size of a memory allocated to the client by an electronic device; and a request module 420, configured to request, from the application server, a picture of a corresponding size according to the size of the memory allocated to the client by the electronic device itself.
Through the embodiment of the disclosure, the client requests the picture with the corresponding size based on the size of the memory allocated by the client, so that not only can the oom problem of the low-end equipment be prevented, but also the high-end communication equipment can use the picture with high quality as usual, and the user experience cannot be influenced.
Fig. 4B schematically illustrates a block diagram of a request module according to an embodiment of the disclosure. As shown in fig. 4B, as an alternative embodiment, the request module 420 includes: a first sending unit 421, configured to send, when the client is started, identification information of the client and related information of a size of a memory allocated to the client by the electronic device itself to the application server, so that the application server can calculate, according to the related information of the size of the memory allocated to the client by the electronic device itself, a picture size compression ratio corresponding to the client, and store, in the database, the picture size compression ratio, the identification information of the client, and a correspondence between the two; the second request unit 422 is configured to, in a process of requesting a picture by a client, enable the client to carry identification information of the client when sending a picture request, so that the application server can respond based on the identification information carried in the picture request, and return a corresponding response result to the client; and an obtaining unit 423 for enabling the client to obtain the picture with the corresponding size according to the response result.
According to the embodiment of the disclosure, the size of the memory is generally in positive correlation with the configuration of the mobile phone, that is, the configuration of the mobile phone with a small memory is not high, so that it is very reasonable to load the same picture with different dimensions according to the size of the memory, so that the picture with a proper size can be requested without affecting the user experience, and the oom problem of the mobile terminal with a small memory is solved.
As an alternative embodiment, the obtaining unit is further configured to: and in the case that the application server returns the URL with the picture size to the client, enabling the client to request the picture with the corresponding size from the picture server based on the URL with the picture size information.
Through the embodiment of the disclosure, under the condition that user experience is not influenced, in the process that some clients with smaller memories request pictures, the pictures with proper sizes are dynamically requested according to the sizes of the memories occupied by the clients, so that the memories of the mobile terminals are saved, and the oom problem easily appearing on the mobile terminals is solved. Further, the scheme provided by the disclosure is dynamically adaptive, because the size of the memory allocated by the client can be changed, for example, the android mobile phone terminal can modify the default maximum memory of the client, and when the user modifies the default maximum memory of the client, the scheme can re-request the picture suitable for the memory according to the new modification value.
Fig. 5A schematically illustrates a block diagram of an application server according to an embodiment of the present disclosure. As shown in fig. 5A, the application server 500 is configured to respond to a picture request from a client, and includes: a first acquisition module 510 and a response module 520. A first obtaining module 510, configured to obtain, in a process of responding to a picture request sent by a client of an electronic device, information about a size of a memory allocated to the client by the electronic device; and a response module 520, configured to enable the application server to respond to the picture request sent by the client according to the information about the size of the memory allocated to the client by the electronic device.
Through the embodiment of the disclosure, the client requests the picture with the corresponding size based on the size of the memory allocated by the client, so that not only can the oom problem of the low-end equipment be prevented, but also the high-end communication equipment can use the picture with high quality as usual, and the user experience cannot be influenced. Correspondingly, the application server can dynamically issue pictures with different sizes according to the memory size of the client so as to save the limited memory of the mobile terminal, and the problem of oom can be effectively solved.
Fig. 5B schematically illustrates a block diagram of a response module according to an embodiment of the disclosure. As an alternative embodiment, as shown in fig. 5B, the response module 520 includes: the searching unit 521 is configured to, in a process that the client requests the picture, enable the application server to search the database based on the identification information carried in the picture request sent by the client, so as to find a picture size compression ratio having a corresponding relationship with the identification information; a generating unit 522 for causing the application server to generate a URL with picture size information based on the picture size compression ratio; and a feedback unit 523 configured to enable the application server to return the URL with the picture size information to the client, so that the client can request the picture of the corresponding size from the picture server based on the URL with the picture size information.
According to the embodiment of the disclosure, since the size of the memory and the configuration of the mobile phone generally form positive correlation, that is, the configuration of the mobile phone with a small memory is not high, it is very reasonable to load the same picture with different dimensions according to the size of the memory, so that the picture adapting to the size of the memory can be issued without affecting the user experience, and the oom problem of the mobile terminal with a small memory is solved.
Fig. 5C schematically shows a block diagram of an application server according to another embodiment of the present disclosure. As shown in fig. 5C, as an alternative embodiment, the application server 500 further includes: a second obtaining module 530, configured to obtain identification information of the client itself sent when the client is started and related information of a memory size allocated to the client by the electronic device; the calculating module 540 is configured to calculate a picture size compression ratio corresponding to the client according to the relevant information of the memory size allocated to the client by the electronic device; and a storage module 550 for storing the picture size compression ratio and the identification information of the client and the corresponding relationship between the two in the database.
According to the embodiment of the disclosure, since the size of the memory and the configuration of the mobile phone generally form positive correlation, that is, the configuration of the mobile phone with a small memory is not high, the picture compression size of the client is calculated according to the size of the memory, so that when the client requests a picture, a picture matched with the size of the memory can be provided based on the picture compression size, and therefore, the picture adapting to the size of the memory can be issued without affecting user experience, and the oom problem of a mobile terminal with a small memory is solved.
It is understood that the determining module 410 and the requesting module 420 (or the first obtaining module 510 and the responding module 520) may be combined in one module to be implemented, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present invention, at least one of the determining module 410 and the requesting module 420 (or the first obtaining module 510 and the responding module 520) may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in a suitable combination of three implementations of software, hardware, and firmware. Alternatively, at least one of the determining module 410 and the requesting module 420 (or the first obtaining module 510 and the responding module 520) may be at least partially implemented as a computer program module, which when executed by a computer, may perform the functions of the respective module.
It should be noted that, a system part in the embodiment of the present disclosure corresponds to a method part in the embodiment of the present disclosure, and the description of the system part specifically refers to the method part, which is not described herein again.
FIG. 6 schematically shows a block diagram of a computer system suitable for implementing a picture request method and a method of responding to a picture request according to an embodiment of the present disclosure. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 6, a computer system 600 according to an embodiment of the present disclosure includes a processor 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing the different actions of the method flows described with reference to fig. 2A and 2B and fig. 3A-3C in accordance with embodiments of the present disclosure.
In the RAM 603, various programs and data necessary for the operation of the computer system 600 are stored. The processor 601, the ROM602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations described above with reference to fig. 2A and 2B and 3A-3C by executing programs in the ROM602 and/or RAM 603. Note that the programs may also be stored in one or more memories other than the ROM602 and RAM 603. The processor 601 may also perform the various operations described above with reference to fig. 2A and 2B and fig. 3A-3C by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, computer system 600 may also include an input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604. Computer system 600 may also include one or more of the following components connected to I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to an embodiment of the present disclosure, the method described above with reference to the flow chart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
It should be noted that the computer readable storage medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing. According to embodiments of the present disclosure, a computer-readable storage medium may include the ROM602 and/or RAM 603 described above and/or one or more memories other than the ROM602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable storage medium carries one or more programs which, when executed by an apparatus, cause the apparatus to perform: in the process of requesting pictures by a client, determining the size of a memory allocated to the client; and enabling the client to request the picture with the corresponding size according to the size of the memory allocated by the client, and enabling the equipment to execute: in the process of responding to a picture request sent by a client, acquiring related information of the size of a memory allocated to the client; and enabling the application server to respond to the picture request sent by the client according to the relevant information of the memory size distributed by the client.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (12)

1. A picture request method is applied to electronic equipment, a client is installed on the electronic equipment, and the method comprises the following steps:
in the process that the client requests the pictures, the size of a memory allocated to the client by the electronic equipment is determined, wherein the process that the client requests the pictures comprises a preparation stage and a request stage; and
enabling the client to request a picture with a corresponding size from an application server according to the size of a memory allocated to the client by the electronic equipment;
the step of enabling the client to request the picture with the corresponding size from the application server according to the size of the memory allocated to the client by the electronic device comprises the following steps:
when the client is started, in the preparation stage, the client sends identification information of the client and related information of the size of a memory allocated to the client by the electronic equipment to an http server, the http server forwards the identification information and the related information of the size of the memory allocated to the client by the electronic equipment to the application server, so that the application server can calculate a picture size compression ratio corresponding to the client according to the related information of the size of the memory allocated to the client by the electronic equipment, and store the picture size compression ratio, the identification information of the client and a corresponding relation between the picture size compression ratio and the identification information of the client in a database;
in the request stage, in the process of requesting the picture by the client, the client carries identification information of the client when sending the picture request, so that the application server can respond based on the identification information carried in the picture request and return a corresponding response result to the client; and
and enabling the client to obtain the picture with the corresponding size according to the response result.
2. The method of claim 1, wherein causing the client to obtain the picture of the corresponding size according to the response result comprises:
and under the condition that the application server returns the URL with the picture size to the client, enabling the client to request the picture with the corresponding size from the picture server based on the URL with the picture size information.
3. A method for responding to a picture request is applied to an application server, and the method comprises the following steps:
in the process of responding to a picture request sent by a client of electronic equipment, acquiring relevant information of the size of a memory distributed to the client by the electronic equipment sent by an http server, wherein the process of requesting the picture by the client comprises a preparation stage and a request stage; and
enabling the application server to respond to the picture request sent by the client according to the relevant information of the memory size allocated to the client by the electronic equipment;
acquiring self identification information which is sent by the http server and sent to the http server in the preparation stage when the client is started, and the size of a memory which is allocated to the client by the electronic equipment;
calculating a picture size compression ratio corresponding to the client according to the relevant information of the memory size allocated to the client by the electronic device, and storing the picture size compression ratio, the identification information of the client and the corresponding relationship between the picture size compression ratio and the identification information in a database, so that the application server searches the database based on the identification information carried in the picture request sent by the client in the request stage to find out the picture size compression ratio corresponding to the identification information.
4. The method of claim 3, wherein the causing the application server to respond to the picture request sent by the client according to the information about the memory size allocated to the client by the electronic device comprises:
in the process that the client requests the picture, enabling the application server to search a database based on identification information carried in the picture request sent by the client so as to find out a picture size compression ratio corresponding to the identification information;
causing the application server to generate a URL with picture size information based on the picture size compression ratio; and
and enabling the application server to return the URL with the picture size information to the client, so that the client can request the picture with the corresponding size from the picture server based on the URL with the picture size information.
5. A client installed on an electronic device for making a picture request, the client comprising:
the determining module is used for determining the size of a memory allocated to the client by the electronic equipment in the process of requesting pictures by the client, wherein the process of requesting pictures by the client comprises a preparation stage and a request stage; and
the request module is used for enabling the client to request the picture with the corresponding size from the application server according to the size of the memory allocated to the client by the electronic equipment;
wherein the request module comprises:
a first sending unit, configured to send, when the client is started, in the preparation phase, identification information of the client and related information of a size of a memory allocated to the client by the electronic device to an http server, where the http server forwards the identification information and the related information of the size of the memory allocated to the client by the electronic device to the application server, so that the application server can calculate, according to the related information of the size of the memory allocated to the client by the electronic device, a picture size compression ratio corresponding to the client, and store, in a database, the picture size compression ratio, the identification information of the client, and a correspondence relationship between the picture size compression ratio and the identification information of the client;
a second request unit, configured to, in the request phase, enable the client to carry identification information of the client when sending a picture request in a process of requesting a picture by the client, so that the application server can respond based on the identification information carried in the picture request, and return a corresponding response result to the client; and
and the acquisition unit is used for enabling the client to acquire the picture with the corresponding size according to the response result.
6. The client of claim 5, wherein the obtaining unit is further configured to:
and under the condition that the application server returns the URL with the picture size to the client, enabling the client to request the picture with the corresponding size from the picture server based on the URL with the picture size information.
7. An application server for responding to a picture request of a client, comprising:
the first obtaining module is used for obtaining relevant information of the memory size distributed to the client by the electronic equipment and sent by an http server in the process of responding to a picture request sent by the client of the electronic equipment, wherein the process of requesting the picture by the client comprises a preparation stage and a request stage; and
the response module is used for enabling the application server to respond to the picture request sent by the client according to the related information of the memory size distributed to the client by the electronic equipment;
wherein the application server further comprises:
the second obtaining module is used for obtaining the identification information of the http server and the memory size distributed by the electronic equipment to the client, wherein the identification information is sent to the http server by the client in the preparation stage when the client is started;
the calculation module is used for calculating the picture size compression ratio corresponding to the client according to the relevant information of the memory size allocated to the client by the electronic equipment; and
the storage module is configured to store the picture size compression ratio, the identification information of the client, and a corresponding relationship between the two in a database, so that the application server searches the database based on the identification information carried in the picture request sent by the client in the request phase to find out the picture size compression ratio having the corresponding relationship with the identification information.
8. The application server of claim 7, wherein the response module comprises:
the searching unit is used for enabling the application server to search a database based on identification information carried in the picture request sent by the client side in the process that the client side requests the picture so as to find out the picture size compression ratio corresponding to the identification information;
a generating unit configured to cause the application server to generate a URL with picture size information based on the picture size compression ratio; and
a feedback unit, configured to enable the application server to return the URL with the picture size information to the client, so that the client can request a picture of a corresponding size from a picture server based on the URL with the picture size information.
9. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the picture request method of claim 1 or 2.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to implement the picture request method of claim 1 or 2.
11. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 3 or 4 for responding to a picture request.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of responding to a picture request of claim 3 or 4.
CN201711499082.9A 2017-12-29 2017-12-29 Picture request method, picture request response method and client Active CN109992406B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711499082.9A CN109992406B (en) 2017-12-29 2017-12-29 Picture request method, picture request response method and client
PCT/CN2018/108753 WO2019128357A1 (en) 2017-12-29 2018-09-29 Picture requesting method, method for responding to picture request, and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711499082.9A CN109992406B (en) 2017-12-29 2017-12-29 Picture request method, picture request response method and client

Publications (2)

Publication Number Publication Date
CN109992406A CN109992406A (en) 2019-07-09
CN109992406B true CN109992406B (en) 2022-06-07

Family

ID=67062979

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711499082.9A Active CN109992406B (en) 2017-12-29 2017-12-29 Picture request method, picture request response method and client

Country Status (2)

Country Link
CN (1) CN109992406B (en)
WO (1) WO2019128357A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400626A (en) * 2020-03-09 2020-07-10 联通沃音乐文化有限公司 Rapid self-adaptive output system and method for webpage pictures
CN112203158B (en) * 2020-09-27 2022-12-30 北京字节跳动网络技术有限公司 Image display method, device, system, equipment and medium
CN112883261A (en) * 2021-01-28 2021-06-01 北京百度网讯科技有限公司 Configuration data pushing method and device, electronic equipment and medium
CN113382180B (en) * 2021-06-01 2023-02-28 海南车智易通信息技术有限公司 Picture processing method, computing device and readable storage medium
CN113641928B (en) * 2021-08-11 2023-10-31 上海浦东发展银行股份有限公司 Webpage request method, system and storage medium
CN113676756A (en) * 2021-08-23 2021-11-19 北京字跳网络技术有限公司 Picture request method, device, equipment, storage medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6651094B1 (en) * 1998-07-17 2003-11-18 International Business Machines Corporation Method and apparatus for creating a preload image for network installation
CN103677942A (en) * 2013-12-30 2014-03-26 Tcl集团股份有限公司 Method and device for browsing network pictures at mobile terminal
CN104965877A (en) * 2015-06-12 2015-10-07 郑州悉知信息技术有限公司 Webpage picture acquisition method, picture cache server, coordination server and system
CN105183560A (en) * 2015-09-01 2015-12-23 北京金山安全软件有限公司 Method for adjusting picture, picture adjusting device and system
CN107179947A (en) * 2017-04-26 2017-09-19 武汉斗鱼网络科技有限公司 A kind of network picture method for down loading and system for mobile terminal
CN107193887A (en) * 2017-04-28 2017-09-22 武汉斗鱼网络科技有限公司 A kind of method and device for the resource that Loads Image

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100640491B1 (en) * 2003-12-08 2006-10-30 삼성전자주식회사 Apparatus and method for downloading picture
CN102650946B (en) * 2012-03-22 2015-04-01 杭州梵艺科技有限公司 Method for loading and displaying graphical interface at hand-held terminal
CN103516748A (en) * 2012-06-25 2014-01-15 北京智慧风云科技有限公司 Method and system for self-adaption file downloading processing of cloud server and cloud server
CN103399822B (en) * 2013-08-14 2017-05-24 上海斐讯数据通信技术有限公司 Memory allocation method and system for solving problem of insufficient memory for applied pictures
CN103544207B (en) * 2013-08-19 2019-01-29 Tcl集团股份有限公司 A kind of method and system of picture loaded and displayed
CN105956062A (en) * 2016-04-27 2016-09-21 广东欧珀移动通信有限公司 Picture acquisition method, system and equipment thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6651094B1 (en) * 1998-07-17 2003-11-18 International Business Machines Corporation Method and apparatus for creating a preload image for network installation
CN103677942A (en) * 2013-12-30 2014-03-26 Tcl集团股份有限公司 Method and device for browsing network pictures at mobile terminal
CN104965877A (en) * 2015-06-12 2015-10-07 郑州悉知信息技术有限公司 Webpage picture acquisition method, picture cache server, coordination server and system
CN105183560A (en) * 2015-09-01 2015-12-23 北京金山安全软件有限公司 Method for adjusting picture, picture adjusting device and system
CN107179947A (en) * 2017-04-26 2017-09-19 武汉斗鱼网络科技有限公司 A kind of network picture method for down loading and system for mobile terminal
CN107193887A (en) * 2017-04-28 2017-09-22 武汉斗鱼网络科技有限公司 A kind of method and device for the resource that Loads Image

Also Published As

Publication number Publication date
CN109992406A (en) 2019-07-09
WO2019128357A1 (en) 2019-07-04

Similar Documents

Publication Publication Date Title
CN109992406B (en) Picture request method, picture request response method and client
CN109308255B (en) Method and device for A/B test experiment
CN110096660B (en) Method and device for loading page pictures and electronic equipment
CN107547629B (en) Method and device for downloading client static resources, electronic equipment and readable medium
CN110888696A (en) Page display method and system, computer system and computer readable medium
CN104601534A (en) Method and system for processing CDN system images
US20190114989A1 (en) Systems and methods for image optimization
CN104378428B (en) A kind of method and apparatus for file download
CN111225010A (en) Data processing method, data processing system and device
CN111079048B (en) Page loading method and device
CN107634854B (en) Service data processing method and device
CN111783005B (en) Method, device and system for displaying web page, computer system and medium
CN113094612A (en) Method and device for loading webpage at client, electronic equipment and medium
CN103051722B (en) A kind ofly determine the method whether page is held as a hostage and relevant device
CN108959393B (en) Dynamic picture processing method, device and storage medium
CN115858905A (en) Data processing method and device, electronic equipment and storage medium
CN111338928A (en) Chrome-based browser testing method and device
US11438403B2 (en) Page presentation method and system, computer system, and computer readable medium
CN112688982B (en) User request processing method and device
US20150248347A1 (en) Content providing apparatus and method, and computer program product
CN111953718A (en) Page debugging method and device
CN112203158A (en) Image display method, device, system, equipment and medium
CN107666497B (en) Data access method and device
CN111580882A (en) Application program starting method, device, computer system and medium
CN109992428B (en) Data processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant