Icon processing method and device, electronic equipment and storage medium

By acquiring and determining the style of scalable vector icons, generating configuration information, and converting it into React components, the problems of high performance consumption and large size in icon processing are solved, achieving more efficient icon processing.

CN114527978BActive Publication Date: 2026-01-02BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210148505.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2026-01-02
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

Existing technologies cannot be compatible with both planar and linear icon styles, resulting in high performance consumption during icon processing and large device size for icon processing.

Method used

By obtaining the target icon in scalable vector graphics format, determining its icon style, generating configuration information based on the style, converting the target icon into a target component, replacing variables with placeholders, and encapsulating it with a template, a usable React component is generated.

Benefits of technology

It effectively reduces the size of scalable vector graphic icons packaged into components, improves running efficiency, and reduces the performance consumption of icon processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114527978B_ABST
    Figure CN114527978B_ABST
Patent Text Reader

Abstract

The present disclosure provides an icon processing method and device, electronic equipment and storage medium, relates to the field of computers, and particularly relates to the fields of cloud services and image technology. The specific implementation scheme is as follows: a target icon to be processed is acquired, wherein the format of the target icon is a scalable vector graphics format; an icon style of the target icon is determined; configuration information is generated based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style; and the target icon is converted into a target component based on the configuration information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computers, and particularly relates to a cloud service, an icon processing method and device, an electronic device and a storage medium in the technical field of images. BACKGROUND

[0002] At present, when a scalable vector graphics (SVG) generation state component (a react component) is implemented, only a fixed style can be used, and the two icon styles of surface and linearity cannot be compatible. SUMMARY

[0003] The present disclosure provides an icon processing method, device, electronic device and storage medium.

[0004] According to an aspect of the present disclosure, an icon processing method is provided. The method can include: obtaining a target icon to be processed, wherein a format of the target icon is a scalable vector graphics format; determining an icon style of the target icon; generating configuration information based on the icon style, wherein the configuration information is used to represent attributes of the target icon under the icon style; and converting the target icon into a target component based on the configuration information.

[0005] According to an aspect of the present disclosure, an icon processing device is provided. The device can include: an obtaining unit configured to obtain a target icon to be processed, wherein a format of the target icon is a scalable vector graphics format; a determining unit configured to determine an icon style of the target icon; a generating unit configured to generate configuration information based on the icon style, wherein the configuration information is used to represent attributes of the target icon under the icon style; and a converting unit configured to convert the target icon into a target component based on the configuration information.

[0006] According to an aspect of the present disclosure, an electronic device is provided. The electronic device can include: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the icon processing method of the embodiments of the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium having computer instructions is also provided, wherein the computer instructions are used to enable a computer to perform the icon processing method of the embodiments of the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product can include a computer program, and the computer program, when executed by a processor, implements the icon processing method of the embodiments of the present disclosure.

[0009] It should be understood that the contents described in this part are not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0010] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0011] Figure 1 is a flowchart of an icon processing method according to an embodiment of the present disclosure;

[0012] Figure 2 is a flowchart of a method for generating configuration information of a target icon based on configuration information according to an embodiment of the present disclosure;

[0013] Figure 3 is a flowchart of a method for converting a target icon into a target component based on configuration information according to an embodiment of the present disclosure;

[0014] Figure 4 is a flowchart of a method for converting a target icon into a target string based on configuration information according to an embodiment of the present disclosure;

[0015] Figure 5 is a flowchart of a method for replacing a variable with a placeholder according to an embodiment of the present disclosure;

[0016] Figure 6 is a flowchart of a method for generating a target string based on a placeholder according to an embodiment of the present disclosure;

[0017] Figure 7 is a flowchart of a method for generating a target component from a target string according to an embodiment of the present disclosure;

[0018] Figure 8 is a schematic diagram of an icon processing device according to an embodiment of the present disclosure;

[0019] Figure 9 is a block diagram of an electronic device for an icon processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered as merely exemplary. Thus, those of ordinary skill in the art should recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of known functions and constructions are omitted in the following description for clarity and conciseness.

[0021] Figure 1is a flowchart of an icon processing method according to an embodiment of the present disclosure, as shown in the figure, the method can include the following steps: Figure 1

[0022] In the technical solution provided by the above step S102 of the present disclosure, the target icon to be processed is obtained, and the format of the target icon is scalable vector graphics (svg).

