EPG file updating method, device and storage medium
By splitting EPG files and building hash tables, the problem of inefficient traditional EPG file update methods is solved, efficient and accurate file updates are achieved, and update efficiency and data timeliness are improved.
Patent Information
- Application Number
- CN202411844798.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
AI Technical Summary
The traditional EPG file update method requires a lot of computer computing power and storage space, resulting in high bandwidth consumption and long waiting time when a large amount of JSON file data is transferred and updated, and the update efficiency is inefficient.
By splitting the EPG file, building a hash table, and transmitting the hash table to the user. The user compares and recognizes the different entries that need to be updated in the initial file according to the hash table. The server provides the corresponding target entries based on these hash numbers, and the user updates its initial file accordingly.
An efficient and accurate file update process is realized, which reduces data transmission, improves update efficiency, and ensures that the user side always has the latest program information.
Smart Images

Figure CN119767088A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an updating method, device and storage medium for an EPG file. Background Art
[0002] At present, Electronic Program Guide (EPG) is a widely used service in digital television, Internet Protocol Television (IPTV) and OTT (Over-The-Top) platforms. In the EPG system in the related art, the data update of JSON (JavaScript Object Notation) files needs to be started after the JSON files are completely transmitted. With the increasing number of TV programs, the traditional method of updating after transmission requires a lot of computer computing power and storage space. Therefore, when a large number of JSON file data are transmitted and updated, high bandwidth consumption and long waiting time are required, resulting in low JSON file update efficiency.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide an EPG file update method, device and storage medium, aiming to solve the technical problem that the traditional method of updating after transmission requires a lot of computer computing power and storage space, and when a large amount of JSON file data is transmitted and updated, high bandwidth consumption and long waiting time are required, resulting in low update efficiency of JSON files.
[0005] To achieve the above object, the present application provides a method for updating an EPG file, the method comprising the following steps: In one embodiment, it is characterized in that the step of obtaining a hash table corresponding to a target EPG file in response to a file update request sent by a user terminal and sending the hash table to the user terminal comprises: In response to a file update request from the user terminal, split the target EPG file to obtain a program entry set, wherein the program entry set includes at least one program entry; Based on the program entry set, the hash table is constructed and sent to the user terminal, and the program entries correspond to the hash values in the hash table one by one.
[0006] In one embodiment, the program entry set includes at least one program entry set, and the step of splitting the target EPG file to obtain the program entry set includes: Determining the entry structure of the program entry based on the requirement information of the file update request and the EPG file format; Parsing the target EPG file, and traversing the parsed target EPG file to extract entry information; The program entry set is constructed based on the entry structure and the entry information.
[0007] In one embodiment, the step of constructing the hash table based on the program entry set and transmitting the hash table to the user terminal includes: determining a target hash function based on an identifier of the set of program entries; Based on the target hash function, calculating a hash value of the identifier to determine a storage location of the program entry set; The storage location is mapped to the hash table, and the hash table is sent to the user end.
[0008] In one embodiment, the step of determining a difference entry based on the difference hash number and sending the difference entry to the user terminal includes: Receive the difference hash number, and calculate a hash value corresponding to the difference hash number; Retrieving the hash value in the target EPG file to determine newly added entries and deleted entries; The deletion entry numbers corresponding to the newly added entry and the deleted entry are encoded based on arithmetic coding, and the encoded deletion entry numbers of the newly added entry are sent to the user terminal.
[0009] In one embodiment, before the step of obtaining a hash table corresponding to the target EPG file in response to the file update request sent by the user terminal and sending the hash table to the user terminal, the method further includes: Obtain and split the historical EPG file to determine the historical entry set; An initial hash table is constructed based on the historical entry set, and the historical entry set is stored in the initial hash table.
[0010] In one embodiment, after the step of constructing an initial hash table based on the historical entry set and storing the historical entry set in the initial hash table, the method further includes: Receiving EPG update information sent by a television service provider, and determining an update entry in the initial hash table; The historical EPG file is updated according to the update entry.
[0011] In one embodiment, after the step of updating the historical EPG file according to the update entry, the method further includes: Detecting the updated EPG file after the update based on a preset update period, and determining a changed item; The change entry is sent to the user terminal, wherein the user terminal receives the change entry and updates the cached EPG file based on the change entry.
[0012] In addition, to achieve the above-mentioned purpose, the present application also provides an EPG file updating device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the EPG file updating method as described above.
[0013] In addition, to achieve the above purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, the steps of the EPG file updating method described above are implemented.
[0014] One or more technical solutions proposed in the present application have at least the following technical effects: the present application transmits a hash table of the target file to the user end, so that the user end can compare and identify the difference entries and their hash numbers that need to be updated in the initial file. The server then provides the corresponding target entries based on these hash numbers, and the user end updates its initial file accordingly, and finally obtains the target updated file, thereby realizing an efficient and accurate file update process. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 A flowchart of a first embodiment of the method for updating an EPG file of the present application; Figure 2 A schematic diagram of a flow chart of a second embodiment of the method for updating an EPG file of the present application; Figure 3 A schematic diagram of a flow chart of a third embodiment of the method for updating an EPG file of the present application; Figure 4 A flowchart of a fourth embodiment of the method for updating an EPG file of the present application; Figure 5A flowchart of a fifth embodiment of the method for updating an EPG file of the present application; Figure 6 A flowchart of a sixth embodiment of the method for updating an EPG file of the present application; Figure 7 It is a structural diagram of an EPG file updating device in a hardware operating environment involved in an embodiment of the present application.
[0018] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0020] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0021] EPG data includes basic EPG information and extended EPG information. Basic EPG information includes network information table, service association table, service description table and event information table, which are used to describe the basic information of the program; extended EPG information can provide richer program content and additional information, such as program introduction, cast list, trailer, etc. With the development of smart TV and streaming media devices, users can easily browse and select TV programs and video content through EPG on smart TV or streaming media devices. Therefore, set-top boxes or streaming media devices need to be synchronized with EPG servers regularly to obtain the latest program information and broadcast information tables.
[0022] However, in the EPG system in the related art, the data update of the JSON file needs to be started after the JSON file is completely transmitted. With the increasing number of TV programs, the traditional method of updating after transmission requires a lot of computer computing power and storage space. Therefore, when a large amount of JSON file data is transmitted and updated, high bandwidth consumption and long waiting time are required, resulting in low update efficiency of the JSON file.
[0023] To solve the above problems, the present application proposes an EPG file update method. The method splits the EPG file and stores it in the form of a hash table, transmits the hash table stored in the server to the user end for comparison, determines the hash number of the user-updated part, finds the corresponding modified part in the hash table by the hash number, determines the hash value corresponding to the modified content, and then transmits the hash value back to the user end to change the data of the user end, so that only the part that needs to be updated is modified.
[0024] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0025] Based on this, the first embodiment of the present application provides a method for updating an EPG file, referring to Figure 1 , Figure 1 This is a flow chart of Embodiment 1 of the method for updating an EPG file of the present application.
[0026] In this embodiment, the EPG file updating method includes steps S100 to S300: Step S100, in response to a file update request sent by a user terminal, obtaining a hash table corresponding to a target EPG file, and sending the hash table to the user terminal.
[0027] It should be noted that the execution subject of this embodiment can be an EPG file update system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an EPG file update, etc., which is not specifically limited in this embodiment. The following takes the update of the EPG file as an example to illustrate this embodiment and the following embodiments.
[0028] It should be noted that a hash table is a data structure that uses a hash function to map a key to a specific location in the table to store data, speeding up data insertion, search, and deletion operations. At the same time, the hash table uses hashing technology to store records in a continuous storage space.
[0029] In response to a file update request transmitted by the user, the corresponding target EPG file is found in the server according to the target EPG file identifier requested by the user, the content of the target EPG file is read, a hash calculation is performed on the file content, a hash value for each entry is generated, the hash value and its corresponding identifier are stored in a hash table, and then the generated hash table format is converted and transmitted to the user via the network.
[0030] As an optional solution for generating a hash table based on file content, it is first necessary to read the EPG file content and then calculate the file content. Optionally, each entry is first converted into a string through the SHA-256 algorithm, and then the string is hashed, and then the calculated hash value and the corresponding identifier are stored in a hash table.
[0031] Step S200: receiving a difference hash number fed back by the user end, wherein the user end determines the difference hash number according to the hash table and the cached EPG file.
[0032] It should be noted that the cached EPG file is the EPG file currently stored on the user end, which contains old or incomplete TV program information. The difference entry is the data item that is inconsistent between the initial EPG file and the target EPG file, indicating the TV program information that needs to be updated. The difference hash number refers to the number or identifier of the hash value corresponding to the part of the program entry set that has changed at a certain point in time or between versions.
[0033] The hash table corresponding to the EPG file is transmitted back to the user end, and the user end compares the hash table with the cached EPG file to determine the difference hash number in the cached EPG file.
[0034] As an optional implementation, using the hash checksum method, the user terminal first calculates the hash value of the initial EPG file, and then compares it with the hash table of the target EPG file to find out the mismatching hash values, and uses the program entries corresponding to these mismatching hash values as difference entries, and the mismatching hash values themselves as hash numbers.
[0035] For example, the time of a program in the EPG file on the user side is recorded incorrectly, and the server has the correct EPG file and its hash table. After the user side calculates the hash value of the local file, it compares it with the hash value of the server to determine the hash value of the unmatched program, indicating that the program is at an incorrect time node and needs to be modified according to the correct EPG file, where the unmatched hash value is the hash number of the difference entry.
[0036] As another optional implementation, the client maintains a hash table copy of the EPG file locally through the distributed hash table technology. Each time the EPG file is updated, the hash table of the client is also updated accordingly. The client then compares the local program entry set with the hash table of the server to determine the difference entries, and then obtains the updated content according to the hash number.
[0037] For example, in a distributed system, each client saves a copy of the EPG file and the corresponding hash table. When the EPG file is updated, the server's hash table is also updated. The client determines which program entries have changed by comparing the local program entry set with the server's hash table. For example, when a new program is added to the EPG, the server's hash table is updated.
[0038] Step S300: determining a difference entry based on the difference hash number, and sending the difference entry to the user terminal, so that the user terminal can update the cached EPG file according to the difference entry.
[0039] After receiving the difference hash number sent by the user end, the EPG file stored in the database is queried by the difference hash number, the difference entry is determined by comparison, and then the difference entry is sent to the user end to update the cached EPG file of the user end.
[0040] Further, after the user terminal determines the difference hash numbers between the cached EPG file and the hash table, the server receives the difference hash numbers sent by the user terminal, and then determines the difference entries stored in the server through the difference hash numbers.
[0041] Specifically, the server receives the difference hash number sent by the client, traverses the program entry set corresponding to the EPG file in the server, and obtains the specific information of the corresponding difference entry by comparing the difference hash numbers.
[0042] For example, if the hash values of three program entries are found to be mismatched during the user-side comparison process, these difference hash numbers are sent to the server, which receives these difference hash numbers and compares them with the cached EPG files in the database to determine the program entries corresponding to the three difference hash numbers.
[0043] As an optional implementation, after splitting the cached EPG file, the user end compares the cached EPG file with the hash value in the hash table. After the comparison, the user end can determine the difference hash numbers of the newly added, modified or deleted parts of the cached EPG file in the hash table.
[0044] For example, an initial EPG file of the user terminal includes item A: News A (8pm to 8:30pm), item B: TV series B (8:30pm to 8:45pm), and item C: (9pm to 10pm). At this time, the user terminal receives a hash table containing the hash values of the items: {"A":"hash12","B":"hash34","C":"hash56","D":"hash78"}, and the server detects that item A is deleted, the time of item B is changed to 8:15pm to 9pm, and item Movie D is added, the time is 10pm to 12am, so it can be determined that the hash value of item A is deleted and determined to be a deleted item, the hash value of item B changes and is determined to be a modified item, and item D is a newly added item. It should be noted that the above time nodes are all on the same night.
[0045] This embodiment provides an EPG file update method. When a user terminal requests an update, the server first responds to the request and sends a hash table corresponding to the target EPG file to the user terminal. The user terminal calculates a difference hash number based on the received hash table and the locally cached EPG file, and feeds these difference hash numbers back to the server. The server then determines specific difference entries based on these difference hash numbers and sends these difference entries back to the user terminal. In this way, the user terminal updates the cached EPG file based on the difference entries, thereby reducing the amount of data transmission, improving the update efficiency, and ensuring that the user terminal always has the latest program information.
[0046] Based on the first embodiment, the second embodiment of the present application provides a method for updating an EPG file, referring to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the method for updating the EPG file of the present application, wherein step S100 includes steps S110 to S120: Step S110: In response to the file update request of the user terminal, split the target EPG file to obtain a program entry set, wherein the program entry set includes at least one program entry.
[0047] It should be noted that an EPG file is a structured data file that contains multiple program entries and is organized in a specific format to facilitate user browsing and searching.
[0048] After responding to the file update request sent by the user terminal, the server receives the file update request and receives the target EPG file, divides the target EPG file, determines the program entry set, and stores the target EPG file through the program entry set.
[0049] As an optional implementation scheme for storing the target EPG file through a program entry set, the target EPG file is parsed by a splitting tool to extract the program entries therein. Based on the parsed file, the splitting tool traverses the entire EPG data structure and extracts the program entries one by one, and then organizes the extracted program entries into a program entry set to reflect all program information in the EPG file.
[0050] Exemplarily, the EPG file can be stored in XML or JSON format, so the corresponding XML or JSON parser can be used. After the parser is determined, the parsing tool traverses the data layer by layer starting from the top layer according to the hierarchical structure of the EPG file. During the traversal process, each data node is identified and processed to extract the relevant information of the program entry, identify the key fields for each program information, and create a data structure for the identified program entry.
[0051] Optionally, step S110 includes steps S111 to S113: Step S111: determining the entry structure of the program entry based on the requirement information of the file update request and the EPG file format.
[0052] As an optional solution for determining the entry structure according to the file update request sent by the user end, the specific requirements of the request for the entry structure are determined according to the content of the file update request sent by the user end, including the required program information type, such as TV programs, radio programs, etc., update frequency, data format requirements, etc., which may be the fields that must be included, the data types of the fields, the order of the fields, etc., and then the basic fields that must be included in the program entry are determined according to the demand information and the EPG file format, such as the program name, broadcast time, channel number and program type, etc. Therefore, appropriate data types can be defined according to these basic fields, such as a string for the program name, a date and time for the broadcast time, an integer for the channel number, etc., and the order and length of the fields are determined according to the requirements of the EPG file format, wherein the order of the fields is arranged according to the logical order of the program information or the user's usage habits, and the length of the field is determined according to the actual needs of the data and the limitation of the storage space.
[0053] Exemplarily, based on the user's request, the specific requirements of the entry structure are determined, including the program name, broadcast time, channel number, program type, program description, and program duration. The field data type is determined. The program name can be in string form and the channel number can be in integer form. The order is then arranged according to the user's requirements.
[0054] Step S112, parsing the target EPG file, and traversing the parsed target EPG file to extract entry information.
[0055] As an optional solution for parsing a target EPG file and extracting entry information, while obtaining the entry structure, the entry information to be extracted is determined according to the target EPG file. First, it is necessary to determine the appropriate parsing tool and library according to the format of the EPG file. For example, for XML files, an XML parser can be used, and for JSON files, a JSON parser can be used. After determining the parsing tool, the entry information of the EPG file is parsed, and according to the parsing result, an internal data structure is constructed to store the EPG data; after parsing the EPG file, according to the logical structure and data relationship of the EPG file, a strategy for traversing the data structure is determined. Optionally, if the EPG data is stored in a tree structure, a depth-first search or breadth-first search strategy can be used. The storage method of the EPG data is not limited here. During the traversal process, the entry information is extracted according to the information in the entry structure, and the extracted entry information is stored in an appropriate data structure.
[0056] Step S113: construct the program entry set based on the entry structure and the entry information.
[0057] After extracting the entry information and determining the entry structure, construct a program entry set through these entry information and entry structure. According to the program structure, create an object or data structure for each program entry, which can be in the form of a Python dictionary, and match the required fields, field order and type with the entry structure. Fill the extracted entry information into the corresponding fields of the program entry object. Make sure that each field corresponds correctly and the data type is consistent. Based on a constructed program entry, create a data structure to store all program entry objects, that is, to form a program entry set. Arrange according to the broadcast time or other logical order of the known entries, and add the constructed program entry objects to the program entry set.
[0058] Exemplarily, first create an empty list to store all program entry objects, traverse the list, create an object for each program information, and add the object to the list, then use Python's built-in sorting method to sort the list. Since a comparison method is defined in the object class, the comparison method defines that the two programs can sort the program entries in ascending order according to the broadcast time, thereby constructing a set of program entries.
[0059] Step S120: construct the hash table based on the program entry set, and send the hash table to the user terminal, wherein the program entries correspond to the hash values in the hash table one by one.
[0060] After constructing the program entry set, select the relevant hash function according to the characteristics of this program entry set, which can be MD5 (Message Digest Algorithm 5), Secure Hash Algorithm 1 (SHA-1), (Secure Hash Algorithm 256, SHA-256), etc. For each program entry, use the selected hash function to generate a hash value and assign a unique hash number to each entry. Create a hash table, use the hash number as the key and the value calculated by the hash function as the hash value, and fill each program and its corresponding number and hash value into the hash table.
[0061] As an optional implementation method for constructing a hash table, a hash number and a hash value are generated based on a specific set of program entries, a simple incremental number is assigned to each entry, the entry information is first converted into a string, and then a hash value is generated, and then each program entry and its corresponding number and hash value are filled back into the hash table to construct the hash table, and then a communication connection is established between the user terminal and the server to facilitate the transmission of the hash table data and send the hash table to the user terminal.
[0062] Exemplarily, in a television program guide system, a dictionary (or hash map) is used, the key of the dictionary is the identifier of the program entry, and the detailed information of the program entry is used as a new hash value. The name of each program entry is calculated, and each program entry and its corresponding number and hash value are filled into the hash table.
[0063] Optionally, step S120 includes steps S121 to S123: Step S121, determining a target hash function based on the identifier of the program entry set.
[0064] Step S122: Calculate the hash value of the identifier based on the target hash function to determine the storage location of the program entry set.
[0065] A specific hash function is selected or generated through a unique attribute in the program entry set, which may be an identifier, so that the position corresponding to each entry can be quickly located after the program entry set is stored.
[0066] As an optional solution for calculating hash values and their storage locations, after determining the hash function, the hash value is calculated by calling the hash function identifier, and the calculated hash value is used as an index to determine the storage location of each program entry in the hash table. If the hash table is an array or a list, the hash value represents the index position of the identifier in the hash table.
[0067] Exemplarily, the target hash function is hash_function(identifier, N), where identifier is the program ID and N is the size of the hash table. The hash function can be a simple modulo operation, such as hash_function(identifier, N) = identifier % N. Thus, for a hash table with a program ID of 123 and a hash table size of 100, the hash value is 123 % 100 = 23; for a hash table with a program ID of 456 and a hash table size of 100, the hash value is 456 % 100 = 56.
[0068] Step S123: Map the storage location to the hash table, and send the hash table to the user terminal.
[0069] A mapping relationship is established based on the storage location information and a key in the hash table (ie, an identifier of the program entry set), and the hash table is filled according to the mapping relationship.
[0070] As an optional mapping method, the calculated hash value is used as a key to store the corresponding program entry in the form of a dictionary, and the program entry is mapped to the hash table as a value. The constructed hash table is then output to the user end, and the user can quickly search and retrieve the program entry based on the hash table.
[0071] This embodiment proposes an EPG file update method, which first splits the target EPG file into a set of multiple program entries, then calculates a hash value based on the identifier of each program entry, and then uses the hash value to determine the specific location of the program entry in the storage system. Next, the system maps the storage location information into a hash table, and finally outputs the hash table to the user end, so that the user end can quickly locate the program entry data that is different from the initial file based on the hash table, thereby improving the efficiency of updating and accessing the cached EPG file and ensuring fast retrieval and distribution of data.
[0072] Since the system introduced in the second embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.
[0073] Based on the first embodiment, the third embodiment of the present application provides a method for updating an EPG file, referring to Figure 3 , Figure 3 This is a flow chart of the third embodiment of the method for updating the EPG file of the present application, step S300 includes steps S310 to S330: Step S310: receiving the difference hash number, and calculating a hash value corresponding to the difference hash number.
[0074] As an optional solution for determining a hash value based on a differential hash number, the format of the differential hash number is determined based on the differential hash number transmitted by the user end, and a parsing tool is determined based on the format to extract the actual numbering information. Based on the numbering information, the corresponding program entry set on the server or in local storage is located, and related program entry set data is read from the storage location. Finally, a suitable hash algorithm is selected to calculate the hash value.
[0075] As a method of calculating the hash value corresponding to the difference hash number, the SHA-256 hash function is selected. It should be noted that SHA-256 is a widely used hash algorithm that generates a 256-bit hash value that can represent 64 hexadecimal digits.
[0076] For example, the SHA-256 hash function is used to calculate the hash value of the example.txt file, and the entire content of the example.txt file is read. At the same time, before passing the file content to the hash function, the file content needs to be encoded into a byte sequence; the file text is converted into bytes. Finally, the encoded byte sequence is passed to the SHA-256 hash range.
[0077] Step S320, searching the target EPG file for the hash value to determine newly added entries and deleted entries.
[0078] It should be noted that the newly added entries include added entries and modified entries. The added entries are newly added entries, the modified entries include entries with modified keys or hash values, and the deleted entries are entries that cannot be matched from the program entry set of the target EPG file.
[0079] As an optional implementation, the target EPG file is hashed and the hash values are compared to determine whether the file has changed. If the hash values are different, the file content is further analyzed to determine which entries are newly added, modified or deleted.
[0080] Exemplarily, the hash value corresponding to the difference hash number is retrieved in the target EPG file, and the newly added items and deleted items in the program item set are identified by comparing the program item set into which the target EPG file is divided.
[0081] Step S330: Encode the deletion entry numbers corresponding to the newly added entry and the deleted entry based on arithmetic coding, and send the encoded deletion entry numbers of the newly added entry to the user terminal.
[0082] It should be noted that arithmetic coding is an efficient data compression technology that implements coding by mapping a probability distribution to a continuous interval. Specifically, an arithmetic coding algorithm is used to encode the difference entry according to a probability model. When the encoded difference entry is received, the difference entry is decoded.
[0083] Optionally, the compared difference entries are compressed by an incremental compression method. It is necessary to clarify that the difference entries include newly added entries, modified entries, and deleted entries, and then the difference entries are compressed.
[0084] As an optional scheme for compressing difference entries, different incremental compression strategies are applied to different difference entries. For newly added entries, the complete content of the newly added entries is directly compressed; for modified entries, only the modified fields or data blocks are compressed instead of the entire modified entries; for deleted entries, a list containing identifiers of the deleted entries is simply compressed without compressing the entire content of the deleted entries. After the compression of each entry is completed, the compressed data generated by the newly added, modified and deleted entries are merged into a single update package.
[0085] After the difference entries are identified, classified and compressed, a unified compressed difference entry is obtained, and the compressed difference entry data is sent to the user end through a network transmission protocol.
[0086] This embodiment provides an EPG file update method, which identifies difference entries (new additions, modifications and deletions) by comparing hash values of new and old EPG files, and then compresses and encodes these differences using arithmetic coding, and finally sends the encoded data to a user terminal, which receives and decodes the data to update its cached EPG file, thereby ensuring that the EPG information of the user terminal is kept up to date, while reducing the amount of data transmission and improving the update efficiency.
[0087] Based on the first embodiment, the fourth embodiment of the present application provides a method for updating an EPG file, referring to Figure 4 , Figure 4 This is a flow chart of the fourth embodiment of the method for updating the EPG file of the present application, steps S60 to S70: Step S60, obtaining and splitting the historical EPG file, and determining the historical entry set.
[0088] It should be noted that the historical EPG file is the historical EPG data saved by a TV station or broadcasting company and is stored in the form of a file, such as XML, JSON or a proprietary format.
[0089] Historical EPG data is obtained from the database for analysis. According to the format of the historical EPG file, the file content is read using the corresponding parsing tool, and then converted into a data structure in the memory according to the file content. The historical program entries are extracted from the parsed data structure, and then the extracted historical entries are split into different subsets as needed to determine the historical entry set.
[0090] For example, in a TV program guide service company, the company needs to extract program information from historical EPG files in order to provide users with accurate program recommendations and broadcast schedules. First, it needs to obtain historical EPG files, download an EPG file containing information from the TV station's official website, and then use the XML parsing library to read the content of the EPG file. Traverse each node in the XML file, extract the program information for each date, and finally split the program information into different subsets according to the date node.
[0091] Step S70: construct an initial hash table based on the historical entry set, and store the historical entry set in the initial hash table.
[0092] It should be noted that the key of the hash table can be one or more unique fields in the historical entry set as the key of the hash table; the hash value can be a complete record of the program information related to the key, or a pointer to the storage location of the program information, such as a row ID in a database.
[0093] As an optional implementation scheme, after splitting the historical EPG file and obtaining the historical entry set, the historical entry set is analyzed to construct an initial hash table, and the program entry set is stored in the initial hash table.
[0094] For example, in the acquired historical EPG file, the file contains the program information of each channel in the past week. After the historical EPG file is split into multiple historical entry sets, each holiday set represents the program information in one day. First, "date, channel, program start time" is selected as the key of the hash table, and the hash value represents the specific information of the program, including program name, program duration, program type, etc.
[0095] This embodiment proposes an EPG file update method, which extracts program information from historical EPG files to form a historical entry set, and uses these entries to build an initial hash table, in which the historical entry set is stored, providing a basic data structure for subsequent EPG data management and update, ensuring that the historical version and current status of the program information can be tracked and verified.
[0096] Based on the first embodiment, the fifth embodiment of the present application provides a method for updating an EPG file. Figure 5 , Figure 5 This is a flowchart of Embodiment 5 of the method for updating an EPG file of the present application, wherein step S200 includes steps S80 to S90: Step S80: receiving EPG update information sent by the television service provider, and determining update entries in the initial hash table.
[0097] It should be noted that the hash table contains the hash value of each program entry in the latest EPG file currently in the server. The initial EPG file is read from the local database.
[0098] First, you need to make sure that the TV or related equipment is connected to the Internet. After identity information verification, monitor the update signal from the service provider through the EPG client software on the device. The service provider sends EPG update data through the Internet. After identifying the format of the update data, parse the received data and extract relevant information of the EPG file, including program name, broadcast time and channel, etc.
[0099] Step S90: updating the historical EPG file according to the update item.
[0100] After receiving the EPG and parsing the update entries, the update entries are compared with the current target EPG file to find the program information that needs to be updated or added, and then the target EPG file is updated or merged according to the comparison result, and then the updated target EPG file is saved back to the storage device; after updating the target EPG file, for each updated or newly added program entry in the EPG file, its hash value is calculated, and then the hash table stored on the device is updated according to the calculated new hash value. After the hash table is updated, all program entries are associated with the hash value.
[0101] Exemplarily, the set-top box parses the EPG update data packet and extracts new program information. At the same time, the set-top box reads the current EPG file and compares the new program information with the existing program information. Based on the comparison results, the set-top box updates the current EPG file, adds new program entries and modifies related program information. For each updated or newly added program entry, the set-top box calculates its hash value and updates the corresponding entry in the hash table.
[0102] This embodiment provides an EPG file update method, which receives EPG (electronic program guide) update information sent by a television service provider, determines the update entries in the initial hash table, and then updates the historical EPG file according to these update entries, that is, integrates the newly acquired program information into the existing EPG data file, ensures that users can view the latest television program information, and maintains the timeliness and accuracy of the EPG data.
[0103] Based on the first embodiment, the sixth embodiment of the present application provides a method for updating an EPG file, referring to Figure 6 , Figure 6 This is a flowchart of Embodiment 6 of the method for updating an EPG file of the present application. After step S90, steps S91 to S92 are also included: Step S91: detecting the updated EPG file after the update based on a preset update period, and determining the changed items.
[0104] It should be noted that the preset update cycle is to set a fixed time interval as the update cycle to trigger the update operation through a timer or a scheduling job. The preset update cycle can be a specific time every hour or every day and is only used to trigger the update operation of the EPG data.
[0105] In addition to user-based file update requests, within a preset update cycle, the system automatically detects changes in program items since the last update, including newly added programs, modified programs, and deleted programs, thereby determining the changed items within the preset update cycle.
[0106] As an optional method for updating the target EPG file according to a preset update period, after receiving the update information sent by the TV service provider, the server updates the target EPG file and the hash table stored in the server according to the update information, and immediately sends the update entries to the user terminal. The user terminal receives the update entries sent by the server, determines the program entries with changes in the local cached EPG file, and adds, deletes or modifies the update entries.
[0107] Exemplarily, when the server receives a new program guide sent by the TV station, the target EPG file and hash table stored in the server are modified according to the updated information in the new program guide.
[0108] Further, after the target EPG file and hash table of the server are updated, the cached EPG file of the user terminal is updated according to the EPG update information sent by the television service provider.
[0109] As an optional solution for updating the cached EPG file of the user end according to the EPG update information, after the server updates the target EPG file and the hash table, the change entries of the target EPG file are sent to the user end in real time. After receiving the change entries, the user end updates the cached EPG file.
[0110] As an optional solution for updating the cached EPG file of the user end according to the EPG update information, the priority of the EPG update information is determined according to the EPG update information update target EPG file and the hash table, and the update mode of the cached EPG file of the user end is determined according to the priority.
[0111] Specifically, after the server updates the target EPG file and hash table, it determines that the program entry in the change entry is the program information six hours later. When the preset update cycle is three hours, there is no need to update immediately. This change entry is added to the queue to be transmitted, and the target EPG file is updated with the second update information within the preset update cycle for comparison to determine the last transmitted change entry.
[0112] Exemplarily, if the preset update cycle is one hour, and the update node is updated at the whole hour, such as 4:00 p.m., 5:00 p.m., etc., the first update information from the television service provider is received, and it is determined that the broadcast time of the program entry "Program A" is changed from 7:00 p.m. to 7:30 p.m., and the current time is 4:10 p.m. on the same day, then the priority of this update information is set to low, and half an hour after the current time (i.e. 4:40 p.m.), the second update information from the television service provider is received, and it is determined that the broadcast time of the program entry "Program A" is changed from 7:30 p.m. back to 7:00 p.m., then, within the preset update cycle, since the first update information is still in the update queue, the first update information and the second update information are compared to determine the comprehensive update information, that is, there is no need to update this program entry.
[0113] Step S92: sending the change entry to the user terminal, wherein the user terminal receives the change entry and updates the cached EPG file based on the change entry.
[0114] After detecting the updated target EPG file within the preset update cycle, the program entry that needs to be updated is determined, and the change entry is sent to the user end. Then, after receiving the change entry, the user end updates the cached EPG file by comparing the change entry with the cached EPG file.
[0115] This embodiment provides an EPG file update method, which automatically detects changed items in the target EPG file through a preset update cycle, and then sends these changed items to the user terminal, which updates the locally cached EPG file accordingly, ensuring that the user can always access the latest TV program information, while reducing the need for manual updates, thereby improving system efficiency and user convenience.
[0116] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the updating method of the EPG file of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0117] The present application provides an EPG file updating device, which includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the EPG file updating method in the above-mentioned embodiment 1.
[0118] Reference below Figure 7 , which shows a schematic diagram of the structure of an EPG file update device suitable for implementing the embodiment of the present application. The EPG file update device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The EPG file updating device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 7As shown, the updating device of the EPG file may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the updating device of the EPG file are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the updating device of the EPG file to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the updating device of the EPG file with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0120] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0121] The EPG file update device provided by the present application adopts the EPG file update method in the above embodiment, which can solve the technical problem that when a large amount of JSON file data is transmitted and updated, high bandwidth consumption and long waiting time are required, resulting in low update efficiency of JSON files. Compared with the prior art, the beneficial effects of the EPG file update device provided by the present application are the same as the beneficial effects of the EPG file update method provided by the above embodiment, and other technical features in the EPG file update device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0122] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the EPG file updating method in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0126] The computer-readable storage medium may be included in the EPG file updating device; or may exist independently without being assembled into the EPG file updating device.
[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the EPG file update device, the EPG file update device: responds to a file update request sent by a user terminal, determines a hash table corresponding to a target EPG file, and sends the hash table to the user terminal; Receiving the difference hash number fed back by the user end, wherein the user end determines the difference hash number according to the hash table and the cached EPG file; A difference entry is determined based on the difference hash number, and the difference entry is sent to the user end, so that the user end can update the cached EPG file according to the difference entry.
[0128] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0131] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for updating the EPG file, and can solve the technical problem that when a large amount of JSON file data is transmitted and updated, high bandwidth consumption and long waiting time are required, resulting in low efficiency in updating the JSON file. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for updating the EPG file provided by the above-mentioned embodiment, and will not be elaborated here.
[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for updating an EPG file, characterized in that: The updating method of the EPG file comprises the following steps: In response to a file update request sent by a user terminal, obtaining a hash table corresponding to a target EPG file, and sending the hash table to the user terminal; Receiving the difference hash number fed back by the user end, wherein the user end determines the difference hash number according to the hash table and the cached EPG file; A difference entry is determined based on the difference hash number, and the difference entry is sent to the user end, so that the user end can update the cached EPG file according to the difference entry.
2. The method for updating an EPG file according to claim 1, wherein: The step of obtaining a hash table corresponding to a target EPG file in response to a file update request sent by a user terminal and sending the hash table to the user terminal comprises: In response to a file update request from the user terminal, split the target EPG file to obtain a program entry set, wherein the program entry set includes at least one program entry; Based on the program entry set, the hash table is constructed and sent to the user terminal, and the program entries correspond to the hash values in the hash table one by one.
3. The method for updating an EPG file as claimed in claim 2, characterized in that: The program entry set includes at least one program entry set, and the step of splitting the target EPG file to obtain the program entry set includes: Determining the entry structure of the program entry based on the requirement information of the file update request and the EPG file format; Parsing the target EPG file, and traversing the parsed target EPG file to extract entry information; The program entry set is constructed based on the entry structure and the entry information.
4. The method for updating an EPG file as claimed in claim 2, wherein: The step of constructing the hash table based on the program entry set and transmitting the hash table to the user terminal comprises: determining a target hash function based on an identifier of the set of program entries; Based on the target hash function, calculating a hash value of the identifier to determine a storage location of the program entry set; The storage location is mapped to the hash table, and the hash table is sent to the user end.
5. The method for updating an EPG file according to claim 1, wherein: The step of determining a difference entry based on the difference hash number and sending the difference entry to the user terminal includes: Receive the difference hash number, and calculate a hash value corresponding to the difference hash number; Retrieving the hash value in the target EPG file to determine newly added entries and deleted entries; The deletion entry numbers corresponding to the newly added entry and the deleted entry are encoded based on arithmetic coding, and the encoded deletion entry numbers of the newly added entry are sent to the user terminal.
6. The method for updating an EPG file as claimed in claim 1, characterized in that: Before the step of obtaining a hash table corresponding to the target EPG file in response to the file update request sent by the user terminal and sending the hash table to the user terminal, the method further includes: Obtain and split the historical EPG file to determine the historical entry set; An initial hash table is constructed based on the historical entry set, and the historical entry set is stored in the initial hash table.
7. The method for updating an EPG file as claimed in claim 6, characterized in that: After the step of constructing an initial hash table based on the historical entry set and storing the historical entry set in the initial hash table, the method further includes: Receiving EPG update information sent by a television service provider, and determining an update entry in the initial hash table; The historical EPG file is updated according to the update entry.
8. The method for updating an EPG file as claimed in claim 7, characterized in that: After the step of updating the historical EPG file according to the update entry, the method further includes: Detecting the updated EPG file after the update based on a preset update period, and determining a changed item; The change entry is sent to the user terminal, wherein the user terminal receives the change entry and updates the cached EPG file based on the change entry.
9. An updating device for EPG files, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for updating the EPG file according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for updating an EPG file according to any one of claims 1 to 8 are implemented.