CN113316010A - Method for recording current viewing channel information by set top box - Google Patents

Method for recording current viewing channel information by set top box Download PDF

Info

Publication number
CN113316010A
CN113316010A CN202110593578.2A CN202110593578A CN113316010A CN 113316010 A CN113316010 A CN 113316010A CN 202110593578 A CN202110593578 A CN 202110593578A CN 113316010 A CN113316010 A CN 113316010A
Authority
CN
China
Prior art keywords
channel information
sector
current channel
length
data
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
CN202110593578.2A
Other languages
Chinese (zh)
Other versions
CN113316010B (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.)
Hangzhou Nationalchip Science & Technology Co ltd
Original Assignee
Hangzhou Nationalchip Science & Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Nationalchip Science & Technology Co ltd filed Critical Hangzhou Nationalchip Science & Technology Co ltd
Priority to CN202110593578.2A priority Critical patent/CN113316010B/en
Publication of CN113316010A publication Critical patent/CN113316010A/en
Application granted granted Critical
Publication of CN113316010B publication Critical patent/CN113316010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/426Internal components of the client ; Characteristics thereof
    • H04N21/42692Internal components of the client ; Characteristics thereof for reading from or writing on a volatile storage medium, e.g. Random Access Memory [RAM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations

Abstract

The invention discloses a method for recording currently watched channel information by a set top box. In the method, the set-top box adopts a flash memory as a storage medium, the current channel information is stored in a flash memory sector, and the current channel information comprises key fields. When the channel is switched and the current channel information is updated, the key field of the written channel information is searched first, and the last position of the matched key field is found. And judging whether the whole sector needs to be erased or not, writing the position of the current channel information, and writing the current channel information into the flash memory sector based on the position. The method of the invention can obviously reduce the times of erasing the same sector and writing the same storage unit caused by recording the current channel information, thereby prolonging the service life of the flash memory.

Description

Method for recording current viewing channel information by set top box
Technical Field
The invention belongs to the technical field of digital television set-top boxes, and relates to a method for recording currently watched channel information by a set-top box.
Background
A Set-Top Box (STB for short) includes hardware and software, and is a device that processes an external input signal source and outputs the processed signal to a television for display. The memory on the set-top box is used for storing a system, an application program and application data, and the memory comprises an EEPROM, a NOR Flash and a NAND Flash. With the diversification of functions of the set-top box, the mirror image of the user program and data is larger and larger, and the requirement on the capacity of the memory is also larger and larger. Compared with EEPROM, NOR Flash has the advantages of large capacity and low cost, and is widely used on set-top boxes.
The Flash memory (NOR Flash) is erased from small to large and sequentially supports Sector (Sector), Block (Block) and whole Chip (Chip) erasing, the size of write support is from 1 Byte (Byte) to 1 Page (Page), the design life of each storage unit (Cell) is generally 10 ten thousand times/erasing, when a set-top box application program processes channel switching operation of a user, currently-viewed channel information needs to be recorded at any time so as to be capable of memorizing the channel information before shutdown when power is supplied next time, and therefore erasing and writing operation needs to be carried out on the NOR Flash. When the channel information which is watched at present is written in by the traditional method, a Sector (Sector) is firstly erased, and then the channel information which is watched at present is written in the same position of the Sector (Sector), when the channel is frequently switched, the same Sector (Sector) and the same position of NOR Flash can be repeatedly erased, the service life of the NOR Flash is quickly reached, and after the storage unit (Cell) of the NOR Flash reaches the service life, the behaviors of erasing and writing instructions are unpredictable.
Disclosure of Invention
The invention aims to provide a method for a set top box to record current channel watching information, aiming at the problem of Nor Flash erasing and writing caused by too frequent channel switching in the prior art.
The method comprises the following steps:
(1) the set-top box adopts a flash memory as a storage medium;
the software system of the set-top box is stored on the flash memory; the software system comprises a starting program, a set-top box identity marking area, an upgrading program, an application program and a data area;
the data area stores current channel information and a program database; the current channel information comprises a key field, a current program number, a current program affiliated group and a sorting mode in the current program affiliated group.
(2) The erasing mode of the flash memory supports sectors, blocks and whole slices from small to large in sequence;
the length Lv of the current channel information is less than or equal to Ls, and Ls is a sector of the flash memory); and the application program searches in the program database through the current program number in the current channel information to acquire the complete information of the program.
(3) When a user switches channels, the application program updates the current channel information of the data area on the flash memory, and the specific method comprises the following steps:
(3-1) the application program reads all data of the sector according to the sector length Ls;
(3-2) the application program traverses the whole sector, starts from the initial offset 0, and sequentially matches the key fields according to the step Lv, if the key fields are not matched, the initial position of writing is x-0, and the length of the written data is Lv; finally, recording the position of the matching key field as x, wherein x is more than or equal to 0, and x + Lv is less than or equal to Ls;
(3-3) when the key field is matched and the residual length of the sector is enough to write data with the length Lv of the current channel information, namely x + Lv is less than or equal to Ls, writing the current channel information in the sector where the current channel information is located; the initial position of the written data is x + Lv, and the length of the written data is Lv;
(3-4) when the residual length of the sector where the channel information is located is not enough to write the data with the current channel information length Lv, namely x + Lv > Ls, erasing the whole sector; after the erasure is finished, the position x of the key field is marked as 0; writing current channel information in a sector where the current channel information is located; the writing position is x ═ 0, and the writing data length is Lv.
(4) When the set-top box is powered on, the application program acquires the current channel information before power failure, specifically:
(4-1) the application program reading all data of the sector by the sector length Ls;
(4-2) the application program traverses the whole sector, starting from the initial offset of 0, and sequentially matching key fields according to Lv stepping, wherein the position of the finally matched key field is recorded as y, y is more than or equal to 0, and y + Lv is less than or equal to Ls; if the key field is not matched, y is marked as 0;
(4-3) when the position of the key field is not matched, that is, y is 0, the sector does not store the current channel information before power-off;
when the position of the key field is matched, namely y + Lv is less than or equal to Ls, the initial position on the sector is y, and the data with the length of Lv is the current channel information before power failure.
By adopting the method, when small data needs to be frequently updated in the sector of the flash memory of the set-top box, the characteristic that the updated data volume is far smaller than the size of the sector of the flash memory is utilized, after the sector is subjected to one-time erasing operation, the key fields are added and sequentially written backwards according to the updated data volume, and the erasing operation is not carried out until the sector is not written enough. When reading, key field matching is employed, thereby obtaining the most recently updated data. By adopting the method, firstly, the erasing times can be reduced, secondly, the updated data volume is also distributed on the sector in a balanced manner, repeated writing in the same position is avoided, other memory units are not used all the time, the erasing and writing times of the NoR Flash can be reduced, the service life of the NoR NoR Flash is prolonged, and therefore the service life of the product is prolonged.
Drawings
FIG. 1 is a software system diagram of a set-top box;
FIG. 2 is a diagram illustrating an application writing current channel information at sector location x;
fig. 3 is a diagram illustrating that the application program erases a sector and then first writes current channel information.
Detailed Description
A method for recording the current viewing channel information by a set-top box includes:
(1) the set-top box adopts a Flash memory (NOR Flash) as a storage medium;
the software system of the set-top box is stored on the flash memory; as shown in fig. 1, the software system includes a Boot program (Boot), a set-top box identity Area (identity Area), an upgrade program (Loader), an Application program (Application), and a Data Area (Data); the Data area (Data) stores current channel information (View information) and a program database; the current channel information includes a Key field (Key field), a current Program number (Program number), a Group (Group) to which the current Program belongs, and a Sort method (Sort) within the Group to which the current Program belongs.
(2) The erasing mode of the flash memory sequentially supports a Sector (Sector), a Block (Block) and a Chip (Chip) from small to large;
the length Lv of the current channel information (View information) is less than or equal to Ls, and Ls is the length of a Sector (Sector) of the flash memory; the Application Program (Application) matches the current Program number in the current channel information (View information) in the Program database to obtain the complete information of the Program.
(3) When a user switches channels, an Application program (Application) updates current channel information (View information) of a Data area (Data) on a flash memory, and the specific method is as follows:
(3-1) the Application program (Application) reading (Read) all data of the Sector (Sector) by the Sector (Sector) length Ls;
(3-2) the Application program (Application) traverses the whole Sector (Sector), starts from the starting offset of 0, steps according to Lv, sequentially matches Key fields (Key fields), if the Key fields (Key fields) are not matched, the written starting position is x equal to 0, and the written data length is Lv; finally, recording the position of the matching key field as x, wherein x is more than or equal to 0, and x + Lv is less than or equal to Ls;
(3-3) when the key field is matched and the residual length of the Sector is enough to write data with the length Lv of the current channel information, namely x + Lv is less than or equal to Ls, writing (programming) the current channel information in the Sector (Sector) where the current channel information is located; the initial position of the written data is x + Lv, and the length of the written data is Lv, as shown in fig. 2;
(3-4) when the residual length of the Sector (Sector) in which the channel information is located is not enough to write the data with the current channel information length Lv, namely x + Lv > Ls, erasing (Erase) the whole Sector (Sector); after the Erase (Erase) is completed, the position x of the Key field is marked as 0; writing (programming) the current channel information in a Sector (Sector) where the current channel information is located; the write position is x ═ 0, and the write data length is Lv, as shown in fig. 3.
(4) When the set-top box is powered on, an Application program (Application) acquires current channel information before power failure, specifically:
(4-1) the Application program (Application) reading (Read) all data of the Sector (Sector) by the Sector (Sector) length Ls;
(4-2) traversing the whole Sector (Sector) by an Application program (Application), starting from the initial offset of 0, stepping according to Lv, sequentially matching Key fields (Key fields), and recording the positions of the finally matched Key fields (Key fields) as y, wherein y is more than or equal to 0, and y + Lv is less than or equal to Ls; if the Key field is not matched, y is marked as 0;
(4-3) when the position of the Key field (Key field) is not matched, that is, y is 0, the Sector (Sector) does not store the current channel information before power-off;
when the position of the Key field (Key field) is matched, that is, y + Lv is less than or equal to Ls, the data with the starting position of y and the length of Lv on the Sector (Sector) is the current channel information before power failure.