[0023] In the technical solution provided by the above step S102 of the present disclosure, the target icon to be processed is obtained, and the format of the target icon is scalable vector graphics (svg).

[0024] Step S104, determine the icon style of the target icon.

[0025] In the technical solution provided by the above step S104 of the present disclosure, the icon style of the obtained target icon to be processed is determined, and the icon style can include color, size, icon surface, or linearity, etc.

[0026] Optionally, the target icon to be processed is obtained, and the target icon to be processed is processed to separate the linearity and the surface.

[0027] Step S106, generate configuration information based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style.

[0028] In the technical solution provided by the above step S106 of the present disclosure, the target icon to be processed is processed to separate the linearity and the surface, and the configuration information is generated based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style, which can include but is not limited to whether to fill, whether to stroke, whether to reverse color, whether to hide, etc.

[0029] Optionally, the embodiment determines the corresponding configuration information based on the icon style, such as whether to fill, whether to stroke, whether to reverse color, whether to hide, etc.

[0030] Step S108, convert the target icon into a target component based on the configuration information.

[0031] In the technical solution provided by the above step S108 of the present disclosure, the configuration information of the target icon is determined, and the target icon is converted into a target component based on the configuration information, wherein the target component can be a usable react component.

[0032] Optionally, the corresponding configuration information is completed, the configuration information is filled with a placeholder, the placeholder is replaced, the target icon is converted into a target component, a layer of template is used to encapsulate the compilation result, and a usable react component is obtained.

[0033] ​Through the steps S102 to S108, the target icon to be processed is obtained, wherein the format of the target icon is a scalable vector graphics format; the icon style of the target icon is determined; the configuration information is generated based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style; and the target icon is converted into the target component based on the configuration information. That is, by distinguishing the icon style (such as linearity and faciality) of the target icon at runtime, generating the configuration information based on the icon style, and then converting the scalable vector graphics icon into the usable react component based on the configuration information, the volume of the scalable vector graphics packed into the component is effectively reduced, the running efficiency is effectively improved, the technical problem of high performance consumption during icon processing is solved, and the technical effect of reducing the performance consumption during icon processing is achieved.

[0034] The above method of the embodiment will be further described in detail below.

[0035] As an optional embodiment, in step S106, the configuration information is generated based on the icon style, including: obtaining the icon content of the target icon; and determining the configuration information corresponding to the icon style based on the icon content.

[0036] Figure 2 is a flowchart of a method for generating configuration information based on a target icon according to an embodiment of the present disclosure, as shown in Figure 2 The method can include the following steps:

[0037] In step S202, the icon content of the target icon is obtained.

[0038] In the technical solution provided by the above step S202 of the present disclosure, the icon content of the target icon is obtained, wherein the target icon can be an svg icon, and the scalable vector graphics icon; and the icon content can be the content in a lightweight data exchange format (javescript object notation, abbreviated as json).

[0039] Optionally, the target icon is obtained, and the target icon is parsed into the content in the lightweight data exchange format.

[0040] In step S204, the configuration information corresponding to the icon style is determined based on the icon content.

[0041] In the technical solution provided by the above step S204 of the present disclosure, the icon content of the target icon is obtained, and the configuration information corresponding to the icon style is determined based on the icon content.

[0042] Optionally, the target icon is parsed into content in a lightweight data exchange format, and corresponding configuration information of different icon styles is separated, such as configuration information corresponding to each path in linear and surface, such as whether to fill, whether to stroke, whether to reverse color, and whether to hide in surface and linear.

[0043] As an optional embodiment, in step S108, the target icon is converted into the target component based on the configuration information, including: converting the target icon into a target string based on the configuration information, where the format of the target string is a scalable vector graphics format; and generating the target string into the target component.

[0044] Figure 3 is a flowchart of a method for converting a target icon into a target component based on configuration information according to an embodiment of the present disclosure, as shown in Figure 3 The method can include the following steps:

[0045] In step S302, the target icon is converted into a target string based on the configuration information, where the format of the target string is a scalable vector graphics format.

[0046] In the technical solution provided in the above step S302 of the present disclosure, the icon content of the target icon is obtained, the configuration information corresponding to the icon style is determined based on the icon content, and the target icon is converted into a target string based on the configuration information, where the format of the target string is a scalable vector graphics format, which can be an svg string.

