A method for managing the EPG memory of a set-top box
By monitoring and managing EPG memory in real time, setting memory thresholds, and cleaning up expired or invalid data, the problem of set-top box memory exhaustion was solved, enabling the presentation of a complete electronic program guide within the system's available memory range.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU GUOXIN MICRO TECH CO LTD
- Filing Date
- 2023-03-20
- Publication Date
- 2026-06-30
AI Technical Summary
When existing set-top boxes support a large number of channels, the memory occupied by the Electronic Program Guide (EPG) exhausts the set-top box's memory configuration, resulting in insufficient system resources and the inability to display the complete EPG.
By monitoring and managing EPG memory in real time, setting memory thresholds, and cleaning up expired or invalid channel data, EPG memory consumption is ensured to remain within the set range. Channel lists and program event lists are used as management methods to allocate memory resources reasonably.
Effectively manage set-top box memory to avoid memory exhaustion, ensure maximum EPG data reception within the available memory range, and provide a more complete electronic program guide.
Smart Images

Figure CN116208813B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital TV set-top box technology, specifically relating to a set-top box EPG memory management method. Background Technology
[0002] A set-top box (STB) consists of hardware and software; it's a device that processes external input signals and outputs them to a television for display. An Electronic Program Guide (EPG) inserts channel service information into an MPEG-2 compliant transport stream, allowing the STB to extract program event information provided by the operator and display it to the user in an intuitive way, making it convenient for the user to watch programs.
[0003] The Electronic Program Guide (EPG) includes Present Events, Following Events, and Schedule Events. Each Event includes the program name, broadcast time, duration, program description, and extended information. After searching for channels, the set-top box initiates the reception, filtering, and storage of the EPG data. Storage involves storing the EPG data in the set-top box's memory. Current set-top boxes support a vast number of channels, especially satellite set-top boxes which can support over 5000 channels. Each Event for each channel includes basic short events (maximum 256 bytes) and extended events (maximum 256 bytes). If there are many Events for 5000 channels, the EPG's memory usage will be enormous, potentially exhausting the set-top box's memory capacity. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a set-top box EPG memory management method. This method continuously counts and monitors the total EPG memory value, cleans up the EPG memory occupied by expired or invalid channels, and ensures that the total memory value consumed by storing EPGs is below a set memory threshold.
[0005] Before initiating the Electronic Program Guide (EPG) search, the total EPG memory value in the system is initialized to 0. A memory threshold is set based on the remaining memory capacity of the system after the set-top box is started. After the program search is completed, all channels are arranged into a channel linked list according to their channel IDs. When a program event data is filtered for a channel, the program event data information is parsed and stored in the program event linked list of the corresponding channel node in the EPG. The memory occupied by the program event is calculated and added to the total EPG memory value.
[0006] Subsequently, for each program event data entry filtered from a channel, the program event data information is parsed, and the memory required to store the program event data information is calculated. If the set memory threshold is exceeded, the program event data already stored in memory in the Electronic Program Guide (EPG) is first cleared according to certain rules, and then the received program event information is stored in the program event linked list of the corresponding channel node in the EPG in chronological order. If the set memory threshold is not exceeded, the filtered program event information is directly stored in the program event linked list of the corresponding channel node in the EPG in chronological order. The memory occupied by the new program event is calculated and added to the total memory value of the EPG.
[0007] The specific operation of the method of the present invention is as follows:
[0008] Step (1) After the set-top box starts up, obtain the remaining memory capacity of the system, set 50% to 90% of the remaining memory capacity as the memory threshold, and record it as M; initialize the total memory value S of EPG to 0;
[0009] Step (2) The set-top box performs a channel search, and all the obtained channels are arranged into a channel list in order of channel ID, denoted as lstChannel; each channel node in the channel list includes the basic information of the channel and the program event list of the channel; the basic information of the channel includes the transport stream ID, channel ID, and channel name; the program event list is arranged in order of the start time of the program event ID, denoted as lstEvent, and each program event node in the program event list includes the program event ID, start time, duration, program name, and program description; the program event list lstEvent of each channel node in the channel list lstChannel is initialized to be empty;
[0010] Step (3) The EPG data filtering module receives a program event data and parses it to obtain the program event data information. The program event data information includes the transport stream ID, channel ID, program event ID, start time, duration, program name, and program description. The memory occupied by this program event data information is denoted as E.
[0011] Step (4) Search for the corresponding channel node in the channel list lstChannel based on the transport stream ID and channel ID in the parsed program event event data information: If there is no corresponding channel node, discard the program event event data information directly and release the memory E occupied by parsing; If there is a corresponding channel node, search for the program event event node in the program event event list lstEvent of the channel node based on the event ID in the parsed program event event data information, and execute step (5);
[0012] Step (5): If a program event node exists, discard the program event data information directly and release the memory E occupied by parsing; if no program event node exists, proceed to step (6).
[0013] Step (6) adds the total EPG memory value S to the memory E occupied by the Event data information of this program event and compares it with the memory threshold M: if S+E≤M, then insert the program event node in the program event linked list lstEvent according to the start time order of the Event data information of this program event, and update the total EPG memory value to S1=S+E; if S+E>M, execute step (7);
[0014] Step (7) Update the total memory value of EPG, as follows:
[0015] Traverse the channel list lstChannel, retrieve each channel node in turn, and determine whether the channel corresponding to that channel node still exists in the set-top box channel database:
[0016] If the channel does not exist in the set-top box channel database, the program event Event linked list lstEvent in the channel node is directly deleted, and the channel node is deleted. After this cleanup is completed, the total EPG memory value is updated to S2, where S2 is the original total EPG memory value minus the memory size occupied by all program events Events of the channel node.
[0017] If the channel exists in the set-top box channel database, the program event linked list lstEvent in the channel node is traversed, each program event node is retrieved in turn, and the start time of the program event data information is added to the duration and compared with the current system time. Program event nodes that are earlier than the current system time are deleted. After this cleanup is completed, the total EPG memory value is updated to S3, where S3 is the original total EPG memory value minus the memory size of all expired program event nodes.
[0018] Step (8) adds the memory E occupied by the Event data information of this program event to the updated EPG total memory value S2 or S3, and then compares it with the memory threshold M:
[0019] If it is less than or equal to the memory threshold M, then according to the start time sequence of the event data information of this program event, insert the program event node in the event linked list lstEvent, and update the total memory value of EPG to the updated total memory value of EPG S2 or S3 plus the memory E occupied by the event data information of this program event;
[0020] If the value exceeds the memory threshold M, discard the event data and release the memory E used to parse the event information.
[0021] By employing the method of this invention, the memory consumed each time an EPG is stored is guaranteed to be below a set memory threshold. This prevents the set-top box from exhausting its memory configuration due to the large number of channels supporting EPGs. At the same time, it ensures that within the available memory range of the system, EPGs can be received to the maximum extent, presenting users with a more complete electronic program guide.
[0022] Using the method of this invention, before initiating the background filtering of Electronic Program Guide (EPG) program events, a memory threshold is set based on the remaining memory capacity after the set-top box system has started. Upon filtering program event data, the data is parsed and the memory required for each event is calculated. If the total EPG memory exceeds the set memory threshold, the EPG program event data stored in memory is cleared according to certain rules. Then, the received program event information is stored in the program event linked list of the corresponding channel node of the EPG in chronological order. If the threshold is not exceeded, the filtered program event information is directly stored in the program event linked list of the corresponding channel node of the EPG, and the total EPG memory is added to the memory occupied by this program event, ensuring that the total EPG memory always remains below the set memory threshold. Based on this patent, the set-top box system's memory configuration will not be exhausted by the program event memory occupied by the large number of programs and the rich electronic program guide (EPG). At the same time, it ensures that the EPG can be received to the maximum extent within the available memory range of the system, presenting users with a more complete and richer electronic program guide, and making the operation more user-friendly. Attached Figure Description
[0023] Figure 1 This is a schematic representation of the channel chain in this invention. Detailed Implementation
[0024] A set-top box EPG memory management method is as follows:
[0025] Step (1) After the set-top box starts up, obtain the remaining memory capacity of the system, set 50% to 90% of the remaining memory capacity as the memory threshold, and record it as M; initialize the total memory value S of EPG to 0;
[0026] Step (2) The set-top box performs a channel search, and all the obtained channels are arranged into a channel list in order of channel ID, denoted as lstChannel; each channel node in the channel list includes the basic information of the channel and the program event list of the channel; the basic information of the channel includes transport stream ID (transport_stream_id), channel ID (service_id), and channel name (service_name); an event list is arranged in order of the start time of the program event ID, denoted as lstEvent, and each program event node in the program event list includes program event ID (event_id), start time (start_time), duration (duration), program name (event_name), and program description (short_event_text); the program event node may also include extended program information (extend_event), which includes director, actors, detailed introduction (extend_event_text), etc.; the program event list lstEvent of each channel node in the channel list lstChannel is initialized to be empty; the channel list structure is as follows Figure 1 As shown;
[0027] Step (3) The EPG data filtering module receives a program event data and parses it to obtain the program event data information. The program event data information includes the transport stream ID, channel ID, program event ID, start time, duration, program name, program description, and program extended description (if any). The memory occupied by this program event data information is denoted as E.
[0028] Step (4) Search for the corresponding channel node in the channel list lstChannel based on the transport stream ID and channel ID in the parsed program event event data information: If there is no corresponding channel node, discard the program event event data information directly and release the memory E occupied by parsing; If there is a corresponding channel node, search for the program event event node in the program event event list lstEvent of the channel node based on the event ID in the parsed program event event data information, and execute step (5);
[0029] Step (5): If a program event node exists, discard the program event data information directly and release the memory E occupied by parsing; if no program event node exists, proceed to step (6).
[0030] Step (6) adds the total EPG memory value S to the memory E occupied by the Event data information of this program event and compares it with the memory threshold M: if S+E≤M, then insert the program event node in the program event linked list lstEvent according to the start time order of the Event data information of this program event, and update the total EPG memory value to S1=S+E; if S+E>M, execute step (7);
[0031] Step (7) Update the total memory value of EPG, as follows:
[0032] Traverse the channel list lstChannel, retrieve each channel node in turn, and determine whether the channel corresponding to that channel node still exists in the set-top box channel database:
[0033] If the channel does not exist in the set-top box channel database, the program event Event linked list lstEvent in the channel node is directly deleted, and the channel node is deleted. After this cleanup is completed, the total EPG memory value is updated to S2, where S2 is the original total EPG memory value minus the memory size occupied by all program events Events of the channel node.
[0034] If the channel exists in the set-top box channel database, the program event event linked list lstEvent in the channel node is traversed, and each program event event node is retrieved in turn. Since lstEvent is arranged in chronological order, it is only necessary to obtain the current system time of the set-top box, add the start time (start_time) and duration (duration) of the program event event data information and compare it with the current system time. Program event event nodes that are earlier than the current system time are deleted. After this cleanup is completed, the total memory value of EPG is updated to S3, which is the original total memory value of EPG minus the memory size of all expired program event event nodes.
[0035] Step (8) adds the memory E occupied by the Event data information of this program event to the updated EPG total memory value S2 or S3, and then compares it with the memory threshold M:
[0036] If it is less than or equal to the memory threshold M, then according to the start time sequence of the event data information of this program event, insert the program event node in the event linked list lstEvent, and update the total memory value of EPG to the updated total memory value of EPG S2 or S3 plus the memory E occupied by the event data information of this program event;
[0037] If the value exceeds the memory threshold M, discard the event data and release the memory E used to parse the event information.
[0038] Steps (3) to (8) are performed by the EPG data filtering module in background filtering mode, or by the user deleting a channel in the channel editor of the set-top box. When the user deletes a channel in the channel editor of the set-top box, the channel linked list lstChannel is traversed, each channel node is retrieved in turn, and it is determined whether the channel corresponding to the channel node is the channel deleted by the user. If it is the channel deleted by the user, the program event Event linked list lstEvent in the channel node corresponding to the channel is directly deleted, and the channel node is deleted; the total EPG memory value is updated to the original total EPG memory value minus the memory size occupied by all program events Event of the channel node.
Claims
1. A method for managing the EPG memory of a set-top box, characterized in that: Before starting the Electronic Program Guide (EPG) search, the total EPG memory value in the system is initialized to 0. A memory threshold is set based on the remaining memory capacity of the system after the set-top box starts up. After the program search is completed, all channels are arranged into a channel list in order of channel ID. When a program event data of a channel is filtered, the program event data information is parsed and stored in the program event list of the corresponding channel node in the EPG. The memory occupied by the program event is calculated and added to the total EPG memory value. Subsequently, for each program event data of a channel that is filtered, the program event data information is parsed and the memory required to store the program event data information is calculated. If the set memory threshold is exceeded, the program event data of the Electronic Program Guide (EPG) already stored in memory is first cleared, and then the received program event information is stored in the program event linked list of the corresponding channel node of the EPG in chronological order. If the set memory threshold is not exceeded, the filtered program event information is directly stored in the program event linked list of the corresponding channel node in the Electronic Program Guide (EPG); the memory occupied by the new program event is calculated and added to the total memory value of the EPG. The specific steps of this method are as follows: Step (1) After the set-top box starts up, obtain the remaining memory capacity of the system, set 50% to 90% of the remaining memory capacity as the memory threshold, and record it as M; initialize the total memory value S of EPG to 0; Step (2) The set-top box performs a channel search, and all the channels obtained are arranged into a channel list in order of channel ID, denoted as lstChannel; each channel node in the channel list includes the basic information of the channel and the program event list of the channel; the basic information of the channel includes the transport stream ID, channel ID, and channel name; the program event list is arranged in order of the start time of the program event ID, denoted as lstEvent, and each program event node in the program event list includes the program event ID, start time, duration, program name, and program description; Initialize the program event (lstEvent) list of each channel node in the channel linked list lstChannel to be empty; Step (3) The EPG data filtering module receives a program event data and parses it to obtain the program event data information. The program event data information includes the transport stream ID, channel ID, program event ID, start time, duration, program name, and program description. The memory occupied by this program event data information is denoted as E. Step (4) Search for the corresponding channel node in the channel list lstChannel based on the transport stream ID and channel ID in the parsed program event event data information: If there is no corresponding channel node, discard the program event event data information directly and release the memory E occupied by parsing; If there is a corresponding channel node, search for the program event event node in the program event event list lstEvent of the channel node based on the event ID in the parsed program event event data information, and execute step (5); Step (5): If a program event node exists, discard the program event data information directly and release the memory E occupied by parsing; if no program event node exists, proceed to step (6). Step (6) Add the total EPG memory value S to the memory E occupied by the Event data information of this program event and compare it with the memory threshold M: If S+E≤M, then insert the program event node in the program event linked list lstEvent according to the start time order of the Event data information of this program event, and update the total EPG memory value to S1=S+E; if S+E>M, execute step (7); Step (7) Update the total memory value of EPG, as follows: Traverse the channel list lstChannel, retrieve each channel node in turn, and determine whether the channel corresponding to that channel node still exists in the set-top box channel database: If the channel does not exist in the set-top box channel database, the program event Event linked list lstEvent in the channel node is directly deleted, and the channel node is deleted. After this cleanup is completed, the total EPG memory value is updated to S2, where S2 is the original total EPG memory value minus the memory size occupied by all program events Events of the channel node. If the channel exists in the set-top box channel database, the program event linked list lstEvent in the channel node is traversed, each program event node is retrieved in turn, and the start time of the program event data information is added to the duration and compared with the current system time. Program event nodes that are earlier than the current system time are deleted. After this cleanup is completed, the total EPG memory value is updated to S3, where S3 is the original total EPG memory value minus the memory size of all expired program event nodes. Step (8) adds the memory E occupied by the Event data information of this program event to the updated EPG total memory value S2 or S3, and then compares it with the memory threshold M: If it is less than or equal to the memory threshold M, then according to the start time sequence of the Event data information of this program event, insert the program event node in the Event linked list lstEvent, and update the total EPG memory value to the updated total EPG memory value S2 or S3 plus the memory E occupied by the Event data information of this program event; If the value exceeds the memory threshold M, discard the event data and release the memory E used to parse the event information.
2. The set-top box EPG memory management method as described in claim 1, characterized in that: Steps (3) to (8) are performed by the EPG data filtering module in background filtering mode, or by the user deleting a channel in the channel editor of the set-top box. When the user deletes a channel in the channel editor of the set-top box, the channel linked list lstChannel is traversed, each channel node is retrieved in turn, and it is determined whether the channel corresponding to the channel node is the channel deleted by the user. If it is the channel deleted by the user, the program event Event linked list lstEvent in the channel node corresponding to the channel is directly deleted, and the channel node is deleted. The total EPG memory value is updated to the original total EPG memory value minus the memory size occupied by all program events Event of the channel node.
3. The set-top box EPG memory management method as described in claim 1, characterized in that: The aforementioned Event node also includes extended program information.