Search

CN-117520585-B - Picture processing method and device, storage medium and electronic equipment

CN117520585BCN 117520585 BCN117520585 BCN 117520585BCN-117520585-B

Abstract

The application discloses a picture processing method and device, a storage medium and electronic equipment. The method comprises the steps of determining a group of first maps and a plurality of groups of second maps, wherein each first map is a map which is referred by more than a preset number of business modules of a target application in a plurality of maps of the target application, each group of second maps comprises other maps which are corresponding to one business module and are in the plurality of maps except for the group of first maps, dividing the group of first maps into a plurality of first maps according to the similarity of reference module information of each first map, the reference module information of each first map is used for representing the business module which references each first map, and dividing each group of second maps into a plurality of second maps according to the similarity of preform reference information of each second map in each group of second maps, wherein the preform reference information of each second map is used for representing the plurality of preforms of the business modules corresponding to each group of second maps, and referencing each second map.

Inventors

  • ZENG GUOLIANG
  • WANG XUXIN
  • LI ZHEN
  • ZHU GUANGYU
  • GAO JIE

Assignees

  • 腾讯科技(深圳)有限公司

Dates

Publication Date
20260512
Application Date
20220728

Claims (19)

  1. 1. A method for processing a picture, comprising: Determining a set of first maps and a plurality of sets of second maps, wherein each first map in the set of first maps is a map which is referenced by more than a preset number of business modules of a target application in a plurality of maps of the target application, and each set of second maps in the plurality of sets of second maps comprises other maps which correspond to one business module and are in the plurality of maps except the set of first maps; Dividing the group of first maps into a plurality of first atlases according to the similarity between the reference module information of each first map, wherein the reference module information of each first map is used for representing a business module for referencing each first map; Dividing each second mapping group into a plurality of second mapping sets according to the similarity between the prefab reference information of each second mapping in each second mapping group, wherein the prefab reference information of each second mapping group is used for representing a plurality of prefabs of a service module corresponding to each second mapping group, and the prefab of each second mapping group is referenced.
  2. 2. The method of claim 1, wherein the partitioning the set of first maps into a plurality of first atlases according to a similarity between the reference module information of each first map comprises: dividing the group of first maps into the plurality of first maps according to the similarity between the module reference tuples of each first map, wherein each element in the module reference tuple of each first map corresponds to one business module of the target application, and each element in the module reference tuple of each first map is used for indicating whether the corresponding business module references each first map.
  3. 3. The method of claim 2, wherein the partitioning the set of first maps into the plurality of first atlases according to similarities between module reference tuples of each first map comprises: the set of first maps is partitioned into the plurality of first atlases according to hamming distances between the module reference tuples of each first map.
  4. 4. The method of claim 1, wherein the partitioning the set of first maps into a plurality of first atlases according to a similarity between the reference module information of each first map comprises: And dividing the group of first maps into the plurality of first maps according to the similarity between the reference module information of each first map and a first resolution size range, wherein the map resolution size of each first map in the plurality of first maps is within the first resolution size range.
  5. 5. The method of claim 4, wherein the first resolution size range is a size range from a first resolution size threshold to a second resolution size threshold, wherein the partitioning the set of first maps into the plurality of first atlases according to the first resolution size range based on a similarity between the reference module information for each first map comprises: Iteratively executing the following dividing steps until a first iteration end condition is met, wherein the first iteration end condition comprises at least one of the following steps that the number of iterations reaches a first number, the number of first maps remaining in the group of first maps is zero, and after the iteration is executed once, increasing a first step size by a first similarity threshold value: the following processing steps are performed with each first map in the set of first maps in turn as a current map: When a built first temporary atlas exists in a first temporary atlas list, determining the similarity between the current mapping and each first temporary atlas according to the similarity between the current mapping and the first mapping in each first temporary mapping set, and obtaining a first matching atlas, wherein the first matching atlas is the first temporary atlas with the highest similarity with the current mapping; Adding the current map to the first matching map set to obtain an updated first matching map set when the similarity between the current map and the first matching map set is greater than or equal to the first similarity threshold and the map resolution size of the first matching map set after adding the current map is less than or equal to the second resolution size threshold; Determining the updated first matching atlas as a first atlas, removing a first map of the updated first matching atlas from the set of first maps, and removing the first matching atlas from the first temporary atlas list, in case an atlas resolution size of the updated first matching atlas is greater than or equal to the first resolution size threshold and an atlas filling factor of the updated first matching atlas is greater than or equal to a first filling factor threshold; When there is no established first temporary atlas in the first temporary atlas list or any first temporary atlas to which the current mapping is not added, establishing a temporary atlas, obtaining a first new atlas, adding the current mapping to the first new atlas, and adding the first new atlas to the first temporary atlas list.
  6. 6. The method of claim 5, wherein determining the similarity between the current map and each first temporary map set based on the similarity between the current map and the first map in each first temporary map set comprises: And determining the average value of the similarity between the current map and each first map in each first temporary map set as the similarity between the current map and each first temporary map set.
  7. 7. The method of claim 5, wherein after said sequentially performing the following processing steps as the current map for each first map in the set of first maps, the method further comprises: determining, when there are a plurality of the first temporary atlas in the first temporary atlas list, a first temporary atlas in which an atlas resolution size is less than or equal to a third resolution size threshold as a first candidate atlas; And under the condition that the number of the first candidate atlases is a plurality of, iteratively executing the following steps until a second iteration ending condition is met, wherein the second iteration ending condition comprises at least one of the following steps that the number of iteration times reaches a second number of times, and the number of the first candidate atlases remained after the iteration is smaller than or equal to a first number threshold value: sorting the plurality of first candidate atlas according to the order of the atlas resolution size from big to small to obtain a first candidate atlas list; traversing the first candidate atlas in the first candidate atlas list in turn, and executing the following atlas merging operation on the traversed current atlas: Determining a first target atlas in the first candidate atlas list, wherein the first target atlas is an atlas with the first candidate atlas list except the current atlas, the atlas resolution size after the atlas merging with the current atlas is smaller than or equal to the second resolution size threshold, and the atlas filling rate is maximum; carrying out atlas merging on the current atlas and the first target atlas to obtain a first merged atlas, and removing the current atlas and the first target atlas from the first candidate atlas list; Determining the first merged atlas as a first atlas if the atlas resolution size of the first merged atlas is greater than or equal to the first resolution size threshold and the atlas filling factor is greater than or equal to the first filling factor threshold; In the case where the atlas resolution size of the first merged atlas is smaller than the first resolution size threshold, the first merged atlas is added as a first candidate atlas to the first candidate atlas list.
  8. 8. The method of claim 1, wherein the partitioning each of the second maps into a plurality of second atlases based on similarity between preform reference information for each of the second maps of the each set comprises: Dividing each set of second maps into the plurality of second map sets according to the similarity between the preform reference tuples of each second map, wherein each element in the preform reference tuple of each second map corresponds to one preform of the service module corresponding to each set of second maps, and each element in the preform reference tuple of each second map is used for indicating whether the corresponding preform references each second map.
  9. 9. The method of claim 8, wherein the partitioning each set of second maps into the plurality of second atlases according to similarities between preform reference tuples of the each second map comprises: Dividing each set of second maps into the plurality of second atlases according to hamming distances between the preform reference tuples of each second map.
  10. 10. The method of claim 1, wherein the partitioning each of the second maps into a plurality of second atlases based on similarity between preform reference information for each of the second maps of the each set comprises: And dividing each group of second maps into a plurality of second map sets according to the similarity between the prefabricated member reference information of each second map and a second resolution size range, wherein the map resolution size of each second map set in the plurality of second map sets is within the second resolution size range.
  11. 11. The method of claim 10, wherein the second resolution size range is a size range from a fourth resolution size threshold to a fifth resolution size threshold, wherein the partitioning each group of second maps into the plurality of second atlas according to the second resolution size range based on a similarity between preform reference information of each second map, comprises: Iteratively executing the following dividing steps until a third iteration end condition is met, wherein the third iteration end condition comprises at least one of the following steps that the number of iterations reaches a third number, the number of second maps remaining in each group of second maps is zero, and after the execution of one iteration is completed, increasing a second similarity threshold by a second step size: and taking each second mapping in each group of second mapping as the current mapping in turn, and executing the following processing steps: When a built second temporary atlas exists in the second temporary atlas list, determining the similarity between the current mapping and each second temporary atlas according to the similarity between the current mapping and the second mapping in each second temporary mapping, and obtaining a second matching atlas, wherein the second matching atlas is the second temporary atlas with the highest similarity with the current mapping; Adding the current map to the second matching map set to obtain an updated second matching map set when the similarity of the current map and the second matching map set is greater than or equal to the second similarity threshold and the map set resolution size of the second matching map set after adding the current map is less than or equal to the fifth resolution size threshold; determining the updated second matching atlas as a second atlas, removing a second map of the second matching atlas from the each set of second maps, and removing the second matching atlas from the second temporary atlas list, in case the resolution size of the updated second matching atlas is greater than or equal to the fourth resolution size threshold and the atlas filling factor of the updated second matching atlas is greater than or equal to a second filling factor threshold; when there is no established second temporary atlas in the second temporary atlas list or any second temporary atlas to which the current mapping is not added, a new temporary atlas is created, a second new atlas is obtained, the current mapping is added to the second new mapping set, and the second new atlas is added to the second temporary atlas list.
  12. 12. The method of claim 11, wherein the determining the similarity between the current map and each second temporary map set based on the similarity between the current map and the second map in each second temporary map set comprises: And determining the average value of the similarity between the current map and each second map in each second temporary map set as the similarity between the current map and each second temporary map set.
  13. 13. The method of claim 11, wherein after said sequentially performing the respective second maps of each set of second maps as current maps the following processing steps, the method further comprises: Determining, when there are a plurality of the second temporary atlas in the second temporary atlas list, a second temporary atlas in which an atlas resolution size is less than or equal to a sixth resolution size threshold as a second candidate atlas; and in the case that the number of the second candidate atlases is a plurality of, iteratively executing the following steps until a fourth iteration end condition is met, wherein the fourth iteration end condition comprises at least one of the following steps that the number of iterations reaches a fourth number, and the number of the second candidate atlases remained after the iteration is smaller than or equal to a second number threshold value: sorting the plurality of second candidate atlas according to the order of the atlas resolution size from big to small to obtain a second candidate atlas list; traversing the second candidate atlas in the second candidate atlas list in turn, and executing the following atlas merging operation on the traversed current atlas: Determining a second target atlas in the second candidate atlas list, wherein the second target atlas is an atlas with the second candidate atlas list except the current atlas, the atlas resolution size after the atlas merging with the current atlas is less than or equal to the fifth resolution size threshold, and the atlas filling rate is the largest; Carrying out atlas merging on the current atlas and the second objective atlas to obtain a second merged atlas, and removing the current atlas and the second objective atlas from the second candidate atlas list; Determining the second merged atlas as a second atlas if the atlas resolution size of the second merged atlas is greater than or equal to the fourth resolution size threshold and the atlas filling factor is greater than or equal to the second filling factor threshold; In the case where the atlas resolution size of the second merged atlas is smaller than the fourth resolution size threshold, the second merged atlas is added as a second candidate atlas to the second candidate atlas list.
  14. 14. The method of any one of claims 1 to 13, wherein the determining a set of first maps and a plurality of sets of second maps comprises: Determining a set of initial maps corresponding to each business module of a plurality of business modules of the target application, wherein the set of initial maps corresponding to each business module includes a map of the plurality of maps referenced by each business module; extracting the mapping referenced by more than the preset number of business modules in the plurality of mapping to obtain the group of first mapping; and removing the first mapping in the group of initial mapping corresponding to each service module to obtain the plurality of groups of second mapping.
  15. 15. The method of claim 14, wherein after said determining a set of initial maps corresponding to each of a plurality of business modules of the target application, the method further comprises: Removing the unreferenced chartlet from the set of initial chartlets corresponding to the first service module to obtain an updated set of initial chartlets corresponding to the first service module when determining that the unreferenced chartlet of the first service module exists in the set of initial chartlet corresponding to the first service module according to the chartlet reference records of the plurality of chartlets; And in the case that the fact that the mapping referenced by the second service module is not contained in the initial mapping group corresponding to the second service module is determined according to the mapping reference records of the mapping, adding the referenced mapping into the initial mapping group corresponding to the second service module, and obtaining an updated initial mapping group corresponding to the second service module.
  16. 16. A picture processing apparatus, comprising: A first determining unit, configured to determine a set of first maps and a plurality of sets of second maps, where each first map in the set of first maps is a map that is referred to by more than a preset number of service modules of a target application in a plurality of maps of the target application, and each set of second maps in the plurality of sets of second maps includes other maps corresponding to one service module, where the other maps in the plurality of maps are other than the set of first maps; A first dividing unit, configured to divide the group of first maps into a plurality of first atlases according to a similarity between reference module information of each first map, where the reference module information of each first map is used to represent a service module that references each first map; And the second dividing unit is used for dividing each group of second maps into a plurality of second map sets according to the similarity between the prefabrication part reference information of each second map in each group of second maps, wherein the prefabrication part reference information of each second map is used for representing a plurality of prefabrication parts of the service module corresponding to each group of second maps, and the prefabrication parts of each second map are referenced.
  17. 17. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 15.
  18. 18. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 15.
  19. 19. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1-15 by means of the computer program.