[0047] Optionally, the target icon is parsed into content in a lightweight data exchange format, and corresponding configuration information of different icon styles is separated, based on the configuration information, the target icon is re-converted into a target string.

[0048] In step S304, the target string is generated into a target component.

[0049] In the technical solution provided in the above step S304 of the present disclosure, the target icon is converted into a target string based on the configuration information, and the target string obtained by the conversion is packaged to generate a target component.

[0050] Optionally, the configuration information corresponding to the icon style is determined based on the icon content, the target icon is converted into a target string based on the obtained configuration information, and the processed target string is packaged to obtain a target component.

[0051] As an optional embodiment, in step S302, the target icon is converted into a target string based on the configuration information, including: replacing a variable corresponding to the configuration information of the target icon with a placeholder; and generating the target string based on the placeholder.

[0052] Figure 4 is a flowchart of a method for converting a target icon into a target string based on configuration information according to an embodiment of the present disclosure, as shown in Figure 4 The method can include the following steps:

[0053] In the technical solution provided by the above step S402 of the present disclosure, the variable corresponding to the configuration information of the target icon is filled into the corresponding position in the form of a placeholder, so as to realize the replacement of the variable corresponding to the configuration information of the target icon with the placeholder.

[0054] In the technical solution provided by the above step S402 of the present disclosure, the variable corresponding to the configuration information of the target icon is filled into the corresponding position in the form of a placeholder, so as to realize the replacement of the variable corresponding to the configuration information of the target icon with the placeholder.

[0055] In the technical solution provided by the above step S404 of the present disclosure, the variable corresponding to the configuration information of the target icon is replaced with the placeholder, and the target string is generated based on the placeholder.

[0056] In the technical solution provided by the above step S404 of the present disclosure, the variable corresponding to the configuration information of the target icon is replaced with the placeholder, and the target string is generated based on the placeholder.

[0057] Optionally, the variable corresponding to the configuration information of the target icon is filled into the corresponding position in the form of a placeholder, for example, the attribute represented by the configuration information is filled with a placeholder, the placeholder is replaced with the form of a react parameter, and a layer of template is used to encapsulate the compilation result to obtain a usable target string (react component).

[0058] As an optional embodiment, in step S402, the variable corresponding to the configuration information of the target icon is replaced with the placeholder, including: generating an array variable based on the configuration information, wherein the array variable is used to represent the stroke attribute and the fill attribute of the target icon under the icon style; determining the target color under the icon style based on the array variable; and replacing the target color with the placeholder.

[0059] Figure 5 is a flowchart of a method for replacing a variable with a placeholder according to an embodiment of the present disclosure, as shown in Figure 5 The method can include the following steps:

[0060] In the technical solution provided by the above step S502 of the present disclosure, an array variable is generated based on the configuration information, wherein the array variable can be a two-dimensional array generated according to the icon style.

[0061] In the technical solution provided by the above step S502 of the present disclosure, an array variable is generated based on the configuration information, wherein the array variable can be a two-dimensional array generated according to the icon style.

[0062] Optionally, the color content can be different when the same position has different styles, so in the compiling process, the position of the icon corresponding color can be represented by writing a coordinate to indicate the position in the two-dimensional array.

[0063] In step S504, the target color in the icon style is determined based on the array variable.

[0064] In the technical solution provided in the above step S504 of the present disclosure, the position of the corresponding color can be determined according to the array variable to determine the target color in the icon style.

[0065] Optionally, when the configuration information is fill anti-color and stroke normal, that is, F(anti-color) L, the corresponding array variable can be [0, 1], and when the planar style is determined, the target color in the corresponding position is determined by comparing with the planar table; when the linear style is determined, the target color in the corresponding position is determined by comparing with the linear table.

[0066] In step S506, the target color is replaced with a placeholder.

[0067] In the technical solution provided in the above step S506 of the present disclosure, the target color is filled with a placeholder after compiling.

[0068] Optionally, the color content can be different when the same position has different styles.

[0069] Optionally, the target color is filled with a placeholder, so that the placeholder can be replaced with the form of the target component.

[0070] As an optional embodiment, the stroke attribute includes at least one of the following: a stroke normal attribute, a stroke anti-color attribute and a stroke hidden attribute; the fill attribute includes at least one of the following: a fill normal attribute, a fill anti-color attribute and a fill hidden attribute.

