CN108388463B - Icon processing method and device, computer equipment and storage medium - Google Patents

Icon processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN108388463B
CN108388463B CN201810176121.XA CN201810176121A CN108388463B CN 108388463 B CN108388463 B CN 108388463B CN 201810176121 A CN201810176121 A CN 201810176121A CN 108388463 B CN108388463 B CN 108388463B
Authority
CN
China
Prior art keywords
icon
prompt
size parameter
preset size
user interface
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
CN201810176121.XA
Other languages
Chinese (zh)
Other versions
CN108388463A (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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810176121.XA priority Critical patent/CN108388463B/en
Publication of CN108388463A publication Critical patent/CN108388463A/en
Application granted granted Critical
Publication of CN108388463B publication Critical patent/CN108388463B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to an icon processing method and device, computer equipment and a storage medium. The method comprises the following steps: receiving prompt information sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; detecting whether a prompt icon matched with the icon identifier exists in a local database; if not, judging whether the icon size parameter is consistent with the preset size parameter or not; when the icon size parameter is inconsistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter; generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises a prompt icon after zooming processing. By adopting the method, unnecessary icon processing steps are avoided, the prompt icon which accords with the preset size parameter can be displayed more timely, and the icon processing efficiency is improved.

Description

Icon processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an icon processing method and apparatus, a computer device, and a storage medium.
Background
If an abnormality occurs in the process of accessing the server by the terminal, the server sometimes generates prompt information to prompt a user to perform corresponding operation. The types of the prompt messages are more, and the prompt messages comprise error reporting messages, processing result messages, risk early warning messages and the like. The server usually sets a corresponding prompt icon for each prompt message to distinguish different prompt messages. After the server sends the prompt icon to the terminal, the terminal may display the prompt icon in the user interface.
However, the size of the original prompt icon in the server may not match the size of the prompt icon displayed by the terminal, and the terminal needs to perform scaling processing on the prompt icon every time the terminal receives the prompt icon, which is inefficient in icon processing.
Disclosure of Invention
In view of the above, it is desirable to provide an icon processing method, an apparatus, a computer device, and a storage medium capable of improving icon processing efficiency.
A method of icon processing, the method comprising: receiving prompt information sent by the server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; detecting whether a prompt icon matched with the icon identifier exists in a local database; if not, judging whether the icon size parameter is consistent with a preset size parameter or not; when the icon size parameter is not consistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter; generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises the prompt icon after the zooming processing.
In one embodiment, the determining whether the icon size parameter is consistent with a preset size parameter includes: calculating according to the icon size parameter to obtain a first icon length-width ratio, and calculating according to the preset size parameter to obtain a second icon length-width ratio; judging whether the length-width ratio of the first icon is consistent with that of the second icon; when the icon size parameter is inconsistent with the preset size parameter, the method for zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter includes: and when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
In one embodiment, the scaling the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter includes: acquiring terminal information; adjusting the preset size parameter according to the preset size parameter; and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter.
In one embodiment, the detecting whether a prompt icon matching the icon identifier exists in the local database includes: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; and marking the prompt icon through the first character string.
In one embodiment, before the determining whether the icon size parameter is consistent with a preset size parameter, the method further includes: acquiring a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface; determining a size parameter interval to which the display width parameter belongs; and determining corresponding preset size parameters according to the determined size parameter interval.
In one embodiment, the reminder icon comprises a dynamic icon; the method further comprises the following steps: extracting dynamic attribute data carried by the dynamic icon; the generating and displaying a user interface according to the zoomed prompt icon comprises: generating a user interface according to the zoomed dynamic icon; and playing the dynamic icon in the user interface according to the dynamic attribute data.
In one embodiment, the generating and displaying a user interface according to the scaled prompt icon includes: determining the information type of the prompt message according to the icon identification; when the message type is a preset message type, searching a view layer where a user interface corresponding to the prompt message is located; drawing a floating window on a top view layer relative to the view layer according to the information type; and displaying the scaled prompt icon in the floating window.
An icon processing apparatus, the apparatus comprising: the receiving module is used for receiving the prompt message sent by the server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; the detection module is used for detecting whether a prompt icon matched with the icon identifier exists in a local database; the judging module is used for judging whether the icon size parameter is consistent with a preset size parameter if the icon size parameter is not consistent with the preset size parameter; the processing module is used for zooming the prompt icon when the icon size parameter is inconsistent with a preset size parameter to obtain and store the prompt icon corresponding to the preset size parameter; the generating module is used for generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises the prompt icon after the zooming processing.
A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the icon processing method described in the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the icon processing method described in the above-described embodiments.
According to the icon processing method, the icon processing device, the computer equipment and the storage medium, after the prompt information which is sent by the server and contains the prompt icon, the icon identification and the icon size parameter is received, whether the processed prompt icon corresponding to the icon identification exists locally or not is judged according to the icon size parameter. And if not, judging whether the icon size parameter is consistent with the preset size parameter or not. And only when the icon size parameter of the prompt icon is not consistent with the preset size parameter, zooming the prompt icon, and generating and displaying a user interface according to the zoomed prompt icon. By storing the zoomed prompt icon, the same prompt icon does not need to be zoomed again when the same prompt message is received next time. Therefore, the resources of the terminal are saved, unnecessary icon processing steps are avoided, the prompt icons meeting the preset size parameters can be displayed more timely, and the icon processing efficiency is improved.
Drawings
FIG. 1 is a diagram of an application scenario of a method for icon processing in one embodiment;
FIG. 2 is a flow diagram illustrating a method for icon processing in one embodiment;
FIG. 3A is a diagram of a user interface layout, under an embodiment;
FIG. 3B is a diagram of a user interface layout in another embodiment;
FIG. 3C is a schematic diagram of a user interface layout in a further embodiment;
FIG. 4A is a diagram of an original prompt icon in one embodiment;
FIG. 4B is a diagram illustrating a prompt icon after whitewashing in one embodiment;
FIG. 4C is a diagram illustrating a cropped hint icon, in accordance with an embodiment;
FIG. 4D is a diagram illustrating a hint icon after a stretch process in one embodiment;
FIG. 5 is a flowchart illustrating a method for icon processing according to another embodiment;
FIG. 6 is a block diagram showing the structure of an icon processing apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first icon aspect ratio may be referred to as a second icon aspect ratio, and similarly, a second icon aspect ratio may be referred to as a first icon aspect ratio, without departing from the scope of the present application. The first icon aspect ratio and the second icon aspect ratio are both icon aspect ratios, but they are not the same icon aspect ratio.
The icon processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers. After receiving the prompt information including the prompt icon, the icon identifier and the icon size parameter sent by the server 104, the terminal 102 may detect whether a matching prompt icon exists in the local database according to the icon identifier. When the prompt icon matched with the icon identifier does not exist in the local database of the terminal 102, the terminal 102 may determine whether the icon size parameter in the received prompt message is consistent with the preset size parameter. If the size of the prompt icon is not consistent with the preset size parameter, the terminal 102 performs scaling processing on the received prompt icon to obtain and store the prompt icon corresponding to the preset size parameter. The terminal 102 may further generate a user interface including the scaled prompt icon according to the scaled prompt icon.
In one embodiment, as shown in fig. 2, an icon processing method is provided, which is described by taking the method as an example applied to the server 104 in fig. 1, and includes the following steps:
step 202, receiving prompt information sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter corresponding to the prompt information.
The prompt information is information which is sent by the server and used for warning the user or prompting the user to perform corresponding operation. The prompt information comprises error reporting information, processing result information, risk early warning information and the like. The prompt icon is computer graphics which correspond to the prompt information and have definite meaning. The image format of the hint icon includes, but is not limited to, formats such as png (Portable Network Graphics), bmp (Bitmap), or jpeg (Joint Photographic Experts Group). The icon identifier is an identifier for distinguishing each prompt icon from other prompt icons, and the icon identifier may be a globally unique identifier. The icon identification may be the icon name of the touched control, the icon number, or a URL (Uniform Resource Locator) of the prompt icon. The icon identification may be a character string including at least one of a number, a letter, and a symbol. The icon size parameter refers to a number representing the icon length and width value in a specific unit. For example, the icon size parameter may be 114 × 114 in units of pixels.
In an embodiment, before receiving the prompt message sent by the server, the method further includes sending a page access request to the server, where the operation request is used to instruct the server to search for a page resource corresponding to the corresponding target page. When the server detects anomalous data, the anomalous data can be parsed and an anomalous log can be generated. The server can also search prompt information corresponding to the abnormal log through a preset mapping table according to the abnormal log. The abnormal data refers to data corresponding to the abnormality in the process that the server searches the page resources corresponding to the corresponding target page. The exception may be that the target page corresponding to the page access request sent by the terminal cannot be accessed, and the prompt information may be used to prompt the user that the target page cannot be accessed. The exception may also be that the authentication information carried in the page access request sent by the terminal is not verified, and the prompt information may be used to prompt the user to re-input the authentication information. The abnormality can also be that the server detects that the page access request sent by the terminal carries risk information, and the prompt information can be used for prompting the user that the risk exists in the access.
And 204, detecting whether a prompt icon matched with the icon identifier exists in the local database.
When the terminal does not receive the prompt message for the first time, repeated icon processing steps can be avoided by detecting whether a prompt icon matched with the icon identifier exists in a preset storage position, such as a local database of the terminal. When the prompt icon exists, the prompt icon matched with the icon identifier in the preset storage position can be directly loaded into the current user interface.
In one embodiment, before detecting whether a prompt icon matching the icon identification exists in the local database, the method further comprises: and loading a preset placeholder icon. Because a time interval exists between the receiving of the prompt information sent by the server and the successful loading of the prompt icon, the problems that the prompt icon cannot be displayed and the layout of a User Interface (UI) is disordered may be caused. Therefore, the preset placeholder icon can be loaded before the successful prompt icon is loaded, and the loaded successful icon is loaded with the preset placeholder icon after the successful prompt icon is loaded. The rearrangement and redrawing of the user interface caused by too slow loading of the prompt icon are avoided by loading the preset placeholder icon. The placeholder icon may be a transparent picture.
And step 206, if not, judging whether the icon size parameter is consistent with the preset size parameter.
The preset size parameter refers to a number which represents the length and width value of the icon by a specific unit, and the preset size parameter refers to an actual size parameter which prompts the icon to be displayed on the terminal. The preset size parameter refers to a size parameter calculated according to the terminal information. The terminal information includes, but is not limited to, a terminal model, a screen size parameter, a screen resolution, and the like. When consistent, the received prompt icon may be loaded directly into the current user interface.
In one embodiment, before determining whether the icon size parameter is consistent with the preset size parameter, the method further includes: and acquiring a preset size parameter corresponding to the icon identification. For example, a preset size parameter of a current UIImageView (a view class in the UIKit frame for displaying a picture) corresponding to the icon identifier is obtained.
In one embodiment, before determining whether the icon size parameter is consistent with the preset size parameter, the method further includes: acquiring a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface; determining a size parameter interval to which the display width parameter belongs; and determining corresponding preset size parameters according to the determined size parameter interval.
A plurality of preset size parameters may be preset. The display width parameter corresponding to the terminal screen or the display window can be detected, and the preset size parameter of the prompt icon is determined according to the size parameter interval to which the display width parameter belongs. When a plurality of prompt icons are included, corresponding adjustment can be performed on the corresponding user interface layout of the prompt icon. For example, when there are 6 prompt icons, as shown in fig. 3A, if the display width parameter is greater than 1300 pixels, the 6 prompt icons may be displayed as a row, and the first preset size parameter of the prompt icon may be 114 × 114; as shown in fig. 3B, if the display width parameter is between 600 pixels and 1300 pixels, 3 hint icons may be displayed as a row, and the second preset size parameter of the hint icons may be 70 × 70; if the display width parameter is below 400 pixels, 2 prompt icons may be displayed as a row, and a third preset size parameter of the prompt icons may be 55 × 55. The preset size parameter of the prompt icon is adjusted according to the display width parameter, so that the prompt icon is more readable.
And 208, when the icon size parameter is not consistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter.
When the icon size parameter is not consistent with the preset size parameter, it is indicated that the received prompt icon is directly loaded to the current user interface, and the problem of disorder of the user interface layout occurs. Therefore, the prompt icon needs to be scaled to obtain the prompt icon corresponding to the preset size parameter. The scaling process includes, but is not limited to, a blank process, a cropping process, and a stretching process. FIG. 4A is a diagram illustrating an original hint icon before a zoom process. Fig. 4B is a schematic diagram of the prompt icon after the blank processing, which is a processing for performing color filling on a part that is not matched without changing the icon size parameter of the prompt icon itself. Fig. 4C is a schematic diagram of the clipped prompt icon, which is obtained by performing scaling up or scaling down on the prompt icon until the length or width of the prompt icon matches the length or width corresponding to the preset size parameter, and filling the unmatched portion. Fig. 4D is a schematic diagram of the prompt icon after the stretching process, which is a process of enlarging or reducing the prompt icon until the length and width of the prompt icon match the length and width corresponding to the preset size parameter. The scaled prompt icon may be stored in a local database of the terminal.
In one embodiment, scaling the hint icon may be accomplished by calling a graphics context (GC, a platform for drawing).
Step 210, generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises a prompt icon after zooming processing.
The user interface is the medium between the terminal and the user for interaction and information exchange. The user interface may be a user interface of an application. An operating system runs on the terminal, and an application program runs on the operating system. An Operating System (OS) is a computer program for managing and controlling hardware and software resources of a terminal, and is the most basic System software directly running on the terminal, and an application program needs to run under the support of the Operating System. The application program may be, but is not limited to, a social application program, a mail application program, or an online shopping application program. After the terminal receives the prompt information sent by the server corresponding to the application program, the terminal can perform scaling processing on the prompt icon contained in the prompt information, generate the user interface of the application program from the scaled prompt icon, and display the user interface containing the scaled prompt icon through a display screen of the terminal.
In one embodiment, when the prompt icon is a dynamic icon, the method further comprises extracting dynamic attribute data carried by the dynamic icon; generating and displaying a user interface according to the zoomed prompt icon, wherein the user interface comprises: generating a user interface according to the zoomed dynamic icon; and playing the dynamic icon in the user interface according to the dynamic attribute data.
The dynamic attribute data is data for specifying dynamic playback of a dynamic icon. The dynamic attribute data includes, but is not limited to, the number of repetitions of the dynamic icon playing (which may be 0 to represent unlimited repetitions), the duration of one dynamic icon playing, and trigger conditions for starting and stopping the dynamic icon playing (for example, the dynamic icon playing may be continued, or may be played only when the terminal is displaying, or may be played when a cursor clicking operation is detected or when a mouse is hovering). For example, multiple images may be generated by UIImageView into a hint icon in GIF Format (Graphics Interchange Format). A plurality of images can be stored in one GIF format file, and animation can be formed by reading the plurality of images one by one and displaying the plurality of images on a terminal and playing the plurality of images in the GIF format file.
In the icon processing method, after receiving prompt information which is sent by a server and contains a prompt icon, an icon identifier and an icon size parameter, whether a processed prompt icon corresponding to the icon identifier exists locally or not is judged according to the icon size parameter. And if not, judging whether the icon size parameter is consistent with the preset size parameter or not. And only when the icon size parameter of the prompt icon is not consistent with the preset size parameter, zooming the prompt icon, and generating and displaying a user interface according to the zoomed prompt icon. By storing the zoomed prompt icon, the same prompt icon does not need to be zoomed again when the same prompt message is received next time. Therefore, the resources of the terminal are saved, unnecessary icon processing steps are avoided, the prompt icons meeting the preset size parameters can be displayed more timely, and the icon processing efficiency is improved.
In one embodiment, the determining whether the icon size parameter is consistent with the preset size parameter includes: calculating according to the icon size parameters to obtain a first icon length-width ratio, and calculating according to preset size parameters to obtain a second icon length-width ratio; judging whether the length-width ratio of the first icon is consistent with that of the second icon; when the icon size parameter is inconsistent with the preset size parameter, the prompt icon is zoomed to obtain and store the prompt icon corresponding to the preset size parameter, and the method comprises the following steps: and when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
The first icon aspect ratio refers to an aspect ratio of the received prompt icon, and the first icon aspect ratio can be calculated according to the icon size parameter. The length-width ratio of the second icon refers to an actual length-width ratio of the prompt icon which needs to be displayed on the terminal, and the length-width ratio of the second icon can be obtained through calculation according to preset size parameters. When the aspect ratio of the first icon is inconsistent with that of the second icon, it is indicated that the prompt icon corresponding to the preset size parameter cannot be obtained through simple scaling processing. Therefore, the prompt icon needs to be scaled according to the aspect ratio of the second icon. When the aspect ratio of the first icon is consistent with that of the second icon, the prompt icon can be subjected to equal scaling processing.
For example, as shown in fig. 4A, if the icon size parameter is 50 × 50, the first icon aspect ratio is calculated according to 50 × 50 as 1: 1. as shown in fig. 4B, 4C, and 4D, if the predetermined size parameter is 50 × 70, the aspect ratio of the second icon is 5 by calculation according to 50 × 70: 7. since the first icon aspect ratio 1: 1 and second icon aspect ratio 5: if the number of the prompt pictures is not consistent with the number of the prompt pictures 7, performing color filling processing on the parts which cannot be covered by the original prompt pictures through blank leaving processing; or the original prompt picture can be enlarged to 70 x 70 by clipping processing, and then the excess part is clipped; the original hint picture can also be stretched to 70 pixels long by the stretching process.
In one embodiment, after the scaling process is performed on the original prompt icon, the scaled prompt icon may be further marked by the processing type of the scaling process and/or the second icon aspect ratio. For example, the original prompt icon is named "icon _404. png", the preset size parameter after the scaling process is 100 × 200, and the processing type of the scaling process is the stretching process, so that the prompt icon after the scaling process can be renamed to "icon _404_100_200_ ls.png". When the prompt icon needs to be acquired next time, the prompt icon meeting the requirement of the preset size parameter and the requirement of the zooming processing type can be found directly according to the name of the prompt icon.
In one embodiment, the scaling the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter includes: acquiring terminal information; adjusting preset size parameters; and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter. The terminal information includes, but is not limited to, a terminal model, a screen size parameter, a screen resolution, and the like.
Corresponding preset size parameters may be preset for each terminal model. For example, when the terminal model is iPhone8, the preset size parameter is 114 × 114. The screen size parameter may be used as the display width parameter, and the screen size parameter may be multiplied by a corresponding ratio, for example, 50% as the display width parameter. When the number of pixels corresponding to the preset size parameter is not changed, if the resolution is increased, the display effect is reduced; if the resolution is reduced, the display effect increases. Therefore, the preset size parameters can be adjusted according to the screen resolution.
In one embodiment, detecting whether a prompt icon matching the icon identification exists in the local database comprises: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; and marking the prompt icon through the first character string.
The icon identification can be converted according to a preset encryption algorithm to obtain a first character string with a fixed length. The preset encryption Algorithm includes, but is not limited to, an MD5 Algorithm (Message Digest Algorithm, the fifth version of the chinese name Message Digest Algorithm) or an SHA Algorithm (Secure Hash Algorithm), etc. And marking the first character string obtained by converting the prompt icon. When the prompt icon needs to be acquired next time, the prompt icon meeting the requirement of the preset size parameter can be searched directly according to the first character string obtained by converting the icon identifier. The corresponding prompt icon is searched through the first character string, and the efficiency of searching the prompt icon can be improved.
In one embodiment, generating and displaying the user interface according to the scaled prompt icon includes: determining the information type of the prompt message according to the icon identification; when the message type is a preset message type, searching a view layer where a user interface corresponding to the prompt message is located; drawing a floating window on a top view layer relative to the view layer according to the information type; and displaying the scaled prompt icon in the floating window.
The prompt message may have a variety of message types, such as an error report type, a processing result type, and a risk pre-warning type. And drawing a floating window on a top view layer corresponding to the view layer where the user interface is located according to one or more information types, such as a risk early warning type, and displaying the scaled prompt icon in the floating window. Wherein, the view layer is a layer for drawing a user interface. A floating window refers to a window that can be customized for display position and display size. The viewing layer where the suspension window is located is a top viewing layer. The floating window can be a square, a circle, an irregular shape, and the like. The display size of the floating window can be uniformly customized by the server.
In one embodiment, the prompt icons can be classified and stored according to the information type of the prompt information. And the prompt icons can be classified according to specific prompt information in a detailed mode. For example, the error type prompt information may be classified into a functional error and a performance problem, the functional error may be classified into a characteristic and a non-characteristic, the characteristic may be classified into a syntactic characteristic and a behavioral characteristic (e.g., crash exception), and the performance problem may be classified into a temporal performance and a spatial performance (e.g., hard disk and memory problem). The hint icons corresponding to each level of information type may have the same attributes. For example, the prompt icon corresponding to the functional error may have a red color background, and the prompt icon corresponding to the performance issue may have a blue color background. The hint icons corresponding to featured functional errors may have a straight line texture. The prompt icon corresponding to the featureless functional error may have a wave texture. The prompt type of the prompt message can be quickly determined through the icon.
In one embodiment, another icon processing method is provided, including the steps of:
step 502, receiving prompt information sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter corresponding to the prompt information.
Step 504, detecting whether a prompt icon matched with the icon identification exists in the local database.
If not, go to step 506; if yes, go to step 512.
Step 506, calculating according to the icon size parameter to obtain a first icon aspect ratio, and calculating according to the preset size parameter to obtain a second icon aspect ratio.
Step 508, determine whether the aspect ratio of the first icon is consistent with the aspect ratio of the second icon.
If not, go to step 510; if yes, go to step 512.
And 510, when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
And step 512, determining the information type of the prompt message according to the icon identification.
And 514, when the message type is the preset message type, searching a view layer where the user interface corresponding to the prompt message is located.
And 516, drawing a floating window on the top view layer relative to the view layer according to the information type.
And step 518, displaying the scaled prompt icon in the floating window.
In the icon processing method, after receiving prompt information which is sent by a server and contains a prompt icon, an icon identifier and an icon size parameter, whether a processed prompt icon corresponding to the icon identifier exists locally or not is judged according to the icon size parameter. And if not, judging whether the length-width ratio of the first icon corresponding to the icon size parameter is consistent with the length-width ratio of the second icon corresponding to the preset size parameter. And when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter. And displaying the zoomed prompt icon on a user interface in a floating window mode aiming at the prompt information of the preset message type. By storing the zoomed prompt icon, the same prompt icon does not need to be zoomed again when the same prompt message is received next time. Therefore, the resources of the terminal are saved, unnecessary icon processing steps are avoided, the prompt icons meeting the preset size parameters can be displayed more timely, and the icon processing efficiency is improved.
It should be understood that although the various steps in the flowcharts of fig. 2 and 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided an icon processing apparatus 600 including: a receiving module 602, configured to receive a prompt message sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; a detecting module 604, configured to detect whether a prompt icon matching the icon identifier exists in the local database; a judging module 606, configured to determine whether the icon size parameter is consistent with the preset size parameter if the icon size parameter is not consistent with the preset size parameter; the processing module 608 is configured to, when the icon size parameter is inconsistent with the preset size parameter, perform scaling processing on the prompt icon to obtain and store a prompt icon corresponding to the preset size parameter; a generating module 610, configured to generate and display a user interface according to the scaled prompt icon; the user interface comprises a prompt icon after zooming processing.
In one embodiment, the determining module 606 is further configured to calculate to obtain a first icon aspect ratio according to the icon size parameter, and calculate to obtain a second icon aspect ratio according to the preset size parameter; judging whether the length-width ratio of the first icon is consistent with that of the second icon; the processing module 608 is further configured to, when the aspect ratio of the first icon is inconsistent with the aspect ratio of the second icon, perform scaling processing on the prompt icon according to the aspect ratio of the second icon, to obtain and store the prompt icon corresponding to the preset size parameter.
In one embodiment, the processing module 608 is further configured to obtain terminal information; adjusting preset size parameters; and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter.
In one embodiment, the detection module 604 is further configured to convert the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; and marking the prompt icon through the first character string.
In one embodiment, the processing module 608 is further configured to obtain a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface; determining a size parameter interval to which the display width parameter belongs; and determining corresponding preset size parameters according to the determined size parameter interval.
In one embodiment, the reminder icon includes a dynamic icon; the generating module 610 is further configured to extract dynamic attribute data carried by the dynamic icon; generating a user interface according to the zoomed dynamic icon; and playing the dynamic icon in the user interface according to the dynamic attribute data.
In one embodiment, the generating module 610 is further configured to determine an information type of the prompt message according to the icon identifier; when the message type is a preset message type, searching a view layer where a user interface corresponding to the prompt message is located; drawing a floating window on a top view layer relative to the view layer according to the information type; and displaying the scaled prompt icon in the floating window.
For the specific definition of the icon processing device, reference may be made to the above definition of the icon processing method, which is not described herein again. The respective modules in the icon processing apparatus can be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an icon processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program: receiving prompt information sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; detecting whether a prompt icon matched with the icon identifier exists in a local database; if not, judging whether the icon size parameter is consistent with the preset size parameter or not; when the icon size parameter is inconsistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter; generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises a prompt icon after zooming processing.
In one embodiment, the step of determining whether the icon size parameter is consistent with the preset size parameter when the processor executes the computer program includes the following steps: calculating according to the icon size parameters to obtain a first icon length-width ratio, and calculating according to preset size parameters to obtain a second icon length-width ratio; judging whether the length-width ratio of the first icon is consistent with that of the second icon; the method for zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter when the size parameter of the icon is inconsistent with the preset size parameter comprises the following steps: and when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
In one embodiment, the step of performing scaling processing on the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter when the processor executes the computer program includes the following steps: acquiring terminal information; adjusting preset size parameters; and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter.
In one embodiment, the step of detecting whether a prompt icon matching the icon identification exists in the local database when the processor executes the computer program includes the steps of: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; and marking the prompt icon through the first character string.
In one embodiment, before the step of determining whether the icon size parameter is consistent with the preset size parameter when the processor executes the computer program, the method further includes the following steps: acquiring a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface; determining a size parameter interval to which the display width parameter belongs; and determining corresponding preset size parameters according to the determined size parameter interval.
In one embodiment, the reminder icon includes a dynamic icon; when the processor executes the computer program, the method further comprises the following steps: extracting dynamic attribute data carried by the dynamic icon; the step of generating and displaying the user interface according to the scaled prompt icon includes the steps of: generating a user interface according to the zoomed dynamic icon; and playing the dynamic icon in the user interface according to the dynamic attribute data.
In one embodiment, the step of generating and displaying the user interface according to the scaled prompt icon when the processor executes the computer program includes the following steps: determining the information type of the prompt message according to the icon identification; when the message type is a preset message type, searching a view layer where a user interface corresponding to the prompt message is located; drawing a floating window on a top view layer relative to the view layer according to the information type; and displaying the scaled prompt icon in the floating window.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving prompt information sent by a server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter which correspond to the prompt information; detecting whether a prompt icon matched with the icon identifier exists in a local database; if not, judging whether the icon size parameter is consistent with the preset size parameter or not; when the icon size parameter is inconsistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter; generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises a prompt icon after zooming processing.
In one embodiment, the step of determining whether the icon size parameter is consistent with the preset size parameter when the computer program is executed by the processor comprises the following steps: calculating according to the icon size parameters to obtain a first icon length-width ratio, and calculating according to preset size parameters to obtain a second icon length-width ratio; judging whether the length-width ratio of the first icon is consistent with that of the second icon; the method for zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter when the size parameter of the icon is inconsistent with the preset size parameter comprises the following steps: and when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
In one embodiment, the step of scaling the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter when the computer program is executed by the processor includes the following steps: acquiring terminal information; adjusting preset size parameters; and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter.
In one embodiment, the step of detecting whether a reminder icon matching the icon identification is present in the local database, as implemented when the computer program is executed by the processor, comprises the steps of: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; and marking the prompt icon through the first character string.
In one embodiment, the computer program, when executed by the processor, further performs the following steps before the step of determining whether the icon size parameter is consistent with the preset size parameter: acquiring a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface; determining a size parameter interval to which the display width parameter belongs; and determining corresponding preset size parameters according to the determined size parameter interval.
In one embodiment, the reminder icon includes a dynamic icon; the computer program, when executed by the processor, further comprises implementing the steps of: extracting dynamic attribute data carried by the dynamic icon; the step of generating and displaying the user interface according to the scaled prompt icon includes the steps of: generating a user interface according to the zoomed dynamic icon; and playing the dynamic icon in the user interface according to the dynamic attribute data.
In one embodiment, the step of generating and displaying a user interface based on the scaled prompt icon, when executed by the processor, includes the steps of: determining the information type of the prompt message according to the icon identification; when the message type is a preset message type, searching a view layer where a user interface corresponding to the prompt message is located; drawing a floating window on a top view layer relative to the view layer according to the information type; and displaying the scaled prompt icon in the floating window.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of icon processing, the method comprising:
sending a page access request to a server;
receiving prompt information sent by the server, wherein the prompt information comprises a prompt icon, an icon identifier and an icon size parameter corresponding to the prompt information, and the prompt information is generated when abnormal data is detected when a server searches for a page resource corresponding to a target page of the corresponding page access request;
detecting whether a prompt icon matched with the icon identifier exists in a local database, wherein the detecting comprises the following steps: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; marking the prompt icon through the first character string;
if yes, loading a prompt icon matched with the icon identification in the local database into a user interface;
if not, judging whether the icon size parameter is consistent with a preset size parameter or not;
when the icon size parameter is not consistent with the preset size parameter, zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter;
and generating and displaying a user interface according to the zoomed prompt icon, wherein the user interface comprises the zoomed prompt icon.
2. The method of claim 1, wherein the determining whether the icon size parameter is consistent with a preset size parameter comprises:
calculating according to the icon size parameter to obtain a first icon length-width ratio, and calculating according to the preset size parameter to obtain a second icon length-width ratio;
judging whether the length-width ratio of the first icon is consistent with that of the second icon;
when the icon size parameter is inconsistent with the preset size parameter, the method for zooming the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter includes:
and when the length-width ratio of the first icon is not consistent with that of the second icon, zooming the prompt icon according to the length-width ratio of the second icon to obtain and store the prompt icon corresponding to the preset size parameter.
3. The method according to claim 1, wherein the scaling the prompt icon to obtain and store the prompt icon corresponding to the preset size parameter includes:
acquiring terminal information;
adjusting the preset size parameter according to the terminal information;
and zooming the prompt icon according to the adjusted preset size parameter to obtain and store the prompt icon corresponding to the adjusted preset size parameter.
4. The method according to any one of claims 1 to 3, wherein before determining whether the icon size parameter is consistent with a preset size parameter, the method further comprises:
acquiring a display width parameter; the display width parameter is a size parameter of a window corresponding to the user interface;
determining a size parameter interval to which the display width parameter belongs;
and determining corresponding preset size parameters according to the determined size parameter interval.
5. The method of any of claims 1-3, wherein the prompt icon comprises a dynamic icon; the method further comprises the following steps:
extracting dynamic attribute data carried by the dynamic icon;
the generating and displaying a user interface according to the zoomed prompt icon comprises:
generating a user interface according to the zoomed dynamic icon;
and playing the dynamic icon in the user interface according to the dynamic attribute data.
6. The method according to any one of claims 1 to 3, wherein the generating and displaying the user interface according to the scaled prompt icon comprises:
determining the information type of the prompt message according to the icon identification;
when the information type is a preset information type, searching a view layer where a user interface corresponding to the prompt information is located;
drawing a floating window on a top view layer relative to the view layer according to the information type;
and displaying the scaled prompt icon in the floating window.
7. An icon processing apparatus, characterized in that the apparatus comprises:
the page access request sending module is used for sending a page access request to the server;
the receiving module is used for receiving the prompt message sent by the server; the prompt information comprises a prompt icon, an icon identifier and an icon size parameter corresponding to the prompt information, and the prompt information is generated when abnormal data is detected when a server searches for a page resource corresponding to a target page of the corresponding page access request;
the detection module is used for detecting whether a prompt icon matched with the icon identifier exists in a local database, and comprises the following steps: converting the icon identification into a first character string; detecting whether a prompt icon matched with the icon identifier exists in a local database or not according to the first character string; marking the prompt icon through the first character string; if yes, loading a prompt icon matched with the icon identification in the local database into a user interface;
the judging module is used for judging whether the icon size parameter is consistent with a preset size parameter if the icon size parameter is not consistent with the preset size parameter;
the processing module is used for zooming the prompt icon when the icon size parameter is inconsistent with a preset size parameter to obtain and store the prompt icon corresponding to the preset size parameter;
the generating module is used for generating and displaying a user interface according to the zoomed prompt icon; the user interface comprises the prompt icon after the zooming processing.
8. The device of claim 7, wherein the determining module is further configured to calculate a first icon aspect ratio according to the icon size parameter, and calculate a second icon aspect ratio according to the preset size parameter; judging whether the length-width ratio of the first icon is consistent with that of the second icon;
and the processing module is further used for carrying out scaling processing on the prompt icon according to the length-width ratio of the second icon when the length-width ratio of the first icon is inconsistent with that of the second icon, so as to obtain and store the prompt icon corresponding to the preset size parameter.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN201810176121.XA 2018-03-02 2018-03-02 Icon processing method and device, computer equipment and storage medium Active CN108388463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810176121.XA CN108388463B (en) 2018-03-02 2018-03-02 Icon processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810176121.XA CN108388463B (en) 2018-03-02 2018-03-02 Icon processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108388463A CN108388463A (en) 2018-08-10
CN108388463B true CN108388463B (en) 2021-02-02

Family

ID=63070268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810176121.XA Active CN108388463B (en) 2018-03-02 2018-03-02 Icon processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108388463B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110996094A (en) * 2019-11-01 2020-04-10 北京奇艺世纪科技有限公司 Method and device for detecting video jamming, computer equipment and storage medium
CN114089898A (en) * 2021-11-23 2022-02-25 国汽智控(北京)科技有限公司 Vehicle information display method, device, equipment, storage medium and program product

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019506B (en) * 2012-11-16 2016-03-30 小米科技有限责任公司 A kind of download instruction of icon and method for down loading, Apparatus and system
CN103927143B (en) * 2014-04-04 2017-04-19 福建星网视易信息系统有限公司 Method and device for adaptively adjusting interface layout on basis of screen resolution
CN106844302B (en) * 2017-03-30 2020-07-28 掌阅科技股份有限公司 Electronic book page display method and device and terminal equipment
CN107678614A (en) * 2017-09-05 2018-02-09 努比亚技术有限公司 A kind of method, equipment and computer-readable recording medium for realizing information alert

Also Published As

Publication number Publication date
CN108388463A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
CN110245469B (en) Webpage watermark generation method, watermark analysis method, device and storage medium
US10878024B2 (en) Dynamic thumbnails
WO2016018683A1 (en) Image based search to identify objects in documents
CN110177039B (en) Message sharing method and device, computer equipment and storage medium
US11321524B1 (en) Systems and methods for testing content developed for access via a network
CN105678127A (en) Verification method and device for identity information
CN108388463B (en) Icon processing method and device, computer equipment and storage medium
CN111223155B (en) Image data processing method, device, computer equipment and storage medium
WO2016018682A1 (en) Processing image to identify object for insertion into document
CN111444448B (en) Data processing method, server and system
US11809806B2 (en) Glyph accessibility system
CN112528189B (en) Data-based component packaging method and device, computer equipment and storage medium
CN111797192B (en) GIS point data rendering method and device, computer equipment and storage medium
CN114428899A (en) Multimedia resource pushing method and device, electronic equipment and storage medium
CN113254984A (en) Webpage monitoring method and device, storage medium and equipment
CN113655973A (en) Page segmentation method and device, electronic equipment and storage medium
CN113094624A (en) Page generation method and device and electronic equipment
CN112748839A (en) Picture processing method and device, computer readable storage medium and computer equipment
CN110489252B (en) Picture processing method and device, computer readable storage medium and computer equipment
CN111046241B (en) Graph storage method and device for flow graph processing
CN116719854A (en) Data comparison method, device, computer equipment and storage medium
CN116846974A (en) Service request processing method, device, computer equipment and storage medium
CN114943045A (en) Terminal webpage loading method and device based on offline cache and computer equipment
CN117193924A (en) Page display method and device and computer equipment
CN112631572A (en) Code display method, device, equipment and storage medium based on mobile terminal

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