CN108874495A - Theme resource conversion method and device and electronic equipment - Google Patents

Theme resource conversion method and device and electronic equipment Download PDF

Info

Publication number
CN108874495A
CN108874495A CN201810666638.7A CN201810666638A CN108874495A CN 108874495 A CN108874495 A CN 108874495A CN 201810666638 A CN201810666638 A CN 201810666638A CN 108874495 A CN108874495 A CN 108874495A
Authority
CN
China
Prior art keywords
picture
array
resource
theme
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810666638.7A
Other languages
Chinese (zh)
Other versions
CN108874495B (en
Inventor
张瑜明
甘洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201810666638.7A priority Critical patent/CN108874495B/en
Publication of CN108874495A publication Critical patent/CN108874495A/en
Application granted granted Critical
Publication of CN108874495B publication Critical patent/CN108874495B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明的实施例公开一种主题资源转换方法、装置及电子设备,涉及手机技术领域,能够弥补目前现有iOS系统原生输入法不能切换主题的不足。所述主题资源转换方法,包括:获取第一主题资源信息;所述第一主题资源包括原图片;在第二主题资源目录下构建用于存放目标图片的图片目录;通过比较原图片尺寸和目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下;在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。本发明尤其适用于安卓资源转换为iOS资源。

The embodiment of the present invention discloses a theme resource conversion method, device and electronic equipment, which relate to the technical field of mobile phones and can make up for the deficiency that the original input method of the existing iOS system cannot switch the theme. The subject resource conversion method includes: obtaining first subject resource information; the first subject resource includes original pictures; constructing a picture directory for storing target pictures under the second theme resource directory; comparing the size of the original picture with the target picture Image size, redraw the original image or directly copy it to the image directory; generate a plist file corresponding to the converted theme resource in the second theme resource directory. The present invention is especially suitable for converting Android resources into iOS resources.

Description

一种主题资源转换方法、装置及电子设备A theme resource conversion method, device and electronic equipment

技术领域technical field

本发明手机技术领域,尤其涉及一种主题资源转换方法、装置及电子设备。The technical field of mobile phones of the present invention particularly relates to a theme resource conversion method, device and electronic equipment.

背景技术Background technique

随着手机技术的飞速发展,不同的手机厂商会有自己独特的操作系统。由于不同操作系统的差异,两种不同操作系统平台开发的主题资源往往不能通用,因此,一套输入法主题若需要用在不同的操作系统中,就需要针对多个系统专门做设计。当输入法APP支持双端,就会有大量的第一输入法主题不能适配在第二操作系统平台。可见,现有的输入法开发不能充分利用已有资源。目前,对于使用最为广泛的安卓(Android)和苹果(iOS)系统而言,同一个设计师设计的主题不能同时适配这两个系统平台,第三方输入法不能自由切换主题。With the rapid development of mobile phone technology, different mobile phone manufacturers will have their own unique operating systems. Due to the differences of different operating systems, the theme resources developed by two different operating system platforms are often not common. Therefore, if a set of input method themes needs to be used in different operating systems, it needs to be specially designed for multiple systems. When the input method APP supports dual-end, there will be a large number of first input method themes that cannot be adapted to the second operating system platform. It can be seen that the existing input method development cannot make full use of existing resources. At present, for the most widely used Android (Android) and Apple (iOS) systems, themes designed by the same designer cannot be adapted to the two system platforms at the same time, and third-party input methods cannot freely switch themes.

发明内容Contents of the invention

有鉴于此,本发明实施例提供一种主题资源转换方法、装置及电子设备,能够解决现有的输入法主题资源不能同时适配不同操作系统的问题,本发明能将第一主题资源转换为第二主题资源,使第三方输入法能够弥补目前现有系统原生输入法不能切换主题的不足。In view of this, the embodiment of the present invention provides a theme resource conversion method, device and electronic equipment, which can solve the problem that the existing input method theme resources cannot be adapted to different operating systems at the same time, and the present invention can convert the first theme resource into The second theme resource enables third-party input methods to make up for the inability of native input methods in existing systems to switch themes.

第一方面,本发明实施例提供一种主题资源转换方法,包括:In the first aspect, an embodiment of the present invention provides a theme resource conversion method, including:

获取第一主题资源信息;所述第一主题资源包括原图片;Obtain the first theme resource information; the first theme resource includes the original picture;

在第二主题资源目录下构建用于存放目标图片的图片目录;Build an image directory for storing target images under the second theme resource directory;

通过比较原图片尺寸和预设的目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下;By comparing the size of the original picture with the preset target picture size, the original picture is redrawn or directly copied to the picture directory;

在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。A plist file corresponding to the converted theme resource is generated under the second theme resource directory.

结合第一方面,在第一方面的第一种实施方式中,在所述在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件之后,还包括:In combination with the first aspect, in the first implementation manner of the first aspect, after generating the plist file corresponding to the converted theme resource under the second theme resource directory, it further includes:

将所述第二主题资源目录压缩后存储。The second theme resource directory is compressed and stored.

结合第一方面,在第一方面的第二种实施方式中,所述获取第一主题资源信息,包括:With reference to the first aspect, in the second implementation manner of the first aspect, the acquisition of the first theme resource information includes:

获取第一主题资源的应用标识;Obtain the application identifier of the first theme resource;

根据所述第一主题资源的应用标识,在存储有所述第一主题资源的数据库中查询原图片的存储路径;According to the application identification of the first theme resource, query the storage path of the original picture in the database storing the first theme resource;

生成用于存储原图片信息的第一数组;所述第一数组的数据结构为原图片文件名和对应的原图片存储路径。A first array for storing original picture information is generated; the data structure of the first array is the file name of the original picture and the corresponding storage path of the original picture.

结合第一方面的第二种实施方式,在第一方面的第三种实施方式中,在在第二主题资源目录下构建用于存放目标图片的图片目录之后,还包括:In combination with the second implementation of the first aspect, in the third implementation of the first aspect, after constructing a picture directory for storing target pictures under the second theme resource directory, further include:

在第二主题资源的默认样本资源文件夹中建立用于存储第二主题资源所需的目标图片信息的第二数组;Establishing a second array for storing target picture information required by the second theme resource in the default sample resource folder of the second theme resource;

所述第二数组的数据结构为预设的目标图片文件名和对应的目标图片尺寸;The data structure of the second array is a preset target picture file name and a corresponding target picture size;

其中,所述通过比较原图片尺寸和预设的目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下,包括:Wherein, by comparing the size of the original picture with the preset target picture size, the original picture is redrawn or directly copied to the picture directory, including:

循环遍历所述第一数组,计算第一数组中记录的每张原图片的尺寸;Loop through the first array to calculate the size of each original picture recorded in the first array;

判断第二数组和第一数组中同一图片文件名对应的原图片尺寸与预设的目标图片尺寸是否一致;Judging whether the size of the original picture corresponding to the same picture file name in the second array and the first array is consistent with the preset target picture size;

若同一图片文件名对应的原图片尺寸与目标图片尺寸一致,则将原图片直接复制到所述图片目录下;If the size of the original picture corresponding to the same picture file name is consistent with the size of the target picture, the original picture is directly copied to the picture directory;

若同一图片文件名对应的原图片尺寸与目标图片尺寸不一致,则将原图片重新画图后再存储至所述图片目录下。If the size of the original picture corresponding to the same picture file name is inconsistent with the size of the target picture, the original picture is redrawn and then stored in the picture directory.

结合第一方面的第三种实施方式,在第一方面的第四种实施方式中,所述图片目录包括用于存放目标图片的二倍图片的二倍图片目录和用于存放目标图片的三倍图片的三倍图片目录;With reference to the third implementation manner of the first aspect, in the fourth implementation manner of the first aspect, the picture directory includes a double picture directory for storing the double picture of the target picture and a triple picture directory for storing the target picture Triple picture catalog of double pictures;

所述在第二主题资源的默认样本资源文件夹中建立用于存储第二主题资源所需的目标图片信息的第二数组,还包括:The establishment of the second array for storing the target picture information required by the second theme resource in the default sample resource folder of the second theme resource further includes:

在所述第二主题资源的默认样本资源文件夹中建立用于存储二倍图片信息的第三数组和第五数组,同时建立用于存储三倍图片信息的第四数组和第六数组;所述第三/四数组的数据结构为原图片文件名和对应的目标图片名称、目标图片尺寸;所述第五/六数组的数据结构为原图片文件名和对应的原图片存储路径、目标图片名称、目标图片尺寸;In the default sample resource folder of the second theme resource, a third array and a fifth array for storing double image information are established, and a fourth array and a sixth array for storing triple image information are established simultaneously; The data structure of the third/fourth array is the original picture file name and the corresponding target picture name, the target picture size; the data structure of the fifth/sixth array is the original picture file name and the corresponding original picture storage path, the target picture name, target image size;

其中,所述若同一图片文件名对应的原图片尺寸与目标图片尺寸不一致,则将原图片重新画图后再存储至所述图片目录下,包括:Wherein, if the size of the original picture corresponding to the same picture file name is inconsistent with the size of the target picture, the original picture is redrawn and then stored in the picture directory, including:

将第二数组中目标图片尺寸与第一数组中同一图片文件名对应的原图片尺寸不一致的图片信息复制到所述第三数组和第四数组中;copying the image information whose target image size in the second array is inconsistent with the original image size corresponding to the same image file name in the first array to the third array and the fourth array;

判断第三数组和第四数组中的图片文件名是否能在第一数组中匹配到;Judging whether the picture file names in the third array and the fourth array can be matched in the first array;

若第三数组和第四数组中的图片文件名能在第一数组中匹配到,则根据第一数组记录的存储路径,判断当前匹配到的图片文件名在所述数据库中对应的文件后缀名中是否包含预定字样;If the picture file names in the third array and the fourth array can be matched in the first array, then according to the storage path recorded in the first array, determine the file suffix corresponding to the currently matched picture file name in the database Whether contains the words "predetermined";

若当前匹配到的图片文件名在所述数据库中对应的文件后缀名中包含预定字样,则为第三数组和第四数组中同一图片文件名设置第一属性;若当前匹配到的图片文件名在所述数据库中对应的文件后缀名中不包含预定字样,则为第三数组和第四数组中同一图片文件名设置第二属性;If the currently matched picture file name contains predetermined characters in the corresponding file suffix name in the database, then set the first attribute for the same picture file name in the third array and the fourth array; if the currently matched picture file name If the corresponding file suffix name in the database does not contain the predetermined words, the second attribute is set for the same picture file name in the third array and the fourth array;

将第三数组中具有第一属性/第二属性的图片信息复制到第五数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;将第四数组中具有第一属性/第二属性的图片信息复制到第六数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;Copy the image information with the first attribute/second attribute in the third array to the fifth array, and copy the original image storage path corresponding to the same image name in the first array to the corresponding record in the fifth array; Copy the image information with the first attribute/second attribute in the fourth array to the sixth array, and copy the original image storage path corresponding to the same image name in the first array to the corresponding record in the fifth array;

按照预定画图策略对第五数组和第六数组中记录的原图片进行重新画图;Redrawing the original pictures recorded in the fifth array and the sixth array according to the predetermined drawing strategy;

将根据所述第五数组中记录的原图片生成的新图片存储至所述二倍图片目录下,将根据所述第六数组中记录的原图片生成的新图片存储至所述三倍图片目录下;其中,对于第五数组和第六数组中具有第一属性的图片文件名,存储时在其对应的新图片后缀名中加上所述预定字样。Store the new picture generated according to the original picture recorded in the fifth array into the double picture directory, and store the new picture generated according to the original picture recorded in the sixth array into the triple picture directory Next; where, for the picture file names with the first attribute in the fifth array and the sixth array, add the predetermined word in the corresponding new picture suffix name when storing.

结合第一方面的第四种实施方式,在第一方面的第五种实施方式中,所述在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件,包括:With reference to the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the generation of the plist file corresponding to the converted theme resource under the second theme resource directory includes:

在所述第二主题资源目录下设置要生成第二主题资源的plist文件夹;A plist folder to generate a second theme resource is set under the second theme resource directory;

预设目标图片的第三属性的plist文件信息并保存至预设的第七数组中;Preset the plist file information of the third attribute of the target image and save it in the preset seventh array;

从所述第二主题资源的默认样本资源文件夹中取出关于第二主题资源图片的第三属性的默认plist文件,所述第八数组、第九数组的数据结构为plist文件名和对应的文件中的参数值;Take out the default plist file about the third attribute of the second theme resource picture from the default sample resource folder of the second theme resource, the data structure of the eighth array and the ninth array is the plist file name and the corresponding file parameter value;

将当前取出的关于第二主题资源图片的二倍图片、三倍图片的第三属性的默认plist文件信息分别写入预设的第八数组、第九数组中;所述第八数组、第九数组的数据结构为plist文件名和对应的文件中的参数值;The default plist file information of the third attribute of the double picture and the triple picture about the second theme resource picture currently taken out are respectively written in the preset eighth array and the ninth array; the eighth array, the ninth array The data structure of the array is the plist file name and the parameter value in the corresponding file;

循环遍历所述第七数组,判断第七数组中的plist文件名是否能在第八数组或第九数组中匹配到;Loop through the seventh array to determine whether the plist file name in the seventh array can be matched in the eighth array or the ninth array;

若第七数组中的plist文件名能在第八数组或第九数组中匹配到,则判断当前匹配到的plist文件名对应的文件中的参数值是否与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致;If the plist file name in the seventh array can be matched in the eighth or ninth array, then judge whether the parameter value in the file corresponding to the currently matched plist file name is the same as the plist folder under the first theme resource directory The parameter values in the same plist file are the same;

若当前匹配到的plist文件名对应的文件中的参数值与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致,则将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件复制到所述第二主题资源目录下的plist文件夹中;If the parameter value in the file corresponding to the currently matched plist file name is consistent with the parameter value in the same plist file in the plist folder under the first theme resource directory, then set the default sample resource folder of the second theme resource Copy the file corresponding to the same plist file name in the plist folder under the second theme resource directory;

若当前匹配到的plist文件名对应的文件中的参数值与第一主题资源目录下的plist文件夹中同一plist文件中的参数值不一致,则将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件中的参数值替换为所述第一主题资源目录下的plist文件夹中同一plist文件名对应的文件中的参数值,随后将该文件存储至第二资源目录下的plist文件夹中。If the parameter value in the file corresponding to the currently matched plist file name is inconsistent with the parameter value in the same plist file in the plist folder under the first theme resource directory, then the default sample resource folder of the second theme resource Replace the parameter value in the file corresponding to the same plist file name in the first theme resource directory with the parameter value in the file corresponding to the same plist file name in the plist folder under the first theme resource directory, and then store the file in the second resource directory in the plist folder under.

结合第一方面至第一方面的第五种中任一种实施方式,在第一方面的第六种实施方式中,在所述获取第一主题资源信息之后,还包括:In combination with any one of the first aspect to the fifth implementation manner of the first aspect, in the sixth implementation manner of the first aspect, after the acquisition of the first theme resource information, it further includes:

判断第一主题资源目录下的声音文件夹中是否有音频资源;Determine whether there are audio resources in the sound folder under the first theme resource directory;

若第一主题资源目录下的声音文件夹中有音频资源,则把所述第一主题资源目录下的声音文件夹中的音频资源复制到所述第二主题资源目录下的声音文件夹中;If there is an audio resource in the sound folder under the first theme resource directory, copy the audio resource in the sound folder under the first theme resource directory to the sound folder under the second theme resource directory;

若第一主题资源目录下的声音文件夹中没有音频资源,则把所述第二主题资源的默认音频文件夹中的音频资源复制到第二主题资源目录下的声音文件夹中。If there is no audio resource in the sound folder under the first theme resource directory, copy the audio resource in the default audio folder of the second theme resource to the sound folder under the second theme resource directory.

结合第一方面至第一方面的第五种中任一种实施方式,在第一方面的第七种实施方式中,所述第一主题资源为安卓Android主题资源,第二主题资源为苹果iOS主题资源。In combination with any one of the fifth implementation manners from the first aspect to the first aspect, in the seventh implementation manner of the first aspect, the first theme resource is an Android theme resource, and the second theme resource is an Apple iOS theme resource. Theme resources.

第二方面,本发明实施例提供一种主题资源转换装置,包括:In the second aspect, an embodiment of the present invention provides a theme resource conversion device, including:

获取模块,用于获取第一主题资源信息;所述第一主题资源包括原图片;An acquisition module, configured to acquire first theme resource information; the first theme resource includes an original picture;

配置模块,用于在第二主题资源目录下构建用于存放目标图片的图片目录;The configuration module is used to construct an image directory for storing target images under the second theme resource directory;

图片处理模块,用于通过比较原图片尺寸和预设的目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下;The image processing module is used to redraw the original image or directly copy it to the image directory by comparing the original image size with the preset target image size;

文件生成模块,用于在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。A file generating module, configured to generate a plist file corresponding to the converted theme resource in the second theme resource directory.

结合第二方面,在第二方面的第一种实施方式中,所述主题资源转换装置还包括:With reference to the second aspect, in the first implementation manner of the second aspect, the subject resource conversion device further includes:

压缩模块,用于将所述第二主题资源目录压缩后存储。A compression module, configured to compress and store the second theme resource directory.

结合第二方面,在第二方面的第二种实施方式中,所述获取模块包括:With reference to the second aspect, in a second implementation manner of the second aspect, the acquisition module includes:

标识获取子模块,用于获取第一主题资源的应用标识;The identification obtaining submodule is used to obtain the application identification of the first theme resource;

第一查询子模块,用于根据所述第一主题资源的应用标识,在存储有所述第一主题资源的数据库中查询原图片的存储路径;The first query submodule is used to query the storage path of the original picture in the database storing the first theme resource according to the application identifier of the first theme resource;

第一生成子模块,用于生成用于存储原图片信息的第一数组;所述第一数组的数据结构为原图片文件名和对应的原图片存储路径。The first generation sub-module is used to generate a first array for storing original picture information; the data structure of the first array is the original picture file name and the corresponding original picture storage path.

结合第二方面的第二种实施方式,在第一方面的第三种实施方式中,所述主题资源转换装置还包括:数组建立模块,用于在第二主题资源的默认样本资源文件夹中建立用于存储第二主题资源所需的目标图片信息的第二数组;所述第二数组的数据结构为预设的目标图片文件名和对应的目标图片尺寸;With reference to the second implementation manner of the second aspect, in the third implementation manner of the first aspect, the theme resource conversion device further includes: an array creation module, configured to create an array in the default sample resource folder of the second theme resource Establishing a second array for storing the target picture information required by the second theme resource; the data structure of the second array is the preset target picture file name and the corresponding target picture size;

所述图片处理模块,包括:The image processing module includes:

计算子模块,用于循环遍历所述第一生成子模块生成的第一数组,计算第一数组中记录的每张原图片的尺寸;The calculation submodule is used to loop through the first array generated by the first generation submodule, and calculate the size of each original picture recorded in the first array;

第一判断子模块,用于判断所述第二数组和第一数组中同一图片文件名对应的原图片尺寸与预设的目标图片尺寸是否一致;The first judging submodule is used to judge whether the original picture size corresponding to the same picture file name in the second array and the first array is consistent with the preset target picture size;

第一复制子模块,用于在所述第一判断子模块的判断结果为是时,根据图片倍数将当前判断的原图片直接复制到所述图片目录下;The first copying submodule is used to directly copy the original picture currently judged to the picture directory according to the multiple of the picture when the judgment result of the first judging submodule is yes;

画图子模块,用于在所述第一判断子模块的判断结果为否时,将当前判断的原图片重新画图后再根据图片倍数存储至所述图片目录下。The picture drawing submodule is used to redraw the original picture currently judged and then store it in the picture directory according to the multiple of the picture when the judgment result of the first judgment submodule is negative.

结合第二方面的第三种实施方式,在第二方面的第四种实施方式中,所述配置模块配置的所述图片目录包括用于存放目标图片的二倍图片的二倍图片目录和用于存放目标图片的三倍图片的三倍图片目录;With reference to the third implementation manner of the second aspect, in the fourth implementation manner of the second aspect, the picture directory configured by the configuration module includes a double picture directory for storing the double picture of the target picture and a In the triple picture directory storing the triple picture of the target picture;

所述数组建立模块,还用于在所述第二主题资源的默认样本资源文件夹中建立用于存储二倍图片信息的第三数组和第五数组,同时建立用于存储三倍图片信息的第四数组和第六数组;所述第三/四数组的数据结构为原图片文件名和对应的目标图片名称、目标图片尺寸;所述第五/六数组的数据结构为原图片文件名和对应的原图片存储路径、目标图片名称、目标图片尺寸;The array creation module is also used to create a third array and a fifth array for storing double picture information in the default sample resource folder of the second theme resource, and simultaneously create a third array for storing triple picture information The fourth array and the sixth array; the data structure of the third/fourth array is the original picture file name and the corresponding target picture name, the target picture size; the data structure of the fifth/sixth array is the original picture file name and the corresponding Original picture storage path, target picture name, target picture size;

所述画图子模块,包括:The drawing submodule includes:

第一复制单元,用于将第二数组中目标图片尺寸与第一数组中同一图片文件名对应的原图片尺寸不一致的图片信息复制到所述第三数组和第四数组中;The first copying unit is used to copy the picture information whose size of the target picture in the second array is inconsistent with the size of the original picture corresponding to the same picture file name in the first array to the third array and the fourth array;

第一判断单元,用于判断第三数组和第四数组中的图片文件名是否能在第一数组中匹配到;The first judging unit is used to judge whether the picture file names in the third array and the fourth array can be matched in the first array;

第二判断单元,用于在所述第一判断单元的判断结果为是时,根据第一数组记录的存储路径,判断所述第一判断单元当前匹配到的图片文件名在所述数据库中对应的文件后缀名中是否包含预定字样;The second judging unit is configured to, when the judging result of the first judging unit is yes, judge that the picture file name currently matched by the first judging unit corresponds to in the database according to the storage path of the first array record. Whether the suffix name of the file contains the word "predetermined";

属性设置单元,用于在所述第二判断单元的判断结果为是时,为第三数组和第四数组中同一图片文件名设置第一属性;An attribute setting unit, configured to set the first attribute for the same picture file name in the third array and the fourth array when the judgment result of the second judgment unit is yes;

在所述第二判断单元的判断结果为否时,为第三数组和第四数组中同一图片文件名设置第二属性;When the judgment result of the second judging unit is No, set the second attribute for the same picture file name in the third array and the fourth array;

第二复制单元,用于将第三数组中具有第一属性/第二属性的图片信息复制到第五数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;The second copy unit is used to copy the picture information with the first attribute/second attribute in the third array to the fifth array, and copy the original picture storage path corresponding to the same picture name in the first array to the fifth array Under the corresponding record in;

将第四数组中具有第一属性/第二属性的图片信息复制到第六数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;Copy the image information with the first attribute/second attribute in the fourth array to the sixth array, and copy the original image storage path corresponding to the same image name in the first array to the corresponding record in the fifth array;

画图单元,用于按照预定画图策略对第五数组和第六数组中记录的原图片进行重新画图;A drawing unit, configured to redraw the original pictures recorded in the fifth array and the sixth array according to a predetermined drawing strategy;

存储单元,用于将所述画图单元根据所述第五数组中记录的原图片生成的新图片存储至所述二倍图片目录下,并将所述画图单元根据所述第六数组中记录的原图片生成的新图片存储至所述三倍图片目录下;其中,对于第五数组和第六数组中具有第一属性的图片文件名,存储时在其对应的新图片后缀名中加上预定字样。The storage unit is used to store the new picture generated by the drawing unit according to the original picture recorded in the fifth array in the double picture directory, and store the new picture generated by the drawing unit according to the original picture recorded in the sixth array. The new picture generated by the original picture is stored under the triple picture directory; wherein, for the picture file name with the first attribute in the fifth array and the sixth array, add a predetermined name in its corresponding new picture suffix name when storing typeface.

结合第二方面的第四种实施方式,在第二方面的第五种实施方式中,所述文件生成模块,包括:With reference to the fourth implementation manner of the second aspect, in the fifth implementation manner of the second aspect, the file generation module includes:

第二生成子模块,用于在所述第二主题资源目录下设置要生成第二主题资源的plist文件夹;The second generation submodule is used to set the plist folder to generate the second theme resource under the second theme resource directory;

第一写入子模块,用于预设目标图片的第三属性的plist文件信息并保存至预设的第七数组中;The first writing submodule is used to preset the plist file information of the third attribute of the target picture and save it in the preset seventh array;

读取子模块,用于从所述第二主题资源的默认样本资源文件夹中取出关于第二主题资源图片的第三属性的默认plist文件,所述第二主题资源图片包括二倍图片、三倍图片;The reading submodule is used to take out the default plist file about the third property of the second theme resource picture from the default sample resource folder of the second theme resource, and the second theme resource picture includes double picture, triple double picture;

第二写入子模块,用于将当前取出的关于第二主题资源图片的二倍图片、三倍图片的第三属性的默认plist文件信息分别写入预设的第八数组、第九数组中;所述第八数组、第九数组的数据结构为plist文件名和对应的文件中的参数值;The second writing sub-module is used to write the default plist file information about the third attribute of the second theme resource picture's double picture and triple picture's third attribute that is currently fetched into the preset eighth array and ninth array respectively ; The data structure of the eighth array and the ninth array is the parameter value in the plist file name and the corresponding file;

第二判断子模块,用于循环遍历所述第七数组,判断第七数组中的plist文件名是否能在第八数组或第九数组中匹配到;The second judging submodule is used to loop through the seventh array to judge whether the plist file name in the seventh array can be matched in the eighth array or the ninth array;

第三判断子模块,用于在所述第二判断子模块的判断结果为是时,判断当前匹配到的plist文件名对应的文件中的参数值是否与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致;The third judging submodule is used to determine whether the parameter value in the file corresponding to the currently matched plist file name is the same as the plist folder under the first theme resource directory when the judging result of the second judging submodule is yes The parameter values in the same plist file are the same;

第二复制子模块,用于在所述第三判断子模块的判断结果为是时,将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件复制到所述第二主题资源目录下的plist文件夹中;The second copying submodule is used to copy the file corresponding to the same plist file name in the default sample resource folder of the second theme resource to the second when the judgment result of the third judging submodule is yes In the plist folder under the theme resource directory;

替换子模块,用于在所述第三判断子模块的判断结果为否时,将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件中的参数值替换为所述第一主题资源目录下的plist文件夹中同一plist文件名对应的文件中的参数值,随后将该文件存储至第二资源目录下的plist文件夹中。The replacement submodule is used to replace the parameter value in the file corresponding to the same plist file name in the default sample resource folder of the second theme resource with the specified Describe the parameter values in the file corresponding to the same plist file name in the plist folder under the first theme resource directory, and then store the file in the plist folder under the second resource directory.

结合第二方面至第二方面的第五种中任一种实施方式,在第二方面的第六种实施方式中,所述主题资源转换装置还包括:In combination with any one of the second aspect to the fifth implementation manner of the second aspect, in the sixth implementation manner of the second aspect, the subject resource conversion device further includes:

音频判断模块,用判断第一主题资源目录下的声音文件夹中是否有音频资源;The audio judging module is used to judge whether there are audio resources in the sound folder under the first theme resource directory;

音频复制模块,用于在所述音频判断模块的判断结果为是时,把所述第一主题资源目录下的声音文件夹中的音频资源复制到所述第二主题资源目录下的声音文件夹中;还用于在所述音频判断模块的判断结果为否时,把所述第二主题资源的默认音频文件夹中的音频资源复制到第二主题资源目录下的声音文件夹中。An audio duplication module, used to copy the audio resources in the sound folder under the first theme resource directory to the sound folder under the second theme resource directory when the judgment result of the audio judgment module is yes In; it is also used to copy the audio resource in the default audio folder of the second theme resource to the sound folder under the second theme resource directory when the judgment result of the audio judging module is No.

结合第二方面至第二方面的第五种中任一种实施方式,在第二方面的第七种实施方式中,所述第一主题资源为安卓Android主题资源,第二主题资源为苹果iOS主题资源。In combination with any one of the fifth implementation manners from the second aspect to the second aspect, in the seventh implementation manner of the second aspect, the first theme resource is an Android theme resource, and the second theme resource is an Apple iOS theme resource. Theme resources.

第三方面,本发明实施例提供一种电子设备,所述电子设备包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为上述客户端的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,用于执行前述任一实施例所述的主题资源转换方法。In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to each circuit or device of the above-mentioned client; the memory is used to store the executable program code; the processor runs and executes by reading the executable program code stored in the memory The program corresponding to the program code is used to execute the subject resource conversion method described in any one of the foregoing embodiments.

第四方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时或实现前述任一实施例所述的主题资源转换方法步骤。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the subject described in any of the foregoing embodiments may be realized Resource conversion method steps.

本发明实施例提供的一种主题资源转换方法、装置及电子设备,通过获取第一主题图片资源,在第二主题资源目录下构建用于存放目标图片的二倍图片目录和三倍图片目录复制到后,比较原图片尺寸和目标图片尺寸,将与目标图片尺寸一致的原图片直接复制到第二主题资源目录下的二倍图片目录/三倍图片目录中,一方面,能够充分利用现有第一主题资源,另一方面,对与目标图片尺寸不一致的原图片进行重新画图转换为第二图片资源。本发明解决了同一套输入法主题不能适配两种资源平台的技术难点,大大节省主题制作时间,提升开发人员的工作效率,使第三方输入法能够弥补iOS原生输入法不能切换主题的不足,满足iOS用户对个性化主题的需求。A theme resource conversion method, device, and electronic device provided by an embodiment of the present invention, by obtaining the first theme picture resource, constructing a copy of a double picture directory and a triple picture directory for storing target pictures under the second theme resource directory After arriving, compare the size of the original picture with the size of the target picture, and copy the original picture with the same size as the target picture directly to the double picture directory/triple picture directory under the second theme resource directory. On the one hand, it can make full use of the existing The first theme resource, on the other hand, redraws the original picture whose size is inconsistent with the target picture and converts it into a second picture resource. The invention solves the technical difficulty that the same set of input method themes cannot be adapted to two resource platforms, greatly saves the time for theme creation, improves the work efficiency of developers, and enables third-party input methods to make up for the inability to switch themes of native iOS input methods. Meet the needs of iOS users for personalized themes.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例提供的一种主题资源转换方法的流程图;FIG. 1 is a flowchart of a theme resource conversion method provided by an embodiment of the present invention;

图2为本发明实施例中获取第一主题资源信息的流程示意图;FIG. 2 is a schematic flow diagram of obtaining first theme resource information in an embodiment of the present invention;

图3为图1中步骤103的实施流程图;Fig. 3 is the implementation flowchart of step 103 in Fig. 1;

图4为图3中步骤304的实施流程图;Fig. 4 is the implementation flowchart of step 304 in Fig. 3;

图5为图1中步骤104的实施流程图;Fig. 5 is the implementation flowchart of step 104 in Fig. 1;

图6为本发明一种主题资源转换装置实施例一的结构示意图;FIG. 6 is a schematic structural diagram of Embodiment 1 of a theme resource conversion device according to the present invention;

图7为本发明主题资源转换装置实施例二的结构示意图;FIG. 7 is a schematic structural diagram of Embodiment 2 of the subject resource conversion device of the present invention;

图8为本发明主题资源转换装置实施例三的结构示意图;FIG. 8 is a schematic structural diagram of Embodiment 3 of the subject resource conversion device of the present invention;

图9为本发明主题资源转换装置实施例四的结构示意图;FIG. 9 is a schematic structural diagram of Embodiment 4 of the subject resource conversion device of the present invention;

图10为本发明主题资源转换装置实施例五的结构示意图;FIG. 10 is a schematic structural diagram of Embodiment 5 of the subject resource conversion device of the present invention;

图11为本发明主题资源转换装置实施例六的结构示意图;FIG. 11 is a schematic structural diagram of Embodiment 6 of the subject resource conversion device of the present invention;

图12为本发明电子设备一个实施例的结构示意图。FIG. 12 is a schematic structural diagram of an embodiment of the electronic device of the present invention.

具体实施方式Detailed ways

下面结合附图对本发明实施例一种主题资源转换方案进行详细描述。A theme resource conversion solution according to an embodiment of the present invention will be described in detail below in conjunction with the accompanying drawings.

应当明确,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。It should be clear that the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图1为本发明实施例提供的一种主题资源转换方法的流程图,如图1所示,本实施例的方法可以包括:Fig. 1 is a flowchart of a theme resource conversion method provided by an embodiment of the present invention. As shown in Fig. 1, the method of this embodiment may include:

步骤101、获取第一主题资源信息;其中,所述第一主题资源包括原图片。Step 101. Obtain first theme resource information; wherein, the first theme resource includes original pictures.

本发明中,为方便区分转换前后的资源分类的不同,将转换前的主题资源称为第一主题资源,将转换后的资源称为第二主题资源。In the present invention, for the convenience of distinguishing the difference in resource classification before and after conversion, the theme resource before conversion is called the first theme resource, and the resource after conversion is called the second theme resource.

本步骤中,作为一可选实施例,图2为本发明实施例中获取第一主题资源信息的流程示意图。参见图2,该流程包括:In this step, as an optional embodiment, FIG. 2 is a schematic flowchart of obtaining the first theme resource information in the embodiment of the present invention. Referring to Figure 2, the process includes:

步骤201、获取第一主题资源的应用标识。Step 201. Obtain the application identifier of the first theme resource.

步骤202、根据所述第一主题资源的应用标识,在存储有所述第一主题资源的数据库中查询原图片的存储路径。Step 202, according to the application identifier of the first theme resource, query the storage path of the original picture in the database storing the first theme resource.

本实施例中,用于进行主题资源存储、转换等统一管理的主题资源管理平台(服务器)的数据库中会存储有多种主题资源,各种主题资源之间以其应用标识(如输入法(tid)标识)相互区别,根据tid标识去数据库中查询第一主题资源在服务器存储的路径。本文中为方便说明,将数据库中第一主题资源中的图片称为原图片。In this embodiment, multiple theme resources are stored in the database of the theme resource management platform (server) for unified management such as theme resource storage and conversion, and various theme resources are identified by their application (such as input method ( tid) identifier) are distinguished from each other, and the path stored in the server of the first subject resource is queried in the database according to the tid identifier. In this document, for the convenience of description, the picture in the first theme resource in the database is referred to as the original picture.

步骤203、生成用于存储原图片信息的第一数组。Step 203, generating a first array for storing original picture information.

其中,所述第一数组的数据结构为原图片文件名和对应的原图片存储路径。Wherein, the data structure of the first array is the file name of the original picture and the corresponding storage path of the original picture.

本实施例中,根据tid标识去数据库中查询到第一主题资源的原图片的存储路径,并将原图片的存储路径存入第一数组中,第一数组中存储有原图片文件名和原图片存储路径,且是一一对应关系,即一个图片名称对应一个图片链接。In this embodiment, the storage path of the original picture of the first theme resource is queried in the database according to the tid identifier, and the storage path of the original picture is stored in the first array, and the original picture file name and the original picture are stored in the first array The storage path has a one-to-one correspondence, that is, a picture name corresponds to a picture link.

步骤102、在第二主题资源目录下构建用于存放目标图片的图片目录。Step 102: Construct a picture directory for storing target pictures under the second theme resource directory.

本实施例中,为方便说明,将原图片转换结果(第二主题图片资源)称为目标图片。In this embodiment, for the convenience of description, the conversion result of the original image (the second theme image resource) is referred to as the target image.

步骤103、通过比较原图片尺寸和预设的目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下。Step 103. By comparing the size of the original picture with the preset target picture size, redraw or directly copy the original picture to the picture directory.

本实施例中,预先设置或根据主题资源转换请求自动生成目标图片所需尺寸,通过比较第一主题资源中的原图片尺寸和预设的(所需的)目标图片尺寸,即:将同一图片名称对应的原图片的宽和高与目标图片的宽和高进行比较,如果原图片和目标图片的宽和高相等,代表第一主题资源中的这张图片可以适用于第二主题资源中,将其直接复制到第二主题资源目录中的图片目录下即可;如果原图片和目标图片的宽和高不相等,则需要对原图片重新画图,以将其尺寸转换为目标图片尺寸后该图片才可作为第二主题资源使用。In this embodiment, the required size of the target picture is preset or automatically generated according to the theme resource conversion request, by comparing the original picture size in the first theme resource with the preset (required) target picture size, that is: the same picture Compare the width and height of the original image corresponding to the name with the width and height of the target image. If the width and height of the original image and the target image are equal, it means that the image in the first theme resource can be used in the second theme resource. Just copy it directly to the image directory in the resource directory of the second theme; if the width and height of the original image and the target image are not equal, you need to redraw the original image to convert its size to the target image size. Images can only be used as secondary theme resources.

步骤104、在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。Step 104: Generate a plist file corresponding to the converted theme resource in the second theme resource directory.

其中,可以通过预先设置的超文本预处理器(Hypertext Preprocessor,PHP),用于在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。Wherein, a preset hypertext preprocessor (Hypertext Preprocessor, PHP) may be used to generate a plist file corresponding to the converted theme resource in the second theme resource directory.

本实施例,通过获取第一主题图片资源,在第二主题资源目录下构建用于存放目标图片的图片目录后,比较原图片尺寸和目标图片尺寸,将与目标图片尺寸一致的原图片直接复制到第二主题资源目录下的图片目录中,充分利用现有第一主题资源,并对与目标图片尺寸不一致的原图片进行重新画图转换为第二图片资源,解决了同一套输入法主题不能适配两种资源平台的技术难点,大大节省主题制作时间,提升开发人员的工作效率,使第三方输入法能够弥补iOS原生输入法不能切换主题的不足,满足iOS用户对个性化主题的需求。In this embodiment, by acquiring the first theme image resource, after constructing the image directory for storing the target image under the second theme resource directory, comparing the size of the original image with the size of the target image, and directly copying the original image with the same size as the target image Go to the picture directory under the second theme resource directory, make full use of the existing first theme resources, and redraw the original picture that is inconsistent with the target picture size and convert it into the second picture resource, which solves the problem that the theme of the same input method cannot be adapted Matching the technical difficulties of the two resource platforms greatly saves the theme production time, improves the developer's work efficiency, and enables the third-party input method to make up for the inability of iOS native input methods to switch themes, meeting the needs of iOS users for personalized themes.

本发明实施例中,作为一可选实施例,在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件之后,还可包括:将所述第二主题资源目录压缩后存储至指定位置,例如存储至当前服务器用于存储主题资源的数据库中或其他备份数据库中。In the embodiment of the present invention, as an optional embodiment, after generating the plist file corresponding to the converted theme resource in the second theme resource directory, it may further include: compressing the second theme resource directory Store to a specified location, for example, to the database used by the current server to store theme resources or to other backup databases.

本发明实施例中,作为一可选实施例,在上述步骤102之后,步骤103之前,还可包括:在第二主题资源的默认样本资源文件夹中建立用于存储第二主题资源所需的目标图片信息的第二数组;所述第二数组的数据结构为预设的目标图片文件名和对应的目标图片尺寸。本实施例中,需要将第一数组和第二数组中的图片尺寸进行对比,以确定能够直接使用的第一主题资源图片以及需要重画的图片。具体地,如图3所示,上述步骤103可以包括以下步骤301-304:In this embodiment of the present invention, as an optional embodiment, after the above step 102 and before step 103, it may further include: creating a file required for storing the second theme resource in the default sample resource folder of the second theme resource A second array of target picture information; the data structure of the second array is a preset target picture file name and a corresponding target picture size. In this embodiment, it is necessary to compare the sizes of the pictures in the first array and the second array to determine the first theme resource pictures that can be used directly and the pictures that need to be redrawn. Specifically, as shown in FIG. 3, the above step 103 may include the following steps 301-304:

步骤301、循环遍历所述第一数组,计算第一数组中记录的每张原图片的尺寸。Step 301, loop through the first array, and calculate the size of each original picture recorded in the first array.

步骤302、判断第二数组和第一数组中同一图片文件名对应的原图片尺寸与预设的目标图片尺寸是否一致;若是,则执行步骤303,否则执行步骤304。Step 302 , judging whether the size of the original picture corresponding to the same picture file name in the second array and the first array is consistent with the preset target picture size; if yes, go to step 303 ; otherwise, go to step 304 .

具体实施时后,可以提取第二数组存储的第N(N的初始值为1)条记录中的图片名称去第一数组中进行匹配是否存在同样的图片名称,若匹配到同样的图片名称,则再比较二者的尺寸(宽和高)是否一致。After specific implementation, you can extract the picture name in the Nth record stored in the second array (the initial value of N is 1) and go to the first array to match whether there is the same picture name. If the same picture name is matched, Then compare whether the dimensions (width and height) of the two are consistent.

步骤303、将与目标图片尺寸一致的原图片直接复制到所述图片目录下。Step 303, directly copy the original picture with the same size as the target picture to the picture directory.

对于同一图片名称对应的原图片和目标图片信息,若目标图片尺寸和原图片尺寸一致,则将该原图片直接复制到所述图片目录下。For the information of the original picture and the target picture corresponding to the same picture name, if the size of the target picture is consistent with the size of the original picture, the original picture is directly copied to the picture directory.

步骤304、将与目标图片尺寸不一致的原图片重新画图后再存储至所述图片目录下。Step 304, redraw the original picture whose size is inconsistent with the target picture, and then store it in the picture directory.

本实施例中,建立第二数组来存储需要的第二资源信息,能够通过比较第一数组和第二数组存储的图片资源的主要信息实现原图片的筛选,比较方法简单,筛选效率高,能够充分利用现有的图片资源,减少设计人员重新画图的工作量。In this embodiment, the second array is established to store the required second resource information, and the original image can be screened by comparing the main information of the image resources stored in the first array and the second array. The comparison method is simple and the screening efficiency is high. Make full use of existing image resources and reduce the workload of designers to redraw images.

对于某些主题资源(例如iOS资源)而言,图片资源会有二倍(2X)图片和三倍(3X)图片两种,因此,作为一可选实施例,步骤102中构建的所述图片目录包括用于存放目标图片的二倍图片的二倍图片目录和用于存放目标图片的三倍图片的三倍图片目录。本实施例中,在建立第二数组时,还可包括:在所述第二主题资源的默认样本资源文件夹中建立用于存储2X图片信息的第三数组和第五数组,同时建立用于存储3X图片信息的第四数组和第六数组;所述第三/四数组的数据结构为原图片文件名和对应的目标图片名称、目标图片尺寸;所述第五/六数组的数据结构为原图片文件名和对应的原图片存储路径、目标图片名称、目标图片尺寸。则如图4所示,上述步骤304可以包括以下步骤401-407:For some theme resources (such as iOS resources), there are two types of picture resources: double (2X) picture and triple (3X) picture, therefore, as an optional embodiment, the picture constructed in step 102 The directory includes a double image directory for storing a double image of the target image and a triple image directory for storing a triple image of the target image. In this embodiment, when establishing the second array, it may further include: establishing a third array and a fifth array for storing 2X picture information in the default sample resource folder of the second theme resource, and simultaneously establishing a Store the fourth array and the sixth array of 3X picture information; the data structure of the third/fourth array is the original picture file name and the corresponding target picture name, the target picture size; the data structure of the fifth/sixth array is the original The image file name and the corresponding storage path of the original image, the name of the target image, and the size of the target image. Then as shown in FIG. 4, the above step 304 may include the following steps 401-407:

步骤401、将第二数组中目标图片尺寸与第一数组中同一图片文件名对应的原图片尺寸不一致的图片信息复制到所述第三数组和第四数组中。Step 401. Copy the picture information whose size of the target picture in the second array is different from that of the original picture corresponding to the same picture file name in the first array to the third array and the fourth array.

其中,若第二数组中目标图片尺寸与第一数组中同一图片文件名对应的原图片尺寸不一致,则将该原图片文件名和对应的目标图片名称、目标图片尺寸各复制一份到所述第三数组、第四数组中。Wherein, if the size of the target picture in the second array is inconsistent with the size of the original picture corresponding to the same picture file name in the first array, then copy the original picture file name, the corresponding target picture name, and the target picture size to the first In the third array and the fourth array.

步骤402、判断第三数组和第四数组中的图片文件名是否能在第一数组中匹配到;若是,则执行步骤403。Step 402, judging whether the picture file names in the third array and the fourth array can be matched in the first array; if yes, execute step 403.

本实施例中,若第三数组和第四数组中图片文件名能在第一数组中匹配到,则代表第三数组和第四数组中的图片文件名有对应的第一主题资源,能够采用该图片来源对其进行重新画图后转换为第二主题资源,若是第三数组和第四数组中的图片文件名在到第一数组中不存在,该图片名称无对应图片来源,无法生成所需的第二主题资源图片,新图片生成失败。In this embodiment, if the picture file names in the third array and the fourth array can be matched in the first array, it means that the picture file names in the third array and the fourth array have corresponding first theme resources, and can be used The image source is redrawn and converted to the second theme resource. If the image file name in the third array and the fourth array does not exist in the first array, the image name does not have a corresponding image source, and the required source cannot be generated. Failed to generate a new image for the resource image of the second theme.

步骤403、根据第一数组记录的存储路径,判断当前匹配到的图片文件名在所述数据库中对应的文件后缀名中是否包含预定字样;若是,则执行步骤404,否则执行步骤405。Step 403 : According to the storage path of the first array record, judge whether the currently matched picture file name contains predetermined characters in the corresponding file suffix name in the database; if so, execute step 404 ; otherwise, execute step 405 .

由于第一主题资源中同样的图片名称可能会有两幅,一幅是普通格式,另一幅是预定格式(例如带9.png后缀的格式),若不对其进行区分,可能会导致相关主题资源转换失败或遗漏等错误。则在此若第三数组和第四数组中的图片名称在第一数组中匹配到后,还需要判断其对应的文件后缀名中是否包含预定字样,以对预定格式的图片在重新画图后不改变其格式存储。优选地,所述预定字样为“.9.png”字样。Since there may be two images with the same image name in the first theme resource, one is in a common format and the other is in a predetermined format (for example, the format with a 9.png suffix), if they are not distinguished, it may cause related topics Errors such as resource conversion failures or omissions. Then if the picture names in the third array and the fourth array are matched in the first array, it is also necessary to judge whether the corresponding file suffix contains the predetermined words, so that the pictures in the predetermined format will not be drawn after redrawing. Change its format storage. Preferably, the predetermined character is ".9.png".

步骤404、为第三数组和第四数组中同一图片文件名设置第一属性,继续执行步骤406。Step 404, set the first attribute for the same picture file name in the third array and the fourth array, and continue to execute step 406.

本实施例中,若第一数组中的图片文件名能在第三数组和第四数组中匹配到,且当前匹配到的图片文件名在所述数据库中对应的文件后缀名中包含预定字样,则为第三数组和第四数组中同一图片文件名设置第一属性,第一属性可以为预先定义的一个数值或字符等,例如设置图片文件名对应的属性值为1表示其具有第一属性。In this embodiment, if the picture file name in the first array can be matched in the third array and the fourth array, and the currently matched picture file name contains predetermined words in the corresponding file suffix name in the database, Then set the first attribute for the same image file name in the third array and the fourth array. The first attribute can be a predefined value or character, etc. For example, setting the attribute value corresponding to the image file name to 1 indicates that it has the first attribute .

步骤405、为第三数组和第四数组中同一图片文件名设置第二属性,继续执行步骤406。Step 405: Set the second attribute for the same picture file name in the third array and the fourth array, and continue to execute step 406.

本实施例中,若第一数组中的图片文件名能在第三数组和第四数组中匹配到,但当前匹配到的图片文件名在所述数据库中对应的文件后缀名中不包含预定字样,则为第三数组和第四数组中同一图片文件名设置第二属性,第二属性可以为预先定义的一个数值或字符等,例如设置图片文件名对应的属性值为0表示其具有第二属性。In this embodiment, if the picture file name in the first array can be matched in the third array and the fourth array, but the currently matched picture file name does not contain the predetermined words in the corresponding file suffix name in the database , then set the second attribute for the same image file name in the third array and the fourth array, the second attribute can be a predefined value or character, etc., for example, setting the attribute value corresponding to the image file name to 0 means that it has the second Attributes.

步骤406、将第三、第四数组中具有第一属性/第二属性的图片信息分别复制到第五、第六数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五、第六数组中的相应记录下。Step 406, copy the picture information with the first attribute/second attribute in the third and fourth arrays to the fifth and sixth arrays respectively, and copy the original picture storage path corresponding to the same picture name in the first array to The corresponding records in the fifth and sixth arrays.

具体地,将第三数组中具有第一属性/第二属性的图片信息复制到第五数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;将第四数组中具有第一属性/第二属性的图片信息复制到第六数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下Specifically, copy the picture information with the first attribute/second attribute in the third array to the fifth array, and copy the original picture storage path corresponding to the same picture name in the first array to the corresponding record in the fifth array Next; copy the image information with the first attribute/second attribute in the fourth array to the sixth array, and copy the original image storage path corresponding to the same image name in the first array to the corresponding record in the fifth array

根据上述说明可知,第三、第四数组中具有第一/第二属性的图片信息对应的图片名称为能在第一数组中匹配到的,即具有第一主题图片资源的,能够对这些图片进行重新画图后转换为第二主题图片资源。因此,此步骤中将第三数组中具有第一属性的图片信息以及具有第二属性的图片信息均复制到第五数组中,同时获取复制到第五数组中的每个图片名称在第一数组中对应的图片存储路径也复制到第五数组中的相应记录下,第四数组类似操作,不再赘述。According to the above description, it can be seen that the picture names corresponding to the picture information with the first/second attribute in the third and fourth arrays can be matched in the first array, that is, those with the first theme picture resource, and these pictures can be Convert to the second theme image resource after redrawing. Therefore, in this step, the image information with the first attribute and the image information with the second attribute in the third array are copied to the fifth array, and at the same time, the name of each image copied to the fifth array is obtained in the first array The corresponding picture storage path in is also copied to the corresponding record in the fifth array, and the fourth array is similarly operated, and will not be repeated here.

步骤407、按照预定画图策略对第五数组和第六数组中记录的原图片进行重新画图。Step 407: Redraw the original pictures recorded in the fifth array and the sixth array according to a predetermined drawing strategy.

其中,对于第五数组中记录的原图片,将其重新画图为二倍图片形式的第二主题资源图片,并将第六数组中记录的原图片重新画图为三倍图片形式的第二主题资源图片。例如,第五数组中记录的原图片文件名为“flower”,根据预定画图策略对其重新画图后得到的目标图片文件名为“flower@2x”;类似地,对于第六数组中记录的原图片文件名为“flower”的图片,根据预定画图策略对其重新画图后得到的目标图片文件名为“flower@3x”。Among them, for the original picture recorded in the fifth array, it is redrawn as a second theme resource picture in the form of a double picture, and the original picture recorded in the sixth array is redrawn as a second theme resource in the form of a triple picture picture. For example, the original image file recorded in the fifth array is named "flower", and the target image file obtained after redrawing it according to the predetermined drawing strategy is named "flower@2x"; similarly, for the original image file recorded in the sixth array For the picture whose picture file name is "flower", the target picture file name obtained after redrawing it according to the predetermined drawing strategy is "flower@3x".

步骤408、将根据第五/第六数组中记录的原图片生成的新图片存储至所述二倍/三倍图片目录下。Step 408: Store the new picture generated according to the original picture recorded in the fifth/sixth array in the double/triple picture directory.

其中,在存储时将第五数组和第六数组中具有第一属性的图片文件名对应的新图片文件后缀名中加上预定字样。Wherein, during storage, a predetermined word is added to the suffix name of the new picture file corresponding to the picture file name having the first attribute in the fifth array and the sixth array.

具体地,将根据所述第五数组中记录的原图片生成的新图片存储至所述二倍图片目录下,将根据所述第六数组中记录的原图片生成的新图片存储至所述三倍图片目录下;其中,对于第五数组和第六数组中具有第一属性的图片文件名,存储时在其对应的新图片后缀名中加上所述预定字样。而对于第五数组和第六数组中具有第二属性的图片文件名对应的新图片,存储为具有常规图片后缀名的图片文件即可。Specifically, store the new picture generated according to the original picture recorded in the fifth array in the double picture directory, and store the new picture generated according to the original picture recorded in the sixth array in the third double picture directory; wherein, for the picture file names with the first attribute in the fifth array and the sixth array, add the predetermined word in the corresponding new picture suffix name when storing. For the new pictures corresponding to the picture file names with the second attribute in the fifth array and the sixth array, it is only necessary to store them as picture files with conventional picture suffixes.

例如,第五数组中记录的图片文件名为“flower”,对应图片后缀为“.9.png”,上一步骤根据预定画图策略对其重新画图后得到的目标图片文件名为“flower@2x”;则在将该“flower@2x”新图片存储至所述二倍图片目录下时,将该图片文件存储为“flower@2x.9.png”。For example, the picture file name recorded in the fifth array is "flower", and the corresponding picture suffix is ".9.png". The target picture file name obtained after redrawing it according to the predetermined drawing strategy in the previous step is "flower@2x "; then when the new picture "flower@2x" is stored in the double picture directory, the picture file is stored as "flower@2x.9.png".

本实施例,对于转换后图片尺寸需求与原图片尺寸不一致的图片进行重新画图,且在重新画图过程中对预定格式的图片画图后仍以该预定格式存储,图片资源转换后不会改变预定格式图片的格式。In this embodiment, redrawing is performed on pictures whose converted picture size requirements are inconsistent with the original picture size, and during the redrawing process, pictures in a predetermined format are still stored in the predetermined format after being drawn, and the predetermined format will not be changed after the picture resource is converted. The format of the picture.

本发明实施例中,作为一可选实施例,如图5所示,上述步骤104可以包括以下步骤501-508:In the embodiment of the present invention, as an optional embodiment, as shown in FIG. 5, the above step 104 may include the following steps 501-508:

步骤501、在所述第二主题资源目录下设置要生成第二主题资源的plist文件夹。Step 501, setting a plist folder to generate a second theme resource under the second theme resource directory.

步骤502、预设目标图片的第三属性的plist文件信息并保存至预设的第七数组中。Step 502, preset the plist file information of the third attribute of the target picture and save it in the preset seventh array.

其中,所述图片的第三属性可以是图片的色值等属性。Wherein, the third attribute of the picture may be an attribute such as a color value of the picture.

此步骤中,预先设置目标图片的第三属性的plist文件信息,即需要存储到上一步骤中设置的plist文件夹中的关于目标图片的第三属性的一个或多个plist文件信息;并可以通过预先设置一脚本,在该脚本中预先设置第七数组,第七数组用于记录关于目标图片的第三属性的plist文件信息,第七数组的数据结构可以为pist文件名。In this step, the plist file information of the third attribute of the target picture is preset, that is, one or more plist file information about the third attribute of the target picture that needs to be stored in the plist folder set in the previous step; and can By presetting a script, the seventh array is preset in the script, the seventh array is used to record the plist file information about the third attribute of the target picture, and the data structure of the seventh array may be a pist file name.

步骤503、从所述第二主题资源的默认样本资源文件夹中取出关于第二主题资源图片的第三属性的默认plist文件。Step 503 , fetch a default plist file about the third attribute of the picture of the second theme resource from the default sample resource folder of the second theme resource.

即:从所述第二主题资源的默认样本资源文件夹中取出默认的第二主题资源图片的第三属性的plist文件,此处第二主题资源图片包括二倍图片和三倍图片。Namely: take out the plist file of the third attribute of the default second theme resource picture from the default sample resource folder of the second theme resource, where the second theme resource picture includes a double picture and a triple picture.

步骤504、将当前取出的关于第二主题资源图片的二倍图片、三倍图片的第三属性的默认plist文件信息分别写入预设的第八数组、第九数组中。Step 504 : Write the default plist file information about the third attribute of the double picture and triple picture of the second theme resource picture taken out into the preset eighth and ninth arrays respectively.

其中,预先设置第八数组、第九数组,所述第八数组、第九数组的数据结构为plist文件名和对应的文件中的参数值。第八数组用于存储关于第二主题资源图片的2X图片的第三属性的默认plist文件信息,第九数组用于存储关于第二主题资源图片的3X图片的第三属性的默认plist文件信息。Wherein, the eighth array and the ninth array are preset, and the data structures of the eighth array and the ninth array are plist file names and parameter values in the corresponding files. The eighth array is used to store the default plist file information about the third property of the 2X picture of the second theme resource picture, and the ninth array is used to store the default plist file information about the third property of the 3X picture of the second theme resource picture.

步骤505、循环遍历所述第七数组,判断第七数组中的plist文件名是否能在第八数组或第九数组中匹配到;若是,则执行步骤506。Step 505, loop through the seventh array, and judge whether the plist file name in the seventh array can be matched in the eighth array or the ninth array; if yes, execute step 506.

此步骤中,循环遍历所述第七数组,判断第七数组中预设的目标图片的第三属性的plist文件名是否能匹配到默认的plist文件。In this step, loop through the seventh array, and judge whether the plist file name of the third attribute of the preset target picture in the seventh array can match the default plist file.

步骤506、判断当前匹配到的plist文件名对应的文件中的参数值是否与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致;若是,则执行步骤507,否则执行步骤508。Step 506, judge whether the parameter value in the file corresponding to the currently matched plist file name is consistent with the parameter value in the same plist file in the plist folder under the first theme resource directory; if so, execute step 507, otherwise execute step 508.

此步骤中,判断当前匹配到的默认plist文件中的参数值是否与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致。In this step, it is determined whether the parameter values in the currently matched default plist file are consistent with the parameter values in the same plist file in the plist folder under the first theme resource directory.

步骤507、将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件复制到所述第二主题资源目录下的plist文件夹中。Step 507. Copy the file corresponding to the same plist file name in the default sample resource folder of the second theme resource to the plist folder under the second theme resource directory.

本实施例中,若步骤505在第八数组或第九数组中能够匹配到第七数组中的plist文件名,且步骤506中判断出该匹配到的文件名对应的文件中的参数值与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致,则将第二主题资源的默认样本资源文件夹中的该plist文件名对应的文件复制到所述第二主题资源目录下的plist文件夹中。In this embodiment, if step 505 can match the plist file name in the seventh array in the eighth array or the ninth array, and it is determined in step 506 that the parameter value in the file corresponding to the matched file name is the same as the first The parameter values in the same plist file in the plist folder under the theme resource directory are consistent, then the file corresponding to the plist file name in the default sample resource folder of the second theme resource is copied to the second theme resource directory in the plist folder.

步骤508、将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件中的参数值替换为所述第一主题资源目录下的plist文件夹中同一plist文件名对应的文件中的参数值,随后将该文件存储至第二资源目录下的plist文件夹中。Step 508, replace the parameter value in the file corresponding to the same plist file name in the default sample resource folder of the second theme resource with the parameter value corresponding to the same plist file name in the plist folder under the first theme resource directory The parameter value in the file, and then store the file in the plist folder under the second resource directory.

本实施例中,若步骤505在第八数组或第九数组中能够匹配到第七数组中的plist文件名,且步骤506中判断出该匹配到的文件名对应的文件中的参数值与第一主题资源目录下的plist文件夹中同一plist文件中的参数值不一致,则使用第一主题资源目录下的plist文件夹中同一plist文件名对应的文件中的参数值作为第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件中的参数值,从而保证第一主题资源对应的第三属性对应的参数值转换为第二主题资源对应的第三属性对应的参数值不变。In this embodiment, if step 505 can match the plist file name in the seventh array in the eighth array or the ninth array, and it is determined in step 506 that the parameter value in the file corresponding to the matched file name is the same as the first If the parameter values in the same plist file in the plist folder under the first theme resource directory are inconsistent, use the parameter values in the file corresponding to the same plist file name in the plist folder under the first theme resource directory as the default for the second theme resource The parameter value in the file corresponding to the same plist file name in the sample resource folder, so as to ensure that the parameter value corresponding to the third attribute corresponding to the first theme resource is converted into the parameter value corresponding to the third attribute corresponding to the second theme resource. .

本发明实施例中,作为一可选实施例,在上述任一实施例中获取第一主题资源信息之后,还可包括步骤:判断第一主题资源目录下的声音文件夹中是否有音频资源;若是,则把所述第一主题资源目录下的声音文件夹中的音频资源复制到所述第二主题资源目录下的声音文件夹中;否则,把所述第二主题资源的默认音频文件夹中的音频资源复制到第二主题资源目录下的声音文件夹中。本实施例中,若第一主题资源有音频资源,则将其直接复制到第二主题资源目录下的声音文件夹中作为转换后的第二主题资源的配套音频文件,若第一主题资源没有音频资源,则使用第二主题资源自己的默认音频资源。In the embodiment of the present invention, as an optional embodiment, after obtaining the first theme resource information in any of the above-mentioned embodiments, a step may also be included: judging whether there is an audio resource in the sound folder under the first theme resource directory; If so, copy the audio resource in the sound folder under the first theme resource directory to the sound folder under the second theme resource directory; otherwise, copy the default audio folder of the second theme resource Copy the audio resources in to the sound folder under the resource directory of the second theme. In this embodiment, if the first theme resource has an audio resource, it is directly copied to the sound folder under the second theme resource directory as a supporting audio file of the converted second theme resource; if the first theme resource does not have Audio resource, use the default audio resource of the second theme resource itself.

本发明实施例中,作为一可选实施例,也可以在步骤104完成之后,再进行音频资源的手动配置,具体地,在步骤104之后,还可以包括步骤:接收对第一主题资源中音频资源的选定;将当前被选定的音频资源复制到第二主题资源目录下的声音文件夹中。In this embodiment of the present invention, as an optional embodiment, after step 104 is completed, manual configuration of audio resources may be performed. Specifically, after step 104, a step may also be included: receiving the audio resource in the first theme resource Resource selection; copy the currently selected audio resource to the sound folder under the resource directory of the second theme.

优选地,上述第一主题资源为为安卓Android主题资源,第二主题资源为苹果iOS主题资源。本发明提供的方法尤其适用于将Android主题资源转换为iOS主题资源。Preferably, the above-mentioned first theme resource is an Android theme resource, and the second theme resource is an Apple iOS theme resource. The method provided by the invention is especially suitable for converting Android theme resources into iOS theme resources.

下面采用两个具体的实施例,对图1~图5中任一个所示方法实施例的技术方案进行详细说明。The technical solution of any one of the method embodiments shown in FIG. 1 to FIG. 5 will be described in detail below using two specific embodiments.

在一个具体实施例一中,用户需要把一个Android主题转化成iOS主题,则通过以下步骤实施:In a specific embodiment one, the user needs to convert an Android theme into an iOS theme, and then implement it through the following steps:

(1)用户从Android主题后台选取待转换主题后点击预定的转换请求按钮,例如可以在客户端显示屏上显示“一键转iOS资源”按钮;(1) The user selects the theme to be converted from the background of the Android theme and clicks the predetermined conversion request button, for example, the "one-click transfer to iOS resources" button can be displayed on the client display screen;

(2)服务器根据上述任一实施例提供的方法对所述待转换主题进行主题资源转换,转换完毕后会向用户发送相应的资源转换完毕通知以提醒用户是否对转换好的iOS主题资源进行下载;(2) The server performs theme resource conversion on the theme to be converted according to the method provided in any of the above-mentioned embodiments, and after the conversion is completed, a corresponding resource conversion completion notification will be sent to the user to remind the user whether to download the converted iOS theme resource ;

(3)用户下载转换好的iOS资源包并打开,可看到里面有2X文件夹和3X文件夹,两个文件夹里分别有三个文件:文件一:images;文件二:sound;文件三:theme.plist;(3) The user downloads the converted iOS resource package and opens it. You can see that there are 2X folders and 3X folders. There are three files in the two folders: file 1: images; file 2: sound; file 3: theme.plist;

(4)用户在服务器提供的iOS主题管理后台新建一个iOS主题,将上一步骤下载的iOS资源包中的2X文件夹和3X文件夹配置到新主题里面并点击上架,则iOS主题配置完成,该主题资源可正常显示和使用在iOS端。(4) The user creates a new iOS theme in the iOS theme management background provided by the server, configures the 2X folder and 3X folder in the iOS resource package downloaded in the previous step into the new theme and clicks on the shelf, and the iOS theme configuration is completed. The theme resource can be displayed and used normally on the iOS side.

在一个具体实施例二中,用户需要从Android主题中选取音效资源配置到iOS主题里,则通过以下步骤实施:In a specific embodiment 2, the user needs to select the sound effect resource from the Android theme and configure it in the iOS theme, and implement it through the following steps:

(1)用户从Android主题后台选取需要转换的资源主题后点击点击预定的转换请求按钮,例如可以在客户端显示屏上显示“一键转iOS资源”按钮;(1) The user selects the resource theme to be converted from the background of the Android theme, and then clicks on the predetermined conversion request button, for example, the "one-key conversion to iOS resources" button can be displayed on the client display screen;

(2)服务器根据上述任一实施例提供的方法对所述待转换主题进行主题资源转换,转换完毕后会向用户发送相应的资源转换完毕通知以提醒用户是否对转换好的iOS主题资源进行下载;(2) The server performs theme resource conversion on the theme to be converted according to the method provided in any of the above-mentioned embodiments, and after the conversion is completed, a corresponding resource conversion completion notification will be sent to the user to remind the user whether to download the converted iOS theme resource ;

(3)用户下载转换好的iOS资源包并打开,可看到里面有2X文件夹和3X文件夹,两个文件夹里分别有三个文件:文件一:images;文件二:sound;文件三:theme.plist;(3) The user downloads the converted iOS resource package and opens it. You can see that there are 2X folders and 3X folders. There are three files in the two folders: file 1: images; file 2: sound; file 3: theme.plist;

(4)用户从待转换主题的sounds文件夹(Android主题资源的sounds文件夹)中选取所需的音效文件替换到下载好的iOS主题资源包的2X、3X两个文件夹里的sounds文件中;(4) The user selects the required sound effect files from the sounds folder of the theme to be converted (the sounds folder of Android theme resources) and replaces them in the sounds files in the 2X and 3X folders of the downloaded iOS theme resource package ;

(5)在iOS主题管理后台找到要待转换主题的标识符,将替换好音效资源的2X、3X两个文件夹更新至iOS主题中心,iOS主题更新完成,可正常显示和使用在iOS端。(5) Find the identifier of the theme to be converted in the iOS theme management background, and update the 2X and 3X folders of the replaced audio resources to the iOS theme center. The iOS theme update is completed and can be displayed and used on the iOS side normally.

本发明提供的主题资源转换方法有效的解决了同一套输入法主题不能适配Android和iOS两个平台的技术难点,充分利用了现有资源,大大节省主题制作时间,提升开发人员的工作效率。且使第三方输入法能够弥补iOS原生输入法不能切换主题的不足,满足iOS用户对个性化主题的需求。The theme resource conversion method provided by the present invention effectively solves the technical difficulty that the same set of input method themes cannot be adapted to both Android and iOS platforms, makes full use of existing resources, greatly saves theme production time, and improves the work efficiency of developers. And the third-party input method can make up for the deficiency that iOS native input methods cannot switch themes, and meet the needs of iOS users for personalized themes.

图6为本发明一种主题资源转换装置实施例一的结构示意图,如图6所示,本实施例的装置可以包括:获取模块11、配置模块12、图片处理模块13和文件生成模块14;FIG. 6 is a schematic structural diagram of Embodiment 1 of a subject resource conversion device according to the present invention. As shown in FIG. 6 , the device of this embodiment may include: an acquisition module 11, a configuration module 12, a picture processing module 13, and a file generation module 14;

其中,获取模块11,用于获取第一主题资源信息;Wherein, the obtaining module 11 is used to obtain the first theme resource information;

所述第一主题资源包括原图片;The first theme resource includes an original picture;

配置模块12,用于在第二主题资源目录下构建用于存放目标图片的图片目录;The configuration module 12 is used to construct a picture directory for storing target pictures under the second theme resource directory;

图片处理模块13,用于通过比较原图片尺寸和预设的目标图片尺寸,将原图片重新画图或直接复制到所述图片目录下;The image processing module 13 is used to redraw the original image or directly copy it to the image directory by comparing the original image size with the preset target image size;

文件生成模块14,用于在所述第二主题资源目录下生成本次转换后的主题资源对应的plist文件。其中,第二主题资源目录存储在服务端数据库中。The file generating module 14 is configured to generate a plist file corresponding to the converted theme resource in the second theme resource directory. Wherein, the second theme resource directory is stored in the server database.

本实施例的装置,可以用于执行图1所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to implement the technical solution of the method embodiment shown in FIG. 1 , and its implementation principle and technical effect are similar, and will not be repeated here.

图7为本发明主题资源转换装置实施例二的结构示意图,如图7所示,本实施例的装置在图6所示装置结构的基础上,进一步地,还包括:Fig. 7 is a schematic structural diagram of Embodiment 2 of the subject resource conversion device of the present invention. As shown in Fig. 7, the device of this embodiment further includes:

压缩模块15,用于将所述第二主题资源目录压缩后存储。The compression module 15 is configured to compress and store the second theme resource directory.

图8为本发明主题资源转换装置实施例三的结构示意图,如图8所示,本实施例的装置在图6所示装置结构的基础上,进一步地,获取模块11包括:Fig. 8 is a schematic structural diagram of the third embodiment of the subject resource conversion device of the present invention. As shown in Fig. 8, the device of this embodiment is based on the structure of the device shown in Fig. 6, and further, the acquisition module 11 includes:

标识获取子模块111、第一查询子模块112和第一生成子模块113;Identify the acquisition submodule 111, the first query submodule 112 and the first generation submodule 113;

其中,标识获取子模块111,用于获取第一主题资源的应用标识;Wherein, the identification obtaining sub-module 111 is used to obtain the application identification of the first theme resource;

第一查询子模块112,用于根据所述第一主题资源的应用标识,在存储有所述第一主题资源的数据库中查询原图片的存储路径;The first query submodule 112 is used to query the storage path of the original picture in the database storing the first theme resource according to the application identifier of the first theme resource;

第一生成子模块113,用于生成用于存储原图片信息的第一数组;所述第一数组的数据结构为原图片文件名和对应的原图片存储路径。The first generation sub-module 113 is configured to generate a first array for storing original picture information; the data structure of the first array is the original picture file name and the corresponding original picture storage path.

本实施例的装置,可以用于执行图1或图2所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to execute the technical solution of the method embodiment shown in FIG. 1 or FIG. 2 , and its implementation principle and technical effect are similar, and will not be repeated here.

图9为本发明主题资源转换装置实施例四的结构示意图,如图9所示,本实施例的装置在图8所示装置结构的基础上,进一步地,主题资源转换装置还包括数组建立模块16,用于在第二主题资源的默认样本资源文件夹中建立用于存储第二主题资源所需的目标图片信息的第二数组;Fig. 9 is a schematic structural diagram of Embodiment 4 of the theme resource conversion device of the present invention. As shown in Fig. 9, the device of this embodiment is based on the structure of the device shown in Fig. 8, and further, the theme resource conversion device further includes an array building module 16. It is used to create a second array for storing target picture information required by the second theme resource in the default sample resource folder of the second theme resource;

所述第二数组的数据结构为预设的目标图片文件名和对应的目标图片尺寸。此外,图片处理模块13,包括:The data structure of the second array is a preset target picture file name and a corresponding target picture size. In addition, the image processing module 13 includes:

计算子模块131、第一判断子模块132、第一复制子模块133和画图子模块134;Calculation submodule 131, first judgment submodule 132, first copy submodule 133 and drawing submodule 134;

其中,计算子模块131,用于循环遍历所述第一生成子模块113生成的第一数组,计算第一数组中记录的每张原图片的尺寸;Wherein, the calculation submodule 131 is used to loop through the first array generated by the first generation submodule 113, and calculate the size of each original picture recorded in the first array;

第一判断子模块132,用于判断所述第二数组和第一数组中同一图片文件名对应的原图片尺寸与预设的目标图片尺寸是否一致;The first judging submodule 132 is used to judge whether the original picture size corresponding to the same picture file name in the second array and the first array is consistent with the preset target picture size;

第一复制子模块133,用于在所述第一判断子模块132的判断结果为是时,将当前判断的原图片直接复制到所述图片目录下;The first copying submodule 133 is used to directly copy the original picture currently judged to the picture directory when the judging result of the first judging submodule 132 is yes;

画图子模块134,用于在所述第一判断子模块132的判断结果为否时,将当前判断的原图片重新画图后再存储至所述图片目录下。The picture drawing sub-module 134 is used for re-drawing the currently judged original picture and then storing it in the picture directory when the judgment result of the first judgment sub-module 132 is negative.

本实施例的装置,可以用于执行图1或图2或图3所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to implement the technical solution of the method embodiment shown in FIG. 1 or FIG. 2 or FIG. 3 , and its implementation principle and technical effect are similar, and will not be repeated here.

图10为本发明主题资源转换装置实施例五的结构示意图,如图10所示,本实施例的装置在图9所示装置结构的基础上,进一步地,Fig. 10 is a schematic structural diagram of Embodiment 5 of the subject resource conversion device of the present invention. As shown in Fig. 10, the device of this embodiment is based on the structure of the device shown in Fig. 9, and further,

配置模块12,用于配置的所述图片目录包括用于存放目标图片的二倍图片的二倍图片目录和用于存放目标图片的三倍图片的三倍图片目录;Configuration module 12, the picture directory used for configuration includes a double picture directory for storing a double picture of the target picture and a triple picture directory for storing a triple picture of the target picture;

数组建立模块16,还用于在所述第二主题资源的默认样本资源文件夹中建立用于存储二倍图片信息的第三数组和第五数组,同时建立用于存储三倍图片信息的第四数组和第六数组;The array building module 16 is also used to set up a third array and a fifth array for storing double picture information in the default sample resource folder of the second theme resource, and simultaneously set up a third array for storing triple picture information Four arrays and sixth array;

所述第三/四数组的数据结构为原图片文件名和对应的目标图片名称、目标图片尺寸;The data structure of the third/fourth array is the original picture file name and the corresponding target picture name, target picture size;

所述第五/六数组的数据结构为原图片文件名和对应的原图片存储路径、目标图片名称、目标图片尺寸。The data structure of the fifth/sixth array is the file name of the original picture and the corresponding storage path of the original picture, the name of the target picture, and the size of the target picture.

此外,本实施例中,画图子模块134,包括:第一复制单元21、第一判断单元22、第二判断单元23、属性设置单元24、第二复制单元25、画图单元26和存储单元27。In addition, in this embodiment, the drawing submodule 134 includes: a first copying unit 21, a first judging unit 22, a second judging unit 23, an attribute setting unit 24, a second copying unit 25, a drawing unit 26 and a storage unit 27 .

图10中,Figure 10,

第一复制单元21,用于将第二数组中目标图片尺寸与第一数组中同一图片文件名对应的原图片尺寸不一致的图片信息复制到所述第三数组和第四数组中;The first copying unit 21 is used to copy the picture information whose size of the target picture in the second array is inconsistent with the size of the original picture corresponding to the same picture file name in the first array to the third array and the fourth array;

第一判断单元22,用于判断第三数组和第四数组中的每个图片文件名是否能在第一数组中匹配到;The first judging unit 22 is used to judge whether each picture file name in the third array and the fourth array can be matched in the first array;

第二判断单元23,用于在所述第一判断单元22的判断结果为是时,根据第一数组记录的存储路径,判断所述第一判断单元22当前匹配到的图片文件名在所述数据库中对应的文件后缀名中是否包含预定字样;The second judging unit 23 is configured to judge that the picture file name currently matched by the first judging unit 22 is in the Whether the corresponding file suffix in the database contains the word "predetermined";

属性设置单元24,用于在所述第二判断单元23的判断结果为是时,为第三数组和第四数组中同一图片文件名设置第一属性,并在所述第二判断单元23的判断结果为否时,为第三数组和第四数组中同一图片文件名设置第二属性;The attribute setting unit 24 is used to set the first attribute for the same picture file name in the third array and the fourth array when the judgment result of the second judging unit 23 is yes, and in the second judging unit 23 When the judgment result is no, set the second attribute for the same picture file name in the third array and the fourth array;

第二复制单元25,用于在属性设置单元24设置完后,将第三数组中具有第一属性/第二属性的图片信息复制到第五数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;The second copying unit 25 is used to copy the picture information with the first attribute/second attribute in the third array to the fifth array after the attribute setting unit 24 is set, and correspond to the same picture name in the first array Copy the storage path of the original picture to the corresponding record in the fifth array;

还用于将第四数组中具有第一属性/第二属性的图片信息复制到第六数组中,并将第一数组中同一图片名称对应的原图片存储路径复制到第五数组中的相应记录下;It is also used to copy the image information with the first attribute/second attribute in the fourth array to the sixth array, and copy the original image storage path corresponding to the same image name in the first array to the corresponding record in the fifth array Down;

画图单元26,用于在第二复制单元25复制完信息后,按照预定画图策略对第五数组和第六数组中记录的原图片进行重新画图,存储单元27,用于将画图单元26根据所述第五数组中记录的原图片生成的新图片存储至所述二倍图片目录下,并将所述画图单元根据所述第六数组中记录的原图片生成的新图片存储至所述三倍图片目录下;其中,对于第五数组和第六数组中具有第一属性的图片文件名,存储时在其对应的新图片后缀名中加上预定字样。。The drawing unit 26 is used for redrawing the original pictures recorded in the fifth array and the sixth array according to a predetermined drawing strategy after the second copying unit 25 has copied the information, and the storage unit 27 is used for drawing the drawing unit 26 according to the predetermined drawing strategy. The new picture generated by the original picture recorded in the fifth array is stored in the double picture directory, and the new picture generated by the drawing unit according to the original picture recorded in the sixth array is stored in the triple Under the picture directory; wherein, for the picture file names with the first attribute in the fifth array and the sixth array, add a predetermined word in its corresponding new picture suffix name when storing. .

本实施例的装置,可以用于执行图1或图2或图3或图4所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to execute the technical solution of the method embodiment shown in FIG. 1 or FIG. 2 or FIG. 3 or FIG. 4 , and its implementation principle and technical effect are similar, and will not be repeated here.

图11为本发明主题资源转换装置实施例六的结构示意图,如图11所示,本实施例的装置在图6所示装置结构的基础上,进一步地,文件生成模块14包括:第二生成子模块141、第一写入子模块142、读取子模块143、第二写入子模块144、第二判断子模块145、第三判断子模块146、第二复制子模块147和替换子模块148;其中,Fig. 11 is a schematic structural diagram of Embodiment 6 of the subject resource conversion device of the present invention. As shown in Fig. 11, the device of this embodiment is based on the structure of the device shown in Fig. 6, further, the file generation module 14 includes: the second generation Submodule 141, first writing submodule 142, reading submodule 143, second writing submodule 144, second judging submodule 145, third judging submodule 146, second copying submodule 147 and replacement submodule 148; of which,

第二生成子模块141,用于在所述第二主题资源目录下设置要生成第二主题资源的plist文件夹;The second generation sub-module 141 is used to set a plist folder to generate a second theme resource under the second theme resource directory;

第一写入子模块142,用于预设目标图片的第三属性的plist文件信息并保存至预设的第七数组中;The first writing sub-module 142 is used to preset the plist file information of the third attribute of the target picture and save it in the preset seventh array;

读取子模块143,用于从所述第二主题资源的默认样本资源文件夹中取出关于第二主题资源图片的第三属性的默认plist文件,所述第二主题资源图片包括二倍图片、三倍图片;The reading submodule 143 is used to take out the default plist file about the third attribute of the second theme resource picture from the default sample resource folder of the second theme resource, and the second theme resource picture includes a double picture, Triple picture;

第二写入子模块144,用于将当前取出的关于第二主题资源图片的二倍图片、三倍图片的第三属性的默认plist文件信息分别写入预设的第八数组、第九数组中;The second writing sub-module 144 is used to write the default plist file information of the third attribute of the double image and the triple image currently taken out into the preset eighth array and the ninth array respectively middle;

所述第八数组、第九数组的数据结构为plist文件名和对应的文件中的参数值;第二判断子模块145,用于循环遍历所述第七数组,判断第七数组中的plist文件名是否能在第八数组或第九数组中匹配到;The data structures of the eighth array and the ninth array are plist filenames and parameter values in corresponding files; the second judging submodule 145 is used to cycle through the seventh array to judge the plist filename in the seventh array Whether it can be matched in the eighth array or the ninth array;

第三判断子模块146,用于在第二判断子模块145的判断结果为是时,判断当前匹配到的plist文件名对应的文件中的参数值是否与第一主题资源目录下的plist文件夹中同一plist文件中的参数值一致;The third judging submodule 146 is used to judge whether the parameter value in the file corresponding to the plist file name that is currently matched is the same as the plist folder under the first theme resource directory when the judging result of the second judging submodule 145 is yes. The parameter values in the same plist file are the same;

第二复制子模块147,用于在第三判断子模块146的判断结果为是时,将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件复制到所述第二主题资源目录下的plist文件夹中;The second copy submodule 147 is used to copy the file corresponding to the same plist file name in the default sample resource folder of the second theme resource to the first when the judgment result of the third judgment submodule 146 is yes. In the plist folder under the theme resource directory;

替换子模块148,用于在第三判断子模块146的判断结果为否时,将所述第二主题资源的默认样本资源文件夹中的同一plist文件名对应的文件中的参数值替换为所述第一主题资源目录下的plist文件夹中同一plist文件名对应的文件中的参数值,随后将该文件存储至第二资源目录下的plist文件夹中。The replacement submodule 148 is used to replace the parameter value in the file corresponding to the same plist file name in the default sample resource folder of the second theme resource with the Describe the parameter values in the file corresponding to the same plist file name in the plist folder under the first theme resource directory, and then store the file in the plist folder under the second resource directory.

本实施例的装置,可以用于执行图1或图2或图3或图4或图5所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to execute the technical solution of the method embodiment shown in FIG. 1 or FIG. 2 or FIG. 3 or FIG. 4 or FIG. 5 , and its implementation principles and technical effects are similar, and will not be repeated here.

本发明实施例中,作为一可选实施例,上述任一主题资源转换装置还可包括音频判断模块和音频复制模块,其中,音频判断模块,用判断第一主题资源目录下的声音文件夹中是否有音频资源;音频复制模块,用于在所述音频判断模块的判断结果为是时,把所述第一主题资源目录下的声音文件夹中的音频资源复制到所述第二主题资源目录下的声音文件夹中;还用于在所述音频判断模块的判断结果为否时,把所述第二主题资源的默认音频文件夹中的音频资源复制到第二主题资源目录下的声音文件夹中。In the embodiment of the present invention, as an optional embodiment, any of the above-mentioned theme resource conversion devices may further include an audio judging module and an audio duplication module, wherein the audio judging module is used to judge the sound folder under the first theme resource directory Whether there are audio resources; the audio duplication module is used to copy the audio resources in the sound folder under the first theme resource directory to the second theme resource directory when the judgment result of the audio judgment module is yes In the sound folder under; It is also used to copy the audio resource in the default audio folder of the second theme resource to the sound file under the second theme resource directory when the judgment result of the audio judgment module is No in the middle.

优选地,本发明实施例提供的主题资源转换装置所转换的第一主题资源为安卓Android主题资源,第二主题资源为苹果iOS主题资源。Preferably, the first theme resource converted by the theme resource conversion device provided in the embodiment of the present invention is an Android theme resource, and the second theme resource is an Apple iOS theme resource.

对应于本发明实施例提供的主题资源转换方法,本发明实施例还提供一种电子设备,图12为本发明电子设备一个实施例的结构示意图,可以实现本发明图1所示实施例的流程,如图12所示,上述电子设备可以包括:壳体31、处理器32、存储器33、电路板34和电源电路35,其中,电路板34安置在壳体31围成的空间内部,处理器32和存储器33设置在电路板34上;电源电路35,用于为上述电子设备的各个电路或器件供电;存储器33用于存储可执行程序代码;处理器32通过读取存储器33中存储的可执行程序代码来运行与可执行程序代码对应的程序,用于执行前述任一实施例的主题资源转换方法。Corresponding to the subject resource conversion method provided by the embodiment of the present invention, the embodiment of the present invention also provides an electronic device. FIG. 12 is a schematic structural diagram of an embodiment of the electronic device of the present invention, which can realize the process of the embodiment shown in FIG. 1 of the present invention , as shown in FIG. 12, the above-mentioned electronic equipment may include: a housing 31, a processor 32, a memory 33, a circuit board 34 and a power supply circuit 35, wherein the circuit board 34 is placed inside the space enclosed by the housing 31, and the processor 32 and the memory 33 are arranged on the circuit board 34; the power supply circuit 35 is used to supply power to each circuit or device of the above-mentioned electronic equipment; the memory 33 is used to store executable program codes; Executing the program code to run a program corresponding to the executable program code is used to execute the subject resource conversion method of any one of the foregoing embodiments.

上述电子设备以多种形式存在,包括但不限于:The aforementioned electronic devices exist in many forms, including but not limited to:

(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。(1) Mobile communication equipment: This type of equipment is characterized by mobile communication functions, and its main goal is to provide voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, feature phones, and low-end phones.

(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, with computing and processing functions, and generally also has the characteristics of mobile Internet access. Such terminals include: PDA, MID and UMPC equipment, such as iPad.

(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放模块(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment equipment: This type of equipment can display and play multimedia content. Such devices include: audio and video playback modules (such as iPod), handheld game consoles, e-books, smart toys and portable car navigation devices.

(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The composition of a server includes processors, hard disks, memory, and system buses. , Reliability, security, scalability, manageability and other aspects have high requirements.

(5)其他具有数据交互功能的电子设备。(5) Other electronic devices with data interaction functions.

本发明还提供一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时用于实现前述任一实施例的主题资源转换方法步骤。The present invention also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it is used to implement the steps of the subject resource conversion method in any of the foregoing embodiments.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. any such actual relationship or order exists between them.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM) and the like.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (10)

1. A method for converting a theme resource, comprising:
acquiring first theme resource information; the first theme resource comprises an original picture;
constructing a picture catalog for storing the target picture under the second theme resource catalog;
the original picture is redrawn or directly copied to the picture directory by comparing the size of the original picture with the preset size of the target picture;
and generating a plist file corresponding to the converted theme resource under the second theme resource catalog.
2. The method for converting topic resources according to claim 1, wherein after generating the plist file corresponding to the topic resource after the conversion in the second topic resource directory, the method further comprises:
and compressing and storing the second theme resource directory.
3. The method for converting topic resources according to claim 1, wherein the obtaining the first topic resource information comprises:
acquiring an application identifier of a first subject resource;
according to the application identification of the first theme resource, inquiring a storage path of an original picture in a database in which the first theme resource is stored;
generating a first array for storing original picture information; the data structure of the first array is the file name of the original picture and the corresponding original picture storage path.
4. The theme resource conversion method according to claim 3, further comprising, after constructing a picture directory for storing the target picture under the second theme resource directory:
establishing a second array for storing target picture information required by the second theme resource in a default sample resource folder of the second theme resource; the data structure of the second array is a preset target picture file name and a corresponding target picture size;
the method for redrawing or directly copying the original picture to the picture directory by comparing the size of the original picture with the preset size of the target picture comprises the following steps:
circularly traversing the first array, and calculating the size of each original picture recorded in the first array;
judging whether the original picture size corresponding to the same picture file name in the second array and the first array is consistent with a preset target picture size or not;
if the original image size corresponding to the same image file name is consistent with the target image size, directly copying the original image to the image directory;
and if the size of the original picture corresponding to the same picture file name is not consistent with the size of the target picture, redrawing the original picture and then storing the original picture in the picture directory.
5. The subject matter resource conversion method according to claim 4, wherein the picture directory includes a double picture directory for storing double pictures of the target picture and a triple picture directory for storing triple pictures of the target picture;
the establishing of the second array for storing the target picture information required by the second theme resource in the default sample resource folder of the second theme resource further includes:
establishing a third array and a fifth array for storing double-fold picture information and establishing a fourth array and a sixth array for storing triple-fold picture information in a default sample resource folder of the second theme resource;
the data structure of the third/fourth array is the file name of the original picture, the name of the corresponding target picture and the size of the target picture;
the data structure of the fifth/sixth array is the original image file name and the corresponding original image storage path, the target image name and the target image size;
if the original picture size corresponding to the same picture file name is not consistent with the target picture size, redrawing the original picture and then storing the original picture in the picture directory, wherein the method comprises the following steps of:
copying picture information of which the target picture size in the second array is inconsistent with the original picture size corresponding to the same picture file name in the first array into the third array and the fourth array;
judging whether the picture file names in the third array and the fourth array can be matched in the first array or not;
if the picture file names in the third array and the fourth array can be matched in the first array, judging whether the currently matched picture file name contains a preset character pattern in a corresponding file suffix name in the database according to a storage path recorded by the first array;
if the currently matched picture file name contains a preset typeface in the corresponding file suffix name in the database, setting a first attribute for the same picture file name in the third array and the fourth array;
if the currently matched picture file name does not contain a preset typeface in the corresponding file suffix name in the database, setting a second attribute for the same picture file name in the third array and the fourth array;
copying picture information with a first attribute/a second attribute in a third array into a fifth array, and copying an original picture storage path corresponding to the same picture name in the first array into a corresponding record in the fifth array; copying picture information with a first attribute/a second attribute in a fourth array into a sixth array, and copying an original picture storage path corresponding to the same picture name in the first array into a corresponding record in a fifth array;
redrawing the original pictures recorded in the fifth array and the sixth array according to a preset drawing strategy;
storing a new picture generated according to the original picture recorded in the fifth array into the double-picture directory, and storing a new picture generated according to the original picture recorded in the sixth array into the triple-picture directory; and adding the predetermined typeface to the corresponding new picture suffix name of the picture file name with the first attribute in the fifth array and the sixth array during storage.
6. The method for converting topic resources according to claim 1, wherein the generating a plist file corresponding to the topic resource after the conversion under the second topic resource directory comprises:
setting a plist folder for generating a second theme resource under the second theme resource directory;
presetting plist file information of a third attribute of the target picture and storing the plist file information into a preset seventh array;
taking out a default plist file related to a third attribute of a second subject resource picture from a default sample resource folder of the second subject resource, wherein the second subject resource picture comprises a double picture and a triple picture;
respectively writing default plist file information of currently taken third attributes of the double-fold picture and the triple-fold picture of the second subject resource picture into a preset eighth array and a preset ninth array; the data structures of the eighth array and the ninth array are plist file names and parameter values in corresponding files;
circularly traversing the seventh array, and judging whether the plist file name in the seventh array can be matched in the eighth array or the ninth array;
if the plist file name in the seventh array can be matched in the eighth array or the ninth array, judging whether the parameter value in the file corresponding to the currently matched plist file name is consistent with the parameter value in the same plist file in the plist folder under the first subject resource directory;
if the parameter value of the currently matched file corresponding to the plist filename is consistent with the parameter value of the same plist file in the plist folder under the first subject resource directory, copying the file corresponding to the same plist filename in the default sample resource folder of the second subject resource into the plist folder under the second subject resource directory;
if the parameter value in the file corresponding to the currently matched plist file name is not consistent with the parameter value in the same plist file in the plist folder under the first subject resource directory, replacing the parameter value in the file corresponding to the same plist file name in the default sample resource folder of the second subject resource with the parameter value in the file corresponding to the same plist file name in the plist folder under the first subject resource directory, and then storing the file into the plist folder under the second resource directory.
7. The method for converting a theme resource according to any one of claims 1 to 6, further comprising, after the acquiring the first theme resource information:
judging whether audio resources exist in a sound folder under the first theme resource directory;
if the sound folder under the first theme resource directory contains audio resources, copying the audio resources in the sound folder under the first theme resource directory into the sound folder under the second theme resource directory;
and if no audio resource exists in the sound folder under the first theme resource directory, copying the audio resource in the default audio folder of the second theme resource into the sound folder under the second theme resource directory.
8. The theme resource conversion method according to any one of claims 1 to 6, wherein the first theme resource is an Android theme Android resource, and the second theme resource is an apple iOS theme resource.
9. A theme resource converting apparatus, comprising:
the acquisition module is used for acquiring first theme resource information; the first theme resource comprises an original picture;
the configuration module is used for constructing a picture catalogue for storing the target picture under the second theme resource catalogue;
the picture processing module is used for redrawing the original picture or directly copying the original picture to the picture directory by comparing the size of the original picture with the preset target picture size;
and the file generation module is used for generating a plist file corresponding to the converted theme resource under the second theme resource catalog.
10. The theme resource converting apparatus according to claim 9, further comprising:
and the compression module is used for compressing and storing the second theme resource directory.
CN201810666638.7A 2018-06-25 2018-06-25 Theme resource conversion method and device and electronic equipment Expired - Fee Related CN108874495B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810666638.7A CN108874495B (en) 2018-06-25 2018-06-25 Theme resource conversion method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810666638.7A CN108874495B (en) 2018-06-25 2018-06-25 Theme resource conversion method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108874495A true CN108874495A (en) 2018-11-23
CN108874495B CN108874495B (en) 2022-02-11

Family

ID=64294767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810666638.7A Expired - Fee Related CN108874495B (en) 2018-06-25 2018-06-25 Theme resource conversion method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108874495B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109491741A (en) * 2018-10-31 2019-03-19 维沃移动通信有限公司 A kind of method and terminal switching background skin
CN113822022A (en) * 2020-06-18 2021-12-21 苏州谦问万答吧教育科技有限公司 PPT (Power Point) auditing processing method, device, equipment and storage medium
CN114218171A (en) * 2021-12-22 2022-03-22 武汉斗鱼鱼乐网络科技有限公司 A convenient storage method, electronic device, storage medium and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719075A (en) * 2009-12-29 2010-06-02 中兴通讯股份有限公司 Method for switching theme of Java virtual machine and terminal device
CN102419706A (en) * 2011-09-29 2012-04-18 奇智软件(北京)有限公司 Method for editing skin of user interface
CN104503747A (en) * 2014-12-11 2015-04-08 北京金和软件股份有限公司 Database storage structure of APP (Application) production platform
CN104699833A (en) * 2015-03-31 2015-06-10 北京奇艺世纪科技有限公司 Picture presentation method, picture storage method, picture presentation device and picture storage device
CN105224302A (en) * 2014-06-27 2016-01-06 北京搜狗科技发展有限公司 The skin processing method of input method and input method system
US20170103548A1 (en) * 2014-03-27 2017-04-13 Pansonic Intellectual Property Manamagement Co., Ltd. Vehicle-mounted display device, method for controlling vehicle-mounted display device, and program
CN106569658A (en) * 2016-10-19 2017-04-19 武汉悦然心动网络科技股份有限公司 Multimedia theme configuration method and multimedia theme configuration system of input method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719075A (en) * 2009-12-29 2010-06-02 中兴通讯股份有限公司 Method for switching theme of Java virtual machine and terminal device
CN102419706A (en) * 2011-09-29 2012-04-18 奇智软件(北京)有限公司 Method for editing skin of user interface
US20170103548A1 (en) * 2014-03-27 2017-04-13 Pansonic Intellectual Property Manamagement Co., Ltd. Vehicle-mounted display device, method for controlling vehicle-mounted display device, and program
CN105224302A (en) * 2014-06-27 2016-01-06 北京搜狗科技发展有限公司 The skin processing method of input method and input method system
CN104503747A (en) * 2014-12-11 2015-04-08 北京金和软件股份有限公司 Database storage structure of APP (Application) production platform
CN104699833A (en) * 2015-03-31 2015-06-10 北京奇艺世纪科技有限公司 Picture presentation method, picture storage method, picture presentation device and picture storage device
CN106569658A (en) * 2016-10-19 2017-04-19 武汉悦然心动网络科技股份有限公司 Multimedia theme configuration method and multimedia theme configuration system of input method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张梦云等: ""基于角色模型的智能手机界面设计研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109491741A (en) * 2018-10-31 2019-03-19 维沃移动通信有限公司 A kind of method and terminal switching background skin
CN109491741B (en) * 2018-10-31 2022-01-28 维沃移动通信有限公司 Method and terminal for switching background skin
CN113822022A (en) * 2020-06-18 2021-12-21 苏州谦问万答吧教育科技有限公司 PPT (Power Point) auditing processing method, device, equipment and storage medium
CN114218171A (en) * 2021-12-22 2022-03-22 武汉斗鱼鱼乐网络科技有限公司 A convenient storage method, electronic device, storage medium and system

Also Published As

Publication number Publication date
CN108874495B (en) 2022-02-11

Similar Documents

Publication Publication Date Title
CN102761623B (en) Resource self-adaptive joins method for down loading, system, data storage server and communication system
CN107958365B (en) Material information changing method and device, storage medium and electronic equipment
CN106648569B (en) Target serialization realization method and device
CN106886568B8 (en) One kind divides table method, apparatus and electronic equipment
CN111506300A (en) Applet generation method, device, equipment and storage medium
CN108874495B (en) Theme resource conversion method and device and electronic equipment
CN112433730A (en) Code detection rule generation method and device and electronic equipment
CN111857712A (en) Form processing method, device, terminal and medium
JP2023027194A (en) Translation method, apparatus, electronic device, readable storage medium and computer program
US20150120650A1 (en) Methods and Systems for Utilizing Global Entities In Software Applications
US20160359932A1 (en) Display device and method of controlling the same
US20250184386A1 (en) Connected cloud applications
CN114205365A (en) Application interface migration system, method and related equipment
CN119166135A (en) Method, device and computer equipment for reusing code components in low-code platform
CN111984293B (en) Information processing method, device and storage medium
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN113448995B (en) Database operation method and device, system, electronic device and storage medium
CN103761020A (en) Shortcut navigating method and device
CN107749201B (en) Click-to-read object processing method and device, storage medium and electronic equipment
CN116880862A (en) Cloud deployment method, device and equipment of big data component and storage medium
CN116594676A (en) Application packaging method, device, equipment and storage medium
CN113190463B (en) A code testing method, node and system
KR102246611B1 (en) Price differentiation by market for in-app software purchases
CN106303668B (en) Method, device and terminal for processing multimedia playback information
CN108920658B (en) Mobile device desktop moving method and device and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220211