CN109033197A - A kind of information display method, device, storage medium and terminal - Google Patents
A kind of information display method, device, storage medium and terminal Download PDFInfo
- Publication number
- CN109033197A CN109033197A CN201810689880.6A CN201810689880A CN109033197A CN 109033197 A CN109033197 A CN 109033197A CN 201810689880 A CN201810689880 A CN 201810689880A CN 109033197 A CN109033197 A CN 109033197A
- Authority
- CN
- China
- Prior art keywords
- information
- data
- current
- type
- data chain
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0241—Advertisements
- G06Q30/0277—Online advertisement
Abstract
The embodiment of the invention discloses a kind of information display method, device, storage medium and terminals.This method comprises: judging whether the type of current global variable is non-default data type when receiving new information and needing to show;If non-default data type, then judge whether the length of current information data chain is preset data chain length maximum value;If maximum value, it is determined that current location of the current display information in information data chain, and the new information is inserted into the next bit of the current location, and delete upper one of the current location.It by using technical solution provided herein, may be implemented quickly to show new information, while the length of control information data chain can also be reached, avoid the too long effect for influencing memory of information data chain.
Description
Technical field
The present embodiments relate to technical field of information display more particularly to a kind of information display method, device, storage Jie
Matter and terminal.
Background technique
With the aggravation of development and the competition of network, major operator must dispose completely new, personalized service with full
The demand of sufficient different clients.For example, being inserted into the played in order that technology realizes zone location advertisement by advertisement, and for user
The incentive message acquired gives publicity etc..During current network information display, for example, the page letter got the winning number in a bond with user
Breath is shown that every information Dynamic Display 3s, most newly generated multidate information is directly inserted at the end of display data.
This there is following problem: first is that causing new information that can not quickly be shown due to being to increase new information at end
Out;Second is that increasing with insertion data, information data chain is increasingly longer, and information data chain is caused to influence terminal inner
Memory space.
Summary of the invention
The embodiment of the present invention provides a kind of information display method, device, storage medium and terminal, and it is quickly right to may be implemented
New information is shown, while can also reach the length of control information data chain, avoids the too long influence of information data chain
The effect of memory.
In a first aspect, the embodiment of the invention provides a kind of information display methods, this method comprises:
When receiving new information and needing to show, judge whether the type of current global variable is non-default data type;
If non-default data type, then judge whether the length of current information data chain is preset data chain length
Maximum value;
If maximum value, it is determined that current location of the current display information in information data chain, and by the new letter
Breath is inserted into the next bit of the current location, and deletes upper one of the current location.
It further, whether is non-silent in the type for when receiving new information and needing to show, judging current global variable
Recognize before data type, the method also includes:
Define default data type and non-default data type;Wherein, when global variable is the default data type,
For being shown to default data information;When the global variable is the non-default data type, for non-default
Data information is shown;
The global variable is initialized as the default data type.
Further, the method also includes:
If judging, the type of current global variable for default data type, the type of the global variable is switched to non-
Default data type, and directly show the new information received.
Further, the method also includes:
If judge that the length of current information data chain is less than preset data chain length maximum value:
It determines current location of the current display information in information data chain, and the new information received is inserted into
In the next bit for arriving the current location;Wherein, when currently not showing information, it is determined that in presently described information data chain
The number of information data is 0, then directly shows the new information received.
Further, the method also includes:
When the number of information data is not 0 in presently described information data chain, then the new information and the letter are judged
Whether any information data ceased in data chain are identical, if they are the same, then it is described to terminate to return to particular value by setting function
The insertion of new information.
Further, if judge that the length of current information data chain is less than preset data chain length maximum value, institute
State method further include:
Judge whether current location is equal to the length of current information data chain;
If so, by calling addition data function to add at the end of current information data chain to the new information
Add.
Further, further includes:
Judge whether current location of the current display information in information data chain is the first;
If so, determining upper one position of current location by recycling the information data chain head and the tail;
The new information is inserted into the next bit of the current location, and deletes upper one of the current location.
Second aspect, the embodiment of the invention also provides a kind of information display device, which includes:
Global variable type judging module, for judging current global variable when receiving new information and needing to show
Whether type is non-default data type;
Data chain length judgment module, if being judged as non-default data class for the global variable type judging module
Type then judges whether the length of current information data chain is preset data chain length maximum value;
New information is inserted into module, if being judged as YES maximum value for the data chain length judgment module, it is determined that when
Current location of the preceding display information in information data chain, and the new information is inserted into the next of the current location
Position, and delete upper one of the current location.
The third aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey
Sequence realizes the information display method as described in the embodiment of the present application when the program is executed by processor.
Fourth aspect, the embodiment of the present application provide a kind of terminal, including memory, and processor and storage are on a memory
And the computer program that can be run in processor, the processor realize such as the embodiment of the present application when executing the computer program
The information display method.
Technical solution provided by the embodiment of the present application judges current global become when receiving new information and needing to show
Whether the type of amount is non-default data type;If non-default data type, then the length of current information data chain is judged
It whether is preset data chain length maximum value;If maximum value, it is determined that current display information is in information data chain
Current location, and the new information is inserted into the next bit of the current location, and delete upper one of the current location.
By using technical solution provided herein, may be implemented quickly to show new information, while can also reach
The length for controlling information data chain avoids the too long effect for influencing memory of information data chain.
Detailed description of the invention
Fig. 1 is the flow chart for the information display method that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of information display method provided by Embodiment 2 of the present invention;
Fig. 3 is the flow chart for the information display method that the embodiment of the present invention three provides;
Fig. 4 is the structural schematic diagram for the information display device that the embodiment of the present invention five provides;
Fig. 5 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these
Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation
The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with
Corresponding to method, function, regulation, subroutine, subprogram etc..
By the function point of one prize drawing rebating of exploitation in the development process of client, have in rebating business function of drawing a lottery
One page info that push user gets the winning number in a bond in real time.The carousel process of this prize information is one more complicated processed
Journey, this programme essentially describe a set of algorithm to solve the problems, such as this, and business function needed for capable of completely realizing the program
Logic.
The Processing Algorithm demand of ad data is nearest 10 dynamics of carousel, and every Dynamic Display 3s is most newly generated dynamic
State is jumped the queue preferential displaying.If needing to delete the upper data currently shown when data are more than 10.
Carousel in traditional scheme shows that logic is usually when having new data arriving directly at the end of display data
It is inserted into, whole process does not delete process.It will lead to many bad places in this way, one is due to being at end
Tail increases new data, so new data quickly can not be demonstrated out.The second is increasing meeting with insertion data
Cause data link increasingly longer, will lead to the data newly increased in this way may need the more long time that can be shown
Come, because the data being newly inserted into are backmost.
What this programme was inserted into and deleted to realize entire data by proposing the algorithm design realization of sets of data insertion
Business function can greatly improve user experience etc. under the premise of meeting business.
Embodiment one
Fig. 1 is the flow chart for the information display method that the embodiment of the present invention one provides, the applicable advertising information of the present embodiment
Insertion display the case where, this method information display device provided by the embodiment of the present invention executes, which can
It realizes, and can be integrated in android terminal in a manner of by software and/or hardware.
As shown in Figure 1, the information display method includes:
S110, when receiving new information and needing to show, judge whether the type of current global variable is non-default data
Type.
In the present embodiment, optionally, when receiving new information and needing to show, judge the type of current global variable
Before whether being non-default data type, the method also includes: define default data type and non-default data type;Its
In, when global variable is the default data type, for being shown to default data information;When the global variable is
When the non-default data type, for being shown to non-default data information;The global variable is initialized as described
Default data type.
Wherein, global variable can be the variable mDataType that global type is DataType, current global variable
Type may include default data type and non-default data type.Wherein, default data type can be understood as default
The type that information plays out, such as bulletin, non-default data type can be advertising information etc., as the advertisement of prize winner is believed
Breath and other any advertising informations etc., due to just enough differences of two kinds of data types, so needing to define respectively, and to the overall situation
Variable carries out tax initial value.
Wherein, shown in default data structure is defined as follows:
public class DefaultStr{
String defaultStr;// default data information
};
The data structure of non-default data is as follows:
In order to be managed to current display state, class can be enumerated come to the shape currently shown by designing one
State information is managed, and is specifically enumerated content-defined as follows:
enum DataType{TYPE_DefaultStr,TYPE_BannerInfo};
It is default data type that wherein the enumerated value of TYPE_DefaultStr, which is 1 expression, TYPE_BannerInfo's
Value is 2 expressions is ad data type, it is subsequent can by be pre-designed this enumerate value object and determine currently to show
Be what kind of data information.
The variable mDataType that global type for definition is DataType, and the value of the variable is initialized
MDataType=TYPE_DefaultStr is default data type.
S120, if non-default data type, then judge whether the length of current information data chain is preset data chain
Length maximum value.
Wherein it is possible to current global variable whether be that default data type judges.Specifically, can pass through
MDataType==TYPE_DefaultStr is very, to mean that and currently need to show default data content, will directly write from memory at this time
Recognize data information to show on the screen.If mDataType==TYPE_DefaultStr is false, then it represents that when
Before need to show non-default data content.It is shown in this case it is necessary to take out ad data from data,
The logic of access evidence can provide detailed description information in following method and step.In this case it is necessary to from data
An ad data is taken out to be shown, the logic for evidence of fetching can provide detailed description letter in following method and step
Breath.
Whether the length for judging current information data chain is preset data chain length maximum value, wherein preset data chain
The maximum value of length can be 10, be also possible to 15,8 etc., can selection according to user or staff couple
It is determined in the setting of client.When the length of current information data chain is preset data chain length maximum value, if
Insertion operation is carried out again for new information, then the length that will lead to data chain is more than preset value, the case where having information spillover.
In the present embodiment, in such a way that the length to current information data chain sets maximum value, can effectively it protect
The length for demonstrate,proving data chain can be controlled effectively for the reserved of data chain memory space, avoid depositing for data chain occupancy
It is excessive to store up space.
If S130, maximum value, it is determined that current location of the current display information in information data chain, and will be described
New information is inserted into the next bit of the current location, and deletes upper one of the current location.
Wherein, non-default data type, which can be through C++ server, be pushed to client, C++ message warp
Barrage distributor is crossed eventually to be distributed in insertion function.In order to facilitate subsequent content to be unfolded, one can be defined and inserted
Enter function, be specifically defined as follows shown:
public void insertBannerBean(BannerBean bannerBean){};
The return value of insertBannerBean function is void type, that is, does not have returned content information,
The type of insertBannerBean function is public publicly-owned, other classes have the authority information for accessing the function in this way,
BannerBean is exactly the above-mentioned ad data structure information defined, that is, the advertisement data content that need to be inserted into.
In order to be safeguarded to current all advertisement data contents, can design a global set variables L ist <
BannerBean > listBannerBean simultaneously initializes the set variable, leads in initialization function init ()
Cross calling List<BannerBean>listBannerBean=newArrayList<BannerBean>();Method is come to collection
Close the operation that listBannerBean is initialized.
The position in data chain of current display information can pass through the index to present displayed content
CurrentIndex (index position information of the current display advertisement in set listBannerBean) is judged.
The algorithm for being inserted into new information data is to call directly listBannerBean.add (bannerBean) to come current
The next bit of the current display position of set listBannerBean increases a data bannerBean illustratively can
Come in the current position currentIndex in a manner of by calling listBannerBean.add (currentIndex+1)
Next increase data.Next it needs to delete the previous data currently shown, calling can be passed through
The mode of listBannerBean.remove (currentIndex-1) deletes upper one of the current position currentIndex
Data information.
In addition, it is worth noting that, it in embodiments of the present invention, apart from the above arrangements, can also be by current number
In the case where reaching maximum value according to the length of chain, using first being deleted to upper one of current display position in data chain
It removes, then to the mode that the next bit of current display position is added, can be realized using above-mentioned respective function.It sets in this way
The benefit set is can be always ensured that the maximum length of data chain is during data chain is added and is deleted
Preset value will not cause data chain during carrying out insertion process to new information, occur more than because of first adding to delete afterwards
The case where maximum value.
Technical solution provided by the embodiment of the present application judges current global become when receiving new information and needing to show
Whether the type of amount is non-default data type;If non-default data type, then the length of current information data chain is judged
It whether is preset data chain length maximum value;If maximum value, it is determined that current display information is in information data chain
Current location, and the new information is inserted into the next bit of the current location, and delete upper one of the current location.
By using technical solution provided herein, may be implemented quickly to show new information, while can also reach
The length for controlling information data chain avoids the too long effect for influencing memory of information data chain.
Based on the above technical solution, optionally, if judge the type of current global variable for default data type,
The type of the global variable is then switched to non-default data type, and directly shows the new information received
Show.
Since the value initialization mDataType=TYPE_DefaultStr of global variable is default data type.So
In the case where thering is new information (ad data) to be shown, the type of current global variable mDataType is first determined whether,
If mDataType==TYPE_DefaultStr is very, to mean that and be currently displaying default data content, connect at this time
The new information received is uniquely to need content to be shown in the information data chain of non-default data type, without consider its
Therefore the type of global variable can be switched to non-default data type, and straight by the problem of position in information data chain
The new information that will be received is connect to show.The benefit being arranged in this way is convenient and efficient, needs to open up receiving new information
Directly the new information is shown when showing.
Embodiment two
Fig. 2 is the flow chart of information display method provided by Embodiment 2 of the present invention.The present embodiment is in above-described embodiment
On the basis of, it is optimized for, the method also includes: if judging, the length of current information data chain is less than preset data chain length
When maximum value, then: determining current location of the current display information in information data chain, and the new information that will be received
It is inserted in the next bit of the current location;Wherein, when currently not showing information, it is determined that presently described information data chain
The number of information data is 0 in item, then directly shows the new information received.
As shown in Fig. 2, the information display method includes:
S210, when receiving new information and needing to show, judge whether the type of current global variable is non-default data
Type;
S220, if non-default data type, then judge whether the length of current information data chain is preset data chain
Length maximum value;If so, executing S230;If it is not, then executing S240.
S230, it determines current location of the current display information in information data chain, and the new information is inserted into
The next bit of the current location, and delete upper one of the current location.
S240, current display information is judged whether there is;If so, executing S250;If it is not, then executing S260.
Wherein, if there is no current display information in data chain, illustrate that currently needing the information number shown is 0.
It is being shown if there is current display information, is illustrating that information number to be shown is needed to be at least 1 in current data chain.
S250, current location of the current display information in information data chain, and the new letter that will be received are determined
Breath is inserted in the next bit of the current location.
Since the length of data chain is less than preset data chain length maximum value, so, if in data chain, when
The next bit of current location of the preceding display information in information data chain is inserted into, and is still conformed to no more than preset data chain
The requirement of length maximum value.
S260, determine information data in presently described information data chain number be 0, then will directly receive described in
New information is shown.
If the number of information data is 0 in presently described information data chain, the new information received can be made
It is directly shown for first in data chain, without deleting and other judgement operations.
The present embodiment on the basis of the above embodiments, provides a kind of current data chain length and is less than preset data chain
In the case where length maximum value, for the insertion method of new information, in this course, it can not have to consider for data-link
Information in item carries out delete operation.
On the basis of above scheme, optionally, the number of information data is not 0 in presently described information data chain
When, then judge whether the new information and any information data in the information data chain are identical, if they are the same, then by setting
Determine function and returns to particular value to terminate the insertion of the new information.The benefit being arranged in this way is can to add to avoid the repetition of information
Add.Specifically, listBannerBean.size () function can be called before being inserted into new information data to determine currently to collect
The element number count closed in listBannerBean can be directly entered the next of insertion operation if count=0 at this time
A process.If count is greater than 0, just need to call the side listBannerBean.contains (bannerBean) again at this time
Method judges whether contained the ad data of bannerBean in listBannerBean set, if having contained this
Shi Buneng carries out insertion operation to the data, needs to terminate by calling return to be inserted into process.If
ListBannerBean.contains (bannerBean) method returns to false, indicates not including bannerBean content, just
Insertion decision logic can be entered.
Embodiment three
Fig. 3 is the flow chart for the information display method that the embodiment of the present invention three provides.The present embodiment is in above-described embodiment
On the basis of, it is optimized for, the method also includes: judge that current location of the current display information in information data chain is
No is the first;If so, determining upper one position of current location by recycling the information data chain head and the tail;It will
The new information is inserted into the next bit of the current location, and deletes upper one of the current location.
As shown in figure 3, the information display method includes:
S310, when receiving new information and needing to show, judge whether the type of current global variable is non-default data
Type.
S320, if non-default data type, then judge whether the length of current information data chain is preset data chain
Length maximum value.
If S330, maximum value, it is determined that whether current location of the current display information in information data chain is several
According to the first place of chain;If so, executing S340;If it is not, then executing S350.
S340, then by the way that information data chain head and the tail are recycled, determine upper one position of current location;By institute
The next bit that new information is inserted into the current location is stated, and deletes upper one of the current location.
Specifically, can be (current to show that advertisement is being gathered by the index currentIndex to present displayed content
Index position information in listBannerBean) judged, if currentIndex==0, expression is currently being shown
What is shown is the first data, and the data have been the first datas at this time, therefore without a upper data, in order to delete upper one
Data can indicate that the last item data are a upper numbers for the first data by building one end to end circulation
According to direct at this time to delete the last item data by calling listBannerBean.remove (10) function.If
The value of currentIndex is not equal to 0 just by way of calling listBannerBean.remove (currentIndex-1)
To delete the upper data information of the current position currentIndex.
S350, the next bit that the new information is inserted into the current location, and delete upper the one of the current location
Position.
The present embodiment provides a kind of position of information currently shown in data-link on the basis of the various embodiments described above
In the case where the first place of item, if to a upper method deleted for current data chain first place, the benefit being arranged in this way
It is that can simplify deletion logic, and avoid because leading to not situations such as deleting without upper one in direct ordinal relation
Generation.
Example IV
The embodiment of the present invention four is a preferred embodiment, in order to the understanding for allowing those skilled in the art to be more clear
Technical solution provided by the present invention, is now described in more details with preferred embodiment.
This programme essentially describes the data processing algorithm design of a set of advertising column, can have by the implementation of this step
Effect realizes a set of completely new algorithm design method to meet current product business demand.This ad data has following several spies
Point nearest 10 dynamics of carousel, every Dynamic Display 3s, most newly generated dynamic are jumped the queue preferential displaying.That is if taking turns
Need for new data to be inserted into the next position that will be shown when thering is new data between date of seeding, if it is greater than 10 when
The data for also needing to delete a upper position for current presentation position are waited, this makes it possible to meet the mesh that data are no more than 10
Mark.
This programme will be unfolded and be illustrated mainly around following several aspects, and realization principle therein is described in detail
And implementation method etc..
One, the displaying of default data.
Two, the realization of data insertion logic.
Next it will be unfolded around above-mentioned two aspect and be illustrated and design principle and reality therein is described in detail
Existing details etc..And the implementation method of algorithm therein is described in detail and logic be how the real algorithm function.
One, the displaying of default data.
The data structure of the data structure of default data and non-default data is completely different, therefore to default data
Processing and the processing of non-default data carry out separating processing.
Shown in default data structure is defined as follows:
public class DefaultStr{
String defaultStr;// default data information
};
The data structure of non-default data is as follows:
The content and ad content shown due to default data is different, it is possible to design DefaultStr and
BannerBean the two data class store different data type informations respectively.
It devises one in order to be managed to current display state and enumerates class come to the status information currently shown
It is managed, specifically enumerates content-defined as follows:
enum DataType{TYPE_DefaultStr,TYPE_BannerInfo};Wherein TYPE_DefaultStr
Enumerated value is 1 expression is default data type, and it is ad data type that the value of TYPE_BannerInfo, which is 2 expressions, subsequent
Can by be pre-designed this enumerate value object determine currently be shown what kind of data information.
By defining the variable mDataType that a global type is DataType, and the value of the variable is initial
Change mDataType=TYPE_DefaultStr is default data type.
In this way in the case where no any other ad data insertion, current global variable is first determined whether
The type of mDataType, if mDataType==TYPE_DefaultStr is very, to mean that current needs show default number
According to content, directly default data information is shown on the screen at this time.If it is vacation, at this time if need from data
An ad data is taken out to be shown, the logic for evidence of fetching can provide detailed description letter in following method and step
Breath.
Two, the realization of data insertion logic
This step mainly describes the service logic of data insertion, is finally that maintenance is nearest to the maintenance target of data
10 datas, if there is new data always is inserted into data behind present displayed content, if data count is more than 10
When, it needs to be inserted into data behind current display one and deletes a upper data for current display one
To guarantee that entire data content does not exceed 10 datas.
The algorithm analysis for being described below above-mentioned data insertion process is how to realize above-mentioned target call.
Ad data is to carry out being pushed to client by C++ server, and C++ message is final by barrage distributor
It can be distributed in the insertion function of my energy, this programme is not concerned with the implementation method that barrage distribution flow is solely focused on insertion algorithm.
In order to facilitate subsequent content to be unfolded, an insertion function can be defined, is specifically defined as follows shown: public
void insertBannerBean(BannerBean bannerBean){}
The return value of insertBannerBean function is void type, that is, does not have returned content information,
The type of insertBannerBean function is public publicly-owned, other classes have the authority information for accessing the function in this way,
BannerBean is exactly the above-mentioned ad data structure information defined, that is, the advertisement data content that need to be inserted into.
In order to be safeguarded to current all advertisement data contents, by one global set variables L ist of design <
BannerBean > listBannerBean simultaneously initializes the set variable, leads in initialization function init ()
Cross calling List<BannerBean>listBannerBean=new ArrayList<BannerBean>();Method is come to collection
Close the operation that listBannerBean is initialized.
When thering is the barrage message of insertion to receive, the insertBannerBean letter being pre-designed can be actively triggered
Number, next with regard to needing to do corresponding insertion decision logic.It needs to call listBannerBean.size before being inserted into data
() function determines the element number count in current collection listBannerBean, if count=0, at this time can be straight
Next process into insertion operation is tapped into, if count is greater than 0, just needs to call again at this time
ListBannerBean.contains (bannerBean) method judges whether contained in listBannerBean set
The ad data of bannerBean needs to pass through calling if insertion operation cannot be carried out to the data at this time by having contained
Return come terminate be inserted into process.If listBannerBean.contains (bannerBean) method returns to false and indicates
Not comprising bannerBean content, so that it may into the insertion decision logic of next step.
First by calling mDataType=TYPE_BannerInfo before being inserted into data, expression currently needs to show
Content become advertising data information from default.Then the logical process of insertion data is done again.
It needs to determine that the data being currently inserted into are the first data when being inserted into data, specific determination method is
By calling listBannerBean.count ()==0 method, if the return of listBannerBean.count () method
Value, which is equal to 0, indicates to be before the first data without the data that data need to be inserted into now, is not otherwise just the first data.Such as
Fruit is to call directly listBannerBean.add (bannerBean) method just to insert data into if the first data
Set listBannerBean.
If not the first data, next need to judge whether the data in current collection listBannerBean reach
To maximum value 10, judgment method be listBannerBean.count ()==10, if the judgement returns to true and indicates
Reached 10 datas, otherwise indicates not reach 10 datas.
If in the case where reaching 10 datas, the algorithm for being inserted into data is to call directly listBannerBean.add
(bannerBean) add a data bannerBean come last position in current collection listBannerBean, next need
Delete the previous data currently shown.The logic for deleting data is also required to do corresponding determination processing, by current aobvious
Show the index currentIndex (index position information of the current display advertisement in set listBannerBean) of content into
Row judgement, if currentIndex==0, indicate to be currently displaying is the first data, and the data have been at this time
First data, therefore without a upper data, in order to delete a upper data, by constructing an end to end circulation
It indicates that the last item data are a upper datas for the first data, directly passes through calling at this time
ListBannerBean.remove (10) function deletes the last item data.If the value of currentIndex is not equal to 0
The current position currentIndex is deleted by way of calling listBannerBean.remove (currentIndex-1)
Upper data information.
If in the case where not reaching 10 datas, the algorithm for being inserted into data is the content for first determining whether currently to show
Whether the most thick latter data in set listBannerBean, specific determination method is to pass through calling
ListBannerBean.size ()==currentIndex, if it is above-mentioned expression formula be true, be otherwise false.
If it is just directly in one data content of the addition backmost of set listBannerBean, concrete implementation mode is to pass through
It calls listBannerBean.add (bannerBean), if not just in next position of current display element addition one
A ad data, the method for adding ad data are listBannerBean.add (currentIndex+1, bannerBean).
By the way that the logic decision of above-mentioned complexity can perfectly there are currently no reach in the case where 10 data current in fact
A data is added behind display, if addition one data and will be current currently display again when reaching 10 behind
A data carries out delete processing before display, to reach the realization target of entire insertion algorithm function.Also complete simultaneously
Beauty solves the problems in traditional scheme point etc..
Embodiment five
Fig. 4 is the structural schematic diagram for the information display device that the embodiment of the present invention five provides.As shown in figure 4, the information
Display device, comprising:
Global variable type judging module 410, for judging current global variable when receiving new information and needing to show
Type whether be non-default data type;
Data chain length judgment module 420, if being judged as non-default for the global variable type judging module 410
Data type then judges whether the length of current information data chain is preset data chain length maximum value;
New information is inserted into module 430, if being judged as YES maximum value for the data chain length judgment module 420,
It determines current location of the current display information in information data chain, and the new information is inserted into the current location
Next bit, and delete upper one of the current location.
Technical solution provided by the embodiment of the present application judges current global become when receiving new information and needing to show
Whether the type of amount is non-default data type;If non-default data type, then the length of current information data chain is judged
It whether is preset data chain length maximum value;If maximum value, it is determined that current display information is in information data chain
Current location, and the new information is inserted into the next bit of the current location, and delete upper one of the current location.
By using technical solution provided herein, may be implemented quickly to show new information, while can also reach
The length for controlling information data chain avoids the too long effect for influencing memory of information data chain.
Method provided by any embodiment of the invention can be performed in the said goods, has the corresponding functional module of execution method
And beneficial effect.
Embodiment six
The embodiment of the present application also provides a kind of storage medium comprising computer executable instructions, and the computer is executable
Instruction is used to execute a kind of information display method when being executed by computer processor, this method comprises:
When receiving new information and needing to show, judge whether the type of current global variable is non-default data type;
If non-default data type, then judge whether the length of current information data chain is preset data chain length
Maximum value;
If maximum value, it is determined that current location of the current display information in information data chain, and by the new letter
Breath is inserted into the next bit of the current location, and deletes upper one of the current location.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap
It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as
DRAM, DDR RAM, SRAM, EDO RAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium
(such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other
Memory of type or combinations thereof.In addition, storage medium can be located at program in the computer system being wherein performed, or
It can be located in different second computer systems, second computer system is connected to computer by network (such as internet)
System.Second computer system can provide program instruction to computer for executing.Term " storage medium " may include can
To reside in different location two or more storage mediums of (such as in the different computer systems by network connection).
Storage medium can store the program instruction (such as being implemented as computer program) that can be performed by one or more processors.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present application
The information display operation that executable instruction is not limited to the described above, can also be performed information provided by the application any embodiment
Relevant operation in display methods.
Embodiment seven
The embodiment of the present application provides a kind of terminal, and information display dress provided by the embodiments of the present application can be integrated in the terminal
It sets.Fig. 5 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.As shown in figure 5, the terminal may include: storage
Device 501, central processing unit (Central Processing Unit, CPU) 502 (also known as processor, hereinafter referred to as CPU), circuit
Plate (not shown) and power circuit (not shown).The circuit board is placed in the space interior that the shell surrounds;
The CPU502 and the memory 501 are arranged on the circuit board;The power circuit, for for each of the terminal
Circuit or device power supply;The memory 501, for storing executable program code;The CPU502 described in reading by depositing
The executable program code stored in reservoir 501 runs computer program corresponding with the executable program code, with reality
Existing following steps:
When receiving new information and needing to show, judge whether the type of current global variable is non-default data type;
If non-default data type, then judge whether the length of current information data chain is preset data chain length
Maximum value;
If maximum value, it is determined that current location of the current display information in information data chain, and by the new letter
Breath is inserted into the next bit of the current location, and deletes upper one of the current location.
The terminal further include: Peripheral Interface 503, RF (Radio Frequency, radio frequency) circuit 505, voicefrequency circuit
506, loudspeaker 511, power management chip 508, input/output (I/O) subsystem 509, touch screen 512, other input/controls
Equipment 510 and outside port 504, these components are communicated by one or more communication bus or signal wire 507.
It should be understood that graphic terminal 500 is only an example of terminal, and terminal 500 can have than figure
Shown in more or less component, two or more components can be combined, or can have different portions
Part configuration.Various parts shown in the drawings can be including one or more signal processings and/or specific integrated circuit
Hardware, software or hardware and software combination in realize.
Just provided in this embodiment below to be described in detail for Message Display Terminal, which takes the mobile phone as an example.
Memory 501, the memory 501 can be accessed by CPU502, Peripheral Interface 503 etc., and the memory 501 can
It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory,
Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU502 and deposited by Peripheral Interface 503, the Peripheral Interface 503
Reservoir 501.
I/O subsystem 509, the I/O subsystem 509 can be by the input/output peripherals in equipment, such as touch screen 512
With other input/control devicess 510, it is connected to Peripheral Interface 503.I/O subsystem 509 may include 5091 He of display controller
For controlling one or more input controllers 5092 of other input/control devicess 510.Wherein, one or more input controls
Device 5092 processed receives electric signal from other input/control devicess 510 or sends electric signal to other input/control devicess 510,
Other input/control devicess 510 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour
Vertical pole clicks idler wheel.It is worth noting that input controller 5092 can with it is following any one connect: keyboard, infrared port,
The indicating equipment of USB interface and such as mouse.
Touch screen 512, the touch screen 512 are the input interface and output interface between user terminal and user, can
It is shown to user depending on output, visual output may include figure, text, icon, video etc..
Display controller 5091 in I/O subsystem 509 receives electric signal from touch screen 512 or sends out to touch screen 512
Electric signals.Touch screen 512 detects the contact on touch screen, and the contact that display controller 5091 will test is converted to and is shown
The interaction of user interface object on touch screen 512, i.e. realization human-computer interaction, the user interface being shown on touch screen 512
Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light
Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 505 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network
The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 505 receives and sends RF letter
Number, RF signal is also referred to as electromagnetic signal, and RF circuit 505 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications
Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 505 may include for executing
The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one
A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould
Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 506 is mainly used for receiving audio data from Peripheral Interface 503, which is converted to telecommunications
Number, and the electric signal is sent to loudspeaker 511.
Loudspeaker 511 is reduced to sound for mobile phone to be passed through RF circuit 505 from the received voice signal of wireless network
And the sound is played to user.
Power management chip 508, the hardware for being connected by CPU502, I/O subsystem and Peripheral Interface are powered
And power management.
Terminal provided by the embodiments of the present application may be implemented quickly to show new information, while can also reach
The length for controlling information data chain avoids the too long effect for influencing memory of information data chain.
The application any embodiment institute can be performed in information display device, storage medium and the terminal provided in above-described embodiment
The information display method of offer has and executes the corresponding functional module of this method and beneficial effect.Not in the above-described embodiments in detail
The technical detail described to the greatest extent, reference can be made to information display method provided by the application any embodiment.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. a kind of information display method characterized by comprising
When receiving new information and needing to show, judge whether the type of current global variable is non-default data type;
If non-default data type, then judge whether the length of current information data chain is that preset data chain length is maximum
Value;
If maximum value, it is determined that current location of the current display information in information data chain, and the new information is inserted
Enter the next bit to the current location, and deletes upper one of the current location.
2. the method according to claim 1, wherein judgement is current when receiving new information and needing to show
Before whether the type of global variable is non-default data type, the method also includes:
Define default data type and non-default data type;Wherein, it when global variable is the default data type, is used for
Default data information is shown;When the global variable is the non-default data type, for non-default data
Information is shown;
The global variable is initialized as the default data type.
3. according to the method described in claim 2, it is characterized by further comprising:
If judging, the type of current global variable for default data type, the type of the global variable is switched to non-default
Data type, and directly show the new information received.
4. the method according to claim 1, wherein further include:
If judge that the length of current information data chain is less than preset data chain length maximum value:
It determines current location of the current display information in information data chain, and the new information received is inserted in
The next bit of the current location;Wherein, when currently not showing information, it is determined that information in presently described information data chain
The number of data is 0, then directly shows the new information received.
5. according to the method described in claim 4, it is characterized by further comprising:
When the number of information data is not 0 in presently described information data chain, then the new information and the Information Number are judged
It is whether identical according to any information data in chain, if they are the same, then particular value is returned to by setting function to terminate the new letter
The insertion of breath.
6. according to the method described in claim 4, it is characterized in that, default if judging that the length of current information data chain is less than
When data chain length maximum value, the method also includes:
Judge whether current location is equal to the length of current information data chain;
If so, by calling addition data function to be added at the end of current information data chain to the new information.
7. the method according to claim 1, wherein further include:
Judge whether current location of the current display information in information data chain is the first;
If so, determining upper one position of current location by recycling the information data chain head and the tail;
The new information is inserted into the next bit of the current location, and deletes upper one of the current location.
8. a kind of information display device characterized by comprising
Global variable type judging module, for judging the type of current global variable when receiving new information and needing to show
It whether is non-default data type;
Data chain length judgment module, if being judged as non-default data type for the global variable type judging module,
Whether the length for then judging current information data chain is preset data chain length maximum value;
New information is inserted into module, if being judged as YES maximum value for the data chain length judgment module, it is determined that current aobvious
Show current location of the information in information data chain, and the new information is inserted into the next bit of the current location, and
Upper one for deleting the current location.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor
The information display method as described in any in claim 1-7 is realized when row.
10. a kind of terminal, including memory, processor and storage are on a memory and can be in the computer journey of processor operation
Sequence, which is characterized in that the processor realizes the information as described in any in claim 1-7 when executing the computer program
Display methods.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810689880.6A CN109033197A (en) | 2018-06-28 | 2018-06-28 | A kind of information display method, device, storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810689880.6A CN109033197A (en) | 2018-06-28 | 2018-06-28 | A kind of information display method, device, storage medium and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109033197A true CN109033197A (en) | 2018-12-18 |
Family
ID=65521979
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810689880.6A Pending CN109033197A (en) | 2018-06-28 | 2018-06-28 | A kind of information display method, device, storage medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109033197A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790337A (en) * | 2015-11-25 | 2017-05-31 | 腾讯科技(深圳)有限公司 | Information-pushing method and device |
CN106980447A (en) * | 2017-02-09 | 2017-07-25 | 广东欧珀移动通信有限公司 | A kind of information processing method, device and terminal |
CN107066564A (en) * | 2017-03-31 | 2017-08-18 | 武汉斗鱼网络科技有限公司 | A kind of data processing method and device based on Android list |
CN107066471A (en) * | 2016-11-23 | 2017-08-18 | 阿里巴巴集团控股有限公司 | A kind of method and device of dynamic display of information |
CN107169580A (en) * | 2017-04-27 | 2017-09-15 | 上海途悠信息科技有限公司 | The queuing reserving method and system of dynamic capacity are accepted based on window |
CN108122121A (en) * | 2016-11-29 | 2018-06-05 | 长沙青核桃网络科技有限公司 | A kind of advertisement marketing system design of Android platform |
-
2018
- 2018-06-28 CN CN201810689880.6A patent/CN109033197A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790337A (en) * | 2015-11-25 | 2017-05-31 | 腾讯科技(深圳)有限公司 | Information-pushing method and device |
CN107066471A (en) * | 2016-11-23 | 2017-08-18 | 阿里巴巴集团控股有限公司 | A kind of method and device of dynamic display of information |
CN108122121A (en) * | 2016-11-29 | 2018-06-05 | 长沙青核桃网络科技有限公司 | A kind of advertisement marketing system design of Android platform |
CN106980447A (en) * | 2017-02-09 | 2017-07-25 | 广东欧珀移动通信有限公司 | A kind of information processing method, device and terminal |
CN107066564A (en) * | 2017-03-31 | 2017-08-18 | 武汉斗鱼网络科技有限公司 | A kind of data processing method and device based on Android list |
CN107169580A (en) * | 2017-04-27 | 2017-09-15 | 上海途悠信息科技有限公司 | The queuing reserving method and system of dynamic capacity are accepted based on window |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6996005B2 (en) | Resource configuration method, equipment, terminals, and storage media | |
US11467855B2 (en) | Application preloading method and device, storage medium and terminal | |
CN108681475A (en) | Application program preloads method, apparatus, storage medium and mobile terminal | |
CN108647052A (en) | Application program preloads method, apparatus, storage medium and terminal | |
JP7138804B2 (en) | INTERFACE DISPLAY METHOD AND DEVICE, TERMINAL AND COMPUTER PROGRAM | |
CN112988400B (en) | Video memory optimization method and device, electronic equipment and readable storage medium | |
CN108829456A (en) | Application program preloads method, apparatus, storage medium and terminal | |
CN108595224A (en) | Application prompts method, apparatus, storage medium and terminal | |
CN111814089A (en) | Page rendering method and device, rendering server and storage medium | |
CN110413347B (en) | Advertisement processing method and device in application program, storage medium and terminal | |
CN110222288B (en) | Page display method, device and storage medium | |
CN108958828A (en) | Application program preloads method, apparatus, storage medium and terminal | |
CN107748684A (en) | Realize processing method, device, storage medium and the mobile terminal of self-starting | |
CN107172501A (en) | Recommend methods of exhibiting and system in a kind of live room | |
CN108829311A (en) | A kind of method and apparatus based on Widget display data | |
CN112817498A (en) | Application authority management method, device, storage medium and terminal | |
CN110149545B (en) | User information processing method and device, electronic equipment and readable storage medium | |
CN109522482A (en) | Game application classification page display method, device, storage medium and terminal | |
CN105955743A (en) | Resource data transfer request generating method, device and system | |
CN108845838A (en) | Application program preloads method, apparatus, storage medium and terminal | |
CN108762836A (en) | Management method, device, storage medium and the intelligent terminal of preloaded applications | |
CN112579048A (en) | Applet integration method, device, electronic equipment and storage medium | |
CN111930287B (en) | Interaction method and device based on virtual object, electronic equipment and storage medium | |
CN112187624B (en) | Message reply method and device and electronic equipment | |
CN117555459A (en) | Application group processing method and device, storage medium and electronic equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181218 |
|
RJ01 | Rejection of invention patent application after publication |