Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of method of videotex file, is intended to solve the method for videotex file common in the prior art, the problem that the size of text is restricted.
The embodiment of the invention is achieved in that a kind of method of videotex file, said method comprising the steps of:
The command information of text is opened in reception;
In flash, create the index record file corresponding: the byte quantity that sets in advance the content of the text that the individual event index of index record file identified with text; Begin to search from first byte of text, create corresponding individual event index, the start byte of the content that described individual event index record identifies to some extent and the position of end byte in text successively according to the byte quantity that sets in advance;
According to the start byte and the position of end byte in text of the content that is identified of described individual event index record, read the content of the text of described individual event index sign to the internal memory application;
The content that shows the text of described individual event index sign.
The embodiment of the invention also provides a kind of system of videotex file, and described system comprises:
First receiver module is used to receive the command information of opening text;
Create the index record module, be used for creating the index record file corresponding with text at flash, described establishment index record module comprises: set in advance module, be used to set in advance the byte quantity of the content of the text that the individual event index of index record file identified; Search creation module, be used for beginning to search from first byte of text, create corresponding individual event index, the start byte of the content that described individual event index record identifies to some extent and the position of end byte in text successively according to the byte quantity that sets in advance;
The application read module is used for according to the start byte of the content that is identified of described individual event index record and end byte reading the content of the text of described individual event index sign to the internal memory application in the position of text;
Display module is used to show the content of the text of described individual event index sign.
The embodiment of the invention also provides a kind of set-top box, and described set-top box comprises the system of described videotex file.
The embodiment of the invention compared with prior art, beneficial effect is: by create the index record file in flash, can create corresponding individual event index successively according to the byte quantity that sets in advance, the content that shows the text of described individual event index sign, thereby when the videotex file, the size of file no longer is restricted.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also Fig. 1, the method for the videotex file that the embodiment of the invention provides said method comprising the steps of:
S101: receive the command information of opening text;
S102: in flash, create the index record file corresponding: the byte quantity that sets in advance the content of the text that the individual event index of index record file identified with text; Begin to search from first byte of text, create corresponding individual event index, the start byte of the content that described individual event index record identifies to some extent and the position of end byte in text successively according to the byte quantity that sets in advance;
S103:, read the content of the text of described individual event index sign to the internal memory application according to the start byte and the position of end byte in text of the content that is identified of described individual event index record;
S104: the content that shows the text of described individual event index sign.
Wherein, during the byte of the byte quantity that the content that last individual event index record is identified sets in advance inadequately, then show the byte content of remaining text.
The byte quantity of the content of the text that the individual event index of the index record file that wherein, sets in advance is identified can be 1024 bytes.
Such as, if a text size is 3100 bytes, when then setting up the index record file, the content that first individual event index identified is the content of 1024 bytes of the 1st byte to the of text;
The content that second individual event index identified is the content of the 1025th byte to 2048 byte of text;
The 3rd content that the individual event index is identified is the content of the 2049th byte to 3072 byte of text;
The 4th content that the individual event index is identified is the content of the 3073rd remaining byte to 3100 byte of text.
Wherein, described S103 is according to the start byte and the position of end byte in text of the content that is identified of described individual event index record, and is further comprising the steps of after the step of content of text of described individual event index sign is read in the internal memory application:
Whether the form of judging text is displayable form, if not, convert described text to displayable form.
At present, text comprises three kinds of forms, and first kind is the UNICODE form, and header byte is 0xFF0xFE; Second kind is the UTF8 coded format, and header byte is 0xEE 0xBB 0xBF; The third is the GB2312 coded format.
First kind and second kind is can not display format, but the third is a display format, in an embodiment of the present invention, if text is first kind or second kind of form, then needs first kind or second kind of format conversion are become the third form.
Wherein, further comprising the steps of after the described step S102:
Acquiescence shows the content of the text of first individual event index sign.
Wherein, described S104 shows after the step of content of text of described individual event index sign further comprising the steps of:
Receive the command information of opening text once more;
Read in the index record file of creating among the flash corresponding with text;
Whether the modification time of judging the text that writes down in the index record file is identical with the modification time of the text of opening, if it is identical, then read the content of the text of the pairing individual event index of breakpoint location sign to the internal memory application, show the content of the text of the pairing individual event index sign of breakpoint location then according to breakpoint location; If it is inequality, then remove the content of index record file, and in flash, create the index record file corresponding once more with text, start byte and the position of end byte in text according to the content that is identified of described individual event index record, read the content of the text of described individual event index sign to the internal memory application, show the content of the text of described individual event index sign then.
Wherein, described S104 shows after the step of content of text of described individual event index sign further comprising the steps of:
Display command information is withdrawed from reception;
Discharge the content of the text that reads in the internal memory.
Wherein, further comprising the steps of after the described step S103:
Internal memory reads the content of the text of described individual event index sign;
See also Fig. 2, the embodiment of the invention also provides a kind of system of videotex file, and described system comprises:
First receiver module 201 is used to receive the command information of opening text;
Createindex record module 202, be used for creating the index record file corresponding with text at flash, described establishment index record module comprises: set in advance module, be used to set in advance the byte quantity of the content of the text that the individual event index of index record file identified; Search creation module, be used for beginning to search from first byte of text, create corresponding individual event index, the start byte of the content that described individual event index record identifies to some extent and the position of end byte in text successively according to the byte quantity that sets in advance;
Application read module 203 is used for according to the start byte of the content that is identified of described individual event index record and end byte reading the content of the text of described individual event index sign to the internal memory application in the position of text;
Display module 204 is used to show the content of the text of described individual event index sign.
Wherein, described system also comprises:
First judge module is used to judge whether the form of text is displayable form;
Modular converter is used for converting described text to displayable form when described judge module judges that the form of text is not displayable form.
In addition, described system also comprises:
Read the index record file module, be used for when described receiver module receives the command information of opening text once more, read in the index record file of creating among the flash corresponding with text;
Second judge module, be used for when reading the index record file module and reading the index record file of creating at flash corresponding, judging whether the modification time of the text that writes down in the index record file is identical with the modification time of the text of opening with text when described;
When the modification time of the text that described application read module writes down in described second judge module judgement index record file is identical with the modification time of the text of opening, read the content of the text of the pairing individual event index of breakpoint location sign according to breakpoint location to the internal memory application, described display module then shows the content of the text of the pairing individual event index sign of breakpoint location;
When the modification time of the modification time of the text that described application read module writes down in described second judge module judgement index record file and the text of opening is inequality, then remove the content of index record file, and in flash, create the index record file corresponding once more with text by described establishment index record module, described application read module is according to the start byte and the position of end byte in text of the content that is identified of described individual event index record, read the content of the text of described individual event index sign to the internal memory application, show the content of the text of described individual event index sign then by display module.
Wherein, described system comprises:
Second receiver module is used for receiving the display command information that withdraws from;
Release module is used for receiving mould and receiving when withdrawing from display command information when described second, discharges the content of the text that reads in the internal memory.
In addition, described system also comprises:
Internal memory is used to read the content of the text of described individual event index sign.
The embodiment of the invention also provides a kind of set-top box, and described set-top box comprises the system of described videotex file.
Method, system and the set-top box of the videotex file that the embodiment of the invention provides, by in flash, creating the index record file, can create corresponding individual event index successively according to the byte quantity that sets in advance, the content that shows the text of described individual event index sign, thereby when the videotex file, the size of file no longer is restricted.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.