[0071] In this embodiment, the stroke attribute includes at least one of the following: a stroke normal attribute, a stroke anti-color attribute and a stroke hidden attribute, which can be represented by L, L(anti-color) represents the stroke anti-color attribute and L(hidden) represents the stroke hidden attribute; the fill attribute includes at least one of the following: a fill normal attribute, a fill anti-color attribute and a fill hidden attribute, which can be represented by F, F(anti-color) represents the stroke anti-color attribute and F(hidden) represents the stroke hidden attribute.

[0072] As an optional embodiment, in the case where the icon style is a planar style, different fill attributes correspond to different target colors; in the case where the icon style is a linear style, different stroke attributes correspond to different target colors.

[0073] In this embodiment, when the icon style is a facial style, different fill attributes correspond to different target colors. For example, when the icon style is a facial style, the color is determined by the fill attribute, and different target colors can be represented by different numbers.

[0074] Optionally, when the icon style is a linear style, different stroke attributes correspond to different target colors. For example, when the icon style is a linear style, the color is determined by the stroke attribute.

[0075] As an optional embodiment, in step S404, the target string is generated based on the placeholder, including: replacing the placeholder with a component parameter of a target component to be generated; and generating the component parameter into the target string.

[0076] Figure 6 is a flowchart of a method for generating a target string based on a placeholder according to an embodiment of the present disclosure, as shown in Figure 6 The method can include the following steps:

[0077] In step S602, the placeholder is replaced with a component parameter of a target component to be generated.

[0078] In the technical solution provided by the above step S602 of the present disclosure, the array variable is generated based on the configuration information, the target color under the icon style is determined based on the array variable, the target color is filled with the placeholder, and the filled placeholder is replaced with the form of the component parameter of the target component.

[0079] In step S604, the component parameter is generated into the target string.

[0080] In the technical solution provided by the above step S604 of the present disclosure, the target attribute is filled with the placeholder, the filled placeholder is replaced with the form of the component parameter of the target component, the component parameter is generated into the target string, and the target string is obtained.

[0081] As an optional embodiment, in step S304, the target string is generated into the target component, including: generating the target string into the target component based on a predetermined template.

[0082] Figure 7 is a flowchart of a method for generating a target string into a target component according to an embodiment of the present disclosure, as shown in Figure 7 The method can include the following steps:

[0083] In step S702, the target string is generated into the target component based on a predetermined template.

[0084] In the technical solution provided in the step S702 of the present disclosure, the target string of the target component is wrapped using a predetermined template to obtain a usable target component, wherein the predetermined template can be a template designed in advance according to the system.

[0085] In the embodiment of the present disclosure, a target icon to be processed is obtained, wherein the format of the target icon is a scalable vector graphics format; an icon style of the target icon is determined; configuration information is generated based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style; and the target icon is converted into a target component based on the configuration information. That is, the present disclosure distinguishes the icon style (such as linearity and faciality) of the target icon at runtime, generates configuration information based on the icon style, and then converts the scalable vector graphics icon into a usable react component based on the configuration information, which effectively reduces the volume of the scalable vector graphics packed into the component, effectively improves the running efficiency, and achieves the technical effect of reducing the performance consumption during icon processing, thereby solving the technical problem of high performance consumption during icon processing.

[0086] The above technical solutions of the embodiments of the present disclosure will be further described below in conjunction with preferred embodiments.

[0087] When a scalable vector image icon is generated into a state component, it is a process of converting a static scalable vector image icon into a state component that can dynamically pass in variables through parsing, reconstruction, and casing.

[0088] In the related art, after the scalable vector image is converted into a lightweight data exchange format, only the path information is taken, and after being wrapped with a component, the path information is circulated in the component to achieve the purpose of rendering the whole scalable vector image.

[0089] The above scheme uses a loop drawing method, which has the problem of being unable to support both faciality and linearity icon styles, and can only be fixed in one style. If simultaneous support is desired, two sets of content must be rendered, which will increase the volume after packaging, and the loop rendering operation needs to be implemented at runtime, so it will consume more performance.

[0090] To solve the above problems, the present disclosure takes into account faciality and linearity when packaging, uses one set of content and one set of variables, and only needs to distinguish between different styles (linearity and faciality) when running to produce different configurations. This greatly reduces the volume after packaging and can also minimize the performance consumption at runtime. Different styles such as color, size, icon faciality or linearity can be displayed according to different parameter content, which greatly improves the reuse rate of icons and the development efficiency.

