CN110618797B - Method and device for generating character trotting horse lamp and terminal equipment - Google Patents

Method and device for generating character trotting horse lamp and terminal equipment Download PDF

Info

Publication number
CN110618797B
CN110618797B CN201910728978.2A CN201910728978A CN110618797B CN 110618797 B CN110618797 B CN 110618797B CN 201910728978 A CN201910728978 A CN 201910728978A CN 110618797 B CN110618797 B CN 110618797B
Authority
CN
China
Prior art keywords
preset
display area
text information
effect file
keyword set
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
CN201910728978.2A
Other languages
Chinese (zh)
Other versions
CN110618797A (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 Saiante Technology Service Co Ltd
Original Assignee
Shenzhen Saiante Technology Service 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 Saiante Technology Service Co Ltd filed Critical Shenzhen Saiante Technology Service Co Ltd
Priority to CN201910728978.2A priority Critical patent/CN110618797B/en
Publication of CN110618797A publication Critical patent/CN110618797A/en
Application granted granted Critical
Publication of CN110618797B publication Critical patent/CN110618797B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • 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

Abstract

The invention is applicable to the technical field of computers, and provides a method, a device and terminal equipment for generating a character trotting horse lamp, wherein the method comprises the following steps: receiving text information input by a user; if the generation event is monitored to be triggered, determining the triggering time of the generation event, and acquiring a preset effect file of the character trotting horse lamp to obtain a preset font size and a display area size; if the triggering time belongs to a preset night time period, extracting a keyword set of text information, and if the keyword set is determined to be incapable of being displayed in the display area at the same time, updating a preset effect file, and generating a word trotting horse lamp for displaying the keyword set according to the updated effect file; if the triggering time belongs to the preset daytime period, and it is determined that the text information cannot be displayed in the display area at the same time, updating the preset effect file, and generating a word trotting horse lamp for displaying the text information according to the updated effect file. The invention improves the efficiency of generating the trotting horse lamp.

Description

Method and device for generating character trotting horse lamp and terminal equipment
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a method, a device and terminal equipment for generating a character trotting horse lamp.
Background
With the continuous development of terminal technology, it is often necessary to implement displaying of text in the form of a trotting horse lamp so as to implement presenting more contents in a limited display area.
However, when a new trotting w is required to be designed, since the content and effect of the new trotting w is often quite different from those of the realized trotting w, each time a new trotting w is realized, the software code needs to be rewritten, so that the efficiency is low and the labor cost is quite high.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a method, a device and a terminal device for generating a character trotting horse lamp, so as to solve the technical problem of low efficiency of generating the character trotting horse lamp in the prior art.
A first aspect of an embodiment of the present invention provides a method for generating a text ticker, including:
receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
if the generation event is monitored to be triggered, determining the triggering time of the generation event, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp;
if the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file;
If the triggering time belongs to a preset daytime period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
A second aspect of an embodiment of the present invention provides an apparatus for generating a text ticker, including:
the receiving and monitoring module is used for receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
the determining and acquiring module is used for determining the triggering time of the generated event if the generated event is triggered, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp;
the first generation module is used for extracting a keyword set of the text information if the triggering time belongs to a preset night time period, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file;
The second generation module is used for extracting a second characteristic parameter used for representing the text information length if the triggering time belongs to a preset daytime period; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
A third aspect of the embodiment of the present invention provides a terminal device, including a memory and a processor, where the memory stores a computer program that can run on the processor, and when the processor executes the computer program, the following steps are implemented:
receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
if the generation event is monitored to be triggered, determining the triggering time of the generation event, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp;
if the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file;
If the triggering time belongs to a preset daytime period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
A fourth aspect of the embodiments of the present invention provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of:
receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
if the generation event is monitored to be triggered, determining the triggering time of the generation event, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp;
if the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file;
If the triggering time belongs to a preset daytime period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
According to the embodiment of the invention, the trotting horse lamp generating event is triggered after the text information is input, and the new trotting horse lamp corresponding to the triggering time is generated according to the triggering time for triggering the trotting horse lamp generating event and the preset effect file of the trotting horse lamp, so that the method for generating the new trotting horse lamp according to the old trotting horse lamp is realized, software codes are not required to be rewritten, the trotting horse lamp generating efficiency is improved, and the labor cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for generating a text ticker according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for generating a text ticker according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for generating a text ticker according to an embodiment of the present invention;
FIG. 4 is a flowchart of another method for generating a text ticker according to an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus for generating a text ticker according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In addition, the description of "first" or "second" and the like in this application is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or an implicit indication of the number of features indicated. Thus, a feature defining "a first" or "a second" etc. may explicitly or implicitly include at least one such feature.
In the prior art, the trotting horse lamp effect of a new content is realized every time, if the designs are different, software codes are required to be rewritten, the efficiency is low, and the labor cost is very high.
The invention realizes a method for generating a new trotting horse lamp according to the old trotting horse lamp, improves the efficiency of generating the trotting horse lamp and reduces the labor cost.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
Fig. 1 shows an implementation flow of a method for generating a text ticker according to an embodiment of the present invention, where the method flow includes steps S101 to S104. The method is suitable for the situation that the character trotting horse lamp needs to be generated. The method is executed by a device for generating the character trotting horse lamp, and the device for generating the character trotting horse lamp is configured in a terminal device and can be realized by software and/or hardware. The specific implementation principle of each step is as follows.
S101, receiving text information input by a user; and monitoring whether a generation event of generating the character trotting horse lamp is triggered or not.
In the embodiment of the invention, the text information is text information input by a user through the terminal equipment, the text information is generally input by the user in a text information input interface, and the text information is a display object of the word trotting horse lamp. The terminal equipment is provided with an application for generating the character revolving horse lamp, and the application can be a terminal application, a webpage application, an applet and the like. The application includes a text information input interface.
Illustratively, the user may effect entry of text information through a text information entry box in the text information input interface of the application, the manner in which text information is entered including, but not limited to, through keyboard entry and/or voice entry, and the like.
The generation event of the generated word revolving horse lamp is an event of the generated word revolving horse lamp triggered by the terminal equipment monitoring the preset triggering condition, and is usually triggered on a text information input interface. The preset trigger condition includes executing a preset operation and/or not monitoring a user operation within a preset time period after receiving the text information input.
Among them, the preset operation is performed including a touch screen operation, a cursor control operation, a voice control operation, and the like, wherein the touch screen operation includes, but is not limited to, a click operation (e.g., single click, double click, long press, and the like), a slide operation (e.g., single-touch or multi-touch slide, and the like), and the like. The cursor control operation includes a cursor control operation by a keyboard, and/or a mouse, and/or a remote control lever, and/or a touch panel, etc. In the embodiment of the invention, the touch point of the cursor and the touch screen can be collectively called as a focus, and the focus position can be changed through the touch screen operation and/or the cursor control operation. The step of not monitoring the user operation within the preset time after receiving the text information input comprises the following steps: and after receiving text information input, triggering a generation event if the focus position is not changed within a preset time period.
Optionally, monitoring whether to trigger a generation event of generating the text ticker includes: monitoring whether a user triggers a generation event of a word revolving horse lamp by clicking a preset operation control in a text information input interface; and/or monitoring whether a user triggers a generation event of the word revolving horse lamp by executing a preset operation in the text information input interface; and/or monitoring whether a user triggers a generation event of the word trotting horse lamp by inputting a preset voice signal; and/or monitoring whether the focus position is unchanged within a preset time after the user inputs the text information, and triggering the generation event of the character trotting horse lamp.
The preset operation control comprises a movable control suspended on a text information input interface, or a fixed control fixed on the text information input interface, or the operation control is a hidden control in a menu key collected on the text information input interface.
The embodiment of the invention has the characteristics of diversified, visual and simple triggering modes, so that a user can easily and conveniently trigger the trotting horse lamp to generate an event after inputting text information, and the operation efficiency is improved.
S102, if the generation event is monitored to be triggered, determining the triggering time of the generation event, and obtaining a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp.
And when the terminal equipment detects a preset trigger condition, the generation event is monitored to be triggered.
And after monitoring that the generation event is triggered, determining the triggering time of the generation event. In addition, before or after determining the triggering time of the generation event, acquiring a preset effect file of the character trotting horse lamp to obtain a preset font size and a display area size of the character trotting horse lamp.
The preset effect file of the character trotting horse lamp is an effect file of the character trotting horse lamp generated in a history mode, that is, the preset effect file is a written effect file used for generating the character trotting horse lamp. The effects file includes various effects attribute parameters including, but not limited to, a preset font size, a size of a display area, a scroll type, a scroll speed, and the like. The size of the display area includes at least the width of the display area.
Optionally, monitoring that the generation event is triggered includes: the method comprises the steps of monitoring that a user triggers a generation event of a word trotting horse lamp by clicking a preset operation control in a text information input interface; and/or monitoring a generation event of triggering the word revolving horse lamp by executing a preset operation in the text information input interface by a user; and/or monitoring a generation event that a user triggers a word trotting horse lamp by inputting a preset voice signal; and/or monitoring that the focus position is unchanged within a preset time period after the user inputs text information so as to trigger a generation event of the character trotting horse lamp.
S103, if the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the fact that the keyword set cannot be displayed in the display area at the same time is determined based on the preset font size, the display area size and the first characteristic parameters, the preset effect file of the word trotting horse lamp is updated, and the word trotting horse lamp for displaying the keyword set is generated according to the updated effect file.
S104, if the triggering time belongs to a preset daytime time period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
Wherein, divide a day into 2 time slots: night time period and day time period. After determining the trigger time, it may be determined whether the trigger time belongs to a night time period or a daytime time period. And generating the character trotting horse lamp by using different modes corresponding to different triggering times.
Illustratively, the daylight period is: 06:00-18:00; the night time period is as follows: 00:00-06:00 and 18:00-24:00. When the triggering time is 23:00, the night time period belongs to, and the trotting horse lamp is generated based on a mode corresponding to the night time period. When the triggering time is 10:00, belonging to the daytime period, the trotting horse lamp is generated based on a mode corresponding to the daytime period.
If the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the fact that the keyword set cannot be displayed in the display area at the same time is determined based on the preset font size, the display area size and the first characteristic parameters, the preset effect file of the word trotting horse lamp is updated, and the word trotting horse lamp for displaying the keyword set is generated according to the updated effect file.
If the triggering time belongs to a preset daytime period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
That is, in the embodiment of the present invention, when the trigger time belongs to the night time period, after determining that the keyword set of the text information cannot be displayed in the display area at the same time, the preset effect file of the text trotting horse is updated, and the text trotting horse for displaying the keyword set is generated according to the updated effect file; when the triggering time belongs to a preset daytime period, the preset effect file of the text trotting horse lamp is updated by determining that the text information cannot be displayed in the display area at the same time, and the text trotting horse lamp for displaying the text information is generated according to the updated effect file.
It should be noted that, after the first feature parameter for representing the length of the keyword set is extracted, if it is determined that the keyword set can be displayed in the display area at the same time based on the preset font size, the size of the display area and the first feature parameter, the keyword set is displayed in the display area according to the preset font size.
It should be further noted that, after the second characteristic parameter for representing the length of the text information is extracted, if it is determined that the text information can be displayed in the display area at the same time based on the preset font size, the size of the display area, and the second characteristic parameter, the text information is displayed in the display area according to the preset font size.
Whether the keyword set can be displayed in the display area at the same time in the night time period or the text information can be displayed in the display area at the same time in the daytime time period, the character trotting horse lamp is not regenerated at the moment, the keyword set or the text information is directly displayed in the display area, the generation program of the trotting horse lamp is not started, the system resource occupation is reduced, and the scheme is further optimized.
According to the embodiment of the invention, on one hand, the new character trotting horse lamp is generated through the preset effect file, and the code is not required to be edited again, so that the generation efficiency is improved, and the labor cost is reduced. In practical software implementation, the trotting horse content, namely the trotting horse characters, and the trotting horse form, namely the trotting horse effect, are packaged in different classes, and the low coupling between the two classes is achieved, so that a new trotting horse can be generated based on the old trotting horse. On the other hand, aiming at the same text information input by the user, the number of the characters displayed in the night time period in the triggering time of the character trotting horse lamp is smaller than the number of the characters displayed in the daytime time period in the triggering time, so that people can conveniently and completely know the content of the trotting horse lamp in a short time when walking in a hurry at night, and the environment suitability of the whole scheme is improved.
On the basis of the embodiment shown in fig. 1, the triggering time is further limited to a preset night time period. Optionally, as shown in fig. 2, step 103 includes steps 201 to 206.
S201, extracting a keyword set of the text information if the triggering time belongs to a preset night time period.
The keyword set is a set composed of all keywords extracted from the text information. In the embodiment of the invention, if the triggering time belongs to a preset night time period, extracting the keyword set of the text information.
S202, extracting a first characteristic parameter for representing the length of the keyword set; the first characteristic parameter is the total word number of the keyword set.
After the keyword set is determined, extracting a first characteristic parameter for representing the length of the keyword set, wherein the first characteristic parameter is the total word number of the keyword set. It should be noted that, when the text information is chinese information, the first feature parameter is the total number of words of the chinese word, and when the text information is english or other language, the first feature parameter is the total number of words.
S203, calculating a first target width of the keyword set under the preset font size based on the preset font size and the total word number of the keyword set, and if the first target width is larger than the width of the display area, determining that the keyword set cannot be displayed in the display area at the same time.
And if the first target width is larger than the width of the display area, determining that the keyword set cannot be displayed in the display area at the same time.
It should be noted that, based on the preset font size and the total number of words in the keyword set, a first target width of the keyword set under the preset font size is calculated, if the first target width is smaller than or equal to the width of the display area, it is determined that the keyword set can be displayed in the display area at the same time, and then the keyword set is displayed in the display area according to the preset font size.
S204, calculating a first ratio of the first target width to the width of the display area.
Wherein, the first target width is DesWidth1, and the width of the display area is PreWidth, and then the first ratio 1=deswidth 1/PreWidth.
And S205, if the first ratio is equal to or greater than a first preset threshold, updating the preset scrolling type in the preset effect file into multi-row scrolling, and if the first ratio is less than the first preset threshold, updating the preset scrolling type in the preset effect file into single-row scrolling.
And when the first ratio 1 is equal to or greater than a first preset threshold, updating the preset scrolling type in the preset effect file into multi-line scrolling. And when the first ratio 1 is smaller than the first preset threshold value, updating the preset scrolling type in the preset effect file into single-row scrolling.
The first preset threshold may be 1.5, 1.8, 2, or the like, and may be any value in the numerical range (1.5, 2). The first preset threshold value is not particularly limited, and can be set according to actual needs.
S206, generating a character trotting horse lamp for displaying the keyword set according to the updated effect file.
In the embodiment of the invention, the preset rolling type in the preset effect file is updated based on the length characteristics of the keyword set, so that the character trotting horse lamp comprising the keyword set is displayed according to the updated effect file, people can completely view the content of the character trotting horse lamp in a limited time, and the adaptability of the scheme is further improved.
On the basis of the embodiments shown in fig. 1 or fig. 2, a further limitation is made to the case where the trigger time belongs to a preset daylight period. Optionally, as shown in fig. 3, step 104 includes steps 301 to 307.
And S301, if the triggering time belongs to a preset daytime time period, extracting a second characteristic parameter used for representing the length of the text information, wherein the second characteristic parameter is the total word number of the text information.
After text information input by a user is acquired, determining that the triggering time belongs to a daytime period, and extracting a second characteristic parameter used for representing the length of the text information, wherein the second characteristic parameter is the total word number of the text information. It should be noted that when the text information is chinese information, the second feature parameter is the total number of words in chinese, and when the text information is english or other language, the second feature parameter is the total number of words.
S302, calculating a second target width of the text information under the preset font size based on the preset font size and the total number of words of the text information, and determining that the text information cannot be displayed in the display area at the same time if the second target width is larger than the width of the display area.
And if the second target width is larger than the width of the display area, determining that the keyword set cannot be displayed in the display area at the same time.
It should be noted that, based on the preset font size and the total number of words of the text information, a second target width of the text information under the preset font size is calculated, if the second target width is smaller than or equal to the width of the display area, it is determined that the text information can be displayed in the display area at the same time, and the text information is displayed in the display area according to the preset font size.
S303, calculating a second ratio of the second target width to the width of the display area.
Wherein, the second target width is DesWidth2, and the width of the display area is PreWidth, and the second ratio 2=deswidth 2/PreWidth.
And S304, if the second ratio is smaller than or equal to a second ratio threshold, updating the preset scrolling speed in the preset effect file to be the first scrolling speed.
S305, if the second ratio is larger than the second ratio threshold and smaller than a third ratio threshold, updating the preset scrolling speed in the preset effect file to be a second scrolling speed, wherein the second scrolling speed is larger than the first scrolling speed;
s306, if the second ratio is equal to or greater than the third ratio threshold, updating the preset scrolling speed in the preset effect file to be a third scrolling speed, wherein the third scrolling speed is greater than the second scrolling speed;
And when the second ratio 2 is smaller than or equal to the second ratio threshold, updating the preset scrolling speed in the preset effect file to the first scrolling speed. The second ratio threshold may be 1 or 1.2 or 1.5, for example, and may be any value in the numerical range (1, 1.5). The first scrolling speed may be a preset scrolling speed or a preset proportion greater than the preset scrolling speed, wherein the preset proportion may be any value within 0% to 10%. The second ratio threshold and the first rolling speed are not particularly limited, and can be set according to actual needs.
And when the second ratio 2 is larger than the second ratio threshold and smaller than the third ratio threshold, updating the preset scrolling speed in the preset effect file to be a second scrolling speed, wherein the second scrolling speed is larger than the first scrolling speed. The third ratio threshold may be 2 or 2.2 or 2.5, etc., and may be any value in the numerical interval (2, 2.5). The second scrolling speed is greater than the first scrolling speed, or may be greater than the preset scrolling speed by a preset ratio, where the preset ratio may be any value within 10% to 20%. The third ratio threshold and the second rolling speed are not particularly limited, and can be set according to actual needs.
And when the second ratio 2 is smaller than or equal to a third ratio threshold, updating the preset rolling speed in the preset effect file to be a third rolling speed, wherein the third rolling speed is larger than the second rolling speed. The third scroll speed is illustratively greater than the second scroll speed, but may be greater than the preset scroll speed by a preset ratio, wherein the preset ratio may be any value within 20% to 50%. The third rolling speed is not particularly limited, and can be set according to actual needs.
S307, generating a word trotting horse lamp for displaying the text information according to the updated effect file.
In the embodiment of the invention, the preset rolling speed in the preset effect file is updated based on the length characteristics of the text information, so that the text trotting horse lamp comprising the text information is displayed according to the updated effect file, people can completely view the content of the text trotting horse lamp in a limited time, and the adaptability of the scheme is further improved.
On the basis of the embodiments shown in fig. 1, fig. 2 or fig. 3, this embodiment further defines how to extract the keyword set of the text information in step 103. As shown in fig. 4, the keyword set of the text information is extracted, including the following steps 401 to 403.
S401, word segmentation processing is carried out on the text information, stop words are removed, and a group of words are obtained.
The word segmentation process is a process of recombining continuous word sequences into word sequences according to a certain specification. Existing word segmentation algorithms can be divided into three main categories: word segmentation method based on character string matching, word segmentation method based on understanding and word segmentation method based on statistics. Those skilled in the art will appreciate that existing word segmentation methods may be used with the present invention, and the present invention is not limited in this regard.
After word segmentation, stop words can be removed, and a group of words corresponding to the text information can be obtained. This processing can improve the accuracy of the set of words, thereby further improving the accuracy of the keyword extraction results.
S402, extracting a plurality of initial keywords with the top matching degree ranking with preset keywords in a keyword library from the group of words.
The terminal equipment pre-stores a keyword library, wherein the shape of the keyword library can be the keyword library set by an expert, and a keyword set marked by the display content of the historical trotting horse can be analyzed.
After a group of words corresponding to the text information are obtained, each word is matched with a keyword library, and a plurality of words with the highest matching degree are used as initial keywords.
S403, performing part-of-speech analysis on each initial keyword, and reserving the initial keywords with preset parts-of-speech to generate a keyword set.
And analyzing the parts of speech of the initial keywords in the text information, and reserving the initial keywords with preset parts of speech to generate a keyword set. The preset parts of speech may be nouns and verbs, may be just nouns, etc., and may be set according to requirements.
It should be noted that, the part-of-speech analysis process may also be combined with the word segmentation process, and when the word segmentation process is combined with the part-of-speech tagging process, an integrated method of combining word segmentation and part-of-speech tagging may be adopted.
The keyword set of the text information is extracted in the mode, so that the calculation amount is small, the system occupancy rate is low, and the implementation is easy.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Corresponding to the method for generating a text ticker described in the above embodiments, fig. 5 shows a block diagram of a device for generating a text ticker according to an embodiment of the present invention, and for convenience of explanation, only the portions related to the embodiments of the present invention are shown.
Referring to fig. 5, the apparatus for generating a text ticker includes:
a receiving and monitoring module 51, configured to receive text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
the determining and acquiring module 52 is configured to determine a trigger time of the generated event if the generated event is triggered, and acquire a preset effect file of the word revolving horse lamp to obtain a preset font size and a display area size of the word revolving horse lamp;
a first generating module 53, configured to extract a keyword set of the text information if the trigger time belongs to a preset night time period, and extract a first feature parameter for characterizing a length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file;
a second generating module 54, configured to extract a second feature parameter for characterizing the text information length if the trigger time belongs to a preset daylight period; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
Optionally, the first characteristic parameter is the total word number of the keyword set;
correspondingly, based on the preset font size, the size of the display area and the first characteristic parameter, determining that the keyword set cannot be displayed in the display area at the same time includes:
and calculating a first target width of the keyword set under the preset font size based on the preset font size and the total word number of the keyword set, and determining that the keyword set cannot be displayed in the display area at the same time if the first target width is larger than the width of the display area.
Optionally, the second characteristic parameter is the total word number of the text information;
correspondingly, based on the preset font size, the size of the display area and the second characteristic parameter, determining that the text information cannot be displayed in the display area at the same time includes:
and calculating a second target width of the text information under the preset font size based on the preset font size and the total word number of the text information, and if the second target width is larger than the width of the display area, determining that the text information cannot be displayed in the display area at the same time.
Optionally, after extracting the first feature parameter for characterizing the length of the keyword set, the method further includes:
and if the keyword set is determined to be simultaneously displayed in the display area based on the preset font size, the display area size and the first characteristic parameter, displaying the keyword set in the display area according to the preset font size.
Optionally, after extracting the second feature parameter for characterizing the length of the text information, the method further includes:
and if the text information is determined to be simultaneously displayed in the display area based on the preset font size, the display area size and the second characteristic parameter, displaying the text information in the display area according to the preset font size.
Optionally, updating the preset effect file of the word revolving horse lamp, generating the word revolving horse lamp for displaying the keyword set according to the updated effect file, including:
calculating a first ratio of the first target width to the width of the display area;
if the first ratio is equal to or greater than a first preset threshold, updating the preset scrolling type in the preset effect file into multi-row scrolling, and if the first ratio is less than the first preset threshold, updating the preset scrolling type in the preset effect file into single-row scrolling;
And generating a character trotting horse lamp for displaying the keyword set according to the updated effect file.
Optionally, updating the preset effect file of the text trotting horse lamp, generating the text trotting horse lamp for displaying the text information according to the updated effect file, including:
calculating a second ratio of the second target width to the width of the display area;
if the second ratio is smaller than or equal to a second ratio threshold, updating the preset rolling speed in the preset effect file to be the first rolling speed;
if the second ratio is greater than the second ratio threshold and less than a third ratio threshold, updating the preset scrolling speed in the preset effect file to be a second scrolling speed, wherein the second scrolling speed is greater than the first scrolling speed;
if the second ratio is equal to or greater than the third ratio threshold, updating the preset scrolling speed in the preset effect file to be a third scrolling speed, wherein the third scrolling speed is greater than the second scrolling speed;
and generating a word trotting horse lamp for displaying the text information according to the updated effect file.
Optionally, the extracting the keyword set of the text information includes:
Word segmentation processing is carried out on the text information, stop words are removed, and a group of words are obtained;
extracting a plurality of initial keywords with top matching degree ranks with preset keywords in a keyword library from the group of words;
and performing part-of-speech analysis on each initial keyword, and reserving the initial keywords with preset parts-of-speech to generate a keyword set.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in the memory 61 and executable on the processor 60, for example a program for generating a trotting horse. The processor 60, when executing the computer program 62, implements the steps of the method embodiment for generating a text ticker described above, such as steps S101 to S104 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, performs the functions of the modules/units of the apparatus embodiments described above, such as the functions of the modules 51 to 54 shown in fig. 5.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program 62 in the terminal device 6.
The terminal device 6 may be a smart phone, a computer, a tablet, a server, etc. The terminal device 6 may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the terminal device 6 and does not constitute a limitation of the terminal device 6, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. A method of generating a text ticker, comprising:
receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
if the generation event is monitored to be triggered, determining the triggering time of the generation event, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp; the preset effect file of the character trotting horse lamp is an effect file of the character trotting horse lamp generated in a history mode;
if the triggering time belongs to a preset night time period, extracting a keyword set of the text information, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file; the keyword set is a set formed by all keywords extracted from the text information;
If the triggering time belongs to a preset daytime period, extracting a second characteristic parameter for representing the text information length; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
2. The method of claim 1, wherein the first characteristic parameter is a total number of words of a set of keywords;
correspondingly, based on the preset font size, the size of the display area and the first characteristic parameter, determining that the keyword set cannot be displayed in the display area at the same time includes:
and calculating a first target width of the keyword set under the preset font size based on the preset font size and the total word number of the keyword set, and determining that the keyword set cannot be displayed in the display area at the same time if the first target width is larger than the width of the display area.
3. A method according to claim 1 or 2, wherein the second characteristic parameter is the total number of words of the text information;
Correspondingly, based on the preset font size, the size of the display area and the second characteristic parameter, determining that the text information cannot be displayed in the display area at the same time includes:
and calculating a second target width of the text information under the preset font size based on the preset font size and the total word number of the text information, and if the second target width is larger than the width of the display area, determining that the text information cannot be displayed in the display area at the same time.
4. The method of claim 1 or 2, wherein,
after the extracting the first characteristic parameter for representing the length of the keyword set, the method further comprises:
if the keyword set can be simultaneously displayed in the display area based on the preset font size, the size of the display area and the first characteristic parameter, displaying the keyword set in the display area according to the preset font size;
after the extracting of the second characteristic parameter for representing the length of the text information, the method further comprises:
and if the text information is determined to be simultaneously displayed in the display area based on the preset font size, the display area size and the second characteristic parameter, displaying the text information in the display area according to the preset font size.
5. The method of claim 2, wherein updating the preset effect file of the text ticker, generating the text ticker displaying the set of keywords from the updated effect file, comprises:
calculating a first ratio of the first target width to the width of the display area;
if the first ratio is equal to or greater than a first preset threshold, updating the preset scrolling type in the preset effect file into multi-row scrolling, and if the first ratio is less than the first preset threshold, updating the preset scrolling type in the preset effect file into single-row scrolling;
and generating a character trotting horse lamp for displaying the keyword set according to the updated effect file.
6. The method of claim 3, wherein updating the preset effect file of the text ticker, generating the text ticker to display the text information based on the updated effect file, comprises:
calculating a second ratio of the second target width to the width of the display area;
if the second ratio is smaller than or equal to a second ratio threshold, updating the preset rolling speed in the preset effect file to be the first rolling speed;
If the second ratio is greater than the second ratio threshold and less than a third ratio threshold, updating the preset scrolling speed in the preset effect file to be a second scrolling speed, wherein the second scrolling speed is greater than the first scrolling speed;
if the second ratio is equal to or greater than the third ratio threshold, updating the preset scrolling speed in the preset effect file to be a third scrolling speed, wherein the third scrolling speed is greater than the second scrolling speed;
and generating a word trotting horse lamp for displaying the text information according to the updated effect file.
7. The method of any of claims 1,2,5, and 6, wherein the extracting the set of keywords for the text information comprises:
word segmentation processing is carried out on the text information, stop words are removed, and a group of words are obtained;
extracting a plurality of initial keywords with top matching degree ranks with preset keywords in a keyword library from the group of words;
and performing part-of-speech analysis on each initial keyword, and reserving the initial keywords with preset parts-of-speech to generate a keyword set.
8. An apparatus for generating a text ticker, comprising:
The receiving and monitoring module is used for receiving text information input by a user; monitoring whether to trigger the generation event of the character trotting horse lamp;
the determining and acquiring module is used for determining the triggering time of the generated event if the generated event is triggered, and acquiring a preset effect file of the word revolving horse lamp to obtain the preset font size and the display area size of the word revolving horse lamp; the preset effect file of the character trotting horse lamp is an effect file of the character trotting horse lamp generated in a history mode;
the first generation module is used for extracting a keyword set of the text information if the triggering time belongs to a preset night time period, and extracting a first characteristic parameter for representing the length of the keyword set; if the keyword set cannot be displayed in the display area at the same time based on the preset font size, the display area size and the first characteristic parameter, updating a preset effect file of the word trotting horse lamp, and generating the word trotting horse lamp for displaying the keyword set according to the updated effect file; the keyword set is a set formed by all keywords extracted from the text information;
The second generation module is used for extracting a second characteristic parameter used for representing the text information length if the triggering time belongs to a preset daytime period; and if the text information cannot be displayed in the display area at the same time based on the preset font size, the display area size and the second characteristic parameter, updating the preset effect file of the text trotting horse lamp, and generating the text trotting horse lamp for displaying the text information according to the updated effect file.
9. A terminal device comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, characterized in that the processor, when executing the computer program, realizes the steps of the method according to any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN201910728978.2A 2019-08-08 2019-08-08 Method and device for generating character trotting horse lamp and terminal equipment Active CN110618797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910728978.2A CN110618797B (en) 2019-08-08 2019-08-08 Method and device for generating character trotting horse lamp and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910728978.2A CN110618797B (en) 2019-08-08 2019-08-08 Method and device for generating character trotting horse lamp and terminal equipment

Publications (2)

Publication Number Publication Date
CN110618797A CN110618797A (en) 2019-12-27
CN110618797B true CN110618797B (en) 2023-07-11

Family

ID=68921664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910728978.2A Active CN110618797B (en) 2019-08-08 2019-08-08 Method and device for generating character trotting horse lamp and terminal equipment

Country Status (1)

Country Link
CN (1) CN110618797B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113741835A (en) * 2020-05-29 2021-12-03 北京嗨动视觉科技有限公司 Method and device for realizing effect of trotting horse lamp
CN116943232A (en) * 2023-06-26 2023-10-27 广州三七极耀网络科技有限公司 Globalization processing method and globalization processing equipment for application program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201780756U (en) * 2010-07-26 2011-03-30 深圳市顾通科技有限公司 LED (light-emitting diode) advertisement screen
CN106250088A (en) * 2016-08-03 2016-12-21 青岛海信电器股份有限公司 Text display method and device
CN109318835A (en) * 2018-11-05 2019-02-12 广州小鹏汽车科技有限公司 Display methods, display device for mounting on vehicle and the automobile of display device for mounting on vehicle

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5546528A (en) * 1994-06-23 1996-08-13 Adobe Systems Incorporated Method of displaying multiple sets of information in the same area of a computer screen
CN100508018C (en) * 2003-03-07 2009-07-01 日本电气株式会社 Scroll display control
CN103135895B (en) * 2011-11-23 2016-01-27 腾讯科技(深圳)有限公司 A kind of method and device controlling display mode
CN104951186B (en) * 2015-06-12 2019-07-26 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN106210851A (en) * 2016-06-30 2016-12-07 乐视控股(北京)有限公司 title display control method and device
CN106340050B (en) * 2016-08-15 2019-10-18 南京师范大学 One kind 2.5 ties up revolving horse lantern animation producing method
EP3567834B1 (en) * 2017-01-25 2021-04-28 Huawei Technologies Co., Ltd. Schedule processing method and electronic terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201780756U (en) * 2010-07-26 2011-03-30 深圳市顾通科技有限公司 LED (light-emitting diode) advertisement screen
CN106250088A (en) * 2016-08-03 2016-12-21 青岛海信电器股份有限公司 Text display method and device
CN109318835A (en) * 2018-11-05 2019-02-12 广州小鹏汽车科技有限公司 Display methods, display device for mounting on vehicle and the automobile of display device for mounting on vehicle

Also Published As

Publication number Publication date
CN110618797A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
CN110020422B (en) Feature word determining method and device and server
US8234706B2 (en) Enabling access to aggregated software security information
US10845939B2 (en) Method and system for determining user interface usage
EP3518119A1 (en) Method, apparatus for event detection, device and storage medium
CN104750378B (en) The input pattern automatic switching method and device of input method
CN109803152A (en) Violation checking method, device, electronic equipment and storage medium
US20080172630A1 (en) Graphical representation of aggregated data
CN110321553A (en) Short text subject identifying method, device and computer readable storage medium
CN110618797B (en) Method and device for generating character trotting horse lamp and terminal equipment
CN111723260A (en) Method and device for acquiring recommended content, electronic equipment and readable storage medium
CN108459845A (en) A kind of surveillance tag attribute buries point methods and device
US20240104302A1 (en) Minutes processing method and apparatus, device, and storage medium
CN106293327A (en) End application fast operating method and system
CN112346951A (en) Service testing method and device
CN112417875B (en) Configuration information updating method and device, computer equipment and medium
EP3425531A1 (en) System, method, electronic device, and storage medium for identifying risk event based on social information
CN111782208A (en) Index early warning method and device, computer equipment and storage medium
CN114519153A (en) Webpage history record display method, device, equipment and storage medium
CN113282218A (en) Multi-dimensional report generation method, device, equipment and storage medium
CN109284354B (en) Script searching method and device, computer equipment and storage medium
CN111443907A (en) Method and device for calling SDK function
CN111832310A (en) Text processing method and device
CN111190818B (en) Front-end code analysis method, front-end code analysis device, computer equipment and storage medium
CN114385792B (en) Method, device, equipment and storage medium for extracting words from work order data
CN114518815B (en) Method, device, equipment, medium and program product for displaying building drawing

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
TA01 Transfer of patent application right

Effective date of registration: 20210129

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Shenzhen saiante Technology Service Co.,Ltd.

Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000

Applicant before: Ping An International Smart City Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant