CN101969457A - Server side mobile widget managing and searching method based on Huffman tree - Google Patents

Server side mobile widget managing and searching method based on Huffman tree Download PDF

Info

Publication number
CN101969457A
CN101969457A CN 201010290584 CN201010290584A CN101969457A CN 101969457 A CN101969457 A CN 101969457A CN 201010290584 CN201010290584 CN 201010290584 CN 201010290584 A CN201010290584 A CN 201010290584A CN 101969457 A CN101969457 A CN 101969457A
Authority
CN
China
Prior art keywords
widget
huffman tree
node
server end
weights
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.)
Granted
Application number
CN 201010290584
Other languages
Chinese (zh)
Other versions
CN101969457B (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN2010102905842A priority Critical patent/CN101969457B/en
Publication of CN101969457A publication Critical patent/CN101969457A/en
Application granted granted Critical
Publication of CN101969457B publication Critical patent/CN101969457B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a server side mobile widget managing and searching method based on a Huffman tree, comprising the following steps of: building the Huffman tree to manage a mobile widget of a server side; firstly extracting a downloading frequency of the widget as a weight of each widget before building the Huffman tree; building the Huffman tree according to a Huffman tree algorithm; and stipulating that a left child weight is smaller than a right child weight in the Huffman tree, wherein the lower the layer number of a node is lower, and the smaller a weight thereof is. The invention enhances the efficiency of the mobile widget management of the server side and the speed of widget retrieving of a mobile user.

Description

Server end based on the Huffman tree moves widget management and lookup method
Technical field
The present invention relates to mobile widget technical field, particularly a kind of server end based on the Huffman tree moves the management method of widget.
Background technology
Widget is the code that a fritter can be carried out on any one Web page based on HTML, and its form of expression may be a video, map, news, trivial games etc.Come from an inserter tool--the Konfabulator of Apple Computers at first, expanded on various desktop operating systems and the mobile phone operating system now.It mainly is that cell-phone customer terminal is used at present that mobile Internet in the mobile phone is used.Through development in a few years, the cell-phone customer terminal that some occurred is used, and comprises mobile phone games, e-book, mobile phone magazine, cell phone map, mobile phone mailbox etc., and these application have obtained cellphone subscriber's welcome to a certain degree.
But, use for cell-phone customer terminal, subject matter has three at present: first, the adaptive problem of mobile phone, almost each client application all faces the adaptive workload to different mobile phones, cause third party development company energy can't be poured into the diversity application innovation fully, a often application is seized state power; The second, do not support technical problems such as dynamic application download, cause the cellphone subscriber to obtain the direct channel disappearance of application; The 3rd, the threshold that exists client application to develop can't be realized mass participation.These all cause cell-phone customer terminal to be used can't realize the surge of quality and quantity in essence, can't satisfy the mobile phone content application demand of user individual.
This little application form of Widget is under this hardware condition that limitation relatively arranged of mobile phone terminal, differs and function differs by the form of expression, is that of the user that requires of increasing now pursuing individuality mobile phone well selects.The Widget of main flow comprises Yahoo Widget, Google gadget, Appledashboard Widget and Facebook Widget etc. at present.
Widget is changing the access mode of the Internet as a kind of special " webpage ", and customer access network no longer needs to depend on browser, but just can realize the web function by these small tools.Widget also provides brand-new user experience to the user.Can customize the own needed various services that realize by Widget user, arbitrarily the desktop of personalization oneself is experienced its again little and cruel style.Widget has that stature is little, form is many, function is big, looks are beautiful, personalized, make numerous advantages such as easy, the user can download widget miscellaneous from server end by the internet.Along with the widget growth of requirement and containing huge business opportunity and potentiality, the personnel that participate in the widget making are more and more, all the time constantly there is the widget of new function to release in the world, the method of the easiest popularization widget is the widget that makes to be placed on user's download is provided on the server, so just caused such predicament, widget that is on the increase and server end are to the conflict between the limited administration ability of widget.
The method of existing mobile widget server end management is many, and usual way has to be given initiate widget distribution ID at random and distribute ID according to the principle of distributing earlier first to widget.These class methods cause the confusion of server end management easily, can not obtain any information of widget according to ID.
Summary of the invention
In order to make server end can manage increasing widget resource efficiently, guarantee that the user finds most popular widget quickly and accurately, the object of the present invention is to provide a kind of server end to move the widget management method based on the Huffman tree.
The source encoding of Huffman encoding a kind of undistorted elongated degree that to be nineteen fifty-two at first proposed by mathematician D.A. Huffman.The Huffman tree, promptly optimum binary tree is the shortest tree of a class cum rights path.The Huffman tree can obtain optimum decision algorithm, through the widget of Huffman tree-encoding management, the result of user inquiring can be provided through fewer number of comparisons, thereby shorten the time that the user searches.The present invention is exactly the mobile widget that utilizes Huffman tree management server end.
The technical scheme that technical solution problem of the present invention is adopted is:
Propose a kind of server end and move the widget management method based on the Huffman tree, it manages by the mobile widget of structure Huffman tree to server end, before making up the Huffman tree, extract the weights of the download frequency of widget earlier as each widget, the widget of server end is made up the Huffman tree according to the Huffman tree algorithm, and every layer of left child's weights are littler than right child's weights in the regulation Huffman tree, and the node place number of plies is low more, and its weights are more little.
The construction step of described Huffman tree is as follows:
1. suppose the set W={w of server end widget 1, w 2, w 3... w n;
2. select the widget:w of two weights minimums iAnd w j, the weights addition generates father's node and joins among the W, deletes the w among the W simultaneously i, w j, with w iAnd w jTwo child nodes and this father's node make up the Huffman tree together, and the child nodes that weights are little is positioned at the left side, and the child nodes that weights are big is positioned at the right;
3. continued in new W, to carry out second step, from W, remove up to all nodes.
If newly added a widget in the server, be inserted in the Huffman tree, concrete steps are as follows:
1. the weights with initiate widget are changed to zero;
2. weights are that the leftmost node of the bottom is the node of weights minimum in the former Huffman tree in zero new node and the former Huffman tree, constitute a pair of child nodes, generate father's node simultaneously;
3. newly-generated father's node and child nodes thereof are inserted into the leftmost node of the bottom place that former Huffman is set.
If server end has been cancelled a widget, this widget of deletion from the Huffman tree, concrete steps are as follows:
1. find this widget node w in the Huffman tree according to Huffman encoding i
2. with this widget node w iThe brotgher of node on move to node w iFather's node place;
3. delete this widget node w iAnd father's node.
The present invention also proposes a kind of lookup method that server end based on the Huffman tree is moved widget, it is characterized in that, mobile widget management method according to above-mentioned server end based on Huffman tree, after the Huffman tree builds, each moves the ID that widget can assign to a Huffman encoding, according to following steps described mobile widget is searched:
1. server end receives the query requests of client;
2. if fuzzy query, server end just according to length and the value size of the ID of widget, is pressed carrier frequency rate sequence arrangement from high to low to widget and is sent on the query interface of client;
3. if accurately inquire about, server end just begins from top to bottom from the top of Huffman tree, compares the keyword of the widget of leaf node and user inquiring from right to left, final query result is sent on the query interface of client.
The beneficial effect that the present invention has is: at first, the structure of Huffman tree has provided the management method of server end to widget; Secondly, propose management, provided the method that optimum widget inserts the Huffman tree, can spend minimum cost to generate new Huffman tree new insertion widget; Once more, the deletion of widget has guaranteed validity and the authenticity of the widget of Huffman tree also to minimize the Huffman tree that has rebuild widget simultaneously.
In addition, the server end to based on the Huffman tree of proposition moves the lookup method of widget, can significantly reduce the time that searches the result, improves mobile subscriber's search efficiency, experiences for the user better.
Description of drawings
Fig. 1 is the overview flow chart of the embodiment of the invention;
Fig. 2 is the schematic diagram of Huffman tree constructed embodiment of the present invention.
Embodiment
As shown in Figure 1, the server end based on the Huffman tree of present embodiment moves the widget management method, comprises following flow process:
1) structure of Huffman tree
Because along with user's download moves the generation of widget behavior, the download frequency of each widget can change.For guaranteeing that most popular widget can access the shortest ID coding, be necessary that rebuilding a Huffman every a time cycle as 48 hours sets.
Before making up the Huffman tree, extract the weights of the download frequency of widget earlier as each widget, its method is at server end a look-up table to be set, be used to write down the download frequency of each widget, definite weights that make up each widget of Huffman tree only need be searched each widget from look-up table download frequency makes up Huffman according to the Huffman tree algorithm and sets.Concrete steps are as follows:
1. suppose the set W={w of server end widget 1, w 2, w 3W n, and left child's weights are littler than right child's weights in the regulation Huffman tree;
2. select the widget:w of two weights minimums iAnd w j(i, j are natural number, and i ≠ j), w iAnd w jThe weights addition generates father's node and joins among the W, deletes the w among the W simultaneously i, w jAnd with w iAnd w jThese two child nodes and its father's node make up the Huffman tree together;
3. continue in new W, to carry out step 2., from W, remove up to all nodes;
Below be data structure and the arthmetic statement of Huffman tree:
Figure BDA0000026969280000061
Fig. 2 is the example that the Huffman tree makes up, in this example, suppose to have 1.-4. four mobile widget, each download frequency that moves widget be weights as shown in the figure, the mobile widget that at every turn selects two weights minimums generates father's node, its weights addition is as the weights of this father's node, at first, two mobile widget that select the weights minimum 3. and 1., weights 3. are less than 1., so 3. on 1. the left side; Secondly, 3. and father's node weights 1. be 60,3. and father's node 1. and the father's node that 4. constitutes them again weights 4. are 70, so; Be built into the Huffman tree according to this.After Huffman tree built, the boundary values on a node left side was 0, and the boundary values on the right is 1, gave each leaf node coding from top to bottom from the summit of tree, was 001 as 1. Huffman encoding ID;
2) if newly added a widget in the server, be inserted in the Huffman tree, concrete steps and method are as follows:
1. because initiate widget download frequency is zero, so the weights of initiate widget are changed to zero;
2. weights are the leftmost node of the bottom in zero new node and the former Huffman tree, and weights minimum node in the promptly former Huffman tree constitutes a pair of child nodes, generates father's node simultaneously;
3. newly-generated father's node and child nodes thereof are inserted into the leftmost node of the bottom place that former Huffman is set;
3) deletion of widget
If server end has been cancelled a widget, need from the Huffman tree, delete this widget, concrete steps and method are as follows:
1. find this node w in the Huffman tree according to Huffman encoding i
2. with this widget node w iThe brotgher of node on move to this widget node w iFather's node place;
3. delete this widget node w iAnd father's node;
4) widget's searches
After the Huffman tree builds, each widget can assign to the ID of a Huffman encoding, the widget download frequency that ID is short more is high more, if ID length is identical, the widget download frequency that the ID value is big more is high more, the widget that the user inquired about is the higher widget of pouplarity usually, and based on this condition, the concrete execution in step of server end is as follows:
1. receive the query requests of client;
2. if fuzzy query (being that the user does not inquire about certain concrete widget), server end just according to length and the value size of the ID of widget, is pressed carrier frequency rate sequence arrangement from high to low to widget and is sent on the query interface of client;
3. if accurately inquiry (being certain concrete widget of user inquiring), server end just begins from last to down from the top of Huffman tree, the keyword that compares the widget of leaf node and user inquiring from right to left, as widget title, widget purposes etc., final query result is sent on the query interface of client.