[0091] The technical solutions of the embodiments of the present disclosure will be further described below.

[0092] The scalable vector image icon is parsed into the content of the lightweight data exchange format, and linear and facial icon information is separated, each path corresponding to different configuration information, such as whether to fill, whether to stroke, whether to reverse color, whether to hide, etc. After obtaining the above icon information, the icon is re-converted into a scalable vector image string, and in the conversion process, through recursive loops, each variable is filled into the corresponding position in the form of a placeholder. After the above compilation process is completed, the placeholder can be replaced with a state variable parameter form. Finally, by using a layer of template to wrap the sorted state variable parameter result, the processed scalable vector image string can be wrapped into a usable state component, and at runtime, only one two-dimensional array corresponding to the icon style needs to be generated.

[0093] Optionally, the present disclosure is special for color filling, because when the color involves different icon styles, such as linear and facial styles, the color content at the same position may need to be reversed (reversed color is a color that can be changed to white when superimposed with the original color) or hidden, and both linear and facial cases need to be considered, as shown in the following table:

[0094] Table 1 is a facial parameter setting table according to an embodiment of the present disclosure, wherein F represents the filling attribute, L represents the stroke attribute, #000 represents the color of the input icon, and #FFF represents the reverse color, wherein #000 represents black and #FFF represents white. It should be noted that #000 and #FFF are only used as examples and can be modified according to actual needs.

[0095] Table 1 is a facial parameter setting table according to an embodiment of the present disclosure

[0096] F F (invert) F (hide) L #000 #FFF none L (invert) #000 #FFF none L (hide) #000 #FFF none

[0097] Optionally, as in the facial parameter setting table, L represents normal display when stroking, that is, the color of the input icon, which is #000 here; L (reverse color) represents that the reverse color needs to be processed when stroking, and the color opposite to the input color (#000 black) (#FFF white) is used to ensure that the icon is normally displayed, and L (hidden) represents that this part needs to be hidden when stroking.

[0098] In the table, F represents normal display when filling, that is, the color of the input icon, which is #000 here; F (reverse color) represents that the reverse color needs to be processed when filling, and the color opposite to the input color (#000 black) (#FFF white) is used to ensure that the icon is normally displayed, and F (hidden) represents that this part needs to be hidden when filling.

[0099] Optionally, when the face is, the color depends on the fill attribute, when the normal fill (F) is, the color is the normal incoming; When the reverse color is used, the opposite color (customizable, white is used here) is used; When hidden, none is used, which means not displayed.

[0100] Optionally, when linear, the color depends on the stroke attribute, which is the same as the face.

[0101] Table 2 is a linear parameter setting table according to an embodiment of the present disclosure

[0102] F F (invert) F (hide) L #000 #000 #000 L (invert) #FFF #FFF #FFF L (hide) none none none

[0103] Table 2 is a linear parameter setting table according to an embodiment of the present disclosure, as shown in the above table, the same content in linear and face is, the corresponding color under different attributes is not the same, and a fixed variable cannot be used to identify. Therefore, a two-dimensional array is used to directly correspond to the above table.

[0104] Table 3 is a two-dimensional array parameter setting table according to an embodiment of the present disclosure

[0105] F F (invert) F (hide) L [0,0] [0,1] [0,2] L (invert) [1,0] [1,1] [1,2] L (hide) [2,0] [2,1] [2,2]

[0106] Table 3 is a two-dimensional array parameter setting table according to an embodiment of the present disclosure, as shown in Table 2, when the fill is reverse color and the stroke is normal, that is, F (reverse color) L, the corresponding two-dimensional array table is [0, 1], wherein [0, 1] represents the zeroth row and the first column, when the face is, the corresponding position of the first table is #FFF, and when the linear is, the color #000 is obtained by referring to the second table.

[0107] Optionally, during runtime, the corresponding color can be dynamically filled according to whether it is linear or face, the face corresponds to Table 1, and the color #FFF can be obtained, the linear corresponds to Table 2, and the color #000 is obtained.

[0108] Optionally, when the fill is normal and the stroke is hidden, that is, FL (hidden), the corresponding is [2, 0], the face color is #000, and the linear color is none.

