Project icon publishing method, device, equipment and storage medium
By receiving project icon publishing requests, decolorization processing and encoding format conversion, and generating compiled files and publishing them to the project warehouse, the problems of low efficiency, low flexibility and poor maintenance in the existing technology are solved, and efficient and flexible icon management and development efficiency are improved.
Patent Information
- Application Number
- CN202110270347.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-12
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-03-12
AI Technical Summary
In the prior art, project icons have low processing efficiency, low flexibility and poor maintenance, resulting in reduced application loading speed, delayed icon switching, and developers need to have image editing technology.
Provides a project icon publishing method, by receiving project icon publishing requests, finding storage paths, copying icons to a specified directory, performing color decoding and encoding format conversion, generating compiled files, and packaging them into project package files and publishing them to the project warehouse.
It improves the integration efficiency and maintainability of project icons, makes the use and update of icons more flexible and convenient, and significantly improves project development efficiency.
Smart Images

Figure CN112988152B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of research and development management, and in particular to a project icon publishing method, device, equipment and storage medium. Background Art
[0002] With the development of the Internet, the content of the network is becoming more and more abundant and diverse, and the icons in network applications are an indispensable component of the application. They can convert a concept into clear and easy-to-understand graphics, thereby reducing the user's understanding cost and improving the aesthetics of the interface. Therefore, when writing project programs, the processing of icons has also become an indispensable link.
[0003] At present, the processing of icons is generally done by developers, and there are three common processing methods: independently introduce a single icon; combine multiple icons into a picture, and then use the icon in the picture using icon positioning technology; convert the icon to a font package, introduce the font package and then use the icon. The above three methods have the following problems: the network request volume increases, the application loading speed is reduced, and the icon switching needs to wait for loading; the maintainability is poor, the icon color is fixed, and all icons cannot be displayed before the image is loaded, and the developer needs to know image editing technology; it cannot be loaded on demand, and all icons cannot be displayed before the font package is loaded. It can be seen that the existing icon processing methods have problems such as low efficiency, low flexibility, and poor maintainability. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problems of low efficiency and poor maintainability of project icon integration.
[0005] A first aspect of the present invention provides a project icon publishing method, comprising:
[0006] receiving a publishing request for a project icon, wherein the publishing request includes a project ID;
[0007] According to the project ID, searching for the storage path corresponding to the project icon;
[0008] According to the storage path, copy the project icon to the specified project directory;
[0009] Decolorizing the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0010] Convert all decolorized icons and multicolor icons in the project directory into encoding formats, and generate compilation files corresponding to each icon;
[0011] The compiled files are packaged into a project package file and published to the project warehouse.
[0012] Optionally, in a first implementation of the first aspect of the present invention, before decolorizing all the monochrome icons in the project icons to obtain a plurality of decolorized icons, the method further includes:
[0013] Parsing the attribute information of each project icon and extracting the color attribute of each project icon;
[0014] According to the color attribute, single-color icons and multi-color icons in the project icons are identified.
[0015] Optionally, in a second implementation of the first aspect of the present invention, the identifying, according to the color attribute, a monochrome icon and a multi-color icon in the project icon includes:
[0016] Determine whether each of the project icons has multiple color attributes;
[0017] If the project icon has multiple color attributes, determining whether the color attribute values are the same;
[0018] If the color attribute values are the same, the project icon is determined to be a monochrome icon; otherwise, the project icon is determined to be a multi-color icon;
[0019] If the project icon does not have multiple color attributes, it is determined that the project icon is a monochrome icon.
[0020] Optionally, in a third implementation of the first aspect of the present invention, decolorizing the monochrome icons in the project icons to obtain a plurality of decolorized icons includes:
[0021] Deleting the color attributes and corresponding color attribute values of each monochrome icon;
[0022] The color attribute of each of the monochrome icons is set to a preset variable value to obtain a plurality of decolorized icons.
[0023] Optionally, in a fourth implementation of the first aspect of the present invention, the step of converting the encoding formats of all decolored icons and multi-colored icons in the project directory and generating compiled files corresponding to the icons includes:
[0024] Obtain a target encoding format template, and convert each of the multi-color icons and each of the decolorized icons into corresponding character strings respectively;
[0025] Writing the character strings into the target encoding format template according to preset writing rules to obtain multiple precompiled files;
[0026] Execute compile commands on the pre-compiled files to generate multiple compiled files.
[0027] Optionally, in a fifth implementation of the first aspect of the present invention, packaging the compiled files into a project package file and publishing the package file to a project repository includes:
[0028] Rename each compiled file according to the camel case naming method, and store the renamed file name of each compiled file in the preset name queue;
[0029] Obtain the configuration file under the project directory, and add the name queue to the configuration file according to the preset adding rule;
[0030] According to the configuration file, execute the project packaging command to package the files in the project directory to obtain a project package file;
[0031] Execute the project release command and publish the project package file to the project warehouse.
[0032] A second aspect of the present invention provides a project icon publishing device, comprising:
[0033] A receiving module, configured to receive a publishing request for a project icon, wherein the publishing request includes a project ID;
[0034] A search module, used to search for a storage path corresponding to the project icon according to the project ID;
[0035] A copy module, used for copying the project icon to a designated project directory according to the storage path;
[0036] a decolorization module, used for decolorizing the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0037] The encoding module is used to convert the encoding format of all decolorized icons and multi-color icons in the project directory and generate a compilation file corresponding to each icon;
[0038] The publishing module is used to package the compiled files into a project package file and publish it to the project warehouse.
[0039] Optionally, in a first implementation of the second aspect of the present invention, the project icon publishing device further includes:
[0040] An extraction module, used for parsing the attribute information of each project icon and extracting the color attribute of each project icon;
[0041] The identification module is used to identify the monochrome icon and the multi-color icon in the project icon according to the color attribute.
[0042] Optionally, in a second implementation of the second aspect of the present invention, the identification module is specifically used to:
[0043] Determine whether each of the project icons has multiple color attributes;
[0044] If the project icon has multiple color attributes, determining whether the color attribute values are the same;
[0045] If the color attribute values are the same, the project icon is determined to be a monochrome icon; otherwise, the project icon is determined to be a multi-color icon;
[0046] If the project icon does not have multiple color attributes, it is determined that the project icon is a monochrome icon.
[0047] Optionally, in a third implementation of the second aspect of the present invention, the decolorization module is specifically used to:
[0048] Deleting the color attributes and corresponding color attribute values of each monochrome icon;
[0049] The color attribute of each of the monochrome icons is set to a preset variable value to obtain a plurality of decolorized icons.
[0050] Optionally, in a fourth implementation manner of the second aspect of the present invention, the encoding module is specifically used to:
[0051] Obtain a target encoding format template, and convert each of the multi-color icons and each of the decolorized icons into corresponding character strings respectively;
[0052] Writing the character strings into the target encoding format template according to preset writing rules to obtain multiple precompiled files;
[0053] Execute compile commands on the pre-compiled files to generate multiple compiled files.
[0054] Optionally, in a fifth implementation of the second aspect of the present invention, the publishing module is specifically used to:
[0055] Rename each compiled file according to the camel case naming method, and store the renamed file name of each compiled file in the preset name queue;
[0056] Obtain the configuration file under the project directory, and add the name queue to the configuration file according to the preset adding rule;
[0057] According to the configuration file, execute the project packaging command to package the files in the project directory to obtain a project package file;
[0058] Execute the project release command and publish the project package file to the project warehouse.
[0059] The third aspect of the present invention provides a project icon publishing device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the project icon publishing device executes the above-mentioned project icon publishing method.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned project icon publishing method.
[0061] In the technical solution provided by the present invention, after the designer prepares the project icon and uploads it, he sends a project icon publishing request. After receiving the publishing request, he searches for the storage path of the icon when it is uploaded, copies the icons required for the project packaging to the project directory to be published under the storage path, and then performs decolorization and compilation processing on the icons in the directory. After generating the target compiled file, the icons are uniformly packaged and published to the designated project warehouse. The present invention can uniformly process the icons needed in the project into a project package, and the project icons therein can be used by directly introducing the project package. The present invention efficiently integrates the project icons, making the use and update of the project icons more flexible and convenient, and greatly improving the efficiency of project development. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 This is a schematic diagram of a first embodiment of a project icon publishing method according to an embodiment of the present invention;
[0063] Figure 2 Schematic diagram of a second embodiment of the project icon publishing method in an embodiment of the present invention;
[0064] Figure 3 This is a schematic diagram of a first embodiment of a device for publishing project icons in an embodiment of the present invention;
[0065] Figure 4 This is a schematic diagram of a second embodiment of a device for publishing project icons in an embodiment of the present invention;
[0066] Figure 5 It is a schematic diagram of an embodiment of a project icon publishing device in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] Embodiments of the present invention provide a project icon publishing method, apparatus, device and storage medium. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0068] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the project icon publishing method in the embodiment of the present invention includes:
[0069] 101. Receive a publishing request for a project icon, wherein the publishing request includes a project ID;
[0070] It is understandable that the execution subject of the present invention may be a project icon publishing device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0071] In this embodiment, the project icon refers to the SVG icon required for use in the project development process. The SVG icon is a scalable vector icon based on XML (Extensible Markup Language) and developed by the World Wide Web Consortium (W3C). It is an open standard vector graphics language. Users can directly use codes to draw images, and can use any word processing tool to open SVG images. By changing part of the code, the image can be made interactive and can be inserted into HTML at any time for viewing through a browser.
[0072] In this embodiment, after the designer creates a project icon and uploads it, he sends a project icon publishing request. After the background receives the project icon publishing request, it assigns a unique ID to each project. This ID can locate each icon in the project and is the identifier of the project.
[0073] 102. According to the project ID, search for a storage path corresponding to the project icon;
[0074] In this embodiment, the project icons may be stored in an online server or a local server. Before completing the publishing task, it is necessary to find the storage paths of these icons one by one and copy them to the project directory to complete the publishing task.
[0075] In this embodiment, the storage path of the project icon can be found according to the project ID, specifically according to the storage method when the icon is published. For example, if a folder named after the project ID is created when publishing and the project icon is stored in the folder, then the project ID is used as the file search keyword to traverse all project folders to determine the folder path of the target project. The folder search can be implemented by command line.
[0076] 103. Copy the project icon to a designated project directory according to the storage path;
[0077] In this embodiment, after the storage path of the project icon is found, a subprocess will be started to copy the relevant icon files to the project directory responsible for packaging and publishing. When the icon is successfully published, the subprocess will also notify the icon management service of the successful publication, and then end the subprocess. The project directory can be specified in a preset manner, and the project directory also contains other files required for project packaging, such as configuration files, declaration files, etc.
[0078] 104. Decolorize the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0079] In this embodiment, project icons are divided into multi-color icons and monochrome icons according to the usage scenarios and design basis of project icons. In order to retain the original style of the design, the color of the multi-color icon is not processed in any way. In order to improve the flexibility of the icon, the color attributes of the monochrome icon are removed so that it can be flexibly changed according to the needs of the project. For example, in the front-end project, the decolored SVG icon will inherit the color attributes of the parent. When the color of the icon needs to be changed, just change the color attributes of its parent tag, and the color of the icon will change accordingly.
[0080] In this embodiment, the decolorized icon can be understood as a transparent icon, which has no color attribute and can change color according to the background color. Since some special fonts may be used in the project, and introducing them through font packages is difficult to maintain and increases the burden of network loading, the usual practice is to convert special fonts into SVG icons and then introduce special fonts in the form of icons. This requires the icon to have the same variability as the font package, which can change size and color at will. For this reason, the automated decolorization of icons is very helpful for improving the efficiency of project development.
[0081] 105. Convert the encoding formats of all decolored icons and multi-colored icons in the project directory, and generate a compilation file corresponding to each icon;
[0082] In this embodiment, in order to improve the integration of project icons, the decolorized icons are further compiled, so that project development is more convenient and efficient. In the prior art, icon compilation is generally done manually, and most of the work is repetitive. Therefore, intelligent processing of this part can reduce the error rate and improve development efficiency.
[0083] In this embodiment, the method for generating a compiled file is to uniformly convert the decolorized icons and multi-color icons into a string format, then write each icon string into a template file of a preset target encoding format to obtain a compilable target file, and then execute these compilable target files to generate multiple compiled files.
[0084] Optionally, step 105 specifically includes:
[0085] Obtain a target encoding format template, and convert each of the multi-color icons and each of the decolorized icons into corresponding character strings respectively;
[0086] Writing the character strings into the target encoding format template according to preset writing rules to obtain multiple precompiled files;
[0087] Execute compile commands on the pre-compiled files to generate multiple compiled files.
[0088] In this optional embodiment, when the target project is a front-end project, the SVG icon can be first parsed into a JSON object, and then converted into a string format after relevant processing of the color attributes in the JSON object. This process can be automatically executed in the form of a command line.
[0089] In this optional embodiment, the corresponding target encoding format template in the front-end project is a TS (TypeScript) file template. After obtaining the template, inserting the JSON string of the icon in a specific position of the template can generate a precompiled file, and by executing the modified TS file, the compiled file required for the project can be generated, wherein the compiled file includes the JS file and d.ts file corresponding to each icon.
[0090] 106. Package the compiled files into a project package file and publish it to the project warehouse.
[0091] In this embodiment, the packaging and publishing of the front-end project can be achieved through the NPM command. NPM is a package management tool for JavaScript and the default package management tool for the Node.js platform. Code can be installed, shared, and distributed, as well as project dependencies can be managed through npm.
[0092] In this embodiment, since the icon needs to be packaged into a project package file, it is necessary to combine other project files to generate a complete project package file, which will involve the modification of some project configuration information. First, in order to unify the naming convention, the compiled icon file is renamed, and then the icon name to be introduced into the project is added to the configuration file of the project as one of the parameters of the project packaging, and then the packaging and publishing commands are executed to complete the publishing task of the project package.
[0093] Optionally, step 106 specifically includes:
[0094] Rename each compiled file according to the camel case naming method, and store the renamed file name of each compiled file in the preset name queue;
[0095] Obtain the configuration file under the project directory, and add the name queue to the configuration file according to the preset adding rule;
[0096] According to the configuration file, execute the project packaging command to package the files in the project directory to obtain a project package file;
[0097] Execute the project release command and publish the project package file to the project warehouse.
[0098] In this optional embodiment, Camel-Case is a set of naming rules (conventions) when writing computer programs. As its name CamelCase indicates, it refers to the use of a mixture of uppercase and lowercase letters to form the names of variables and functions. In order to make it easier for programmers to communicate their codes among peers, they often adopt a unified naming method with better readability. For example, the original name of the icon is "icon_education", then the name renamed using Camel-Case is "iconEducation".
[0099] In an embodiment of the present invention, after a designer prepares a project icon and uploads it, a project icon publishing request is sent. After receiving the publishing request, the storage path of the icon when it is uploaded is searched, and each icon required for project packaging is copied under the storage path to the project directory to be published. Then, the icons under the directory are decolored and compiled, and after the target compiled file is generated, they are uniformly packaged and published to the designated project warehouse. The present invention can uniformly process the icons needed in the project into a project package, and the project icons therein can be used by directly introducing the project package. The present invention efficiently integrates the project icons, making the use and update of the project icons more flexible and convenient, and greatly improving the efficiency of project development.
[0100] See also Figure 2The second embodiment of the project icon publishing method in the embodiment of the present invention includes:
[0101] 201. Receive a publishing request for a project icon, wherein the publishing request includes a project ID;
[0102] 202. According to the project ID, search for a storage path corresponding to the project icon;
[0103] 203. Copy the project icon to a designated project directory according to the storage path;
[0104] 204. Parse the attribute information of each project icon and extract the color attribute of each project icon;
[0105] 205. Identify a monochrome icon and a multi-color icon in the project icon according to the color attribute.
[0106] Optionally, step 205 specifically includes:
[0107] Determine whether each of the project icons has multiple color attributes;
[0108] If the project icon has multiple color attributes, determining whether the color attribute values are the same;
[0109] If the color attribute values are the same, the project icon is determined to be a monochrome icon; otherwise, the project icon is determined to be a multi-color icon;
[0110] If the project icon does not have multiple color attributes, it is determined that the project icon is a monochrome icon.
[0111] In this optional embodiment, the parsed icon can be a JSON object, which describes all the properties of the icon, including color attributes. The parsed file may contain multiple color attributes, and whether the icon is a monochrome icon is determined by judging the number of color attributes and attribute values. When there is only one color attribute, it can be quickly determined that the icon is a monochrome icon, but when there are two or more color attributes, it is necessary to compare the color attribute values to determine whether it is a monochrome icon. It should be noted that an icon may contain multiple color attributes even if it is a monochrome icon. This is because SVG icons may be composed of different shapes, each of which may have a separate color attribute. Therefore, it is not possible to determine whether it is a monochrome icon by only judging the number of color attributes.
[0112] 206. Decolorize the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0113] Optionally, step 206 specifically includes:
[0114] Deleting the color attributes and corresponding color attribute values of each monochrome icon;
[0115] The color attribute of each of the monochrome icons is set to a preset variable value to obtain a plurality of decolorized icons.
[0116] In this optional embodiment, to achieve icon decolorization, it is necessary to first delete the icon's inherent color attributes, and then reset the new color attributes to a variable value. This variable value is not a specific color attribute value, but a variable parameter that allows the icon to inherit the parent label color attribute. When generating the front-end page, the program will read the parent label color attribute value through this variable parameter, and assign the read color attribute to the icon, thereby achieving inheritance.
[0117] 207. Convert the encoding formats of all decolored icons and multi-colored icons in the project directory, and generate a compilation file corresponding to each icon;
[0118] 208. Package the compiled files into a project package file and publish it to the project warehouse.
[0119] In the embodiment of the present invention, in order to improve the flexibility of the icon during use, the monochrome icon is decolorized, and the decolorized icon will inherit the color attribute of the parent label when used. The decolorization method is to first identify the monochrome icon according to the color attribute of the icon, delete the original color attribute and then add a new color attribute variable, so as to obtain a transparent icon that can be flexibly changed in color. The embodiment of the present invention can make the icon color change flexibly, and the color of the icon can be changed without using image editing tools to modify the icon color, thereby improving the efficiency and flexibility of project development.
[0120] The above describes the project icon publishing method in the embodiment of the present invention. The following describes the project icon publishing device in the embodiment of the present invention. Figure 3 The first embodiment of the project icon publishing device in the embodiment of the present invention includes:
[0121] The receiving module 301 is used to receive a publishing request for a project icon, wherein the publishing request includes a project ID;
[0122] A search module 302, used to search for a storage path corresponding to the project icon according to the project ID;
[0123] A copy module 303, used to copy the project icon to a designated project directory according to the storage path;
[0124] A decolorization module 304 is used to decolorize the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0125] The encoding module 305 is used to convert the encoding format of all decolored icons and multi-colored icons in the project directory and generate a compilation file corresponding to each icon;
[0126] The publishing module 306 is used to package the compiled files into a project package file and publish it to the project warehouse.
[0127] Optionally, the encoding module 305 is specifically used for:
[0128] Obtain a target encoding format template, and convert each of the multi-color icons and each of the decolorized icons into corresponding character strings respectively;
[0129] Writing the character strings into the target encoding format template according to preset writing rules to obtain multiple precompiled files;
[0130] Execute compile commands on the pre-compiled files to generate multiple compiled files.
[0131] Optionally, the publishing module 306 is specifically used for:
[0132] Rename each compiled file according to the camel case naming method, and store the renamed file name of each compiled file in the preset name queue;
[0133] Obtain the configuration file under the project directory, and add the name queue to the configuration file according to the preset adding rule;
[0134] According to the configuration file, execute the project packaging command to package the files in the project directory to obtain a project package file;
[0135] Execute the project release command and publish the project package file to the project warehouse.
[0136] In an embodiment of the present invention, after the designer prepares the project icon and uploads it, he sends a project icon publishing request. After receiving the publishing request, he searches for the storage path of the icon when it is uploaded, copies each icon required for project packaging to the project directory to be published under the storage path, and then decolorizes and compiles the icons in the directory. After generating the target compiled file, the icons are uniformly packaged and published to the designated project warehouse. The present invention can uniformly process the icons needed in the project into a project package, and the project icons therein can be used by directly introducing the project package. The present invention efficiently integrates the project icons, making the use and update of the project icons more flexible and convenient, greatly improving the efficiency of project development. .
[0137] See also Figure 4 The second embodiment of the project icon publishing device in the embodiment of the present invention includes:
[0138] The receiving module 301 is used to receive a publishing request for a project icon, wherein the publishing request includes a project ID;
[0139] A search module 302, used to search for a storage path corresponding to the project icon according to the project ID;
[0140] A copy module 303, used to copy the project icon to a designated project directory according to the storage path;
[0141] A decolorization module 304 is used to decolorize the monochrome icons in the project icons to obtain a plurality of decolorized icons;
[0142] The encoding module 305 is used to convert the encoding format of all decolored icons and multi-colored icons in the project directory and generate a compilation file corresponding to each icon;
[0143] The publishing module 306 is used to package the compiled files into a project package file and publish it to the project warehouse.
[0144] An extraction module 307, used to parse the attribute information of each project icon and extract the color attribute of each project icon;
[0145] The identification module 308 is used to identify the single-color icon and the multi-color icon in the project icon according to the color attribute.
[0146] Optionally, the identification module 308 is specifically used for:
[0147] Determine whether each of the project icons has multiple color attributes;
[0148] If the project icon has multiple color attributes, determining whether the color attribute values are the same;
[0149] If the color attribute values are the same, the project icon is determined to be a monochrome icon; otherwise, the project icon is determined to be a multi-color icon;
[0150] If the project icon does not have multiple color attributes, it is determined that the project icon is a monochrome icon.
[0151] Optionally, the decolorization module 304 is specifically used for:
[0152] Deleting the color attributes and corresponding color attribute values of each monochrome icon;
[0153] The color attribute of each of the monochrome icons is set to a preset variable value to obtain a plurality of decolorized icons.
[0154] In the embodiment of the present invention, in order to improve the flexibility of the icon during use, the monochrome icon is decolorized, and the decolorized icon will inherit the color attribute of the parent label when used. The decolorization method is to first identify the monochrome icon according to the color attribute of the icon, delete the original color attribute and then add a new color attribute variable, so as to obtain a transparent icon that can be flexibly changed in color. The embodiment of the present invention can make the icon color change flexibly, and the color of the icon can be changed without using image editing tools to modify the icon color, thereby improving the efficiency and flexibility of project development.
[0155] above Figure 3 and Figure 4 The project icon publishing device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the project icon publishing device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0156] Figure 5 is a structural diagram of a project icon publishing device provided by an embodiment of the present invention. The project icon publishing device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more massive storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 may be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the project icon publishing device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the project icon publishing device 500.
[0157] The project icon publishing device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 5 The illustrated project icon publishing device structure does not constitute a limitation on the project icon publishing device, and may include more or fewer components than illustrated, or a combination of certain components, or a different arrangement of components.
[0158] The present invention also provides a project icon publishing device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the project icon publishing method in the above-mentioned embodiments.
[0159] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the project icon publishing method.
[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0162] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A project icon publishing method, characterized in that: The project icon publishing method comprises: receiving a publishing request for a project icon, wherein the publishing request includes a project ID; According to the project ID, searching for the storage path corresponding to the project icon; According to the storage path, copy the project icon to the specified project directory; According to the usage scenario and design basis of the project icon, determine the monochrome icon and the multi-color icon in the project icon, and remove the color attribute of each of the monochrome icons; set the color attribute of the parent label of each of the monochrome icons after decolorization to a preset variable value to obtain a plurality of decolorized icons; Obtain a target coding format template, and convert each of the multi-color icons and each of the decolorized icons into a corresponding character string; write the character strings into the target coding format template according to a preset writing rule to obtain a plurality of precompiled files; execute a compile command on each of the precompiled files to generate a plurality of compiled files; The compiled files are packaged into a project package file and published to the project warehouse.
2. The project icon publishing method according to claim 1, characterized in that: The determining of the monochrome icon and the multi-color icon in the project icon comprises: Parsing the attribute information of each of the project icons, and extracting the color attribute of each of the project icons; According to the color attribute, single-color icons and multi-color icons in the project icons are identified.
3. The project icon publishing method according to claim 2, characterized in that: The identifying, according to the color attribute, the monochrome icon and the multi-color icon in the project icon comprises: Determine whether each of the project icons has multiple color attributes; If the project icon has multiple color attributes, determining whether the color attribute values are the same; If the color attribute values are the same, the project icon is determined to be a monochrome icon; otherwise, the project icon is determined to be a multi-color icon; If the project icon does not have multiple color attributes, it is determined that the project icon is a monochrome icon.
4. The project icon publishing method according to claim 1, characterized in that: The step of packaging the compiled files into a project package file and publishing the package file to the project warehouse includes: Rename the compiled files according to the camel case naming method, and store the renamed file names of the compiled files in the preset name queue; Obtain the configuration file under the project directory, and add the name queue to the configuration file according to the preset adding rule; According to the configuration file, execute the project packaging command to package the files in the project directory to obtain a project package file; Execute the project release command and publish the project package file to the project warehouse.
5. A project icon publishing device, characterized in that: The project icon publishing device comprises: A receiving module, configured to receive a publishing request for a project icon, wherein the publishing request includes a project ID; A search module, used to search for a storage path corresponding to the project icon according to the project ID; A copy module, used for copying the project icon to a designated project directory according to the storage path; A decolorization module is used to determine the monochrome icons and multi-color icons in the project icons according to the usage scenarios and design basis of the project icons, and remove the color attributes of each of the monochrome icons; set the color attributes of the parent labels of each of the monochrome icons after decolorization to a preset variable value to obtain a plurality of decolorized icons; The encoding module is used to obtain a target encoding format template, and convert each of the multi-color icons and each of the decolorized icons into corresponding character strings; write the character strings into the target encoding format template according to preset writing rules to obtain multiple precompiled files; execute a compilation command on each of the precompiled files to generate multiple compiled files; The publishing module is used to package the compiled files into a project package file and publish it to the project warehouse.
6. The project icon publishing device according to claim 5, characterized in that: The project icon publishing device also includes: An extraction module, used for parsing the attribute information of each of the project icons and extracting the color attribute of each of the project icons; The identification module is used to identify the monochrome icon and the multi-color icon in the project icon according to the color attribute.
7. A project icon publishing device, characterized in that: The project icon publishing device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the project icon publishing device to execute the project icon publishing method according to any one of claims 1 to 4.
8. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the project icon publishing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Method and device for remote publishing application
CN102591667A
Generation method of theme, application method of theme and terminal
CN106020802A