CN113238747A - Label generation method and system for self-adaptive container display - Google Patents

Label generation method and system for self-adaptive container display Download PDF

Info

Publication number
CN113238747A
CN113238747A CN202110513409.3A CN202110513409A CN113238747A CN 113238747 A CN113238747 A CN 113238747A CN 202110513409 A CN202110513409 A CN 202110513409A CN 113238747 A CN113238747 A CN 113238747A
Authority
CN
China
Prior art keywords
label
user
text
array
target
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.)
Pending
Application number
CN202110513409.3A
Other languages
Chinese (zh)
Inventor
李春晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information 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 Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN202110513409.3A priority Critical patent/CN113238747A/en
Publication of CN113238747A publication Critical patent/CN113238747A/en
Pending legal-status Critical Current

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/34Graphical or visual programming
    • 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

Landscapes

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

Abstract

The invention discloses a label generation method and system for self-adaptive container display, and relates to the field of computers. One embodiment of the method comprises: extracting at least one tag element from a tag text input by a user; judging whether the text length of each label element is larger than a preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content; and generating a label corresponding to each label element according to the label content corresponding to each label element. According to the embodiment, the label generation method can realize that the part of the label content exceeding the length is omitted from display, meets the personalized requirements and user-defined settings of users, greatly improves the convenience, simplicity and diversity of label generation, and further optimizes a label generation system.

Description

