Summary of the invention
In view of this, the embodiment of the invention discloses a kind of method and apparatus of focus frame positioning, for realizing focus frameThe dynamic positioning of different columns, improves working efficiency in different format differences interface, reduces storage pressure.
A kind of method of focus frame positioning is disclosed in the embodiment of the present invention, is applied to set-top box, including:
Receive the move of moving focal point frame;
According to the move, focus frame institute positioning rail purpose column layout information is obtained;The column layout informationSpecification for position and occupied units of pages lattice in the page where characterizing the column;
According in the move directional information and the column layout information determine target column;
Target column layout information according to the target column regenerates goal-focus frame as the focus after movementFrame.
Preferably, further include before the move for receiving moving focal point frame:
The column layout information of each column in the pre-generated page.
Preferably, the column layout information of each column includes in the pre-generated page:
Obtain the corresponding column array of the column generated after each column execution unit lattice merges in the page;
According to column array described in each, the column coordinate of the page where calculating four vertex of the column;
Obtain the height of cell, width and gap in the page;
According to corresponding to the height of the cell, width, gap and each described column Coordinate generation columnColumn layout information, the column layout information include the column purpose mark, coordinate, height, width, apart from page topDistance and the distance apart from page left end.
Preferably, the directional information according in the move and the column layout information determine target columnIncluding:
Obtain the directional information of the move;
Extract the column coordinate value to match in the column coordinate of the column layout information with the directional information;
Target identification is determined according to the column coordinate value and the directional information;
Using column corresponding to the target identification for meeting mobile condition as target column.
Preferably, the target column layout information according to the target column regenerates goal-focus frame as shiftingFocus frame after dynamic includes:
Obtain the column layout information of the target column;
Extract height in the column layout information, width, the distance apart from page top and apart from page left endDistance;
Using the distance apart from page top and the distance apart from page left end as absolute fix, with the heightDegree and width generate goal-focus frame as the focus frame after movement.
On the other hand the embodiment of the present invention also discloses a kind of device of focus frame positioning, be applied to set-top box, including:
Receiving unit, for receiving the move of moving focal point frame;
Acquiring unit, for obtaining focus frame institute positioning rail purpose column layout information according to the move;It is describedThe specification of position and occupied units of pages lattice where column layout information is used to characterize the column in the page;
Determination unit, for according in the move directional information and the column layout information determine target columnMesh;
Positioning unit regenerates goal-focus frame conduct for the target column layout information according to the target columnFocus frame after movement.
Preferably, further include:
Pre-generatmg unit, for pre-generating the column layout information of each column in the page.
Preferably, the pre-generatmg unit includes:
Array obtains module, for obtaining in the page column pair generated after each column execution unit lattice mergesThe column array answered;
Coordinate generation module, for the page where according to column array described in each, calculating four vertex of the columnColumn coordinate;
Data acquisition module, for obtaining the height of cell, width and gap in the page;
Pre-generatmg module, for raw according to the height of the cell, width, gap and each described column coordinateAt column layout information corresponding to the column, the column layout information include the column purpose mark, coordinate, height, width,Distance apart from page top and the distance apart from page left end.
Preferably, the determination unit includes:
Direction obtains module, for obtaining the directional information of the move;
Coordinate extraction module is matched with the directional information in the column coordinate for extracting the column layout informationColumn coordinate value;
Determining module is identified, for determining target identification according to the column coordinate value and the directional information;
Column determining module, for column corresponding to the target identification of mobile condition will to be met as target column.
Preferably, the positioning unit includes:
Layout information obtains module, for obtaining the column layout information of the target column;
Property extracting module, for extracting height, width, the distance apart from page top in the column layout informationAnd the distance apart from page left end;
Locating module, for using the distance apart from page top and the distance apart from page left end as absolutelyPositioning generates goal-focus frame as the focus frame after movement using the height and width.
In technical solution of the present invention, a kind of method and device of focus frame positioning is disclosed, set-top box is applied to, it is describedThe move of method reception moving focal point frame;Then according to the move, focus frame institute positioning rail purpose column is obtainedLayout information;Position and occupied units of pages where the column layout information is used to characterize the column in the pageThe specification of lattice;Later according in the move directional information and the column layout information determine target column;FinallyTarget column layout information according to the target column regenerates goal-focus frame as the focus frame after movement.It can seeOut, due in technical solution of the present invention, not needing to carry out writing for attribute codes for each column in advance, but meter in real timeIt calculates, generates focus frame in real time, therefore, for developer, work without extra written in code, improve work effectRate, while greatly reducing the pressure of set-top box memory space.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
In technical solution of the present invention, application scenarios are mainly in set-top box, wherein a kind of support television terminal of set-top boxThe household appliance of integrated information business is provided, the digital signal of compression can be changed into television content, and show on a television setOut, enable users to watch digital television program on existing television set, and can be interacted by network formula digitlization amusement,Education and commercialization activity.
It is a kind of flow diagram of the method for focus frame positioning disclosed by the invention referring to Fig. 1, Fig. 1.
The invention discloses a kind of methods of focus frame positioning, are applied to set-top box comprising:
S101, the move for receiving moving focal point frame;
In technical solution of the present invention, the move of moving focal point frame is received first, it is logical which can be userRemote controler transmission is crossed, be also possible to send by the software app mode of other such as mobile phones can control page in set-top boxThe mobile order of the focus frame in face.It include moving direction information in the move, such as up and down etc., it can also wrap certainlyOperation information is included, such as obtains the program etc. of column.
S102, according to the move, obtain focus frame institute positioning rail purpose column layout information;The column layoutThe specification of position and occupied units of pages lattice where information is used to characterize the column in the page;
After receiving the move, the column for the column that focus frame in current page was positioned at current time can be obtainedLayout information.It include its mark in the page in the column layout information, coordinate, length, height can also include apart from pageThe distance on face top and distance apart from page left end.In embodiments of the present invention, these parameters can in the form of array tableShow.
S103, according in the move directional information and the column layout information determine target column;
After the column layout information for obtaining the column currently positioned, according to the directional information in move and it can be somebody's turn to doColumn layout information determines the target column for needing to be moved to.Specific calculating process is introduced later.
S104, goal-focus frame is regenerated as after mobile according to the target column layout information of the target columnFocus frame.
Finally, a new focus frame can be generated in real time as the focus frame after movement in the embodiment of the present invention.With it is existingTechnology is the difference is that be that various Code Edits were realized to the movement of focus frame later in advance in the prior art, and the application skillIt is then to regenerate goal-focus frame as the focus frame after movement in art scheme.It is, of course, understood that regeneratingIt is meant that after deleting original focus frame and executes the meaning regenerated, i.e., the mobile front and back of focus frame has and there is only oneFocus frame.I.e. while regenerating goal-focus frame, original focus frame can be removed.
In technical solution of the present invention, a kind of method and device of focus frame positioning is disclosed, set-top box is applied to, it is describedThe move of method reception moving focal point frame;Then according to the move, focus frame institute positioning rail purpose column is obtainedLayout information;Position and occupied units of pages where the column layout information is used to characterize the column in the pageThe specification of lattice;Later according in the move directional information and the column layout information determine target column;FinallyTarget column layout information according to the target column regenerates goal-focus frame as the focus frame after movement.It can seeOut, due in technical solution of the present invention, not needing to carry out writing for attribute codes for each column in advance, but meter in real timeIt calculates, generates focus frame in real time, therefore, for developer, work without extra written in code, improve work effectRate, while greatly reducing the pressure of set-top box memory space.
In above-described embodiment, the process for generating column layout information is described, is described in detail below to this process.
Referring to fig. 2, Fig. 2 is a kind of another process signal of the method for focus frame positioning disclosed in the embodiment of the present inventionFigure.
In the embodiment of the present invention, on the basis of the above embodiments, before the move for receiving moving focal point frameFurther include:
The column layout information of each column in S201, the pre-generated page.
That is, the column layout information of each column can be pre-generated in technical solution of the present invention.Then step is executedS101-S104。
Certainly, the process of generation, which can also be, just executes when receiving move every time and stores.The application is excellentChoosing be it is pre-generated, in order to improve execution efficiency.Certainly, with the continuous development of processor technology, therefore, even ifIt is real-time perfoming, Caton phenomenon also can be unobvious from the user's point of view, will not influence user experience.
Specifically, the column layout information of each column includes in the pre-generated page:
Obtain the corresponding column array of the column generated after each column execution unit lattice merges in the page;
In the embodiment of the present invention, when carrying out the column typesetting of the page according to cell span, the page can be automatically generatedText file, array corresponding to each column is preserved in this article this document.For example, with reference to mono- page of Fig. 3 a byThe cell of 3*7 is constituted, and after carrying out cell span, constitutes multiple columns, such as Fig. 3 b, constitutes 11 columns after merging, in figureIt is identified using number 0 to 10.Wherein, such as column 0,1,4,8,10 can be formed by multiple cell spans.Complete itThe text file including array can be automatically generated afterwards, and wherein each column is all made of an array to indicate.For example, in Fig. 3 bIn, [[1,1,1,0,0,0,0], [1,1,1,0,0,0,0], [0,0,0,0,0,0,0]] can be used to indicate the column after mergingMesh 0.In the array, it is identified as the 1 representative column and occupies cell, 0 indicates vacant.And so on, other columnsAlso it is indicated using such mode.It should be noted that the process is realized in advance in server end, text text is only saved in set-top boxPart.
It is understood that the process obtained can be by the move of user's first time moving focal point frame as touchingHair, can also be after set-top box starts with regard to automatic trigger, herein without specifically limiting, as long as available be to column arrayIt can.
According to column array described in each, the column coordinate of the page where calculating four vertex of the column;
In the embodiment of the present invention, after obtaining column data, the column coordinate on four vertex such as column 0 can be calculated.ItsIn, the data of page location where column coordinate is used to indicate that column.
Since each column belongs to rectangle, regard each column as a rectangle to calculate the columnMesh includes the following steps in the coordinate of the page, the process for obtaining coordinate.
The numerical value for encountering 1 in reading column array for the first time, obtains the subscript of the cell corresponding to it, as columnStart unit lattice coordinate ls and wide start unit lattice coordinate ws.That is, having found rectangular upper left side vertex.
Then it is longitudinal go for encountering 0 or to array longitudinal direction the last position, be determined as the vertex in the rectangle lower left corner,That is the end unit lattice coordinate le of the length of column.Meanwhile laterally read 0 or array laterally the last when, determine rectangularThe vertex in the shape upper right corner, the i.e. wide end unit lattice we of column.
For example, the coordinate of column 0 is " ws " in Fig. 3 b:0,"we":2,"ls":0,"le":1.That is, column 0 is from the upper left cornerFirst cell starts, and width is 2 cells, the layout of a length of 3 cells.The coordinate of column 1 is " ws ":3,"we":4,"ls":0,"le":0。
Obtain the height of cell, width and gap in the page;
After having obtained the coordinate on rectangular four vertex, height, width and the gap of cell in the page are obtained, thisA little data are configured in advance, the parameter specifically specified according to actual needs.
According to corresponding to the height of the cell, width, gap and each described column Coordinate generation columnColumn layout information, the column layout information include the column purpose mark, coordinate, height, width, apart from page topDistance and the distance apart from page left end.
Finally, generating the column layout information of each column.Wherein, column layout information include the column purpose mark,Coordinate, height, width, the distance apart from page top and the distance apart from page left end.
For example, in Fig. 3 b, the layout information of obtained column 0 can be:
{"id":"unit00","ws":0,"we":2,"ls":0,"le":1,"left":0,"top":0,"width":464,"height":258};
Wherein, id is the column purpose mark, left is the distance apart from page left end, top be apart from page top away fromFrom width is width, and height is height.
Wherein, calculation is Left=ws* (width+cell interval of cell), Top=ls* (cellHeight+cell interval), width=(we-ws+1) * cell width+(we-ws) * cell interval, height=(le-ls+1) height of * cell+(le-ls) * cell interval.
In this way, having obtained the column layout information of each column.
After obtaining column layout information, so that it may the position of focus frame be accurately positioned using these data.
On the basis of the above embodiments, the present invention can determine target column according to move.
Specifically, according in the move directional information and the column layout information determine target column packetIt includes:
Obtain the directional information of the move;
Extract the column coordinate value to match in the column coordinate of the column layout information with the directional information;
Target identification is determined according to the column coordinate value and the directional information;
Using column corresponding to the target identification for meeting mobile condition as target column.
In the embodiment of the present invention, the directional information in move, such as upper and lower, left and right, then according to the direction are obtainedInformation and column coordinate, to determine the target identification of column.
Specifically, executing following calculation process when user's operation key.
Upper key:Under the premise of le of the ls-1 equal to object element for meeting currentElement, also meet the ws's of currentElementThe value that value is greater than the we of the ws and currentElement equal to object element is less than the value of the we equal to object element, or currentIt is any in the value for the we that the value that the value of the ws of element is equal to the ws of the object element or we of currentElement is equal to object elementA kind of situation.
Down key:Under the premise of ls of the le+1 equal to object element for meeting currentElement, also to meet the ws of currentElementValue be greater than the ws equal to object element and meet the value of the we of currentElement and be less than the value of the we equal to object element, orIn the value for the we that the value that the value of the ws of person's currentElement is equal to the ws of the object element or we of currentElement is equal to object elementAny one situation.
Left button:Under the premise of we of the value -1 equal to object element for meeting the ws of currentElement, it is also necessary to meet current memberThe value that the ls of element is more than or equal to the ls and currentElement le of object element is less than the value of the le equal to object element, or currentIt is any in the value for the le that the value that the value of the ls of element is equal to the ls of the object element or le of currentElement is equal to object elementA kind of situation.
Right button:Under the premise of ws of the value+1 equal to object element for meeting the we of currentElement, meet the ls of currentElementValue more than or equal to the ls and currentElement le of object element is less than the value or currentElement of the le equal to object elementAny one feelings in the value for the le that the value that the value of ls is equal to the ls of the object element or le of currentElement is equal to object elementCondition.
The target identification of column is determined according to above-mentioned mobile condition.For example, when focus frame is in column 0, by directionkeysUnder, then the mark that can calculate column 7 meets mobile condition, then regard column 7 as target column.
After the target column that needs are moved to has been determined, focus frame can be generated in real time.
Wherein, the target column layout information according to the target column regenerates goal-focus frame as movementFocus frame afterwards includes:
Obtain the column layout information of the target column;
Extract height in the column layout information, width, the distance apart from page top and apart from page left endDistance;
Using the distance apart from page top and the distance apart from page left end as absolute fix, with the heightDegree and width generate goal-focus frame as the focus frame after movement.
In the embodiment of the present invention, extract column layout information in height, width, the distance apart from page top and away fromWith a distance from page left end.
By taking above-described embodiment as an example, obtain " " left ":0,"top":0,"width":464,"height":258 ", to makeFor the absolute fix of generation goal-focus frame and height and width.
Wherein, left and top is absolute fix position, then regenerates focus frame according to width and height.Realize the movement of focus frame.
As can be seen that the embodiment of the present invention in, the rectangular vertex of positioning rail purpose, when user's operation direction key (onKey, down key, left button, right button) dynamic positioning target column purpose mark, according to the target column calculated before away from a page left sideThe distance (left) of side, the distance (top) away from page top, width (width), height (height) setting focus position andSize, to realize the switching of focus.Therefore, the embodiment of the present invention does not need that each column position is arranged, as the column is oppositeThe distance top and size of distance left and top on the left of the page such as the width width and height height of the column, withAnd corresponding code after focus button operation, so that it may realize the switching at runtime of element focus.Reduce developerThe complexity of written in code, improves work efficiency, and does not need to save excessive code, reduces the storage pressure of set-top boxPower.
The method for compareing the focus frame positioning of one of above-described embodiment, the embodiment of the invention also discloses a kind of focus framesThe device of positioning is applied to set-top box.
Referring to fig. 4, described device includes:
Receiving unit 1, for receiving the move of moving focal point frame;
Acquiring unit 2, for obtaining focus frame institute positioning rail purpose column layout information according to the move;InstituteState specification of the column layout information for position and occupied units of pages lattice in the page where characterizing the column;
Determination unit 3, for according in the move directional information and the column layout information determine targetColumn;
Positioning unit 4 regenerates goal-focus frame for the target column layout information according to the target column and makeesFor the focus frame after movement.
Optionally, further include:
Pre-generatmg unit, for pre-generating the column layout information of each column in the page.
Optionally, the pre-generatmg unit includes:
Array obtains module, for obtaining in the page column pair generated after each column execution unit lattice mergesThe column array answered;
Coordinate generation module, for the page where according to column array described in each, calculating four vertex of the columnColumn coordinate;
Data acquisition module, for obtaining the height of cell, width and gap in the page;
Pre-generatmg module, for raw according to the height of the cell, width, gap and each described column coordinateAt column layout information corresponding to the column, the column layout information include the column purpose mark, coordinate, height, width,Distance apart from page top and the distance apart from page left end.
Optionally, the determination unit includes:
Direction obtains module, for obtaining the directional information of the move;
Coordinate extraction module is matched with the directional information in the column coordinate for extracting the column layout informationColumn coordinate value;
Determining module is identified, for determining target identification according to the column coordinate value and the directional information;
Column determining module, for column corresponding to the target identification of mobile condition will to be met as target column.
Optionally, the positioning unit includes:
Layout information obtains module, for obtaining the column layout information of the target column;
Property extracting module, for extracting height, width, the distance apart from page top in the column layout informationAnd the distance apart from page left end;
Locating module, for using the distance apart from page top and the distance apart from page left end as absolutelyPositioning generates goal-focus frame as the focus frame after movement using the height and width.
It should be noted that the device of one of embodiment of the present invention focus frame positioning can be implemented using the above methodThe method of one of example focus frame positioning, for realizing whole technical solutions in above method embodiment, modulesFunction can be implemented according to the method in above method embodiment, specific implementation process can refer in above-described embodimentAssociated description, details are not described herein again.
In technical solution of the present invention, a kind of device of focus frame positioning is disclosed, set-top box is applied to, described deviceThe move of receiving unit reception moving focal point frame;Then acquiring unit obtains focus frame and determines according to the moveBit field purpose column layout information;Position where the column layout information is used to characterize the column in the page and sharedThe specification of units of pages lattice;Determination unit is according to the directional information and column layout letter in the move laterIt ceases and determines target column;Last positioning unit regenerates goal-focus according to the target column layout information of the target columnFrame is as the focus frame after movement.As can be seen that due in technical solution of the present invention, do not need in advance for each column intoRow attribute codes are write, but are calculated in real time, focus frame are generated in real time, therefore, for developer, without extraWritten in code work, improves work efficiency, while greatly reducing the pressure of set-top box memory space.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to byOne entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operationBetween there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaningCovering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes thatA little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article orThe intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arrangedExcept there is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with otherThe difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application.Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined hereinGeneral Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the applicationIt is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase oneThe widest scope of cause.