Claims (1)

1. A method for a set top box to record information of a currently viewed channel, the method comprising:
(1) the set-top box adopts a flash memory as a storage medium;
the software system of the set-top box is stored on the flash memory; the software system comprises a starting program, a set-top box identity marking area, an upgrading program, an application program and a data area;
the data area stores current channel information and a program database; the current channel information comprises a key field, a current program number, a current program affiliated group and a sorting mode in the current program affiliated group;
(2) the erasing mode of the flash memory supports sectors, blocks and whole slices from small to large in sequence;
the length Lv of the current channel information is less than or equal to Ls, and Ls is the sector length of the flash memory; the application program searches in a program database through a current program number in the current channel information to acquire complete information of the program;
(3) when a user switches channels, the application program updates the current channel information of the data area on the flash memory, and the specific method comprises the following steps:
(3-1) the application program reads all data of the sector according to the sector length Ls;
(3-2) the application program traverses the whole sector, starts from the initial offset 0, and sequentially matches the key fields according to the step Lv, if the key fields are not matched, the initial position of writing is x-0, and the length of the written data is Lv; finally, recording the position of the matching key field as x, wherein x is more than or equal to 0, and x + Lv is less than or equal to Ls;
(3-3) when the key field is matched and the residual length of the sector is enough to write data with the length Lv of the current channel information, namely x + Lv is less than or equal to Ls, writing the current channel information in the sector where the current channel information is located; the initial position of the written data is x + Lv, and the length of the written data is Lv;
(3-4) when the residual length of the sector where the channel information is located is not enough to write the data with the current channel information length Lv, namely x + Lv > Ls, erasing the whole sector; after the erasure is finished, the position x of the key field is marked as 0; writing current channel information in a sector where the current channel information is located; the writing position is x is 0, and the writing data length is Lv;
(4) when the set-top box is powered on, the application program acquires the current channel information before power failure, specifically:
(4-1) the application program reading all data of the sector by the sector length Ls;
(4-2) the application program traverses the whole sector, starting from the initial offset of 0, and sequentially matching key fields according to Lv stepping, wherein the position of the finally matched key field is recorded as y, y is more than or equal to 0, and y + Lv is less than or equal to Ls; if the key field is not matched, y is marked as 0;
(4-3) when the position of the key field is not matched, that is, y is 0, the sector does not store the current channel information before power-off;
when the position of the key field is matched, namely y + Lv is less than or equal to Ls, the initial position on the sector is y, and the data with the length of Lv is the current channel information before power failure.
CN202110593578.2A 2021-05-28 2021-05-28 Method for recording current viewing channel information by set top box Active CN113316010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110593578.2A CN113316010B (en) 2021-05-28 2021-05-28 Method for recording current viewing channel information by set top box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110593578.2A CN113316010B (en) 2021-05-28 2021-05-28 Method for recording current viewing channel information by set top box

