Method and device for batch merging of materials, storage medium and electronic device
By analyzing and matching material tables, batch upload of offline material materials is realized, solving the problems of complex operation and low efficiency in the existing technology, improving production efficiency and reducing costs.
Patent Information
- Application Number
- CN202210687352.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-06-16
AI Technical Summary
In the prior art, when making offline materials, it is necessary to upload or replace the materials provided by the service provider one by one, resulting in complex operations and low production efficiency.
By obtaining the material material package of the resource provider, analyzing the target material material table, matching the material folder name, batch uploading the target material material, and generating batch material composite charts.
It realizes batch upload of material materials, improves operation efficiency, reduces operation costs, and avoids the color difference problem of offline printing color.
Smart Images

Figure CN114925666B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and more particularly to a method and device for batch merging of material images. The present application also relates to a computer storage medium and an electronic device. Background Art
[0002] With the continuous development of the Internet and computer technology, various applications have been widely used in daily life, such as shopping, ordering food and other life service application software.
[0003] In different application scenarios, it is necessary to design and produce pages for the activity material information of a designated service provider, such as posters or advertisements. During the design and production process, it is necessary to combine the materials provided by the service provider so that the produced activity material information can reflect the characteristics of the service provider, thereby promoting traffic generation. Summary of the invention
[0004] The present application provides a method for batch merging of material materials to solve the technical problems in the prior art of complex operation and low production efficiency caused by the need to upload or replace materials provided by a service provider one by one when producing offline materials.
[0005] The present application provides a method for batch merging of materials, including:
[0006] Parsing the acquired target material table to determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes a plurality of material folder names used to indicate that the material information belongs to a resource provider; the table parsing result includes material names matching the plurality of material folder names, and type identification information indicating the material type in the material information;
[0007] Determine, based on the analysis of the acquired material package of the resource provider, multiple target material folder names in the material package that match the multiple material folder names;
[0008] Determine the corresponding position area of the target material in the target folder in the table parsing result according to the correspondence between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result;
[0009] A batch of material material composite images are generated based on the synthesis of the target material materials uploaded in batches to the corresponding position area.
[0010] In some embodiments, it also includes:
[0011] A candidate material template is generated according to the template material composition structure; wherein the candidate material template includes a first format template image and a second format template image.
[0012] In some embodiments, parsing the acquired target material table to determine the table parsing result includes:
[0013] Selecting the target material template from the candidate material templates;
[0014] Generate the material table according to the target material template;
[0015] Writing the multiple target material folder names into the header of the multiple material folder names added in the material material table;
[0016] Determine the table in which the names of the plurality of target material folders are written as the target material table;
[0017] The target material table is parsed to determine the table parsing result.
[0018] In some embodiments, generating a candidate material template according to the template material composition structure includes:
[0019] The template material composition structure is named according to a grouping rule and / or a non-grouping rule, wherein the naming includes naming the type identification information;
[0020] The candidate material template is generated according to the named template material composition structure; wherein the first format template image is a PDF format template image, and the second format template image is an SVG format template image.
[0021] In some embodiments, determining the corresponding position area of the target material in the target folder in the table parsing result according to the correspondence between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result includes:
[0022] According to the correspondence between the target material identification information and the material name in the table parsing result, obtaining the row information of the target material identification information in the table parsing result;
[0023] Parsing the acquired material package of the resource provider to determine the target material included in the target folder corresponding to the multiple target material folder names;
[0024] Identify the image material in the target material and determine the image type of the image material;
[0025] According to the correspondence between the image type and the type identification information in the row information, a corresponding position area of the image material in the table parsing result is determined.
[0026] In some embodiments, the identifying the image material in the target material to determine the image type of the image material includes:
[0027] Determining whether the type of the image material is a two-dimensional code image type according to identifying the image material;
[0028] If not, calculating the image type score of the image material according to the size of the image material and / or the name of the image material;
[0029] The image type of the image material is determined according to the correspondence between the image type score and the reference score of the image type.
[0030] In some embodiments, determining the corresponding position area of the image material in the table parsing result according to the correspondence between the image type and the type identification information in the row information includes:
[0031] Obtaining the quantity of the type identification information in the table parsing result;
[0032] Determining whether the number of the type identification information is greater than or equal to the number of the image materials;
[0033] If yes, determining whether there is a corresponding relationship between the name of the image material and the type identification information in the row information;
[0034] If so, the position of the type identification information in the row information is determined as the corresponding position area of the image material in the table parsing result.
[0035] In some embodiments, it also includes:
[0036] When the result of determining whether there is a corresponding relationship between the name of the image material and the type identification information in the row information is no, the corresponding position area of the image material in the row information is randomly determined.
[0037] In some embodiments, it also includes:
[0038] When the number of the type identification information is less than the number of the image materials, determining a difference between the number of the type identification information and the number of the image materials;
[0039] Determine whether the number of abnormal image materials with the type score being abnormal is greater than or equal to the difference;
[0040] If so, based on the deletion of the abnormal image material, it is determined that the amount of the image identification information is equal to the amount of the image material.
[0041] In some embodiments, it also includes:
[0042] When the number of abnormal image materials with abnormal type scores is less than the difference, deleting the abnormal image materials;
[0043] Calculate the similarity between the deleted image materials;
[0044] Delete image materials whose similarity meets the deletion requirements;
[0045] Determining whether the number of image materials deleted according to the similarity is equal to the number of type identification information;
[0046] If not, the image materials after the similarity deletion are deleted according to a preset deletion order until the number of the deleted image materials is equal to the number of the type identification information.
[0047] In some embodiments, the deleting the image materials after similarity deletion according to a predetermined deletion order until the number of deleted image materials is equal to the number of type identification information includes:
[0048] Determining a priority order for deleting the image materials according to image types of the image materials;
[0049] The image materials after the similarity deletion are deleted according to the priority order until the number of the deleted image materials is equal to the number of the type identification information.
[0050] In some embodiments, it also includes:
[0051] Determine whether the corresponding location area in the table parsing result uploaded with the target material is correct;
[0052] If not, the position sequence of the target material uploaded in the table parsing result is adjusted.
[0053] In some embodiments, the adjusting the position sequence of the target material uploaded in the table parsing result includes:
[0054] Separately adjust the target material uploaded in the table analysis result;
[0055] or;
[0056] The target material uploaded in the table analysis result is adjusted row by row.
[0057] The present application also provides a device for combining batches of materials, including:
[0058] A first determination unit is used to parse the acquired target material table and determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes a plurality of material folder names used to indicate that the material information belongs to a resource provider, and type identification information indicating the material type in the material information;
[0059] A second determining unit is used to determine, based on the analysis of the acquired material package of the resource provider, a plurality of target material folder names in the material package that match the plurality of material folder names;
[0060] A third determining unit is used to determine the corresponding position area of the target material in the target folder in the table parsing result according to the corresponding relationship between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result;
[0061] A generating unit is used to generate a batch of material material combined images according to the synthesis of the target material materials uploaded in batches to the corresponding position area.
[0062] The present application also provides a computer storage medium for storing a computer program;
[0063] The program executes the steps in the method for batch merging of material drawings as described above.
[0064] The present application also provides an electronic device, comprising:
[0065] processor;
[0066] A memory is used to store a computer program, wherein the program executes the steps in the method for batch merging of material images as described above.
[0067] Compared with the prior art, this application has the following advantages:
[0068] The present application provides a method for combining materials in batches, which determines the name of the material folder that needs to be added in the table for recording material information generated based on the target material template by obtaining the name of the target material folder in the material package of the resource provider, that is, the target material folder name matches the material folder name. The merchant's material package is obtained and parsed, and the corresponding position area of the image material in the table parsing result is determined according to the correspondence between the target material identification information in the target folder corresponding to the multiple target material folder names and the material file name in the table parsing result, that is, the correspondence between the image material name and the SVG_ID, and then the image material is uploaded in batches according to the corresponding position area to generate a batch of material material combined pictures. This process only needs to determine the corresponding position area to be uploaded according to the corresponding relationship between the image material name and the SVG_ID, so that batch uploading can be achieved, and there is no need to complete the combination of the image materials by uploading them one by one, thereby improving the operation efficiency while reducing the operation cost.
[0069] Furthermore, by presetting PDF format images and SVG format images in the material pixel template, the stability of offline printing colors can be guaranteed to avoid color difference problems when outputting offline material combined images. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 This is a flow chart of an embodiment of a method for batch merging of materials provided by the present application;
[0071] Figure 2 It is a structural schematic diagram of a target material table in an embodiment of a method for batch merging of materials provided by the present application;
[0072] Figure 3 It is a structural schematic diagram of the table parsing result in an embodiment of a method for batch merging of material images provided by the present application;
[0073] Figure 4 It is a structural schematic diagram of an embodiment of a device for batch combining drawings of materials provided by the present application;
[0074] Figure 5 It is a structural schematic diagram of an electronic device embodiment provided by the present application. DETAILED DESCRIPTION
[0075] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0076] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", are not limitations on quantity or sequence, but are used to distinguish the same type of information from each other.
[0077] Based on the description of the above background technology, it can be known that the concept of a method for batch merging of material materials provided in this application comes from the need to replace each material image one by one when designing and producing offline materials (for example, designing and producing advertising posters in takeaway application scenarios), which leads to problems such as complex production, low efficiency and increased production costs. Specifically, after collecting the merchant's materials, such as the QR code, merchant LOGO, and dish pictures that need to be changed, they will be placed in the corresponding folder. The process of replacing multiple images of the same material separately each time can include the following steps:
[0078] 1. Find the corresponding material and size.
[0079] 2. Replace the text and images in each area (the specific number of operations depends on how many areas the current template has that can be uploaded or replaced. Assume that the number of text contents is N1 and the number of image contents is N2)
[0080] 3. After the machine review is successful, the manual review process will begin.
[0081] The problem with implementing the above steps is that when the user needs to create multiple (for example, M) materials of the same or different sizes under a template group, the operation of uploading or replacing the image of each area is (N1+N2)×M times, which obviously makes the production efficiency low and the labor cost increases.
[0082] At the same time, during the conception process, there were problems with color difference, display abnormalities, and confusion between online and offline material designs in the production of offline materials.
[0083] Based on this, this application provides a method for batch merging of material images, such as Figure 1 As shown, Figure 1 It is a flow chart of an embodiment of a method for batch merging of materials provided by the present application. The method embodiment may include:
[0084] Step S101: parse the acquired target material table to determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes a plurality of material folder names used to indicate that the material information belongs to a resource provider; the table parsing result includes material names that match the plurality of material folder names, and type information indicating the material type in the material information.
[0085] The material in step S101 may be used to display the service information of the resource service provider, such as advertisements, posters, etc. In this embodiment, the material may be an offline material, that is, objects such as advertisements and posters placed in the offline environment of the resource service provider. The resource service provider may be a merchant, such as a takeaway merchant. The material material may be the material information constituting the material, such as pictures, text and other related information, wherein the picture may include the merchant's product picture, the merchant's QR code picture, the merchant's logo, etc., and the text information may be the description information for the picture, the description information for the activity, and other text information.
[0086] like Figure 2 As shown, in this embodiment, the target material material table can be determined based on the name of multiple material material folders added to the material material table, and the type information of the material material type in the material material information. The material material table can be generated according to a material material template, and each row in the material material table can be material material information for a merchant, and can include multiple rows, that is, material material information of multiple merchants. Before describing the implementation process of step S101, the concept of the material material template is described here as follows:
[0087] The material template can be a template designed in advance according to specified requirements, for example: in a takeaway scenario, a template designed for a specified date, such as: Mid-Autumn Festival template, New Year's Day template, etc., of course, it can also be a general template designed based on the service type of a takeaway merchant, etc. Therefore, in this embodiment, there is no specific restriction on the material template. The target material template can be a template that meets the requirements selected from the pre-designed material templates according to the needs of the merchant (also known as the user). When making offline materials, the target material template can be selected from the pre-designed templates to batch produce offline materials for multiple merchants on the same specified date or scenario. Therefore, it can include:
[0088] Step S1a: Generate a candidate material template according to the template material composition structure; wherein the candidate material template includes a first format template image and a second format template image.
[0089] In this embodiment, the candidate material template may be a template for offline materials. To avoid color difference in offline materials after output, the first format template image in the template may be a PDF format template image, and the second format template image may be an SVG format template image, thereby supporting subsequent offline printing color mode (CMYK, i.e. C: Cyan, M: Magenta, Y: Yellow, K: Black) material synthesis.
[0090] In this embodiment, the first format template image and the second format template image may be of the same size. For example, the size of the PDF format template image may be 1920×1080px, and correspondingly, the size of the SVG format template image may be 1920×1080px.
[0091] The candidate material template may include information of multiple areas where data can be uploaded, such as: an area for uploading merchant product images, an area for uploading merchant logo images, an area for uploading merchant QR code images, etc. Therefore, the upload area in the candidate material template is named with image identification information. In this embodiment, the naming method may include at least one of the following two methods:
[0092] Method 1: Group naming, that is: layer name_layer order_material name_material order; for example: group_1_single product image_1.
[0093] Method 2: No grouping and naming, that is: no grouping_material naming_material sorting, for example: no grouping_single product copy 1_1.
[0094] The grouping can be understood as, for example, a graphic template includes multiple elements and the elements are related to each other, such as optimized price, discounted product image, and discount copy; these three elements related to optimization belong to a set and can be grouped. The non-grouping can be understood as the situation where there are few elements in the graphic template and no grouping is required.
[0095] Therefore, the step S1a may specifically include:
[0096] Step S1a-1: Name the template material composition structure according to the grouping rule and / or non-grouping rule, and the naming includes naming the type identification information. In this embodiment, the naming of the type identification information can be an identification of the image type, such as: QR code image, product image, Logo image, etc.
[0097] Step S1a-2: generating the candidate material template according to the named template material composition structure; wherein the first format template image is a PDF format template image, and the second format template image is an SVG format template image.
[0098] In this embodiment, the candidate material template includes a PDF format template image and an SVG format template image, so that the color difference problem that occurs when printing the material after the target image is uploaded can be avoided, because the printed material is generated based on the PDF format, thus avoiding the color difference problem.
[0099] It should be noted that, regardless of the above-mentioned method 1 or method 2, the type identification information can be the naming of the identification information of the image type, that is, SVG_ID, for example: the identification information of the meal image, the identification information of the QR code image, the identification information of the merchant logo, etc.
[0100] like Figure 3 As shown, based on the above content, the specific implementation process of step S101 may include:
[0101] Step S101-1: Selecting the target material template from the candidate material templates;
[0102] Step S101-2: generating the material material table according to the target material material template; that is, generating a table header matching the material material information and corresponding information in the table header in the material material table;
[0103] Step S101-3: writing the multiple target material material folder names into the header of the multiple material material folder names added in the material material table; the written content may be key information or partial information in the multiple target material material folder names, or may be all information of the target material material folder names; in other words, adding the relevant information of the target material material folder names into the material material table;
[0104] Step S101-4: determining the table in which the names of the plurality of target material folders are written as the target material table;
[0105] Step S101-5: parse the target material table to determine the table parsing result. The table parsing result may also include multiple lines of information, each line of information corresponding to the relevant information of a material, which may include the material name, material size, material type, etc. (such as Figure 3 shown).
[0106] It should be noted that the multiple material material folder names added in the target material material table may be target material material folder names of the material materials to be produced, for example: target material material folder names provided by merchants. The type information characterizing the material material type in the material material information may be type identification information pre-set when producing the candidate material material template. As mentioned above, the type identification information may be SVG_ID, i.e., identification information of the image type.
[0107] Step S102: determining multiple target material folder names in the material package that match the multiple material folder names according to the analysis of the acquired material package of the resource provider;
[0108] The material package in step S102 may be material information provided by multiple merchants and associated with the merchants, such as product images, merchant logos, merchant QR codes, etc. The material information provided by the merchants will be created in the form of a compressed package. After parsing the compressed package, the name of the material folder included in the compressed package and the material materials in the material folder can be determined. For example, the name of the compressed package may be merchant material or merchant image, etc. After decompression, multiple material folders may be obtained, such as merchant A, merchant B_1, merchant C, merchant B_2, etc. The target folder corresponding to the material folder name of each merchant includes the material information provided by each merchant, for example: the merchant A folder includes the image information of product 1 provided by merchant A, the image information of product 2, the logo image information of merchant A, the QR code image information of merchant A, etc.; the merchant B_1 folder includes the image information of product 1 provided by merchant B, the logo image information of merchant B, the QR code image information of merchant B, etc.; the merchant C folder includes the image information of product 1 provided by merchant C, the image information of product 2, the image information of product 3, the logo image information of merchant C, the QR code image information of merchant C, etc.; the merchant B_2 folder includes the image information of product 2 provided by merchant B, the logo image information of merchant B, the QR code image information of merchant B, etc. The above are only examples and are not used to limit the information included in the target folder.
[0109] It is understandable that, because it is necessary to batch generate offline material images based on the material materials provided by the merchant, the multiple target material material folder names obtained after parsing the material material package correspond to the multiple material material folder names added to the material material table in step S101-3. In other words, the multiple material material folder names added in step S101-3 can be determined based on the target material material information provided by the merchant, that is, the information of the target material material provider is added to the material material folder name header in the table, so as to meet the merchant information that can identify the target material material belongs to.
[0110] In this embodiment, the corresponding matching relationship is determined mainly through the names of multiple target material folders in the material package and the names of multiple material folders in the target material table.
[0111] Step S103: determining the corresponding position area of the target material in the target folder in the table parsing result according to the correspondence between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result.
[0112] The purpose of step S103 is to determine the corresponding location area of the target material in the table parsing result, so as to subsequently upload the target material to the corresponding location area.
[0113] In this embodiment, the target material materials in the target folder may include image materials, which may include product images, merchant logo images, merchant QR code images, and other image materials. The number and format of image materials are not limited. That is, the target material materials are materials required to generate offline materials, which may match the pre-made material material template, or may be more than the material quantity requirement in the material material template.
[0114] In this embodiment, the specific implementation process of step S103 may include:
[0115] Step S103-1: acquiring row information of the target material identification information in the table parsing result according to the correspondence between the target material material identification information and the material name in the table parsing result;
[0116] Step S103-2: Parse the material package obtained from the resource provider to determine the target material materials included in the target folder corresponding to the multiple target material material folder names; the material package can be parsed by decompressing the material material compression package, and after parsing, the target material material folder names included in the material package can be obtained, and the target material material information included in the target folder corresponding to the target material material folder name can be obtained, such as: image materials.
[0117] Step S103 - 3 : Identify the image material in the target material and determine the image type of the image material.
[0118] In this embodiment, the specific implementation process of step S103-2 may include:
[0119] Step S103-21: Determine whether the type of the image material is a two-dimensional code image type based on the identification of the image material; specifically, two-dimensional scanning (zxing) is used to identify the image material in the target material to determine whether the image type of the image material is a two-dimensional code image.
[0120] Step S103 - 22 : If not, calculating the image type score of the image material according to the size of the image material and / or the name of the image material.
[0121] Step S103-23: Determine the image type of the image material according to the correspondence between the image type score and the reference score of the image type.
[0122] The corresponding relationship between the image type score and the reference score in step S103-23 can be shown in the following table:
[0123] QR code image Logo Image Product images Abnormal (unknown) image Points Score>=100 100>score>=10 10>score=1 No score or score of 0
[0124] When the image type score falls within the range of the QR code image reference score, the image material is a QR code image type; when the image type score falls within the range of the Logo image reference score, the image material is a Logo image type; when the image type score falls within the range of the commodity image reference score, the image material is a commodity image type. When the image type score is 0 or no score, the image material is an abnormal image or an unknown image.
[0125] It is understandable that the image material can also be identified by identifying the name of the image material. Usually, the name of the image material can include relevant information of the image type. Therefore, the image type to which the image material belongs can be determined by identifying the keywords in the name of the image material.
[0126] Therefore, the recognition of the image material is not limited to the recognition and scoring of the QR code, but may also be keyword recognition, recognition of image feature points, and the like.
[0127] In step S103-22, the image type score of the image material is calculated according to the size of the image material. The type identification information of the image, such as SVG_ID, may be pre-set during template design. Different types of images have different sizes. Usually, the size of the product image is larger than the size of the QR code image, and the size of the QR code image is larger than the size of the Logo image. Therefore, the score can be given according to the size. The clarity of the image after uploading can be obtained through the image size and the size of the corresponding position area. The greater the clarity, the closer it is to the product image, the second closest to the QR code image, and the last to the Logo image. The image type score of the image material is calculated according to the name of the image material. It can be processed according to the vocabulary of the picture name, such as the product vocabulary, including similar words such as rice, beverages, etc., or obvious QR codes, logos, etc. for scoring. The closer to which vocabulary, the higher the score.
[0128] Step S103-4: According to the correspondence between the image type and the type identification information in the row information, determine the corresponding position area of the image material in the table parsing result. The type identification information is pre-marked when the material template is designed and produced, that is, SVG_ID, as described in the above step S101. Therefore, by comparing the image type with the type identification information, it is determined whether there is a correspondence between the two, and then the corresponding position area of the image material in the table parsing result is determined.
[0129] In this embodiment, the specific implementation process of step S103-3 may include:
[0130] Step S103-31: Obtain the quantity of the type identification information in the table parsing result;
[0131] Step S103-32: Determine whether the quantity of the type identification information is greater than or equal to the quantity of the image materials;
[0132] Step S103-33: If yes, determine whether there is a corresponding relationship between the name of the image material and the type identification information in the row information;
[0133] Step S103-34: If yes, the position of the type identification information in the row information is determined as the corresponding position area of the image material in the table parsing result.
[0134] When the determination result of step S103-33 is no, that is, there is no corresponding relationship between the name of the image material and the type identification information in the row information, the corresponding position area of the image material in the row information is randomly determined.
[0135] The above is a process of determining the corresponding position area based on determining whether the number of the type identification information is greater than or equal to the number of the image materials.
[0136] Further, when the determination result in step S103-32 is no, that is, the number of the type identification information is less than the number of the image materials, the method may include:
[0137] Step S103 - 41 : Determine the difference between the quantity of the type identification information and the quantity of the image materials, for example, the difference is N.
[0138] Step S103-42: Determine whether the number of abnormal image materials with the type score being abnormal is greater than or equal to the difference;
[0139] Step S103-43: If yes, then according to the deletion of the abnormal image material, determine that the number of the image identification information is equal to the number of the image material. In this embodiment, the deletion of the abnormal image material can be performed randomly, and if the number of deletions satisfies that the number of the image identification information is equal to the number of the image material, no more deletion is performed.
[0140] Based on the fact that the quantity of the image identification information in step S103-43 is equal to the quantity of the image materials, step S103-33 is executed.
[0141] Further, when the number of abnormal image materials with abnormal type scores in step S103-42 is less than the difference, the method may include:
[0142] Step S103-51: deleting the abnormal image material;
[0143] Step S103-52: Calculate the similarity between the deleted image materials;
[0144] Step S103-53: deleting image materials whose similarity meets the deletion requirement; for example, if the similarity between image material A and image material B is 95%, then deleting any one of the image material A and image material B;
[0145] Step S103-54: determining whether the number of image materials deleted according to the similarity is equal to the number of type identification information;
[0146] Step S103-55: If not, then delete the image materials after the similarity deletion according to the preset deletion order until the number of deleted image materials is equal to the number of type identification information. If yes, then execute the step S103-33.
[0147] In this embodiment, the specific implementation process of step S103-55 may include:
[0148] Step S103-551: Determine the priority order for deleting the image material according to the image type of the image material; for example, set the deletion priority order as: product image>merchant Logo image>QR code image.
[0149] Step S103-552: Deleting the image materials after the similarity is deleted according to the priority order until the number of deleted image materials is equal to the number of type identification information.
[0150] To further ensure the matching of the image material in the corresponding position area in the table parsing result, that is, when the number of image materials in the target material material and the SVG_ID in the table parsing result are inconsistent, the image material uploaded to the corresponding position area may not be the image required by the merchant, and thus a mismatch problem may occur. Therefore, in this embodiment, the following may also be included:
[0151] Step S101-b1: Determine whether the corresponding position area in the table parsing result where the target material is uploaded is correct;
[0152] Step S101-b2: If not, adjust the position sequence of the target material uploaded in the table parsing result. If yes, execute step S104.
[0153] In this embodiment, the position order adjustment may be performed by uploading the image materials of the same row of SVG_ID in the table parsing result separately or adjusting the order, that is, the position relationship is adjusted by marking the order of the image materials. Therefore, step S101-b2 may include:
[0154] Step Sb2-1: individually adjusting the target material uploaded in the table analysis result;
[0155] or;
[0156] Step Sb2-2: adjusting the target material uploaded in the table analysis result by row.
[0157] To further ensure that the uploaded image material meets the requirements for image material in the target material template, the above-mentioned image material can be cropped.
[0158] Step S104: generating a batch of material material combined images based on the synthesis of the target material materials uploaded in batches to the corresponding position area.
[0159] The above is a description of an embodiment of a method for batch merging of materials provided by the present application. In this embodiment, the name of the material folder to be added in the table for recording material information generated based on the target material template is determined by obtaining the name of the target material folder in the material package of the resource provider, that is, the name of the target material folder matches the name of the material folder; or, the name of the target material folder in the material package is added to the target material table. The material package of the acquired merchant (resource provider) is parsed, and the corresponding relationship between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result (the material name matches the multiple material folder names in the table before parsing, and the multiple material folder names are added to the table based on the target material folder name in the material package), that is, the corresponding relationship between the image material name and the SVG_ID, determines the corresponding position area of the image material in the table parsing result, and then uploads the image material in batches according to the corresponding position area to generate a batch of material material merging. This process only needs to determine the corresponding location area to be uploaded based on the corresponding relationship between the image material name and the SVG_ID, so that batch uploading can be achieved, and there is no need to upload the image materials one by one to complete the combined image, which improves the operation efficiency and reduces the operation cost. In addition, by presetting PDF format images and SVG format images in the material pixel template, the stability of offline printing colors is guaranteed to avoid color difference when outputting offline material combined images.
[0160] The above is a detailed description of an embodiment of a method for batch merging of materials provided by the present application. Corresponding to the embodiment of a method for batch merging of materials provided above, the present application also discloses an embodiment of a device for batch merging of materials, please refer to Figure 4 Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0161] like Figure 4 As shown, Figure 4 : is a schematic diagram of a structure of an embodiment of a device for batch merging of materials provided by the present application, and the device embodiment may include:
[0162] The first determination unit 401 is used to parse the acquired target material table and determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes a plurality of material folder names used to indicate that the material information belongs to a resource provider; the table parsing result includes material names matching the plurality of material folder names, and type identification information indicating the material type in the material information;
[0163] The second determining unit 402 is used to determine a plurality of target material folder names matching the plurality of material folder names in the material package according to the analysis of the acquired material package of the resource provider;
[0164] The third determining unit 403 is used to determine the corresponding position area of the target material in the target folder in the table parsing result according to the corresponding relationship between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result;
[0165] The generating unit 404 is used to generate a batch of material material combined images according to the synthesis of the target material materials uploaded in batches to the corresponding position area.
[0166] To avoid color difference after offline material output, further steps may include:
[0167] The candidate template generating unit is used to generate a candidate material template according to the template material composition structure; wherein the candidate material template includes a first format template image and a second format template image.
[0168] The candidate template generating unit may include: a naming subunit and a generating subunit;
[0169] The naming subunit is used to name the template material composition structure according to the grouping rule and / or non-grouping rule, and the naming includes the naming of the type identification information;
[0170] The generating subunit is used to generate the candidate material template according to the named template material composition structure; wherein the first format template image is a PDF format template image, and the second format template image is an SVG format template image.
[0171] The first determination unit 401 may include: a selection subunit, a table generation subunit, a writing subunit, a target table determination subunit, and a determination subunit;
[0172] The selection subunit is used to select the target material template from the candidate material templates;
[0173] The table generation subunit is used to generate the material table according to the target material template;
[0174] The writing subunit is used to write the multiple target material folder names into the header of the multiple material folder names added in the material material table;
[0175] The target table determination subunit is used to determine the table in which the names of the plurality of target material folders are written as the target material table;
[0176] The determination subunit is used to parse the target material table and determine the table parsing result.
[0177] The third determination unit 403 may include: a row information acquisition subunit, a target name determination subunit, an image type determination subunit, and a position determination subunit;
[0178] The row information acquisition subunit is used to acquire the row information of the target material material identification information in the table parsing result according to the correspondence between the target material material identification information and the material name in the table parsing result;
[0179] The target name determination subunit is used to parse the acquired material package of the resource provider to determine the target material included in the target folder corresponding to the multiple target material folder names;
[0180] The image type determination subunit is used to identify the image material in the target material and determine the image type of the image material;
[0181] The position determination subunit is used to determine the corresponding position area of the image material in the table parsing result according to the corresponding relationship between the image type and the type identification information in the row information.
[0182] Wherein, the image type determination subunit may include: an identification subunit, a calculation subunit and a determination subunit;
[0183] The identification subunit is used to determine whether the type of the image material is a two-dimensional code image type according to identifying the image material;
[0184] The calculation subunit is configured to calculate the image type score of the image material according to the size of the image material and / or the name of the image material when the recognition result in the recognition subunit is negative;
[0185] The determining subunit is used to determine the image type of the image material according to the corresponding relationship between the image type score in the calculating subunit and the reference score of the image type.
[0186] Based on the above, the position determination subunit may include: a quantity acquisition subunit, a quantity determination subunit, and a relationship determination subunit.
[0187] The quantity acquisition subunit is used to acquire the quantity of the type identification information in the table parsing result;
[0188] The quantity determination subunit is used to determine whether the quantity of the type identification information is greater than or equal to the quantity of the image materials;
[0189] The relationship determination subunit is used to determine whether there is a corresponding relationship between the name of the image material and the type identification information in the row information when the determination result of the quantity determination subunit is yes;
[0190] The position determination subunit may be, when the determination result of the relationship determination subunit is yes, determine the position of the type identification information in the row information as a corresponding position area of the image material in the table parsing result.
[0191] Based on the above, when the determination result of the relationship determination subunit is negative, the method may further include: a random determination subunit configured to randomly determine a corresponding position area of the image material in the row information.
[0192] Based on the above, when the determination result in the quantity determination subunit is that the quantity of the type identification information is less than the quantity of the image materials, it may include: a difference determination subunit, a difference relationship determination subunit, and a deletion subunit;
[0193] The difference determination subunit is used to determine the difference between the quantity of the type identification information and the quantity of the image materials;
[0194] The difference relationship determination subunit is used to determine whether the number of abnormal image materials with abnormal type scores is greater than or equal to the difference;
[0195] The deleting subunit is used to determine that the amount of the image identification information is equal to the amount of the image materials based on the deletion of the abnormal image materials when the determination result of the difference relationship determining subunit is yes.
[0196] When the determination result of the difference relationship determination subunit is that the number of abnormal image materials with abnormal type scores is less than the difference, it includes: a first deletion subunit, a similarity calculation subunit, a second deletion subunit, a quantity determination subunit, and a third deletion subunit;
[0197] The first deleting subunit is configured to delete the abnormal image material when the number of abnormal image materials with abnormal type scores is less than the difference value;
[0198] The similarity calculation subunit is used to calculate the similarity between the deleted image materials;
[0199] The second deleting subunit is used to delete the image materials whose similarity meets the deletion requirement;
[0200] The quantity determination subunit is used to determine whether the quantity of the image materials deleted according to the similarity is equal to the quantity of the type identification information;
[0201] The third deleting subunit is used to delete the image materials after similarity deletion according to a preset deletion order when the determination result of the quantity determining subunit is no, until the number of deleted image materials is equal to the number of type identification information.
[0202] The third deletion subunit may include: a priority determination subunit, used to determine the priority order for deleting the image material according to the image type of the image material; the third deletion subunit can specifically be used to delete the image material after the similarity is deleted according to the priority order determined in the priority determination subunit, until the number of deleted image materials is equal to the number of type identification information.
[0203] To ensure the matching of the uploaded image material, it may also include: a position determination subunit and an adjustment subunit;
[0204] The position determination subunit is used to determine whether the corresponding position area of the target material uploaded to the table parsing result is correct;
[0205] The adjusting subunit is used to adjust the position sequence of the target material uploaded in the table parsing result when the determination result of the position determining subunit is no.
[0206] The adjustment subunit may include: a separate adjustment subunit or a row adjustment subunit; the separate adjustment subunit is used to separately adjust the target material uploaded in the table parsing result; the row adjustment subunit is used to adjust the target material uploaded in the table parsing result according to the row.
[0207] The above is a description of an embodiment of a device for batch merging of material images provided in the present application. The specific content of the device embodiment can refer to the content of steps S101 to S104 in the above method embodiment, which will not be described in detail here.
[0208] Based on the above content, the present application also provides a computer storage medium for storing a computer program, wherein the program can execute the content of steps S101 to S104 as described above.
[0209] Based on the above content, the present application also provides an electronic device, such as Figure 5 As shown, in an embodiment of the electronic device, the electronic device may include:
[0210] Processor 501;
[0211] The memory 502 is used to store a computer program, and the program executes the contents of the above steps S101 to S104.
[0212] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0213] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0214] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0215] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0216] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A method for combining batches of materials, characterized in that: include: Parse the acquired target material table to determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes multiple material folder names used to indicate that the material information belongs to a resource provider, and multiple rows and multiple resource providers' material information; the table parsing result includes material names that match the multiple material folder names, and type identification information indicating the material type in the material information; Determine, based on the analysis of the acquired material package of the resource provider, multiple target material folder names in the material package that match the multiple material folder names; Determine the corresponding position area of the target material in the target folder in the table parsing result according to the correspondence between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result; A batch of material material composite images are generated based on the synthesis of the target material materials uploaded in batches to the corresponding position area.
2. The method for combining materials in batches according to claim 1, characterized in that: Also includes: A candidate material template is generated according to the template material composition structure; wherein the candidate material template includes a first format template image and a second format template image.
3. The method for combining materials in batches according to claim 2, characterized in that: The step of parsing the acquired target material table to determine the table parsing result includes: Selecting the target material template from the candidate material templates; Generate the material table according to the target material template; Writing the multiple target material folder names into the header of the multiple material folder names added in the material material table; Determine the table in which the names of the plurality of target material folders are written as the target material table; The target material table is parsed to determine the table parsing result.
4. The method for combining materials in batches according to claim 2, characterized in that: The step of generating a candidate material template according to the template material composition structure includes: The template material composition structure is named according to a grouping rule and / or a non-grouping rule, wherein the naming includes naming the type identification information; The candidate material template is generated according to the named template material composition structure; wherein the first format template image is a PDF format template image, and the second format template image is an SVG format template image.
5. The method for combining materials in batches according to claim 1, characterized in that: The determining, according to the correspondence between the target material material identification information in the target folder corresponding to the multiple target material material folder names and the material name in the table parsing result, a corresponding position area of the target material material in the target folder in the table parsing result comprises: According to the correspondence between the target material identification information and the material name in the table parsing result, obtaining the row information of the target material identification information in the table parsing result; Parsing the acquired material package of the resource provider to determine the target material included in the target folder corresponding to the multiple target material folder names; Identify the image material in the target material and determine the image type of the image material; According to the correspondence between the image type and the type identification information in the row information, a corresponding position area of the image material in the table parsing result is determined.
6. The method for combining materials in batches according to claim 5, characterized in that: The identifying the image material in the target material to determine the image type of the image material includes: Determining whether the type of the image material is a two-dimensional code image type according to identifying the image material; If not, calculating the image type score of the image material according to the size of the image material and / or the name of the image material; The image type of the image material is determined according to the correspondence between the image type score and the reference score of the image type.
7. The method for combining materials in batches according to claim 5, characterized in that: The determining, according to the correspondence between the image type and the type identification information in the row information, a corresponding position area of the image material in the table parsing result includes: Obtaining the quantity of the type identification information in the table parsing result; Determining whether the number of the type identification information is greater than or equal to the number of the image materials; If yes, determining whether there is a corresponding relationship between the name of the image material and the type identification information in the row information; If so, the position of the type identification information in the row information is determined as the corresponding position area of the image material in the table parsing result.
8. The method for combining batches of materials according to claim 7, characterized in that: Also includes: When the result of determining whether there is a corresponding relationship between the name of the image material and the type identification information in the row information is no, the corresponding position area of the image material in the row information is randomly determined.
9. The method for combining materials in batches according to claim 7, characterized in that: Also includes: When the number of the type identification information is less than the number of the image materials, determining a difference between the number of the type identification information and the number of the image materials; Determine whether the number of abnormal image materials with the type score being abnormal is greater than or equal to the difference; If so, based on the deletion of the abnormal image material, it is determined that the amount of the image identification information is equal to the amount of the image material.
10. The method for combining materials in batches according to claim 9, characterized in that: Also includes: When the number of abnormal image materials with abnormal type scores is less than the difference, deleting the abnormal image materials; Calculate the similarity between the deleted image materials; Delete image materials whose similarity meets the deletion requirements; Determining whether the number of image materials deleted according to the similarity is equal to the number of type identification information; If not, the image materials after the similarity deletion are deleted according to a preset deletion order until the number of the deleted image materials is equal to the number of the type identification information.
11. The method for combining batches of materials according to claim 10, characterized in that: The deleting the image materials after the similarity deletion according to a predetermined deletion order until the number of the deleted image materials is equal to the number of the type identification information includes: Determining a priority order for deleting the image materials according to image types of the image materials; The image materials after the similarity deletion are deleted according to the priority order until the number of the deleted image materials is equal to the number of the type identification information.
12. The method for combining batches of materials according to claim 1, characterized in that: Also includes: Determine whether the corresponding location area in the table parsing result uploaded with the target material is correct; If not, the position sequence of the target material uploaded in the table parsing result is adjusted.
13. The method for combining batches of materials according to claim 12, characterized in that: The step of adjusting the position sequence of the target material uploaded in the table parsing result includes: Separately adjust the target material uploaded in the table analysis result; or; The target material uploaded in the table analysis result is adjusted row by row.
14. A device for combining batches of materials, characterized in that: include: A first determination unit is used to parse the acquired target material table and determine the table parsing result; wherein the target material table is a table for recording material information generated according to the selected target material template, and the table includes a plurality of material folder names used to indicate that the material information belongs to a resource provider, and a plurality of rows and material information of a plurality of resource providers; the table parsing result includes a material name matching the plurality of material folder names, and type identification information indicating a material type in the material information; A second determining unit is used to determine, based on the analysis of the acquired material package of the resource provider, a plurality of target material folder names in the material package that match the plurality of material folder names; A third determining unit is used to determine the corresponding position area of the target material in the target folder in the table parsing result according to the corresponding relationship between the target material identification information in the target folder corresponding to the multiple target material folder names and the material name in the table parsing result; A generating unit is used to generate a batch of material material combined images according to the synthesis of the target material materials uploaded in batches to the corresponding position area.
15. A computer storage medium for storing a computer program; The program executes the method for batch merging of materials as described in any one of claims 1-13 above.
16. An electronic device, comprising: processor; A memory for storing a computer program, wherein the program executes the method for batch merging of material drawings as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Method and system for advertisement generation and display and advertisement production and display client
CN101651550A
Method and device for generating page and providing page information
CN108108157A