Description

Picture processing method and device, storage medium and electronic equipment Technical Field The present application relates to the field of computers, and in particular, to a method and apparatus for processing a picture, a storage medium, and an electronic device. Background For applications allowing human-computer interaction, interaction with a User and information exchange can be performed through a User Interface (UI), and a picture required for UI presentation is a UI map. If there are a large number of UI maps in project engineering of the application (each UI map is an independent map), the application occupies a large running memory and draw call (Drawcall) when running, and causes a large performance consumption for the running memory and GPU (Graphics Processing Unit, graphics processor) of the application. To reduce the footprint of running memory and the performance consumption of the GPU, UI maps used in applications may be partitioned into different Atlas (Atlas) in advance, thereby generating multiple UI Atlas. Element renderings in each graph set can be combined into a single Drawcall under specific conditions, rendering performance loss of device operation is reduced by reducing Drawcall, and meanwhile, the graph set can also reduce memory occupation through a specific compression texture algorithm. Currently, in performing atlas classification, manual classification is typically performed by a developer of a project based on the resource analysis results and technical experience of the project. After division, the atlas needs to look up the real-time running memory when the application runs, find out the problematic place in the division, and often needs to be divided repeatedly for many times to achieve a better result. As can be seen from the above, the related art picture processing method has a problem of large human resource consumption due to the need to perform manual atlas division multiple times. Disclosure of Invention The embodiment of the application provides a picture processing method and device, a storage medium and electronic equipment, and aims to solve the problem that at least the picture processing method in the related technology has large manpower resource consumption caused by the need of manually dividing a picture set for a plurality of times. According to one aspect of the embodiment of the application, a picture processing method is provided, which comprises the steps of determining a first set of maps and a plurality of second sets of maps, wherein each first map in the first set of maps is a map which is referenced by more than a preset number of service modules of a target application in a plurality of maps of the target application, each second set of maps in the plurality of second maps comprises other maps which correspond to one service module and are except for the first set of maps, dividing the first set of maps into a plurality of first map sets according to the similarity between the reference module information of each first map, wherein the reference module information of each first map is used for representing the service module which references each first map, and dividing each second set of maps into a plurality of second maps according to the similarity between the reference information of each second map in the second set of second maps, wherein the reference module information of each second map is used for each prefabricated member in the second set of maps. According to another aspect of the embodiment of the present application, there is further provided a processing apparatus for pictures, including a first determining unit configured to determine a first set of first maps and a plurality of second maps, where each first map in the first set of first maps is a map of a plurality of maps of a target application that is referenced by more than a preset number of service modules of the target application, each second map in the plurality of second maps includes other maps of the plurality of second maps corresponding to one service module, except for the first set of first maps, a first dividing unit configured to divide each first set of first maps into a plurality of first map sets according to a similarity between reference module information of each first map, where the reference module information of each first map is used to represent a service module that references the each first map, and a second dividing unit configured to divide each second map in the second set of second maps into a plurality of reference module of prefabricated members according to a similarity between reference module information of each second map in the second set of second maps, where each second map is used to represent a plurality of prefabricated member reference module. As an alternative, the first dividing unit includes a first dividing module, configured to divide the set of first maps into the plurality of first atlases according to a similarity bet