Publications (2)

Publication Number Publication Date
CN113316010A true CN113316010A (en) 2021-08-27
CN113316010B CN113316010B (en) 2023-02-28

Family

ID=77376103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110593578.2A Active CN113316010B (en) 2021-05-28 2021-05-28 Method for recording current viewing channel information by set top box

Country Status (1)

Country Link
CN (1) CN113316010B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184155A (en) * 2007-12-18 2008-05-21 中国电子科技集团公司第五十四研究所 Method for storing station name of security receiving chip
CN101499033A (en) * 2008-12-18 2009-08-05 上海全景数字技术有限公司 Flash memory data saving method
CN101551780A (en) * 2008-12-29 2009-10-07 深圳创维-Rgb电子有限公司 Television and data storage method and device thereof
CN101908021A (en) * 2009-06-03 2010-12-08 康佳集团股份有限公司 Flash memory erasing-writing method and flash memory
CN102306125A (en) * 2011-08-17 2012-01-04 深圳市共进电子股份有限公司 Method for erasing and writing data of FLASH memory
US20190369898A1 (en) * 2018-06-04 2019-12-05 Dell Products, Lp System and Method for Performing Wear Leveling at a Non-Volatile Firmware Memory

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184155A (en) * 2007-12-18 2008-05-21 中国电子科技集团公司第五十四研究所 Method for storing station name of security receiving chip
CN101499033A (en) * 2008-12-18 2009-08-05 上海全景数字技术有限公司 Flash memory data saving method
CN101551780A (en) * 2008-12-29 2009-10-07 深圳创维-Rgb电子有限公司 Television and data storage method and device thereof
CN101908021A (en) * 2009-06-03 2010-12-08 康佳集团股份有限公司 Flash memory erasing-writing method and flash memory
CN102306125A (en) * 2011-08-17 2012-01-04 深圳市共进电子股份有限公司 Method for erasing and writing data of FLASH memory
US20190369898A1 (en) * 2018-06-04 2019-12-05 Dell Products, Lp System and Method for Performing Wear Leveling at a Non-Volatile Firmware Memory