Label generation method and system for self-adaptive container display
Technical Field
The invention relates to the technical field of computers, in particular to a label generation method and system for self-adaptive container display.
Background
In the process of computer interface construction and development, the implementation of a text input box is a common functional implementation, and in order to simplify the development process, a preset control for implementing text box input, such as a UI control in an IOS environment, is usually provided in a development environment. However, the mere use of controls to implement text entry has not been able to meet the diverse text entry needs well due to the limitations of the rules of the controls themselves that the development environment carries.
With the diversification of network display forms, the demand for specific tags is increasing day by day. And the existing text input box is directly used, the styles of the displayed text and the label are generally uniformly set, if some personalized text styles are to be realized, more complex development logic needs to be set for realization, and the development difficulty is greatly increased. The conventional label generation method mostly depends on a third-party file, cannot meet the personalized requirements of users, and needs to develop a new label generation method and system.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for generating a tag for adaptive container display, which can select and display the content of the tag without a third-party file, improve the user experience, and meet the requirement of personalized operation of the user.
To achieve the above object, according to an aspect of an embodiment of the present invention, a label generation method for adaptive container display is provided.
The label generation method for the self-adaptive container display comprises the following steps:
acquiring a label text input by a user, wherein the label text comprises at least one label element;
judging whether the text length of each label element is larger than a preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
and generating a label corresponding to each label element according to the label content corresponding to each label element.
Optionally, acquiring the tag text input by the user includes:
in response to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array;
monitoring each character input by the user in real time, and judging whether the character is a separator or not; if not, putting the characters into the text receiving array, and then monitoring the next character input by the user; if so, creating a new second array, taking the new second array as a text receiving array, and then monitoring the next character input by the user;
and respectively taking all characters in each second array as a label element to obtain a plurality of label elements input by the user.
Optionally, before determining whether the character is a separator, the method further includes: acquiring historical label contents associated with characters input by the user from a historical label element set of the user, displaying the historical label contents to the user according to the sequence of the association degrees from high to low, and confirming that a content selection request of the user for screening target historical label contents from the displayed historical label contents is not received;
and if a content selection request of the user for screening target historical tag contents from the displayed historical tag contents is received, putting the target historical tag contents into the text receiving array, then creating a new second array, taking the new second array as the text receiving array, and monitoring the next character input by the user.
Optionally, after the characters are put into the text receiving array or the target history tag content is put into the text receiving array, at least one of the following is further included:
monitoring a character deleting request sent by the user, analyzing a target second array, a first deleting position and a deleting type from the character deleting request, and deleting at least one character before and/or after the first deleting position in the target second array according to the deleting type;
monitoring an array deleting request sent by the user, analyzing a second deleting position and a deleting type from the array deleting request, and deleting at least one second array before and/or after the second deleting position according to the deleting type.
Optionally, the method further comprises:
displaying placeholder characters in an input box before acquiring a label text input by a user; hiding the placeholder text when a character is input by a user; after the label corresponding to each label element is generated, the placeholder characters are displayed again;
after generating a label corresponding to each label element, displaying the label in a label display frame; the label display frame and the input frame are located in the same block.
Optionally, determining the tag content according to the target text includes: taking the target text as the label content; or adding preset characters behind the target text, and taking the whole of the target text and the preset characters as the label content.
Optionally, after generating the tag corresponding to each tag element, the method further includes: receiving a label viewing request sent by a user, analyzing a target label from the label viewing request, and displaying a label element corresponding to the target label.
Optionally, after generating the tag corresponding to each tag element, the method further includes: determining the residual length of the current line in a label display frame, and judging whether the text length of the label content is greater than the residual length; if so, displaying the label on the next line of the current line; otherwise, displaying the label on the current row; and the current row refers to the row where the last label displayed in the label display frame is located.
Optionally, when generating a label corresponding to each label element, generating a label according to a pre-edited label style; or after generating a label corresponding to each label element, performing style editing on the label according to a style editing request of a user; editing the label style comprises at least one of: editing the color of the label, editing the font of the content of the label, and adding one or more of a deletion identifier, a click and a link into the label.
Optionally, after performing style editing on the tag according to the style editing request of the user, the method further includes: deleting the target label in response to the operation of the user on the deletion identifier of the target label; or hiding the deletion symbol of the target label in response to a hiding request of the user for the target label.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a label generation system for adaptive container display.
The label generation system for the self-adaptive container display comprises the following components:
the text acquisition module is used for acquiring a label text input by a user, wherein the label text comprises at least one label element;
the content acquisition module is used for judging whether the text length of each label element is larger than the preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
and the label generation module is used for generating a label corresponding to each label element according to the label content corresponding to each label element.
Optionally, the obtaining a tag text input by a user by the text obtaining module includes:
in response to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array;
monitoring each character input by the user in real time, and judging whether the character is a separator or not; if not, putting the characters into the text receiving array, and then monitoring the next character input by the user; if so, creating a new second array, taking the new second array as a text receiving array, and then monitoring the next character input by the user;
and respectively taking all characters in each second array as a label element to obtain a plurality of label elements input by the user.
Optionally, the text obtaining module is further configured to: before judging whether the characters are separators or not, acquiring historical label contents associated with the characters input by the user from a historical label element set of the user, displaying the historical label contents to the user according to the sequence of the association degrees from high to low, and confirming that a content selection request for screening target historical label contents from the displayed historical label contents is not received by the user;
and if a content selection request of the user for screening target historical tag contents from the displayed historical tag contents is received, putting the target historical tag contents into the text receiving array, then creating a new second array, taking the new second array as the text receiving array, and monitoring the next character input by the user.
Optionally, the text obtaining module is further configured to at least one of: after placing the characters into the text receiving array or the targeted history tag content into the text receiving array,
monitoring a character deleting request sent by the user, analyzing a target second array, a first deleting position and a deleting type from the character deleting request, and deleting at least one character before and/or after the first deleting position in the target second array according to the deleting type;
monitoring an array deleting request sent by the user, analyzing a second deleting position and a deleting type from the array deleting request, and deleting at least one second array before and/or after the second deleting position according to the deleting type.
Optionally, the text obtaining module is further configured to: displaying placeholder characters in an input box before acquiring a label text input by a user; hiding the placeholder text when a character is input by a user; after the label corresponding to each label element is generated, the placeholder characters are displayed again;
the tag generation module is further configured to: after generating a label corresponding to each label element, displaying the label in a label display frame;
the label display frame and the input frame are located in the same block.
Optionally, the determining, by the content determining module, tag content according to the target text includes: taking the target text as the label content; or adding preset characters behind the target text, and taking the whole of the target text and the preset characters as the label content.
Optionally, the system further includes a tag viewing module, configured to receive a tag viewing request sent by a user after the tag generating module generates the tag corresponding to each tag element, parse a target tag from the tag viewing request, and display the tag element corresponding to the target tag.
Optionally, the tag generation module is further configured to: after generating a label corresponding to each label element, determining the residual length of a current line in a label display frame, and judging whether the text length of the label content is greater than the residual length; if so, displaying the label on the next line of the current line; otherwise, displaying the label on the current row; and the current row refers to the row where the last label displayed in the label display frame is located.
Optionally, the tag generation module is further configured to: when generating a label corresponding to each label element, generating a label according to a label style edited in advance; or after generating a label corresponding to each label element, performing style editing on the label according to a style editing request of a user; editing the label style comprises at least one of: editing the color of the label, editing the font of the content of the label, and adding one or more of a deletion identifier, a click and a link into the label.
Optionally, the tag generation module is further configured to: after the style editing is carried out on the label according to the style editing request of the user, the target label is deleted in response to the operation of the user on the deletion identifier of the target label; or hiding the deletion symbol of the target label in response to a hiding request of the user for the target label.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a label-generating electronic device for adaptive container display.
The label generation electronic equipment for the self-adaptive container display comprises: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the label generation method for adaptive container presentation according to the embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium.
The computer readable medium of the embodiment of the present invention stores thereon a computer program, which when executed by a processor implements the tag generation method of the adaptive container display of the embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, one or more label contents are determined according to the preset label length and the label elements, so that the display of the part of the label contents exceeding the length can be omitted, the displayed contents can be selected in a self-defining way, and meanwhile, the self-defining setting is carried out on whether the deleting symbol, the label sequence, the label color, the label content font, the label event and the like on the label are displayed or not. Compared with the existing label generation method, the embodiment of the invention optimizes the diversified settings of the label generation method, greatly improves the convenience, simplicity and diversity of label generation, and further optimizes a label generation system.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a label generation method for adaptive container display according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main flow of obtaining label text entered by a user in some alternative embodiments of the invention;
FIG. 3 is a schematic diagram of the main flow of obtaining label text entered by a user in yet other alternative embodiments of the present invention;
fig. 4 is a schematic diagram of a main flow of deleting characters in a label generation method for adaptive container display according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a main flow of deleting an array in a label generation method for adaptive container display according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main modules of an adaptive container presentation label generation system of an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a label generation method for adaptive container display according to an embodiment of the present invention. As shown in fig. 1, the method mainly includes:
step S101: acquiring a label text input by a user, wherein the label text comprises at least one label element;
step S102: judging whether the text length of each label element is larger than a preset label length; if yes, go to step S103; if not, executing step S104;
step S103: extracting a target text with the length less than or equal to the preset label length from the label elements, and determining label content according to the target text;
step S104: taking the label element as label content;
step S105: and generating a label corresponding to each label element according to the label content corresponding to each label element.
The label text refers to text input by the user for generating a label. The label element refers to text for generating one label. The tag text input by the user may include only one tag element, or may include two or more tag elements. For step S101, in most application scenarios, such as mailbox address bar tag and search bar tag, when the user input is blank text, there is no need to generate a blank tag.
The user enters text through the input box. In an alternative embodiment, prior to obtaining the label text entered by the user, placeholder text is displayed in the input box; hiding the placeholder text when a character is input by a user; and after the label corresponding to each label element is generated, the placeholder characters are redisplayed. The specific content of the placeholder text can be selectively set. For example, the placeholder text may be displayed as: "please click enter after input". In the input process of the user, the character 'please click enter after input' disappears, so that the influence on characters input by the user is avoided, and after the input of the user is finished and the label corresponding to each label element is generated, the 'click enter after input' is displayed again, so that the user can prompt in time when forgetting the requirement of inputting the content after deleting the input text.
In some optional embodiments, obtaining the label text input by the user includes: responding to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array; monitoring each character input by a user in real time, and judging whether the character is a separator or not; if not, the character is put into a text receiving array, and then the next character input by the user is monitored; if so, creating a new second array, taking the new second array as a text receiving array, and then monitoring the next character input by the user; and respectively taking all characters in each second array as a label element to obtain a plurality of label elements input by the user.
Referring to fig. 2, acquiring the label text input by the user includes the following steps:
step S201, responding to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array;
step S202, monitoring the ith character input by a user in real time, wherein i is a positive integer, and i is 1 under the initial condition;
step S203, judging whether the ith character is a separator; if not, jumping to step S204; if yes, go to step S206;
step S204, putting the ith character into a text receiving array, and then jumping to step S205;
step S205, determining whether the user input is finished (for example, triggering a specific time, such as clicking an Enter key, a blank key, etc.); if so, jumping to step S208, otherwise, i +1, and then jumping to step S202;
step S206, judging whether the user input is finished (for example, triggering a specific time, such as clicking an Enter key, a blank key and the like); if yes, jumping to step S208, otherwise, jumping to step S207;
step S207, creating a new second array, taking the new second array as a text receiving array, i +1, and then jumping to step S202;
step S208, respectively using all the characters in each second array as a tag element, and obtaining a plurality of tag elements input by the user.
In step S203, it may be determined whether the character is a separator by monitoring an event, and in an alternative embodiment, a monitoring keyup event, that is, a keyboard key bounce event, is added to the input box for receiving the character string input by the user. Whether the current character input by the user is a separator can be judged by monitoring the keyup event. The separator is a special character which can identify the separation position of the characters and can be selectively set by a user. For example, if the separator is set to ",", and the character string input by the user is "whitened", and if no separator is input at this time, "whitened" is put in the text reception array. And when the user continues to input the character after the character is whitened, judging that the character contains the separator, creating a new second array at the moment, and taking the new second array as a text receiving array. When the user continues to enter "long hair" after "enter" the "long hair" is in the new second array.
In other alternative embodiments, before determining whether the character is a separator, the method further comprises: acquiring historical label contents associated with characters input by a user from a historical label element set of the user, displaying the historical label contents to the user according to the sequence of the association degrees from high to low, and confirming that a content selection request of the user for screening target historical label contents from the displayed historical label contents is not received. And if a content selection request of the user for screening target historical label contents from the displayed historical label contents is received, putting the target historical label contents into a text receiving array, then creating a new second array, taking the new second array as the text receiving array, and monitoring the next character input by the user. When the historical label content has the label content which the user wants to select, the label element can be quickly obtained by directly carrying out selection operation without repeated input, so that the method is more efficient and convenient.
As shown in fig. 3, acquiring the label text input by the user includes the following steps: step S301, acquiring historical label contents associated with characters input by a user from a historical label element set of the user; step S302, displaying the history label content to the user according to the sequence of the relevance degree from high to low; step S303, judging whether a content selection request of a user for screening target historical label contents from the displayed historical label contents is received; if so, go to step S304, otherwise go to step S306. In step S304, the target history tag content is put into the text receiving array, and then it jumps to step S305. In step S305, a new second array is created, and the new second array is used as the text receiving array. In step S306, the character is determined, and the specific process of determining includes: if the character is not a separator, putting the character into a text receiving array, and then monitoring the next character input by the user; if the character is a separator, a new second array is created, the new second array is used as a text receiving array, and then the next character input by the user is monitored.
Further optionally, before obtaining the history tag content associated with the character input by the user from the history tag element set of the user, it is confirmed that the number of characters which have been input by the user and are not put into the text receiving array is plural, for example, 2 and more. Illustratively, when the user inputs 1 character, the history tag content associated with the 1 character is not acquired and displayed, and when the user inputs 2 characters, the history tag content associated with the 2 characters is acquired and displayed. Compared with one character, two or more characters can form a word or a sentence, so that the direction of the associated display is more favorably determined by the two or more characters, and the acquired historical label content is more closely associated with the character input by the user and closer to the requirement of the user.
For recommending the associated history tag content to the user, in an alternative embodiment, the associated history tag content is presented based on the whole character string input by the user, for example, when the user inputs "loved one", the history tag content associated with the whole of "loved one" is presented, but the history tag content associated with "loved one" is not presented.
The determination method of the association degree between the history tag content and the character or character string input by the user can be selectively set according to the actual situation, for example, according to the semantic correlation degree or the time correlation degree. In some alternative embodiments, the association between the history tag content and the character or character string input by the user may be determined by one, two or three of the first association rule, the second association rule and the third association rule. The first association rule is as follows: the greater the number of repeated characters between the history tag content and the character or character string entered by the user, the higher the degree of association. The second association rule is as follows: the more times the historical label content containing the user input character or string is labeled by the generated label, the higher the degree of association. The third association rule is: the later the historical label content containing the user input character or string is tagged with the higher the degree of association.
When the association degree is determined by more than two association degree rules, a relevance degree value can be determined based on each association degree rule, then the final association degree is obtained by weighted summation, and the history label content is displayed to the user according to the sequence of the final association degree from high to low. When weighting and summing, the association degree rules may adopt the same weight or different weights.
When determining the association degree by two or more association degree rules at the same time, a person skilled in the art may also set the priority of each association rule in advance. When determining the association degree between each history label content and the character string input by the user, preferentially determining a first association degree between each history label content and the character or the character string input by the user based on the association degree rule with the highest priority, and displaying the history label contents to the user according to the sequence of the first association degree from high to low. If a plurality of historical label contents with the same first relevance degree exist, determining a second relevance degree between the plurality of historical label contents and the character or character string input by the user according to a relevance degree rule with a lower priority, and determining the display sequence of the plurality of historical label contents according to the sequence of the second relevance degree from high to low. If a plurality of historical label contents with the same second relevance degree exist, the display sequence of each historical label content is further determined by adopting the association rule with lower priority. Illustratively, the first association rule has a higher priority than the second association rule, and when the user inputs "airplane", tags such as "airport", "air ticket", etc. are preferentially presented according to the association, but the tags are not preferentially presented because the number of times of input of the "flight" word is greater.
In the above optional embodiment, if there are multiple history tag contents with the same first association degree, the second association degree between the multiple history tag contents and the character or character string input by the user may also be determined according to an association degree rule with a lower priority, and the first association degree is modified according to the second association degree (the first association degree of the history tag content with the higher second association degree in the two history tag contents is increased, or the first association degree of the history tag content with the lower second association degree in the two history tag contents is decreased). And if a plurality of historical label contents with the same second relevance exist, continuously correcting the first relevance or the second relevance according to the relevance determined by the relevance rule with lower priority, and displaying the historical label contents from high to low according to the finally obtained first relevance. The display sequence of each historical label content is further determined. Illustratively, the number of repeated characters between each history label content and the character or character string input by the user is preferentially determined according to the first association rule, and in the case that the number of the repeated characters is the same, the corresponding history label content is corrected according to the second association rule. In the case where the number of repeated characters is small, even if the number of times of inputting the keyword is large, the keyword is not displayed only according to the second association degree rule.
When history tag contents are presented to a user, all history tag contents may be presented to the user in an order from high relevance to low relevance, or top N history tag contents with higher relevance may be presented, where N is a positive integer, such as 5 or 10.
In some alternative embodiments, after placing the characters in the text receiving array or the target history tag content in the text receiving array, the user may choose to delete the characters, as shown in FIG. 4, including: step S401: monitoring a character deleting request sent by a user; step S402: analyzing a target second array, a first deleting position and a deleting type from the character deleting request; step S403: and deleting at least one text before and/or after the first deletion position in the target second array according to the deletion type. Wherein, the first target array is the array where the character to be deleted is located; the first deleting position is the specific position of the character to be deleted in the array.
In other alternative embodiments, after placing the characters in the text receiving array or the target history tag content in the text receiving array, the user may choose to delete the array, as shown in FIG. 5, including: step S501: monitoring an array deleting request sent by a user; step S502: analyzing the second deletion position and the deletion type from the array deletion request; step S503: and deleting at least one array before and/or after the second deletion position according to the deletion type. And the second deleting position is the specific position of the array to be deleted in the label text.
In alternative embodiments, the deletion type may be classified as forward deletion or backward deletion, for example, forward deletion from the current deletion location when the Backspace key is pressed, and backward deletion from the current deletion location when the Delete key is pressed. Through different deletion requests, the selected characters and arrays can be deleted quickly, so that a user can use the device more conveniently, and the user experience is improved.
The user input label text can define whether to check. In an alternative embodiment, non-importable characters, such as only Chinese, English, numeric and underline, may be verified according to regular expressions, with other characters coming in and going out such as "! And if so, prompting an error, and not executing subsequent steps until a user modifies the user and meets the regular expression rule, and executing the subsequent steps. The regular expression is a logic formula for operating the character string, can be preset according to user requirements, sets an input character format, and does not limit the setting rule in different application scenarios.
The label text input by the user can be customized to check whether to be duplicated. In an optional embodiment, whether the currently input label text is repeated with the generated label content or not may be determined, and if the currently input label text is completely the same as the generated label content, the label repetition is prompted, so that a large number of repeated labels caused by malicious output are avoided, and resource waste is reduced.
The specific length of the preset label length can be selectively set according to the user requirement, and in an optional embodiment, the specific length is different under different application scenarios. For example, when the user input content is a mailbox address, the preset tag length may be 10 characters or more, and when the user input content is a description of a commodity, the preset tag length is only 6 characters or less.
When the target text with the length less than or equal to the preset label length is extracted from the label elements, the target text which the user wants to show can be arbitrarily extracted from the label elements, partial content with the front number of the displayed words can be selected, and the number of the words can be selected and important content can be displayed. In an alternative embodiment, determining the tag content according to the target text includes: taking the target text as the label content; or adding preset characters behind the target text, and taking the whole of the target text and the preset characters as the label content. For example, when the tag element input by the user is "the world lovely people" and the preset tag length is 5 characters, the tag content that the user can determine is "the world favorite" or "the world favorite … …", which meets the personal requirements of the user according to personal habits.
The label generated in step S105 is displayed in the label display frame. When a plurality of tags are generated in step S105, the plurality of tags may be displayed in the same block or may be displayed separately. For example, the tag display frame and the input frame may be arranged in the same div region, the tag display frame may be arranged as a div display tag, the input frame may be arranged as an input frame, and the outermost div region setting style is consistent with that of the ordinary input frame, so that the user may look that the entire outermost div is a large input frame, thereby increasing the fluency of the use process.
In an optional embodiment, after generating the tag corresponding to each tag element, the method further includes: receiving a tag viewing request sent by a user, analyzing a target tag from the tag viewing request, and displaying tag elements corresponding to the target tag; the target label is a label which is generated correspondingly when the whole of the target text and the preset characters is used as the label content.
For example, when the tag content is presented as "world favorite … …," the tag may be presented as the complete tag text "favorite people worldwide" when the mouse is selected on the tag, and redisplayed as "world favorite … …" when the mouse is removed.
The generated label may be displayed at different positions according to the length of the label content, and in an optional embodiment, after the label is generated in step S105, the remaining length of the current row in the label display frame is further determined; judging whether the text length of the label content is larger than the residual length; if so, displaying the label on the next line of the current line; otherwise, displaying the label on the current row; the current row is a row where the last displayed label in the label display frame is located.
In order to facilitate the determination of the remaining length of the current line in the tag display box, in an alternative embodiment, the width of the external div area may be set to be a fixed width, the widths of the div display tag and the input box may be set to float, and the input box may be displayed in the next line if the remaining length of the current line in the tag display box is less than the text length of the tag content.
After the labels are generated, the labels can be randomly ordered according to the requirements of users. In an optional embodiment, the tags can be sequenced through mouse dragging, and when the tail lengths of the generated multiple rows of tags are far away due to the tag sequence, the tag sequence can be adjusted in an artificial adjustment mode so as to be attractive and tidy to display.
In an optional implementation manner, when generating a tag corresponding to each tag element, the tag may be generated according to a pre-edited tag style. Of course, after the tag corresponding to each tag element is generated, the tag may also be subjected to style editing according to a style editing request of the user. Editing of the label style may include at least one of: editing the color of the label, editing the font of the content of the label, and adding one or more of a deletion identifier, a click and a link into the label. The color library, the font library and the added event library can be preset, and user-defined editing is facilitated for users.
Regarding the label color: the method can not only edit the color of the whole label outer frame, but also edit the color of a single character of the label content, thereby displaying the colorful label.
Regarding the label font: due to the frequent generation of the fonts, in an optional embodiment, the fonts can be added in the font library by self, and the fonts added by self are stored in the form of the cloud font library, so that the subsequent calling is facilitated, and meanwhile, the local storage space is saved.
Regarding the addition event: the click event can occur when the object is clicked, and commands such as full selection, animation and the like can be set on the basis of the click event; the link event may add a hyperlink to the tag, linking to any web page or other resource.
The user can delete the target label or hide the deletion symbol of the target label according to the requirement. In an optional implementation manner, after the style editing is performed on the tag according to the style editing request of the user, the target tag is deleted in response to the operation of the user on the deletion identifier of the target tag; in another alternative embodiment, the delete symbol of the target tag is hidden in response to a user request to hide the target tag. In order to simplify the display, the deleted symbols of the labels are hidden, so that the typesetting can be more conveniently carried out, the display of redundant symbols is reduced, and the use experience of a user is improved.
The tag generation method for the self-adaptive container display is simple and convenient, has high personalization degree, can realize that the part of the tag content exceeding the length is omitted from display, and can perform custom selection on the display content, thereby improving the attractiveness and simplicity of display in the self-adaptive container and greatly improving the user experience.
Fig. 6 is a schematic diagram of the main modules of an adaptive container presentation label generation system 600 according to an embodiment of the present invention. As shown in fig. 6, includes:
the text acquisition module 601 is used for acquiring a tag text input by a user, wherein the tag text comprises at least one tag element;
the content obtaining module 602 is configured to determine whether a text length of each tag element is greater than a preset tag length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
the tag generating module 603 generates a tag corresponding to each tag element according to the tag content corresponding to each tag element.
Optionally, the obtaining a tag text input by a user by the text obtaining module includes:
in response to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array;
monitoring each character input by the user in real time, and judging whether the character is a separator or not; if not, putting the characters into the text receiving array, and then monitoring the next character input by the user; if so, creating a new second array, taking the new second array as a text receiving array, and then monitoring the next character input by the user;
and respectively taking all characters in each second array as a label element to obtain a plurality of label elements input by the user.
Optionally, the text obtaining module is further configured to: before judging whether the characters are separators or not, acquiring historical label contents associated with the characters input by the user from a historical label element set of the user, displaying the historical label contents to the user according to the sequence of the association degrees from high to low, and confirming that a content selection request for screening target historical label contents from the displayed historical label contents is not received by the user;
and if a content selection request of the user for screening target historical tag contents from the displayed historical tag contents is received, putting the target historical tag contents into the text receiving array, then creating a new second array, taking the new second array as the text receiving array, and monitoring the next character input by the user.
Optionally, the text obtaining module is further configured to at least one of: after placing the characters into the text receiving array or the targeted history tag content into the text receiving array,
monitoring a character deleting request sent by the user, analyzing a target second array, a first deleting position and a deleting type from the character deleting request, and deleting at least one character before and/or after the first deleting position in the target second array according to the deleting type;
monitoring an array deleting request sent by the user, analyzing a second deleting position and a deleting type from the array deleting request, and deleting at least one second array before and/or after the second deleting position according to the deleting type.
Optionally, the text obtaining module is further configured to: displaying placeholder characters in an input box before acquiring a label text input by a user; hiding the placeholder text when a character is input by a user; after the label corresponding to each label element is generated, the placeholder characters are displayed again;
the tag generation module is further configured to: after generating a label corresponding to each label element, displaying the label in a label display frame;
the label display frame and the input frame are located in the same block.
Optionally, the determining, by the content determining module, tag content according to the target text includes: taking the target text as the label content; or adding preset characters behind the target text, and taking the whole of the target text and the preset characters as the label content.
Optionally, the system further includes a tag viewing module (not shown in the figure), configured to receive a tag viewing request sent by a user after the tag generating module generates a tag corresponding to each tag element, parse a target tag from the tag viewing request, and display the tag element corresponding to the target tag.
Optionally, the tag generation module is further configured to: after generating a label corresponding to each label element, determining the residual length of a current line in a label display frame, and judging whether the text length of the label content is greater than the residual length; if so, displaying the label on the next line of the current line; otherwise, displaying the label on the current row; and the current row refers to the row where the last label displayed in the label display frame is located.
Optionally, the tag generation module is further configured to: when generating a label corresponding to each label element, generating a label according to a label style edited in advance; or after generating a label corresponding to each label element, performing style editing on the label according to a style editing request of a user; editing the label style comprises at least one of: editing the color of the label, editing the font of the content of the label, and adding one or more of a deletion identifier, a click and a link into the label.
Optionally, the tag generation module is further configured to: after the style editing is carried out on the label according to the style editing request of the user, the target label is deleted in response to the operation of the user on the deletion identifier of the target label; or hiding the deletion symbol of the target label in response to a hiding request of the user for the target label.
The label generation system for the self-adaptive container display of the embodiment of the invention is realized by directly using the native js without depending on any third-party file, and has high compatibility. Meanwhile, the display of the part of the label content exceeding the length can be omitted, the personalized requirements and the user-defined setting of a user are met, the convenience, the simplicity and the diversity of label generation are greatly improved, and a label generation system is further optimized.
The label generation system for the self-adaptive container display can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
Fig. 7 shows an exemplary system architecture 700 to which the label generation method for adaptive container presentation or the label generation system for adaptive container presentation according to an embodiment of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 701, 702, and 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the tag generation method for adaptive container display provided in the embodiment of the present invention is generally executed by the server 705, and accordingly, the tag generation system for adaptive container display is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 805 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring a label text input by a user, wherein the label text comprises at least one label element;
judging whether the text length of each label element is larger than a preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
and generating a label corresponding to each label element according to the label content corresponding to each label element.
The technical scheme of the embodiment of the invention is directly realized by using the native js, overcomes the defect that the prior art needs any UI control depending on a third-party file, and has high compatibility. Meanwhile, the display of the part of the label content exceeding the length can be omitted, the personalized requirements and the user-defined setting of a user are met, the convenience, the simplicity and the diversity of label generation are greatly improved, and a label generation system is further optimized.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A label generation method for adaptive container display, the method comprising:
acquiring a label text input by a user, wherein the label text comprises at least one label element;
judging whether the text length of each label element is larger than a preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
and generating a label corresponding to each label element according to the label content corresponding to each label element.
2. The method of claim 1, wherein obtaining user-entered label text comprises:
in response to an input request sent by a user, creating a first array, creating a second array in the first array, and taking the second array as a text receiving array;
monitoring each character input by the user in real time, and judging whether the character is a separator or not; if not, putting the characters into the text receiving array, and then monitoring the next character input by the user; if so, creating a new second array, taking the new second array as a text receiving array, and then monitoring the next character input by the user;
and respectively taking all characters in each second array as a label element to obtain a plurality of label elements input by the user.
3. The method of claim 2, further comprising, prior to determining whether the character is a separator: acquiring historical label contents associated with characters input by the user from a historical label element set of the user, displaying the historical label contents to the user according to the sequence of the association degrees from high to low, and confirming that a content selection request of the user for screening target historical label contents from the displayed historical label contents is not received;
and if a content selection request of the user for screening target historical tag contents from the displayed historical tag contents is received, putting the target historical tag contents into the text receiving array, then creating a new second array, taking the new second array as the text receiving array, and monitoring the next character input by the user.
4. The method of claim 2 or 3, further comprising, after placing the characters into the text receiving array or placing the target history tag content into the text receiving array, at least one of:
monitoring a character deleting request sent by the user, analyzing a target second array, a first deleting position and a deleting type from the character deleting request, and deleting at least one character before and/or after the first deleting position in the target second array according to the deleting type;
monitoring an array deleting request sent by the user, analyzing a second deleting position and a deleting type from the array deleting request, and deleting at least one second array before and/or after the second deleting position according to the deleting type.
5. The method of claim 1, further comprising:
displaying placeholder characters in an input box before acquiring a label text input by a user; hiding the placeholder text when a character is input by a user; after the label corresponding to each label element is generated, the placeholder characters are displayed again;
after generating a label corresponding to each label element, displaying the label in a label display frame; the label display frame and the input frame are located in the same block.
6. The method of claim 1, wherein determining tag content from the target text comprises:
taking the target text as the label content; or adding preset characters behind the target text, and taking the whole of the target text and the preset characters as the label content.
7. The method of claim 6, wherein after generating the label corresponding to each of the label elements, the method further comprises:
receiving a label viewing request sent by a user, analyzing a target label from the label viewing request, and displaying a label element corresponding to the target label.
8. The method of claim 1 or 5, wherein after generating the label corresponding to each of the label elements, the method further comprises:
determining the residual length of the current line in a label display frame, and judging whether the text length of the label content is greater than the residual length; if so, displaying the label on the next line of the current line; otherwise, displaying the label on the current row; and the current row refers to the row where the last label displayed in the label display frame is located.
9. The method according to claim 1, wherein when generating the label corresponding to each label element, generating the label according to a label style edited in advance; or after generating a label corresponding to each label element, performing style editing on the label according to a style editing request of a user; editing the label style comprises at least one of: editing the color of the label, editing the font of the content of the label, and adding one or more of a deletion identifier, a click and a link into the label.
10. The method of claim 9, further comprising, after style editing the tab according to the style edit request of the user:
deleting the target label in response to the operation of the user on the deletion identifier of the target label; or hiding the deletion symbol of the target label in response to a hiding request of the user for the target label.
11. An adaptive container display label generation system, comprising:
the text acquisition module is used for acquiring a label text input by a user, wherein the label text comprises at least one label element;
the content acquisition module is used for judging whether the text length of each label element is larger than the preset label length; if yes, extracting a target text with the length less than or equal to the preset label length from the label element, and determining label content according to the target text; otherwise, the label element is used as the label content;
and the label generation module is used for generating a label corresponding to each label element according to the label content corresponding to each label element.
12. An adaptive container-displaying label-generating electronic device, comprising: one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202110513409.3A 2021-05-11 2021-05-11 Label generation method and system for self-adaptive container display Pending CN113238747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110513409.3A CN113238747A (en) 2021-05-11 2021-05-11 Label generation method and system for self-adaptive container display

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110513409.3A CN113238747A (en) 2021-05-11 2021-05-11 Label generation method and system for self-adaptive container display