[0109] Therefore, the same position may have different styles, and the color content may be different, so during the compiling process, we only need to write a coordinate corresponding to the color position of the scalable vector image to represent the position in the two-dimensional array.

[0110] The icon processing method of the embodiment shown in the figure.

[0111] The embodiment of the present disclosure also provides an icon processing device for executing the icon processing method. Figure 1 The icon processing device of the icon processing method of the embodiment shown in the figure.

[0112] Figure 8 The icon processing device of the embodiment shown in the figure. Figure 8 The icon processing device 80 can include an acquisition unit 81, a determination unit 82, a generation module 83 and a conversion module 84.

[0113] The acquisition unit 81 is configured to acquire a target icon to be processed, wherein the format of the target icon is a scalable vector graphics format;

[0114] The determination unit 82 is configured to determine an icon style of the target icon;

[0115] The generation unit 83 is configured to generate configuration information based on the icon style, wherein the configuration information is used to represent the attributes of the target icon under the icon style;

[0116] The conversion unit 84 is configured to convert the target icon into a target component based on the configuration information.

[0117] Optionally, the generation unit 83 includes an acquisition module configured to acquire icon content of the target icon, and a determination module configured to determine the configuration information corresponding to the icon style based on the icon content.

[0118] Optionally, the conversion unit 84 includes a conversion module configured to convert the target icon into a target string based on the configuration information, wherein the format of the target string is a scalable vector graphics format; and a generation module configured to generate the target string into the target component.

[0119] Optionally, the conversion module includes a replacement submodule configured to replace variables of the target icon corresponding to the configuration information with placeholders; and a generation submodule configured to generate the target string based on the placeholders.

[0120] Optionally, the replacing subunit replaces the variable corresponding to the configuration information of the target icon with the placeholder by: generating an array variable based on the configuration information, wherein the array variable is used to represent the stroke attribute and the fill attribute of the target icon in the icon style; determining the target color in the icon style based on the array variable; and replacing the target color with the placeholder.

[0121] Optionally, the device includes: the stroke attribute includes at least one of the following: a stroke normal attribute, a stroke inverse attribute and a stroke hidden attribute; and the fill attribute includes at least one of the following: a fill normal attribute, a fill inverse attribute and a fill hidden attribute.

[0122] Optionally, the device includes: in a case where the icon style is a face style, different fill attributes correspond to different target colors; and in a case where the icon style is a linear style, different stroke attributes correspond to different target colors.

[0123] Optionally, the generating subunit generates the target string based on the placeholder by: replacing the placeholder with a component parameter of the target component to be generated; and generating the component parameter as the target string.

[0124] Optionally, the generating subunit generates the target string as the target component by: generating the target string as the target component based on a predetermined template.

[0125] In the icon processing device of this embodiment, the target icon to be processed is acquired by the acquiring unit, wherein the format of the target icon is a scalable vector graphics format; the icon style of the target icon is determined by the determining unit; the configuration information is generated based on the icon style by the generating unit, wherein the configuration information is used to represent the attribute of the target icon in the icon style; and the target icon is converted into the target component based on the configuration information by the converting unit, which effectively improves the running efficiency, thereby achieving the technical effect of reducing the performance consumption during icon processing and solving the technical problem of large performance consumption during icon processing.

[0126] In the technical scheme of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0127] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0128] An electronic device according to an embodiment of the disclosure can include at least one processor, and a memory connected with the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a method of processing deep learning model data according to an embodiment of the disclosure.

[0129] Optionally, the electronic device can further include a transmission device connected with the processor, and an input and output device connected with the processor.

[0130] According to an embodiment of the disclosure, the disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to perform a method of icon processing according to an embodiment of the disclosure.

[0131] Optionally, in the embodiment, the non-transitory computer-readable storage medium can be configured to store a computer program for performing the following steps:

[0132] S1, obtaining a target icon to be processed, wherein the target icon is in a scalable vector graphics format;

[0133] S2, determining an icon style of the target icon;

[0134] S3, generating configuration information based on the icon style, wherein the configuration information is used to represent attributes of the target icon in the icon style;

[0135] S4, converting the target icon into a target component based on the configuration information.

[0136] Optionally, in the embodiment, the non-transitory computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of a readable storage medium would include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0137] According to an embodiment of the disclosure, the disclosure further provides a computer program product including a computer program, which, when executed by a processor, implements the following steps:

[0138] S1, obtaining a target icon to be processed, wherein the target icon is in a scalable vector graphics format;

[0139] S2, Determine the icon style of the target icon;

[0140] S3, Generate configuration information based on icon style, where the configuration information is used to characterize the attributes of the target icon under the icon style;

[0141] S4 converts the target icon into the target component based on the configuration information.

[0142] Figure 9 This is a block diagram of an electronic device according to an embodiment of the icon processing method of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0143] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0144] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0145] The computing unit 901 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs various methods and processes described above, such as the method data processing method. For example, in some embodiments, the method data processing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded onto the RAM 903 and executed by the computing unit 901, one or more steps of the data processing method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the data processing method by any other suitable means, such as by means of firmware.

[0146] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0147] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0148] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, 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.

[0149] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0150] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0151] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0152] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technology described in the present disclosure are achieved.

[0153] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An icon processing method, comprising: obtaining a target icon to be processed, wherein a format of the target icon is a scalable vector graphics format; determining an icon style of the target icon; generating configuration information based on the icon style, wherein the configuration information is used to represent properties of the target icon under the icon style; converting the target icon into a target component based on the configuration information, wherein the target component is generated based on a target string, the target string is generated by replacing variables of the target icon corresponding to the configuration information with placeholders, and a format of the target string is the scalable vector graphics format.

2. The method of claim 1, wherein, The generating of the configuration information based on the icon style comprises: obtaining icon content of the target icon; determining the configuration information corresponding to the icon style based on the icon content.

3. The method of claim 1, wherein, The replacing of the variables of the target icon corresponding to the configuration information with the placeholders comprises: generating an array variable based on the configuration information, wherein the array variable is used to represent stroke properties and fill properties of the target icon under the icon style; determining a target color under the icon style based on the array variable; replacing the target color with the placeholder.

4. The method of claim 3, wherein, The stroke properties comprise at least one of the following: a normal stroke property, a reverse stroke property and a hidden stroke property; and the fill properties comprise at least one of the following: a normal fill property, a reverse fill property and a hidden fill property.

5. The method of claim 3, wherein, In a case where the icon style is a facial style, different fill properties correspond to different target colors; and in a case where the icon style is a linear style, different stroke properties correspond to different target colors.

6. The method of claim 1, wherein, The method further comprises: replacing the placeholder with a component parameter of the target component to be generated; and generating the component parameter into the target string.

7. The method of claim 1, wherein, The method further comprises: generating the target string into the target component based on a predetermined template.

8. An icon processing apparatus, comprising: an obtaining unit, configured to obtain a target icon to be processed, wherein a format of the target icon is a scalable vector graphics format; a determining unit, configured to determine an icon style of the target icon; a generating unit, configured to generate configuration information based on the icon style, wherein the configuration information is used to represent properties of the target icon under the icon style; a converting unit, configured to convert the target icon into a target component based on the configuration information, wherein the target component is generated based on a target string, the target string is generated by replacing variables of the target icon corresponding to the configuration information with placeholders, and a format of the target string is the scalable vector graphics format.

9. The apparatus of claim 8, wherein, The generating unit comprises: an obtaining module, configured to obtain icon content of the target icon; a determining module, configured to determine the configuration information corresponding to the icon style based on the icon content.

10. The apparatus of claim 8, wherein, The apparatus is further configured to: generating an array variable based on the configuration information, wherein the array variable is used to represent a stroke attribute and a fill attribute of the target icon under the icon style; determining a target color under the icon style based on the array variable; replacing the placeholder with the target color.

11. The apparatus of claim 10, wherein, The stroke attribute comprises at least one of the following: a normal stroke attribute, a reverse stroke attribute, and a hidden stroke attribute; and the fill attribute comprises at least one of the following: a normal fill attribute, a reverse fill attribute, and a hidden fill attribute.

12. The apparatus of claim 10, wherein, In a case where the icon style is a face style, different fill attributes correspond to different target colors; and in a case where the icon style is a linear style, different stroke attributes correspond to different target colors.

13. The apparatus of claim 8, wherein, The apparatus is further configured to: replace the placeholder with a component parameter of the target component to be generated; and generate the component parameter as the target string.

14. The apparatus of claim 8, wherein, The apparatus is further configured to: generate the target string as the target component based on a predetermined template.

15. An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

16. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-7.

17. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-7.