Claims (7)

1. the server end based on the Huffman tree moves the widget management method, mobile widget to server end manages by structure Huffman tree, it is characterized in that: before making up the Huffman tree, extract the weights of the download frequency of widget earlier as each widget, the widget of server end is made up the Huffman tree according to the Huffman tree algorithm, and every layer of left child's weights are littler than right child's weights in the regulation Huffman tree, and the node place number of plies is low more, and its weights are more little.
2. the server end based on the Huffman tree as claimed in claim 1 moves the widget management method, it is characterized in that the construction step of described Huffman tree is as follows:
1. suppose the set W={w of server end widget 1, w 2, w 3... w n;
2. select the widget:w of two weights minimums iAnd w j, the weights addition generates father's node and joins among the W, deletes the w among the W simultaneously i, w j, with w iAnd w jTwo child nodes and this father's node make up the Huffman tree together, and the child nodes that weights are little is positioned at the left side, and the child nodes that weights are big is positioned at the right;
3. continued in new W, to carry out second step, from W, remove up to all nodes.
3. the server end based on the Huffman tree as claimed in claim 1 moves the widget management method, it is characterized in that: if newly added a widget in the server, be inserted in the Huffman tree, concrete steps are as follows:
1. the weights with initiate widget are changed to zero;
2. weights are the leftmost node of the bottom in zero new node and the former Huffman tree, constitute a pair of child nodes, generate father's node simultaneously;
3. newly-generated father's node and child nodes thereof are inserted into the leftmost node of the bottom place that former Huffman is set.
4. the server end based on the Huffman tree as claimed in claim 1 moves the widget management method, it is characterized in that: if server end has been cancelled a widget, and this widget of deletion from the Huffman tree, concrete steps are as follows:
1. find this widget node w in the Huffman tree according to Huffman encoding i
2. with this widget node w iThe brotgher of node move to node w iFather's node place;
3. delete this widget node w iAnd father's node.
5. the server end based on Huffman tree according to claim 1 moves the widget management method, it is characterized in that: every a time cycle widget of server end is rebuild the Huffman tree one time.
6. lookup method that the server end based on Huffman tree is moved widget, it is characterized in that: according to the mobile widget management method of each described server end based on Huffman tree of claim 1-5, after the Huffman tree builds, each moves the ID that widget can assign to a Huffman encoding, according to following steps described mobile widget is searched:
1. server end receives the query requests of client;
2. if fuzzy query, server end just according to length and the value size of the ID of widget, is pressed carrier frequency rate sequence arrangement from high to low to widget and is sent on the query interface of client;
3. if accurately inquire about, server end just begins from top to bottom from the top of Huffman tree, compares the keyword of the widget of leaf node and user inquiring from right to left, final query result is sent on the query interface of client.
7. the lookup method that the server end based on the Huffman tree is moved widget according to claim 6, it is characterized in that: in the described fuzzy query, the widget download frequency that ID is short more is high more, if ID length is identical, the widget download frequency that the ID value is big more is high more.
CN2010102905842A 2010-09-25 2010-09-25 Server side mobile widget managing and searching method based on Huffman tree Expired - Fee Related CN101969457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102905842A CN101969457B (en) 2010-09-25 2010-09-25 Server side mobile widget managing and searching method based on Huffman tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102905842A CN101969457B (en) 2010-09-25 2010-09-25 Server side mobile widget managing and searching method based on Huffman tree

Publications (2)

Publication Number Publication Date
CN101969457A true CN101969457A (en) 2011-02-09
CN101969457B CN101969457B (en) 2012-09-05

Family

ID=43548561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102905842A Expired - Fee Related CN101969457B (en) 2010-09-25 2010-09-25 Server side mobile widget managing and searching method based on Huffman tree

Country Status (1)

Country Link
CN (1) CN101969457B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5742779A (en) * 1991-11-14 1998-04-21 Tolfa Corporation Method of communication using sized icons, text, and audio
CN101039473A (en) * 2006-03-14 2007-09-19 三星电子株式会社 Apparatus and method for fast access to applications in mobile communication terminal
CN101661392A (en) * 2008-08-29 2010-03-03 中国移动通信集团公司 Method, device and equipment for operating special interface tool on mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5742779A (en) * 1991-11-14 1998-04-21 Tolfa Corporation Method of communication using sized icons, text, and audio
CN101039473A (en) * 2006-03-14 2007-09-19 三星电子株式会社 Apparatus and method for fast access to applications in mobile communication terminal
CN101661392A (en) * 2008-08-29 2010-03-03 中国移动通信集团公司 Method, device and equipment for operating special interface tool on mobile terminal

Also Published As

Publication number Publication date
CN101969457B (en) 2012-09-05

Similar Documents

Publication Publication Date Title
CN102193917B (en) Method and device for processing and querying data
CN102323947B (en) Generation method of pre-join table on ring-shaped schema database
CN109614402B (en) Multidimensional data query method and device
CN107291785A (en) A kind of data search method and device
CN102906751A (en) Method and device for data storage and data query
CN104239511B (en) A kind of user's space file system implementation method towards MongoDB
CN111723073B (en) Data storage processing method, device, processing system and storage medium
CN104346345B (en) The storage method and device of data
CN102769640B (en) The update method of user profile, server and system
CN103488687A (en) Searching system and searching method of big data
CN103581224A (en) Method and device for pushing information
CN103838831A (en) On-line social network mass data storage method based on community division
CN110737663A (en) data storage method, device, equipment and storage medium
CN105407030A (en) Method and device for playing multimedia file in instant messaging
CN106790552A (en) A kind of content providing system based on content distributing network
CN106815260A (en) A kind of index establishing method and equipment
CN104346347A (en) Data storage method, device, server and system
CN111935306A (en) Node scheduling method and device
CN110119396B (en) Data management method and related product
US20180205790A1 (en) Distributed data structure in a software defined networking environment
CN107844536B (en) Method, device and system for selecting application program
CN108810139A (en) A kind of wireless caching method based on Monte Carlo tree search auxiliary
CN101859316A (en) Method and device for mass file access
CN103744882A (en) Catalogue fragment expressing method and device based on key value pair
CN108153759B (en) Data transmission method of distributed database, intermediate layer server and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120905

Termination date: 20150925

EXPY Termination of patent right or utility model