Also Published As

Publication number Publication date
CN113316010B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
CN1658171B (en) Faster write operations to nonvolatile memory by manipulation of frequently accessed sectors
CN103425597A (en) Data storage device and method for flash block management
US8793430B2 (en) Electronic system having memory with a physical block having a sector storing data and indicating a move status of another sector of the physical block
EP1739683B1 (en) Space management for managing high capacity nonvolatile memory
US7526599B2 (en) Method and apparatus for effectively enabling an out of sequence write process within a non-volatile memory system
EP1729304B1 (en) Space management for managing high capacity nonvolatile memory
EP0712067B1 (en) Flash disk card
US20110264842A1 (en) Memory controller, nonvolatile memory device, access device, and nonvolatile memory system
US20090083475A1 (en) Apparatus and method for updating firmware stored in a memory
WO2001008015A1 (en) Recording system, data recording device, memory device, and data recording method
US20190121555A1 (en) Recycled version number values in flash memory
CN113220239A (en) Erasing and writing method, device and equipment for flash storage and readable storage medium
KR20050119085A (en) Method of writing on a flash memory
US20090259796A1 (en) Data writing method for non-volatile memory and storage system and controller using the same
CN109597580B (en) Flash operation method suitable for intelligent electric meter load curve storage
US8195870B2 (en) Memory card and method for handling data updating of a flash memory
CN111966281B (en) Data storage device and data processing method
US5829014A (en) Method of supervising storage of data in a memory card having EEPROM and a memory card system using the same
CN113316010B (en) Method for recording current viewing channel information by set top box
US8176231B2 (en) Methods for handling data updating of flash memory and related memory cards
CN110286848B (en) Data processing method and device
US20040019761A1 (en) Flash storage medium having a NAND-type flash memory
CN105810246B (en) Memory management method, memory storage device and memory control circuit unit
KR20060106993A (en) Method for storing data in flash memory
CN1272716C (en) Data management method and configuration manner for memory

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
GR01 Patent grant
GR01 Patent grant