CN115599384B - Picture character generating method, device, equipment and storage medium thereof - Google Patents

Picture character generating method, device, equipment and storage medium thereof Download PDF

Info

Publication number
CN115599384B
CN115599384B CN202211599004.7A CN202211599004A CN115599384B CN 115599384 B CN115599384 B CN 115599384B CN 202211599004 A CN202211599004 A CN 202211599004A CN 115599384 B CN115599384 B CN 115599384B
Authority
CN
China
Prior art keywords
background color
target
picture
displayed
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211599004.7A
Other languages
Chinese (zh)
Other versions
CN115599384A (en
Inventor
张良
杨传兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingyuan Yunke E Commerce Co ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202211599004.7A priority Critical patent/CN115599384B/en
Publication of CN115599384A publication Critical patent/CN115599384A/en
Application granted granted Critical
Publication of CN115599384B publication Critical patent/CN115599384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method, a device and equipment for generating picture characters and a storage medium thereof, belonging to the technical field of computer application. The text generation method comprises the following steps: combing a picture text template library and a background color library of the associated user interface; acquiring data to be displayed of the associated user interface; according to the data to be displayed, an adaptive target picture text template is determined from the picture text template library; according to the data to be displayed, determining an adaptive target background color from the background color library; and placing the data to be displayed into the target picture character template and adding the target background color to generate corresponding picture characters. The invention solves the technical problem of slow page running speed caused by long picture resource loading time in the prior art.

Description

Picture character generating method, device, equipment and storage medium thereof
Technical Field
The present invention relates to the field of computer applications, and in particular, to a method, an apparatus, a device, and a storage medium for generating a picture and text.
Background
With the continuous progress of computer and internet technologies, the display requirements for the system or web pages are also higher and higher. Generally speaking, data of an enterprise system or an internal website can be displayed in a list or card form, and in order to make the display effect of the data more attractive, pictures need to be added into the data to form the effect of overlapping the pictures and the characters (picture characters), so as to promote the visual perception of a user.
The conventional picture character generation method is to initiate page requests to the network terminal so as to load picture resources, but the method needs to initiate page requests to other terminals for a plurality of times, so that the loading time of the page is prolonged, and the running speed of the page is further reduced.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device and equipment for generating picture characters and a storage medium thereof, and aims to solve the technical problem that the conventional picture resource loading method is long in loading time, so that the running speed of a page is reduced.
In order to achieve the above object, the present invention provides a method for generating a picture text, the method comprising:
combing a picture text template library and a background color library of the associated user interface;
acquiring data to be displayed of the associated user interface;
according to the data to be displayed, an adaptive target picture text template is determined from the picture text template library;
according to the data to be displayed, determining an adaptive target background color from the background color library;
And placing the data to be displayed into the target picture character template and adding the target background color to generate corresponding picture characters.
Optionally, the step of combing the photo text template library of the associated user interface includes:
acquiring an interface design draft of an associated user interface;
identifying and extracting parent elements and child elements in the interface design manuscript;
nesting the parent element and the child element to serve as the picture text template, wherein at least one child element is nested in the parent element;
and adding the theme type and the number of sub-elements to the picture text template, and establishing a picture text template library.
Optionally, the step of combing the background color library of the associated user interface includes:
identifying and extracting colors in the interface design manuscript to be used as the background color;
and adding an index value to the background color according to the extraction sequence of the colors, and establishing a background color library.
Optionally, the step of identifying and extracting the color in the interface design draft as the background color includes:
dividing the interface design manuscript into a plurality of blocks according to a preset blocking standard;
Performing fuzzy processing on the block to obtain a fuzzy processed block, and determining the number of pixel points of each color in the fuzzy processed block;
and taking the color with the largest number of pixel points as the background color.
Optionally, the step of determining the adapted target picture text template from a preset picture text template library according to the data to be displayed includes:
acquiring key information of the data to be displayed, and determining the topic type of the data to be displayed according to the key information;
screening target theme types consistent with the theme types based on the picture text template library;
determining the key information quantity of the data to be displayed;
and screening the picture text templates corresponding to the number of the subelements consistent with the number of the key information based on the target theme type to serve as target picture text templates.
Optionally, the step of determining the adapted target background color from a preset background color library according to the data to be displayed includes:
acquiring an identification number of the data to be displayed and a quantity value of the background color in the background color library;
performing traversal accumulation on the identification numbers to obtain corresponding identification values;
And performing modulus on the identification value and the number value to obtain a corresponding background color index value, and taking the background color corresponding to the background color index value as a target background color.
Optionally, the step of placing the data to be displayed in the target picture text template and adding the target background color to generate the corresponding picture text includes:
acquiring a target parent element and a target child element in a target picture text template;
taking the target background color as the parent element content of the target parent element, and setting the background color attribute of the target background color according to the parent element attribute of the target parent element, wherein the parent element attribute comprises length, width and coordinates;
and acquiring key information in the data to be displayed, taking the key information as sub-element content of the target sub-element, and setting key information attributes of the key information according to sub-element attributes of the target sub-element, wherein the sub-element attributes comprise fonts, word sizes and alignment modes.
The invention also provides a picture character generating device, which comprises:
the combing module is used for combing the picture text template library and the background color library of the related user interface;
The acquisition module is used for acquiring the data to be displayed of the associated user interface;
the determining module is used for determining an adaptive target picture text template from the picture text template library according to the data to be displayed; according to the data to be displayed, determining an adaptive target background color from the background color library;
and the generating module is used for placing the data to be displayed into the target picture text template and adding the target background color to generate corresponding picture text.
The invention also provides a picture character generating device, which comprises: the image character generation device comprises a memory, a processor and an image character generation program which is stored in the memory and can run on the processor, wherein the image character generation program is configured to realize the steps of the image character generation method.
The present invention also provides a storage medium, which is a computer readable storage medium, and the computer readable storage medium stores a photo text generation program, where the photo text generation program is executed by a processor to implement the steps of the photo text generation method.
The invention discloses a method, a device, equipment and a storage medium for generating picture characters, which are characterized in that the generation efficiency and the attractiveness of the picture characters are improved by combing a picture character template library and a background color library of an associated user interface, further, data to be displayed of the associated user interface are acquired when the associated user interface has a use requirement, further, an adaptive target picture character template is determined from the picture character template library according to the data to be displayed, an adaptive target background color is determined from the background color library, and further, the data to be displayed is put into the target picture character template and the target background color is added, so that corresponding picture characters are generated. The method for generating the picture characters can directly extract key information in the data to be displayed, and select matched picture character templates and background colors from a preset picture character template library and a background color library, so as to directly generate the picture characters and display the picture characters in an associated user interface; the method and the device avoid sending a picture loading request to the network equipment, can effectively reduce the loading time of picture resources, and increase the running speed of an associated user interface; the key information in the data to be displayed is fused in the picture characters for display, so that the situation that an invariable default picture is used by an associated user interface after the picture loading fails is avoided, the attractiveness of the associated user interface is effectively improved, the key information is displayed in a more visual mode by utilizing the character symbols in the picture characters, a browser of the associated user interface can quickly capture the key information, and the use feeling of the user is further improved.
Drawings
FIG. 1 is a schematic diagram of a structure of a photo-text generating device in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic view of a scenario of a method for generating a picture text according to an embodiment of the present invention;
FIG. 3 is a flowchart of a more complete embodiment of a method for generating pictographic characters according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a method for generating photo text according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an interface design draft effect of a method for generating photo text according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a photo text effect of a photo text generation method according to an embodiment of the present invention;
fig. 7 is a schematic device structure diagram of a method for generating a picture text according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a photo text generating device in a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the photo text generation apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the pictographic character generating device, and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
As shown in fig. 1, an operating system, a data storage module, a network communication module, a user interface module, and a pictogram generation program may be included in the memory 1005 as one type of storage medium.
In the pictogram generating device shown in fig. 1, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001, the memory 1005 in the picture word generation device of the present invention may be provided in a picture word generation device that calls a picture word generation program stored in the memory 1005 through the processor 1001 and performs the following operations:
combing a picture text template library and a background color library of the associated user interface;
acquiring data to be displayed of the associated user interface;
according to the data to be displayed, an adaptive target picture text template is determined from the picture text template library;
according to the data to be displayed, determining an adaptive target background color from the background color library;
and placing the data to be displayed into the target picture character template and adding the target background color to generate corresponding picture characters.
Further, the step of combing the photo text template library of the associated user interface comprises the following steps:
acquiring an interface design draft of an associated user interface;
identifying and extracting parent elements and child elements in the interface design manuscript;
nesting the parent element and the child element to serve as the picture text template, wherein at least one child element is nested in the parent element;
and adding the theme type and the number of sub-elements to the picture text template, and establishing a picture text template library.
Further, the step of combing the background color library of the associated user interface includes:
identifying and extracting colors in the interface design manuscript to be used as the background color;
and adding an index value to the background color according to the extraction sequence of the colors, and establishing a background color library.
Further, the step of identifying and extracting the color in the interface design manuscript as the background color includes:
dividing the interface design manuscript into a plurality of blocks according to a preset blocking standard;
performing fuzzy processing on the block to obtain a fuzzy processed block, and determining the number of pixel points of each color in the fuzzy processed block;
And taking the color with the largest number of pixel points as the background color.
Further, the step of determining the adapted target picture text template from a preset picture text template library according to the data to be displayed includes:
acquiring key information of the data to be displayed, and determining the topic type of the data to be displayed according to the key information;
screening target theme types consistent with the theme types based on the picture text template library;
determining the key information quantity of the data to be displayed;
and screening the picture text templates corresponding to the number of the subelements consistent with the number of the key information based on the target theme type to serve as target picture text templates.
Further, the step of determining the adapted target background color from the preset background color library according to the data to be displayed includes:
acquiring an identification number of the data to be displayed and a quantity value of the background color in the background color library;
performing traversal accumulation on the identification numbers to obtain corresponding identification values;
and performing modulus on the identification value and the number value to obtain a corresponding background color index value, and taking the background color corresponding to the background color index value as a target background color.
Further, the step of placing the data to be displayed in the target picture text template and adding the target background color to generate the corresponding picture text includes:
acquiring a target parent element and a target child element in a target picture text template;
taking the target background color as the parent element content of the target parent element, and setting the background color attribute of the target background color according to the parent element attribute of the target parent element, wherein the parent element attribute comprises length, width and coordinates;
and acquiring key information in the data to be displayed, taking the key information as sub-element content of the target sub-element, and setting key information attributes of the key information according to sub-element attributes of the target sub-element, wherein the sub-element attributes comprise fonts, word sizes and alignment modes.
The embodiment of the invention provides a picture character generating method, which is described in a scene schematic diagram of an implementation mode of the picture character generating method, and referring to fig. 2, it is to be described that an execution subject of the picture character generating method is a picture character generating device, and the picture character generating device can determine a generating mode of pictures in an associated user interface according to user requirements; the method comprises the steps that an image text generating device loads data to be displayed, identifies and extracts image contents in the data to be displayed, such as company LOGO, user head portrait and the like, and displays the extracted image contents in an associated user interface; the method comprises the steps that picture text generating equipment loads data to be displayed, if picture content is not extracted, the picture text generating equipment sends a picture loading request to associated network equipment, acquires the picture content sent by the network equipment, and further displays the picture content in an associated user interface; if the picture content is not extracted from the data to be displayed and/or the picture loading request is not sent to the network equipment, the picture character generating equipment can also select an adaptive default picture from preset default pictures and display the adaptive default picture on an associated user interface, or generate picture characters through the picture character generating method and display the picture characters in the associated user interface; the picture character generating device can directly extract key information in the data to be displayed, and selects a matched picture character template and background color from a preset picture character template library and a background color library, so that picture characters are directly generated and displayed in an associated user interface.
The default picture is a picture stored locally in advance and is used for being displayed in a page when picture resource loading fails, so that the attractiveness of the page is improved; the data to be displayed refers to data which needs to be displayed but is not displayed in the page.
The embodiment of the invention provides a picture character generating method, which is described below by a flow diagram of a more complete embodiment of the picture character generating method, referring to fig. 3, picture character generating equipment combs and establishes a picture character template library and a background color library according to an interface design draft of an associated user interface, and determines an adapted target picture character template from the picture character template library according to data to be displayed, wherein the picture character template is formed by nesting a father element and a child element, the father element is set as a relative positioning element by a CSS technology, the child element is set as an absolute positioning element, the adapted target background color is determined from the background library, key information of the data to be displayed is further put into the target picture character template to serve as child element content of the child element, the target background color is added to serve as father element content of the father element, and finally the picture character is generated. The embodiment of the invention provides a picture character generation method for improving front-end efficiency, which avoids sending a picture loading request to network equipment, can effectively reduce the loading time of picture resources and increases the running speed of an associated user interface; and the key information in the data to be displayed is fused in the picture text for display, so that the aesthetic property of the associated user interface is further improved.
Referring to fig. 4, in a first embodiment of a method for generating a picture text, the method for generating a picture text includes:
and S10, combing a picture text template library and a background color library of the associated user interface.
In some embodiments, it should be noted that an execution subject of the method for generating a picture text is a picture text generating device, where the picture text generating device obtains an interface design draft uploaded by an interface designer in an associated user interface, and combines a picture text template library and a background color library of the associated user interface according to the interface design draft, and stores the combined picture text template library and background color library in the picture text generating device, so as to provide multiple picture text templates and background colors for data to be displayed of the associated user interface.
The picture and the text refer to an effect picture formed by overlapping the picture and the text.
The related user interface refers to a graphic state presented in front of a user and displayed on a display screen, and is a medium for interaction and information exchange between a system and the user, and comprises a man-machine interaction and graphic user interface.
The interface design manuscript is a design manuscript which is uploaded by a user interface designer and related to the related user interface, and each element of the related user interface and attribute information thereof are marked on the interface design manuscript.
The picture text template library is a set of picture text templates which are stored with a plurality of associated user interfaces and are available; the picture text template is in a fixed format for generating picture text, comprises at least one father element and at least one child element, and is generated in a mode of nesting child elements of the father element in a CSS (cascading style sheet) box model.
The box model refers to that various labels, elements and the like in various user interfaces can be regarded as one box, the labels, the elements and the like can play the functions of the box or have the attributes of the box, different elements, the labels and the like in the user interfaces are put into the box, or the different elements, the labels and the like in the user interfaces are used as the content of the box and are endowed with the attributes of the box, in addition, another small box can be nested in a large box, the large box is the father element, and the small box is the child element; the parent element attribute of the parent element comprises length, width and coordinates, wherein the coordinates refer to coordinates of the parent element in a corresponding user interface; the child element attributes of the child element include: font, font size, and alignment.
The background color library is a set of background colors available for storing a plurality of associated user interfaces; the background color is used for setting the background color of the image text.
Optionally, the step S10, the step of combing the photo text template library and the background color library of the associated user interface includes:
step S11, acquiring an interface design draft of the associated user interface.
And step S12, identifying and extracting parent elements and child elements in the interface design manuscript.
In some embodiments, the photo text generation device obtains the interface design manuscript uploaded by the interface designer in the associated user interface, and identifies the interface design manuscript, thereby extracting the parent element and the child element in the interface design manuscript.
In order to assist understanding of the above technical solution, the following description is aided by an interface design draft schematic diagram of a specific image text generation method, referring to fig. 5, an associated user interface stores an interface design draft uploaded by an interface designer, where the interface design draft has preset parent elements and child elements, and the image text generation device identifies and extracts the parent elements and child elements in the user interface design draft and generates an image text template.
And step S13, nesting the parent element and the child element to serve as the picture text template, wherein at least one child element is nested in the parent element.
And S14, adding the theme type and the number of the subelements to the picture text template, and establishing a picture text template library.
In some embodiments, the photo text generation device nests the parent element and the child element extracted from the interface design manuscript through a CSS technology to serve as the photo text template, wherein the photo text template comprises at least one parent element, and at least one child element is nested in the parent element; the nesting method of the parent element and the child element in the picture text template can be used for directly nesting according to the content in the interface design manuscript, or the parent element and the child element extracted from the interface design manuscript are randomly combined to generate a new picture text template. The picture character generating equipment adds a theme type, such as a name, an academic, a department, a title and the like, to the picture character template according to the user interface design draft, adds the number of sub-elements to the picture character template according to the number of the sub-elements contained in the picture character template, and takes the theme type and the number of the sub-elements as the identification of the picture character template; and combining the picture text templates generated based on the interface design manuscript to generate the picture text template library.
Nesting refers to a method of adding one or more small boxes (child elements) to an existing large box (parent element).
The identification is used for matching with the data to be displayed of the associated user interface, so that an adapted picture text template is determined in the picture text template library.
For example, referring to fig. 5, the photo text generating device identifies and extracts a parent element a and a parent element B, and a child element 1, a child element 2, a child element 3, a child element 4, a child element 5, and a child element 6 according to the interface design draft, so as to nest the parent element and the child element, thereby generating a photo text template, where the photo text template a may be the parent element a, the child element 1, the child element 2, and the child element 3 that are directly nested from the interface design draft, or may randomly combine the parent element and the child element extracted from the interface design draft, so as to generate the photo text template B: parent element B, child element 1, and child element 6; further, the picture text generating device analyzes each picture text template and adds a theme type to each picture text template, and for example, if initial contents of all subelements in the picture text template a are accounting, cashing and financial director, the theme type can be added to the picture text template a: the financial department, the subelement quantity 3, and then finish setting up the said picture word template a; and combining the picture and text templates combed out from the interface design manuscript so as to generate a picture and text template library.
In this embodiment, the image text generating device identifies and extracts a parent element and a child element in an associated user interface by acquiring an interface design draft of the associated user interface, and then nests the parent element and the child element to be used as the image text template, adds a theme type and the number of child elements to be used as identifiers to the image text template to be matched with data to be displayed of the associated user interface, thereby determining an adapted image text template, and combines the generated image text templates to establish an image text template library. By establishing the picture text template library, various subjects and various types of picture text templates are provided for the data to be displayed of the interface, so that each data to be displayed can be adapted, various picture texts are further generated, the attractiveness of the associated user interface is further improved, meanwhile, the generation time of the picture texts can be effectively reduced by establishing the picture text template library, and the running speed of the associated interface is further improved.
And step S15, identifying and extracting the colors in the interface design manuscript to serve as the background color.
In some embodiments, the photo text generation device obtains an interface design draft of the associated user interface, further identifies and extracts colors in the interface design draft, and uses the extracted colors as the background colors for use in photo text generation.
Optionally, the step S15 of identifying and extracting the color in the interface design draft as the background color includes:
and step S151, dividing the interface design manuscript into a plurality of blocks according to a preset partitioning standard.
Step S152, performing blurring processing on the block to obtain a blurred block, and determining the number of pixels of each color in the blurred block.
And step S153, taking the color with the largest number of pixel points as the background color.
In some embodiments, the image text generating device divides the interface design draft into a plurality of blocks according to a preset partitioning standard, and further performs fuzzy processing on each block to obtain each block after the fuzzy processing, and further counts the number of pixels of each color in each block, determines a color with the largest number of pixels in each block, and uses the color as a main color of the block, and further uses a main color of each block as the background color.
The preset partitioning standard refers to a standard for properly partitioning the interface design manuscript according to requirements; illustratively, the interface design manuscript is transversely divided into 5 blocks; the preset partitioning standard may be preset according to the statistical analysis result of the big data, or may be determined according to the actual situation, which is not limited in this embodiment.
The blurring processing refers to a processing method for blurring an image by removing image details through weighted average processing on pixels in the image according to a Gaussian curve and the like.
In this embodiment, the image text generating device appropriately divides the interface design manuscript of the related user interface into each block according to the preset partitioning standard, and further performs fuzzy processing on each block, so that the image text generating device can more quickly extract feature pixels in each block, determine feature colors (main colors), extract appropriate colors as background colors adapted to the related interface, and generate a corresponding background color library.
And S16, adding an index value to the background color according to the extraction sequence of the colors, and establishing a background color library.
In some embodiments, the image text generating device divides the interface design draft into a plurality of blocks according to a preset partitioning standard, extracts the main colors of the blocks as background colors respectively, adds an index value to the background colors according to the extraction sequence of the main colors of the blocks, establishes a background color library by combining the background colors, and establishes an index to the background color library according to the index value.
The index is a storage structure created for accelerating the retrieval of data in a database, each data in the database corresponds to a unique index value, and corresponding data can be quickly searched through the index value.
In this embodiment, the image text generating device identifies and extracts the colors in the interface design manuscript, uses the main colors of each partition in the interface design manuscript as the background colors, realizes the determination of the adaptation background colors of the associated interface, further adds index values to the obtained background colors, establishes indexes with each background color combination, and further establishes a background color library adapted to the associated user interface. By means of the establishment of the adaptation background color library and the creation of the index, the background color of the picture text adaptation can be rapidly determined through the index value when the picture text is generated, the loading time of picture resources of an associated user interface is further reduced, the running speed of the interface is increased, the aesthetic property of the associated user interface can be effectively increased through the adapted background color, and the use feeling of a user is further improved.
Step S20, obtaining the data to be displayed of the associated user interface.
In some embodiments, when the image text generating device detects that the associated user interface has a data display requirement, the image text generating device acquires data to be displayed of the associated user interface, extracts key information and an identification number of the data to be displayed, determines an adaptive image text template and background color according to the key information and the identification number, and generates corresponding image text.
And step S30, determining an adaptive target picture text template from the picture text template library according to the data to be displayed.
In some embodiments, the photo text generating device obtains key information of the data to be displayed, determines a theme type of the data to be displayed according to the key information, and defines templates of various theme types in a photo text template library through the photo text templates, wherein the theme types include but are not limited to names, sexes, titles, academia and the like; and for the picture text templates with the same theme type, the adaptive picture text templates can be determined according to the number of key information and the number of sub-elements in the data to be displayed.
And S40, determining an adaptive target background color from the background color library according to the data to be displayed.
In some embodiments, the picture text generating device obtains a unique ID (identification) number of the data to be displayed, and further performs traversal accumulation on the unique ID number to obtain a unique identification value corresponding to the data to be displayed, and further obtains an index value of a background color according to the unique identification value, and determines an adapted background color in the background color library according to the index value.
And S50, placing the data to be displayed into the target picture text template and adding the target background color to generate corresponding picture text.
In some embodiments, the image text generating device places the key information of the data to be displayed in the corresponding position of the image text template, adds the adaptive background color, and effectively increases the aesthetic property of the associated user interface by fusing the key information in the data to be displayed in the image text for display.
In this embodiment, the image text generating device promotes the generating efficiency and the aesthetic degree of the image text by combing the image text template library and the background color library of the associated user interface, and further obtains the data to be displayed of the associated user interface when the associated user interface has a use requirement, and further determines an adapted target image text template from the image text template library according to the data to be displayed, and determines an adapted target background color from the background color library, and further places the data to be displayed in the target image text template and adds the target background color to generate the corresponding image text. The method for generating the picture characters can directly extract key information in the data to be displayed, and select matched picture character templates and background colors from a preset picture character template library and a background color library, so as to directly generate the picture characters and display the picture characters in an associated user interface; the method and the device avoid sending a picture loading request to the network equipment, can effectively reduce the loading time of picture resources, and increase the running speed of an associated user interface; the key information in the data to be displayed is fused in the picture characters for display, so that the situation that an invariable default picture is used by an associated user interface after the picture loading fails is avoided, the attractiveness of the associated user interface is effectively improved, the key information is displayed in a more visual mode by utilizing the character symbols in the picture characters, a browser of the associated user interface can quickly capture the key information, and the use feeling of the user is further improved.
Further, based on the above embodiment, after step S30, the photo text generation method may further include:
step S31, obtaining key information of the data to be displayed, and determining the theme type of the data to be displayed according to the key information.
In some embodiments, the picture text generating device extracts key information from the acquired data to be displayed, analyzes the extracted key information, determines a topic type corresponding to the key information, and further determines the topic type of the data to be displayed.
The key information refers to words or words capable of summarizing the data content to the greatest extent.
Exemplary, the image text generation extracts the key information from the acquired data to be displayed to obtain the key information: thirdly, determining the topic type corresponding to the key information according to the key information as follows: and determining the name, and further determining the theme type of the data to be displayed as the name.
And step S32, screening the target theme type consistent with the theme type based on the picture text template library.
In some embodiments, the picture text generating device matches the determined topic type of the key information with picture text templates in the picture text template library, and screens the picture text templates consistent with the topic type. Exemplary, the topic types of the key information are: the names and the theme types in the picture text template library are screened out as follows: a picture text template of the name.
Step S33, determining the key information quantity of the data to be displayed.
Step S34, based on the target theme type, screening the picture text templates corresponding to the number of the sub-elements consistent with the number of the key information as target picture text templates.
In some embodiments, the picture text generating device determines the number of key information in the data to be displayed, and further performs secondary screening in the screened picture text templates consistent with the topic types of the key information, and takes the picture text templates consistent with the topic types and the number of sub-elements in the picture text templates consistent with the topic types as target picture text templates, where the target picture text templates are the picture text templates with the highest adaptation degree with the data to be displayed.
In this embodiment, the picture text generating device determines a theme type of the data to be displayed according to the key information by acquiring the key information of the data to be displayed, and then screens a target theme type consistent with the theme type based on the picture text template library, so as to screen the picture text template once, determine a picture text template consistent with the theme type, further determine the number of key information of the data to be displayed, and screen the picture text template corresponding to the number of sub-elements consistent with the number of key information as a target picture text template based on the target theme type. And determining a picture text template most suitable for the data to be displayed from the picture text template library through secondary screening of the topic type and the key information quantity, thereby further improving the generation efficiency and the aesthetic property of the picture text.
Further, based on the above embodiment, after step S40, the photo text generation method may further include:
step S41, the identification number of the data to be displayed and the number value of the background colors in the background color library are obtained.
Step S42, traversing and accumulating the identification numbers to obtain corresponding identification values.
And S43, performing modulus of the identification value and the number value to obtain a corresponding background color index value, and taking the background color corresponding to the background color index value as a target background color.
In some embodiments, the picture text generating device obtains the unique identification number of the data to be displayed, and then performs traversal accumulation on the unique identification number to obtain a unique identification value corresponding to the data to be displayed, and then obtains a quantity value of the background color in the background color library, and performs modulus of the unique identification value and the quantity value, and then obtains an index value according to the modulus result, and determines the corresponding background color in the background color library as the target background color according to the index value.
The target background color refers to the unique background color to which the data to be displayed is adapted.
The traversal accumulation refers to a method for sequentially accessing and accumulating the identification numbers along a certain route and summing the identification numbers to obtain corresponding numerical values.
The modulo operation is an operation method for obtaining a remainder of dividing two numbers by each other.
Illustratively, the unique identification number of the data to be displayed is: 3265842125, the picture character generating device performs traversal accumulation on the unique identification numbers to obtain corresponding unique identification values: 38, the number value of the background colors in the background color library is 38, and the unique marking value and the number value are subjected to modulus to obtain a background color index value 1, so that the background color 1 in the background color library is determined to be the target background color according to the index value.
In this embodiment, the picture text generating device obtains the identification number of the data to be displayed and the number value of the background color in the background color library, so as to perform traversal accumulation on the identification number to obtain a corresponding identification value, and then perform modulo on the identification value and the number value to obtain a corresponding background color index value, and takes the background color corresponding to the background color index value as the target background color. And determining the unique and fixed background color corresponding to the data to be displayed through the unique marking value corresponding to the unique marking number in the data to be displayed, so that the background color of the picture text is prevented from changing after the associated page is refreshed, and the generation quality of the picture text is further improved.
Further, based on the above embodiment, after step S50, the photo text generation method may further include:
step S51, obtaining a target parent element and a target child element in the target picture text template.
In some embodiments, the photo text generation device obtains a target parent element and a target child element in a target photo text template, sets the target parent element as a relative positioning element and sets the target child element as an absolute positioning element through a CSS technology. The relative positioning element is an element which does not deviate from the document flow when being shifted, still keeps the form before the relative positioning element is not positioned, and keeps the original space occupied by the relative positioning element, and the upper left corner of the relative positioning element is taken as a reference object when being shifted. The absolute positioning element refers to an element which is separated from a document stream when offset is performed, does not occupy space, and a subsequent element in the document stream fills the space left by the subsequent element. The document flow refers to the position occupied by the displayable objects in the document when arranged.
And step S52, taking the target background color as the parent element content of the target parent element, and setting the background color attribute of the target background color according to the parent element attribute of the target parent element, wherein the parent element attribute comprises length, width and coordinates.
In some embodiments, the photo text generation device replaces the original parent element content in the target parent element with the obtained target background color, or directly uses the target background color as the parent element content of the target parent element, and sets the background color attribute of the target background color according to the parent element attribute of the target parent element, where the parent element attribute includes a length, a width and coordinates.
Illustratively, referring to FIG. 6, the left side in the user interface is the target picture text template, the left side is the generated picture text effect; the target background color is background color 1, and the element attribute of the target parent element is: length 15, width 13, coordinates (5, 7); the picture text generating device takes the background color 1 as the parent element content of the target parent element, and sets the background color attribute of the target background color according to the parent element attribute of the target parent element as follows: length 15, width 13, coordinates (5, 7).
Step S53, obtaining key information in the data to be displayed, taking the key information as sub-element content of the target sub-element, and setting key information attributes of the key information according to sub-element attributes of the target sub-element, wherein the sub-element attributes comprise fonts, word sizes and alignment modes.
In some embodiments, the photo text generating device replaces original child element content in the target child element with the obtained key information, or directly uses the key information as child element content of the target child element, and sets key information attributes of the key information according to parent element attributes of the target child element, where the child element attributes include fonts, word sizes and alignment modes.
Illustratively, referring to fig. 6, the key information is: zhang San (name), the subelement attribute is: font-regular script, font size-5 and alignment-centering alignment; the picture text generating device takes the key information as the sub-element content of the sub-element, and sets the key information attribute of the key information according to the sub-element attribute of the target sub-element as follows: font-regular script, font size-5, and alignment-centering alignment, and further generates pictorial text and displays it in an associated user interface.
In this embodiment, the picture text generating device obtains a target parent element and a target child element in a target picture text template, further uses the target background color as a parent element content of the target parent element, and sets a background color attribute of the target background color according to a parent element attribute of the target parent element, where the parent element attribute includes a length, a width and coordinates, further obtains key information in the data to be displayed, uses the key information as a child element content of the target child element, and sets a key information attribute of the key information according to a child element attribute of the target child element, where the child element attribute includes a font, a word size and an alignment mode, so as to generate a picture text and display the picture text in an associated user interface. By setting and determining the adaptive target picture text template and the target background color, the picture loading request is prevented from being sent to the network equipment, the loading time of picture resources can be effectively reduced, and the running speed of an associated user interface is increased; the key information in the data to be displayed is fused in the picture characters for display, so that the situation that an invariable default picture is used by an associated user interface after the picture loading fails is avoided, the attractiveness of the associated user interface is effectively improved, the key information is displayed in a more visual mode by utilizing the character symbols in the picture characters, a browser of the associated user interface can quickly capture the key information, and the use feeling of the user is further improved.
Further, an embodiment of the present invention further provides a picture word generating device, referring to fig. 7, where the picture word generating device is applied to a picture word generating apparatus, the picture word generating device includes:
a combing module 10 for combing the picture text template library and the background color library of the associated user interface;
an obtaining module 20, configured to obtain data to be displayed of the associated user interface;
a determining module 30, configured to determine an adapted target picture text template from the picture text template library according to the data to be displayed; according to the data to be displayed, determining an adaptive target background color from the background color library;
a generating module 40 for placing the data to be displayed into the target picture text template and adding the target background color to generate corresponding picture text
The specific implementation of the image text generating device is basically the same as that of each embodiment of the image text generating method, and is not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. The picture character generation method is characterized by comprising the following steps of:
Acquiring an interface design draft in an associated user interface, and combing a picture text template library and a background color library of the associated user interface;
acquiring data to be displayed of the associated user interface, wherein the data to be displayed comprises pictures and/or characters;
determining the theme type of the data to be displayed according to the key information of the data to be displayed, and determining an adaptive target picture text template from the picture text template library according to the theme type and the quantity of the key information;
determining a background color index value according to the identification number of the data to be displayed, and determining an adaptive target background color from the background color library according to the background color index value;
placing the data to be displayed into the target picture character template and adding the target background color to generate corresponding picture characters;
the method comprises the steps of obtaining an interface design draft in an associated user interface, and combing a picture text template library and a background color library of the associated user interface, wherein the steps comprise:
acquiring an interface design draft of an associated user interface;
identifying and extracting parent elements and child elements in the interface design manuscript;
nesting the parent element and the child element to serve as the picture text template, wherein at least one child element is nested in the parent element;
Adding theme types and the number of sub-elements to the picture text template, and establishing a picture text template library;
identifying and extracting colors in the interface design manuscript to be used as the background color;
adding an index value to the background color according to the extraction sequence of the colors, and establishing a background color library;
the step of placing the data to be displayed in the target picture text template and adding the target background color to generate corresponding picture text comprises the following steps:
acquiring a target parent element and a target child element in a target picture text template through a CSS technology, and setting the target parent element and the target child element as a relative positioning element and an absolute positioning element respectively;
taking the target background color as the parent element content of the target parent element, and setting the background color attribute of the target background color according to the parent element attribute of the target parent element, wherein the parent element attribute comprises length, width and coordinates;
and acquiring key information in the data to be displayed, taking the key information as sub-element content of the target sub-element, and setting key information attributes of the key information according to sub-element attributes of the target sub-element, wherein the sub-element attributes comprise fonts, word sizes and alignment modes.
2. The pictographic character generating method of claim 1, wherein the step of identifying and extracting a color in the interface design script as the background color comprises:
dividing the interface design manuscript into a plurality of blocks according to a preset blocking standard;
performing fuzzy processing on the block to obtain a fuzzy processed block, and determining the number of pixel points of each color in the fuzzy processed block;
and taking the color with the largest number of pixel points as the background color.
3. The method for generating picture text according to claim 2, wherein the step of determining a theme type of the data to be displayed according to the key information of the data to be displayed and determining an adapted target picture text template from the picture text template library according to the theme type and the number of the key information comprises:
acquiring key information of the data to be displayed, and determining the topic type of the data to be displayed according to the key information;
screening target theme types consistent with the theme types based on the picture text template library;
determining the key information quantity of the data to be displayed;
And screening the picture text templates corresponding to the number of the subelements consistent with the number of the key information based on the target theme type to serve as target picture text templates.
4. The picture word generation method according to claim 3, wherein the step of determining a background color index value according to the identification number of the data to be displayed, and determining an adapted target background color from the background color library according to the background color index value comprises:
acquiring an identification number of the data to be displayed and a quantity value of the background color in the background color library;
performing traversal accumulation on the identification numbers to obtain corresponding identification values;
and performing modulus on the identification value and the number value to obtain a corresponding background color index value, and taking the background color corresponding to the background color index value as a target background color.
5. A picture word generation device, the device comprising:
the combing module is used for acquiring an interface design draft in the associated user interface and combing a picture text template library and a background color library of the associated user interface;
the acquisition module is used for acquiring data to be displayed of the associated user interface, wherein the data to be displayed comprises pictures and/or characters;
The determining module is used for determining the theme type of the data to be displayed according to the key information of the data to be displayed, and determining an adaptive target picture text template from the picture text template library according to the theme type and the quantity of the key information; determining a background color index value according to the identification number of the data to be displayed, and determining an adaptive target background color from the background color library according to the background color index value;
the generating module is used for placing the data to be displayed into the target picture character template and adding the target background color to generate corresponding picture characters;
the combing module is also used for acquiring an interface design draft of the associated user interface; identifying and extracting parent elements and child elements in the interface design manuscript; nesting the parent element and the child element to serve as the picture text template, wherein at least one child element is nested in the parent element; adding theme types and the number of sub-elements to the picture text template, and establishing a picture text template library; identifying and extracting colors in the interface design manuscript to be used as the background color; adding an index value to the background color according to the extraction sequence of the colors, and establishing a background color library;
The generation module is further used for acquiring a target parent element and a target child element in the target picture text template through a CSS technology, and setting the target parent element and the target child element as a relative positioning element and an absolute positioning element respectively; taking the target background color as the parent element content of the target parent element, and setting the background color attribute of the target background color according to the parent element attribute of the target parent element, wherein the parent element attribute comprises length, width and coordinates; and acquiring key information in the data to be displayed, taking the key information as sub-element content of the target sub-element, and setting key information attributes of the key information according to sub-element attributes of the target sub-element, wherein the sub-element attributes comprise fonts, word sizes and alignment modes.
6. A photo text generation apparatus, the apparatus comprising: a memory, a processor and a photo word generation program stored on the memory and executable on the processor, the photo word generation program being configured to implement the steps of the photo word generation method of any one of claims 1 to 4.
7. A storage medium having stored thereon a pictogram generation program which, when executed by a processor, implements the steps of the pictogram generation method of any one of claims 1 to 4.
CN202211599004.7A 2022-12-14 2022-12-14 Picture character generating method, device, equipment and storage medium thereof Active CN115599384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211599004.7A CN115599384B (en) 2022-12-14 2022-12-14 Picture character generating method, device, equipment and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211599004.7A CN115599384B (en) 2022-12-14 2022-12-14 Picture character generating method, device, equipment and storage medium thereof

Publications (2)

Publication Number Publication Date
CN115599384A CN115599384A (en) 2023-01-13
CN115599384B true CN115599384B (en) 2023-05-26

Family

ID=84854220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211599004.7A Active CN115599384B (en) 2022-12-14 2022-12-14 Picture character generating method, device, equipment and storage medium thereof

Country Status (1)

Country Link
CN (1) CN115599384B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117232A (en) * 2015-09-08 2015-12-02 北京乐动卓越科技有限公司 Method and system for generating text image on user interface
CN108733371A (en) * 2018-05-16 2018-11-02 北京奇艺世纪科技有限公司 A kind of interface creating method, device and equipment
WO2021036735A1 (en) * 2019-08-23 2021-03-04 华为技术有限公司 User interface display method and electronic device
CN113238829A (en) * 2021-06-07 2021-08-10 北京字节跳动网络技术有限公司 Background color generation method and device, electronic equipment and storage medium
CN113497899A (en) * 2021-06-22 2021-10-12 深圳市大头兄弟科技有限公司 Character and picture matching method, device and equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288064B (en) * 2017-01-09 2022-06-07 北京京东尚科信息技术有限公司 Method and device for generating pictures
CN109447086A (en) * 2018-09-19 2019-03-08 浙江口碑网络技术有限公司 A kind of extracting method and device of picture character color
CN111415396A (en) * 2019-01-08 2020-07-14 腾讯科技(深圳)有限公司 Image generation method and device and storage medium
CN113963353A (en) * 2020-07-02 2022-01-21 苏宁云计算有限公司 Character image processing and identifying method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117232A (en) * 2015-09-08 2015-12-02 北京乐动卓越科技有限公司 Method and system for generating text image on user interface
CN108733371A (en) * 2018-05-16 2018-11-02 北京奇艺世纪科技有限公司 A kind of interface creating method, device and equipment
WO2021036735A1 (en) * 2019-08-23 2021-03-04 华为技术有限公司 User interface display method and electronic device
CN113238829A (en) * 2021-06-07 2021-08-10 北京字节跳动网络技术有限公司 Background color generation method and device, electronic equipment and storage medium
CN113497899A (en) * 2021-06-22 2021-10-12 深圳市大头兄弟科技有限公司 Character and picture matching method, device and equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
顾韵华 ; 李佩 ; 谢刚 ; .一种基于文本样式的Web主题信息提取方法研究.计算机与数字工程.2009,(11),第 23-26+182页. *

Also Published As

Publication number Publication date
CN115599384A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
US8442324B2 (en) Method and system for displaying image based on text in image
US9262386B2 (en) Data editing for improving readability of a display
US9111007B2 (en) Adaptive rendering of a webpage on an electronic display device
CN102117269B (en) Apparatus and method for digitizing documents
JP4271878B2 (en) Character search method and apparatus in video, and character search processing program
CN110780873B (en) Interface color adaptation method, device, computer equipment and storage medium
CN105094775B (en) Webpage generation method and device
US9117314B2 (en) Information output apparatus, method, and recording medium for displaying information on a video display
CN110309447B (en) Electronic bookmark generation method, electronic equipment and computer storage medium
US20120005564A1 (en) Content distribution system and method
WO2018130069A1 (en) Method and apparatus for generating bearing page for image collection content, computing device, and storage medium
CN111368841A (en) Text recognition method, device, equipment and storage medium
CN105389308B (en) Webpage display processing method and device
CN111324836A (en) Page processing method and device, computer equipment and storage medium
CN110134920B (en) Pictogram compatible display method, device, terminal and computer readable storage medium
CN115599384B (en) Picture character generating method, device, equipment and storage medium thereof
CN108804652B (en) Method and device for generating cover picture, storage medium and electronic device
CN115909449A (en) File processing method, file processing device, electronic equipment, storage medium and program product
CN112950167A (en) Design service matching method, device, equipment and storage medium
CN115686492A (en) H5 page editing method and device
JP4501731B2 (en) Image processing device
CN106776489B (en) Electronic document display method and system of display device
CN111832529A (en) Video text conversion method, mobile terminal and computer readable storage medium
JP2008004116A (en) Method and device for retrieving character in video
US20130104014A1 (en) Viewer unit, server unit, display control method, digital comic editing method and non-transitory computer-readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231221

Address after: 518000 901, Block A, Jindi Weixin Center, No. 16, Gaoxin South 10th Road, High tech Zone Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong

Patentee after: Shenzhen Mingyuan Yunke e-commerce Co.,Ltd.

Address before: Room 801, Block A, Gemdale Weixin Center, No. 16, Gaoxin South 10th Road, Gaoxin District Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong 518000

Patentee before: Shenzhen Mingyuan Cloud Technology Co.,Ltd.

TR01 Transfer of patent right