Publications (1)

Publication Number Publication Date
CN113238747A true CN113238747A (en) 2021-08-10

Family

ID=77133571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110513409.3A Pending CN113238747A (en) 2021-05-11 2021-05-11 Label generation method and system for self-adaptive container display

Country Status (1)

Country Link
CN (1) CN113238747A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836905A (en) * 2021-09-24 2021-12-24 网易(杭州)网络有限公司 Theme extraction method and device, terminal and storage medium
CN114519334A (en) * 2022-04-19 2022-05-20 北京金堤科技有限公司 Multi-line text display method and device with label, storage medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836905A (en) * 2021-09-24 2021-12-24 网易(杭州)网络有限公司 Theme extraction method and device, terminal and storage medium
CN113836905B (en) * 2021-09-24 2023-08-08 网易(杭州)网络有限公司 Theme extraction method, device, terminal and storage medium
CN114519334A (en) * 2022-04-19 2022-05-20 北京金堤科技有限公司 Multi-line text display method and device with label, storage medium and electronic equipment
CN114519334B (en) * 2022-04-19 2022-07-08 北京金堤科技有限公司 Multi-line text display method and device with label, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US10824691B2 (en) Page rendering method, device, and data storage medium
JP7283067B2 (en) A system and method for detangling interrupted conversations in a communication platform, a method, a program, and a computer device for parsing unstructured messages
CN109074547B (en) Text message ordering based on message content
CN113238747A (en) Label generation method and system for self-adaptive container display
EP2869219A1 (en) Text processing apparatus, text processing method, and computer program product
WO2016058416A1 (en) Push information processing method and device, browser, browser plug-in and non-volatile computer storage medium
CN113657113A (en) Text processing method and device and electronic equipment
US11132418B2 (en) Systems and methods for generating floating button interfaces on a web browser
CN110519155B (en) Information processing method and system
CN114065750A (en) Commodity information matching and publishing method and device, equipment, medium and product thereof
CN112965781A (en) Method and device for processing page
CN114663155A (en) Advertisement putting and selecting method and device, equipment, medium and product thereof
WO2023236795A1 (en) Encyclopedia entry processing method and apparatus, and electronic device, medium and program product
CN106878151A (en) A kind of method for transmitting information, equipment and system
CN116569159A (en) Automatic depiction and extraction of tabular data in portable document format using a graph neural network
CN113836877A (en) Text labeling method, device, equipment and storage medium
CN113342450B (en) Page processing method, device, electronic equipment and computer readable medium
KR20200032394A (en) Program for message processing by providing combined expression image words
CN110895655A (en) Method and device for extracting text core phrase
CN105988992A (en) Icon pushing method and device
US20220197484A1 (en) Technologies for transforming a data display
CN112308016A (en) Expression image acquisition method and device, electronic equipment and storage medium
CN114492456B (en) Text generation method, model training method, device, electronic equipment and medium
US11244021B2 (en) User interface for creating and managing URL parameters
US20240095464A1 (en) Systems and methods for a reading and comprehension assistance tool

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