Attribute notification method, device and equipment of IPTV (Internet Protocol Television) system and medium
By using the init process in the IPTV system to establish a socket connection with the application side and notify when the attributes change, the problem of low efficiency in the application side obtaining attribute information in the existing IPTV system is solved, and more efficient attribute notification and better general consistency are achieved.
Patent Information
- Application Number
- CN202510132218.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-02-06
AI Technical Summary
In existing IPTV systems, the application side is less efficient in obtaining attribute information, resulting in wasted CPU resources.
Create a file descriptor under /dev/socket/ through the init process, create a first socket, and establish a connection with multiple application terminals through the socket. When receiving a property change request for the target attribute, modify the value of the target attribute and query whether the target attribute exists through the pre-stored hash list. If present, the target socket associated with the target attribute is notified that the target application side property has changed.
It realizes notifying the application side only when the attribute changes, improves the efficiency of the application side in the IPTV system to obtain attribute information, and supports notifying APK applications and native binary programs, with good general consistency.
Smart Images

Figure CN119562088A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of IPTV technology and provides an attribute notification method, device, equipment and medium for an IPTV system. Background Art
[0002] During the development of Internet Protocol Television (IPTV) systems, multiple applications often need to communicate or save data. The most commonly used are system properties, which are special key-value pairs used to store system configuration and status information. All applications can write and read their own status and values through system properties, which is very simple and convenient to use. For example, an application configures its own shared value into a property, and other applications read the property to obtain the property value. However, if the program needs to monitor property changes, it can only repeatedly obtain the current property value on one thread to obtain the changed property value, which is inefficient and leads to a waste of CPU resources. Summary of the invention
[0003] The present application provides an attribute notification method, device, equipment and medium of an IPTV system, which are used to solve the problem of low efficiency of application acquisition of attribute information in the existing IPTV system.
[0004] In a first aspect, a property notification method of an IPTV system is provided, which is applied to a server of the IPTV system, wherein the IPTV system further includes a plurality of application terminals; the method comprises: The init process creates a file descriptor under / dev / socket / to create the first socket; Establishing connections with the multiple application terminals through the first socket; the multiple application terminals include APK applications and native binary programs; When the init process receives an attribute change request of a target attribute, the attribute value of the target attribute in the IPTV system is modified, and a pre-stored hash list is queried to determine whether the target attribute exists; wherein the hash list includes a plurality of attributes and a socket associated with each attribute; If so, the target application is notified of the change of the target attribute through the target socket associated with the target attribute.
[0005] Optionally, the step of establishing connections with multiple application terminals through the first socket includes: Add the first socket to epoll, and receive a connection request from any application end through the first socket; the connection request is initiated by any application end through the newly created third socket; A second socket is created for communicating with any one of the application ends.
[0006] Optionally, after creating the second socket for communicating with any one of the application terminals, the method further includes: Add the second socket to epoll, and receive the attribute group requested to be monitored by any application end through the second socket; the attribute group is initiated by any application end through the third socket; the attribute group includes at least one attribute; The at least one attribute and the second socket association are written into the hash list.
[0007] Optionally, after writing the at least one attribute and the second socket association into the hash list, the method further includes: A property monitoring success flag is sent to the third socket of any application end through the second socket; the property monitoring success flag is used to indicate that the at least one property has been successfully monitored.
[0008] Optionally, after sending a property monitoring success flag to any application end, the method further includes: If an error message is received through the second socket, the second socket is removed from the hash list and the second socket is closed; the error message is used to instruct any application end to disconnect.
[0009] Optionally, the attribute change request includes the name of the target attribute and the changed attribute value; and the step of notifying the target application end of the change of the target attribute through the target socket associated with the target attribute includes: The name of the target attribute and the changed attribute value are sent to the target application end through the target socket associated with the target attribute.
[0010] Optionally, the change request further includes the name of the target attribute and the changed attribute value; and the step of notifying the target application end of the change of the target attribute through the target socket associated with the target attribute includes: The name of the target attribute is sent to the target application end through the target socket associated with the target attribute, so that the target application end calls a specified interface and reads the changed attribute value from the IPTV system according to the name of the target attribute.
[0011] In a second aspect, an optimization device for an IPTV system is provided, which is arranged in a server of the IPTV system, wherein the IPTV system further includes a plurality of application terminals; the device includes: Create a module for creating a file descriptor under / dev / socket / through the init process to create the first socket; A connection module, configured to establish a connection with the multiple application terminals through the first socket; the multiple application terminals include APK applications and native binary programs; A modification module, configured to modify the attribute value of the target attribute in the IPTV system when the init process receives an attribute change request of the target attribute, and query whether the target attribute exists in a pre-stored hash list; wherein the hash list includes a plurality of attributes and a socket associated with each attribute; The notification module is used to notify the target application end of the change of the target attribute through the target socket associated with the target attribute if the target attribute exists in the hash list.
[0012] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the attribute notification method of the IPTV system described in the first aspect.
[0013] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and a processor executes the computer program to implement the attribute notification method of the IPTV system described in the first aspect.
[0014] Compared with the prior art, the present invention has the following beneficial effects: The present application provides an attribute notification method for an IPTV system, which is applied to a server of the IPTV system, wherein the IPTV system further comprises a plurality of application terminals; the method comprises: establishing a file descriptor under / dev / socket / through an init process to create a first socket; establishing connections with a plurality of application terminals through the first socket; the plurality of application terminals comprise APK applications and native binary programs; when the init process receives an attribute change request of a target attribute, modifying the attribute value of the target attribute in the IPTV system, and querying whether the target attribute exists in a pre-stored hash list; wherein the hash list comprises a plurality of attributes and a socket associated with each attribute; if so, notifying a target application terminal of the change of the target attribute through a target socket associated with the target attribute.
[0015] In this application, this method only notifies the application end when the attribute changes. Compared with the polling mechanism of the application end for the attribute in the prior art, the efficiency of the application end in obtaining attribute information in the IPTV system can be improved. And by establishing a file descriptor under / dev / socket / through the init process, when the attribute changes, not only the APK application can be notified, but also the native binary program can be notified, which has good universal consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0017] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application; Figure 2 A flowchart of a method for notifying an IPTV system of an attribute provided by an embodiment of the present application; Figure 3 A schematic diagram of the server initialization process provided in an embodiment of the present application; Figure 4 A schematic diagram of a process for notifying a server of attribute changes provided in an embodiment of the present application; Figure 5 A schematic diagram of the application process provided in the embodiment of the present application; Figure 6 A schematic diagram of the structure of an attribute notification device for an IPTV system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0019] There are many attributes in the IPTV system, for example, net.dns1 represents the IP address of the primary DNS server, and net.dns2 represents the IP address of the backup DNS server. In the prior art, various applications of the IPTV system mainly use a polling mechanism to read attribute values. If the interval is set too short, the CPU overhead is large. If the interval is set too long, the timeliness of information acquisition is low.
[0020] In view of this, the embodiment of the present application provides an attribute notification method of an IPTV system, which is applied to the IPTV system. Figure 1 , is a schematic diagram of an application scenario provided in an embodiment of the present application, or can be understood as a structural diagram of an IPTV system. The IPTV system includes a server and multiple application terminals, Figure 1 The example in which multiple application terminals include application terminal 1 and application terminal 2 is taken, but in fact, the number of application terminals is not limited.
[0021] Among them, multiple application terminals include APK applications and native binary programs. Among them, APK applications refer to Android applications using Android Application Package (APK). Native binary programs refer to applications for C and Linux programs.
[0022] Combination Figure 2 The embodiment of the present application also provides an attribute notification method of an IPTV system, wherein the method steps defined in the process related to the attribute notification method of the IPTV system can be implemented by the server of the IPTV system.
[0023] The following will Figure 2 The specific process shown is explained in detail.
[0024] S201. Create a file descriptor under / dev / socket / through the init process to create a first socket.
[0025] In the specific implementation process, after the property service of the IPTV system is initialized, a first socket for monitoring property changes is added, and the first socket uses Unix Socket. Unix Socket is a mechanism for communication between processes on the same machine, and a special file is directly created in the file system to represent the socket. Therefore, by creating a file descriptor (property_change) under / dev / socket / , the first socket can be created. The file descriptor is created and controlled by the init process.
[0026] In the embodiment of the present application, Unix Socket does not rely on network protocols (such as TCP, IP, etc.) like network sockets, but uses file paths in the file system for communication, thereby avoiding the performance overhead brought by the network protocol stack and is usually more efficient.
[0027] In a possible embodiment, since Unix Socket uses a file system path to identify a communication endpoint instead of an IP address and a port number, the Unix socket file has file system permission control, and commands such as chmod and chown can be used to set the access permissions for the socket file, and only users or processes with access permissions can access or operate the Unix Socket. In other words, the file descriptor ( / dev / socket / property_change) is similar to a file. If the property of the file descriptor is set to the system user, only applications with system permissions are allowed to access the file descriptor, and general applications cannot access the file descriptor and cannot obtain the property value, thereby improving the security of the IPTV system.
[0028] S202: Establish connections with multiple application terminals through a first socket.
[0029] In the specific implementation process, after the server creates a file descriptor (property_change) under / dev / socket / , if an application has a property that needs to be monitored, it needs to first connect to the file descriptor, that is, establish a connection with the application through the first socket.
[0030] In a possible embodiment, the first socket is added to epoll, and a connection request from any application end is received through the first socket; the connection request is initiated by any application end through a newly created third socket; and a second socket is created for communicating with any application end.
[0031] In the specific implementation process, after creating the first socket, the server first adds the first socket to epoll, then joins the event monitoring loop of epoll, and waits for the connection of the application. After any application is started, the third socket is first created, and then a connection request is initiated to the first socket (i.e., file descriptor) through the third socket. After the first socket of the server receives the connection request from any application, the second socket is created through the accept function, and the second socket is used to communicate with the any application. Thereafter, the communication between the server and the any application is realized through the second socket and the third socket.
[0032] In the embodiment of the present application, epoll is an I / O event notification mechanism provided by the Linux kernel for efficiently managing a large number of file descriptors (such as network connections, files, etc.). epoll uses an event-driven approach and will only notify the application when the state of the file descriptor changes. Multiple file descriptors can be associated with it. For example, if multiple sockets want to receive data, they generally need to wait in multiple threads. Now only one thread is used to wait in epoll. After receiving the data, the epoll event will be triggered, causing it to return, and then the data will be received on the socket, which can have better performance overhead.
[0033] In a possible embodiment, after creating a second socket for communicating with any application end, the method further includes: The second socket is added to epoll, and the attribute group requested to be monitored by any application end is received through the second socket; the attribute group is initiated by any application end through the third socket; the attribute group includes at least one attribute; the at least one attribute and the second socket are written into the hash list.
[0034] In the specific implementation process, after creating the second socket, the server adds the second socket to epoll and waits for any application to send a request to monitor the attribute group. Any application combines at least one attribute that needs to be monitored into an attribute group. If the attribute group includes multiple attributes, the multiple attributes are separated by specific characters (such as ";"), and then the attribute group is sent to the second socket of the server through the third socket. The second socket of the server receives the attribute group. If the attribute group includes multiple attributes, the attribute group is split into multiple separate attributes, and each attribute that needs to be monitored is associated with the second socket and written into a hash list.
[0035] In a possible embodiment, after writing the at least one attribute and the second socket association into the hash list, the method further includes: A property monitoring success flag is sent to a third socket of any application end through the second socket; the property monitoring success flag is used to indicate that at least one property has been successfully monitored.
[0036] In an embodiment of the present application, the server sends a property monitoring success flag to any application end. When any application end receives the property monitoring success flag, it confirms that the property monitoring has been successfully set, which can avoid repeatedly sending the property group requested for monitoring without clear feedback, resulting in repeated operations or waste of resources.
[0037] In a possible embodiment, if the attribute monitoring setting fails, the server may also send an attribute monitoring failure flag to the application, and the application knows that the request is unsuccessful and can take appropriate remedial measures (such as retrying or adjusting the attributes of the requested monitoring). The server may also record the relevant information of the attribute monitoring setting failure in the log to facilitate subsequent investigation and analysis, thereby optimizing the IPTV system.
[0038] In a possible embodiment, after sending a property monitoring success flag to any application end, the method further includes: If an error message is received through the second socket, the second socket is removed from the hash list and the second socket is closed; wherein the error message is used to instruct any application end to disconnect.
[0039] In the specific implementation process, after the server sends a successful attribute monitoring flag to any application, it will continue to add the second socket to the event monitoring loop and wait for the application request. When the application is suddenly disconnected or exits abnormally, the second socket will receive an error message, and the server will process the error message. If the attribute associated with the second socket has no association with other sockets in the hash list, it means that only the application is monitoring the attribute, and the second socket and the attribute associated with the second socket can be removed from the hash list. If the attribute associated with the second socket has an association with other sockets in the hash list, it means that other applications are also monitoring the attribute, and only the second socket is removed from the hash list. Finally, close the second socket to complete resource recovery.
[0040] In the embodiment of the present application, when the application needs to monitor the attribute, it sends the attribute to be monitored to the server, and when the application does not need to monitor the attribute, it can disconnect from the server, which is convenient to operate and highly efficient. When the application is disconnected or an abnormality occurs, the server can respond in time and perform cleanup operations to avoid continuous resource occupation.
[0041] S203: When the init process receives the attribute change request of the target attribute, the attribute value of the target attribute in the IPTV system is modified, and it is checked whether the target attribute exists in the pre-stored hash list.
[0042] In the specific implementation process, when the target attribute in the IPTV system changes, the init process will receive an attribute change request, wherein the attribute change request includes the name of the target attribute and the changed attribute value. The name of the target attribute refers to the name of the attribute that is changing, identifying a specific configuration item or setting in the IPTV system. The changed attribute value refers to the newly set attribute value, indicating the new state or new value of the target attribute. The server can modify the attribute value of the target attribute in the IPTV system to the changed attribute value according to the name of the target attribute. A plurality of attributes and the socket associated with each attribute are pre-stored in the hash list. The server can query whether there is a target attribute in the hash list to determine whether there is an application in the IPTV system that is listening to the target attribute.
[0043] S204: If so, notify the target application end of the change in the target attribute through the target socket associated with the target attribute.
[0044] In the specific implementation process, if the target attribute exists in the hash list, it means that an application in the IPTV system is monitoring the target attribute. Then, the target socket associated with the target attribute is determined from the hash list, and the information about the change of the target attribute is sent to the target application (i.e., the application corresponding to the target socket) through the target socket.
[0045] It should be noted that there may be multiple applications listening to the target attribute at the same time, so there may be multiple target sockets associated with the target attribute in the hash list. The information about the change of the target attribute can be sent to the target application corresponding to each target socket through each target socket.
[0046] There are two specific implementations, which are introduced below respectively.
[0047] The first method is to send the name of the target attribute and the changed attribute value to the target application through the target socket associated with the target attribute.
[0048] During the specific implementation process, when the target attribute changes, the server will push a message containing the name of the target attribute and the changed attribute value to the target application. After receiving the message, the target application does not need to query the changed attribute value again, and can directly perform subsequent business processing based on the changed attribute value of the target attribute, which can improve the processing efficiency of the application.
[0049] The second method is to send the name of the target attribute to the target application end through the target socket associated with the target attribute, so that the target application end calls the specified interface and reads the changed attribute value of the target attribute from the IPTV system according to the name of the target attribute.
[0050] In the specific implementation process, when the target attribute changes, the server only notifies the name of the target attribute. After receiving the name of the target attribute, the target application can call the specified interface at a specific time to query the latest value of the target attribute according to its own needs. The IPTV system returns the changed attribute value (i.e., the latest value) of the target attribute by calling the specified interface, and the application performs subsequent business processing based on the changed attribute value of the target attribute.
[0051] In the embodiment of the present application, the server only notifies the name of the target attribute, which can reduce the amount of data transmitted over the network. If the application does not need to know the change of the attribute value in real time, but only needs to obtain the changed attribute value of the target attribute at a specific time, the second method will be more flexible. And only the message of the attribute change is notified to the application. If the application does not have access rights, it still cannot obtain the attribute value corresponding to the target attribute, which ensures the security of the IPTV system.
[0052] In a possible embodiment, after executing S203, if the target attribute does not exist in the hash list, it means that no application terminal in the IPTV system is monitoring the target attribute, and the process ends.
[0053] Please refer to Figure 3 , which is a schematic diagram of the server initialization process provided in an embodiment of the present application.
[0054] S301. Create a socket corresponding to the file descriptor.
[0055] After the system property service is initialized, a first socket for property change monitoring is added. The socket uses a unix socket and creates a file descriptor property_change under / dev / socket / . The created socket name is server. The file descriptor is created and controlled by the init process.
[0056] S302, add the socket to the event loop and wait for receiving messages.
[0057] Add the socket to the event monitoring loop and wait for the application to connect.
[0058] S303. Establish socket s through accept.
[0059] When an application connects, the server establishes a second socket (socket s) through accept, and adds the second socket s to epoll, waiting for the application to send a request.
[0060] S304: Receive the attribute group to be monitored from s.
[0061] S305: Add the attribute group and s to the hash list.
[0062] S306, add s to the event loop.
[0063] The server continues to add s to the event monitoring loop and waits for the application request to avoid sudden disconnection or abnormal exit of the application. When these situations occur, s will receive an error message.
[0064] S307: Determine whether the application end is disconnected.
[0065] If s does not receive the error message, it is determined that the application end is not disconnected, and the message from other application ends is continued to be received, and S303 is executed. If s receives the error message, it is determined that the application end is disconnected, and S308 is executed.
[0066] S308. Remove the attribute containing s from the hash list and close s.
[0067] After the application closes s, it returns an error message to the server, which processes the error message, removes the attribute of the socket s from the list, and closes s, completing resource recycling. After the server executes S308, it can continue to execute S303.
[0068] Please refer to Figure 4 , which is a flow chart of the server notifying attribute changes provided in an embodiment of the present application.
[0069] S401: Receive an attribute change request.
[0070] When the system has a target property that changes, the init process will receive a property change request. This part is a native function of the system.
[0071] S402: Query the hash list for the name of the currently changed attribute.
[0072] The newly added function of the embodiment of the present application is triggered in the attribute change request to query whether the target attribute exists in the hash list h.
[0073] S403: Determine whether the attribute name exists in the hash list.
[0074] If it exists, execute S404; if it does not exist, continue to execute S401.
[0075] S404: Send a message of attribute change to all corresponding s in the hash list.
[0076] Get all s corresponding to the attribute name of the target attribute, and send the name of the target attribute to the corresponding target application through each s.
[0077] Please refer to Figure 5, which is a flow chart of the application side provided in an embodiment of the present application.
[0078] S501. Create socket s1.
[0079] After the application is started, it creates a third socket (socket s1).
[0080] S502, s1 connect to the server.
[0081] The application connects to the file descriptor property_change established under / dev / socket / through the third socket (socket s1).
[0082] S503: Merge the attributes to be monitored into an attribute group.
[0083] The application combines multiple attributes that need to be monitored into an attribute group.
[0084] S504: Send the attribute group through s1.
[0085] The application sends the attribute group to the server through the third socket (socket s1). After the server completes receiving it, it returns the attribute monitoring success flag to the application.
[0086] S505, adding s1 to the event waiting loop.
[0087] The application adds the third socket (socket s1) to the event waiting loop, waiting for notification of attribute changes.
[0088] S506: Receive attribute change notification.
[0089] The application receives the name of the target attribute of the attribute change and calls the specified interface to read the current attribute value of the target attribute.
[0090] S507: Business logic processing.
[0091] In summary, the embodiment of the present application provides an attribute notification method for an IPTV system. After the system attribute change is completed, other application terminals are selectively notified to avoid the application terminal from polling the attribute. When the attribute needs to be monitored, the application terminal sends the attribute to be monitored to the server terminal, and closes it when it is not needed, which is highly efficient. Notification is only given based on message changes. If the application terminal does not have access rights, it still cannot obtain the corresponding attribute value, thereby ensuring the security of the IPTV system.
[0092] In addition, Android has strict security control in the usage scenario. The highest permission of the application app is generally system. Some functions that require root permission cannot be completed by the app, so it needs to be run after being encoded as a binary executable program in native C. The existing technology can usually only notify APK applications, but cannot notify native binary programs. In the embodiment of the present application, a file descriptor is established under / dev / socket / through the init process. Both C and Java can connect to the file descriptor. Therefore, it can not only notify APK applications, but also notify native binary programs developed in C language, which has universal consistency.
[0093] For example, in the IPTV system, there is a running binary program that can implement the network packet capture function by monitoring the changes in attributes. This function must be implemented in the native C binary program. Due to the Android security mechanism, Android applications can only implement system permission functions at most, and cannot implement functions that require root permissions. Therefore, some programs that require root permissions can be written into a native binary program, and different functions can be switched in this process through configured attributes.
[0094] Based on the same inventive concept, Figure 6 As shown, the embodiment of the present application also provides an attribute notification device of an IPTV system, which is arranged in a server of the IPTV system, and the IPTV system also includes multiple application terminals; the device includes: The creation module is used to create a file descriptor under / dev / socket / through the init process to create the first socket; The connection module is used to establish a connection with multiple application terminals through the first socket; the multiple application terminals include APK applications and native binary programs; The modification module is used to modify the attribute value of the target attribute in the IPTV system when the init process receives an attribute change request of the target attribute, and query whether the target attribute exists in a pre-stored hash list; wherein the hash list includes multiple attributes and a socket associated with each attribute; The notification module is used to notify the target application end of the change of the target attribute through the target socket associated with the target attribute if the target attribute exists in the hash list.
[0095] It should be noted that each module in the attribute notification device of the IPTV system in this embodiment corresponds one-to-one to each step in the attribute notification method of the IPTV system in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the attribute notification method of the aforementioned IPTV system, which will not be repeated here.
[0096] In addition, in one embodiment, the present application also provides a computer device, which is equivalent to the set-top box discussed above, and the computer device includes a processor, a memory, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the attribute notification method of the aforementioned IPTV system.
[0097] In addition, in one embodiment, the present application further provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the attribute notification method of the IPTV system described above is implemented.
[0098] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0099] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0100] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0101] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0102] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0103] The serial numbers of the embodiments of the present application are for description only and do not indicate the advantages or disadvantages of the embodiments.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a disk, or an optical disk), and includes a number of instructions for a multimedia terminal device to execute the methods described in each embodiment of the present application.
[0105] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A property notification method for an IPTV system, characterized in that: Applied in a server of an IPTV system, the IPTV system further comprising a plurality of application terminals; the method comprising: The init process creates a file descriptor under / dev / socket / to create the first socket; Establishing connections with the multiple application terminals through the first socket; the multiple application terminals include APK applications and native binary programs; When the init process receives an attribute change request of a target attribute, the attribute value of the target attribute in the IPTV system is modified, and a pre-stored hash list is queried to determine whether the target attribute exists; wherein the hash list includes a plurality of attributes and a socket associated with each attribute; If the target attribute exists in the hash list, the target application is notified of the change of the target attribute through the target socket associated with the target attribute.
2. The attribute notification method of the IPTV system according to claim 1, characterized in that: The step of establishing connections with multiple application terminals through the first socket includes: Add the first socket to epoll, and receive a connection request from any application end through the first socket; the connection request is initiated by any application end through the newly created third socket; A second socket is created for communicating with any one of the application ends.
3. The attribute notification method of the IPTV system according to claim 2, characterized in that: After creating a second socket for communicating with any one of the application ends, the method further includes: Add the second socket to epoll, and receive the attribute group requested to be monitored by any application end through the second socket; the attribute group is initiated by any application end through the third socket; the attribute group includes at least one attribute; The at least one attribute and the second socket association are written into the hash list.
4. The attribute notification method of the IPTV system according to claim 3, characterized in that: After writing the at least one attribute and the second socket association into the hash list, the method further comprises: A property monitoring success flag is sent to the third socket of any application end through the second socket; the property monitoring success flag is used to indicate that the at least one property has been successfully monitored.
5. The attribute notification method of the IPTV system according to claim 4, characterized in that: After sending the attribute monitoring success flag to any application end, the method further includes: If an error message is received through the second socket, the second socket is removed from the hash list and the second socket is closed; the error message is used to instruct any application end to disconnect.
6. The attribute notification method of the IPTV system according to claim 1, characterized in that: The attribute change request includes the name of the target attribute and the changed attribute value; The step of notifying the target application end of the change of the target attribute through the target socket associated with the target attribute comprises: The name of the target attribute and the changed attribute value are sent to the target application end through the target socket associated with the target attribute.
7. The attribute notification method of the IPTV system according to claim 1, characterized in that: The change request also includes the name of the target attribute and the changed attribute value; the step of notifying the target application end of the change of the target attribute through the target socket associated with the target attribute includes: The name of the target attribute is sent to the target application end through the target socket associated with the target attribute, so that the target application end calls a specified interface and reads the changed attribute value from the IPTV system according to the name of the target attribute.
8. An attribute notification device for an IPTV system, characterized in that: The device is arranged in a server of an IPTV system, wherein the IPTV system further comprises a plurality of application terminals; the device comprises: Create a module for creating a file descriptor under / dev / socket / through the init process to create the first socket; A connection module, configured to establish a connection with the multiple application terminals through the first socket; the multiple application terminals include APK applications and native binary programs; A modification module, configured to modify the attribute value of the target attribute in the IPTV system when the init process receives an attribute change request of the target attribute, and query whether the target attribute exists in a pre-stored hash list; wherein the hash list includes a plurality of attributes and a socket associated with each attribute; The notification module is used to notify the target application end of the change of the target attribute through the target socket associated with the target attribute if the target attribute exists in the hash list.
9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the attribute notification method of the IPTV system according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the attribute notification method of the IPTV system according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method, system and device for data transmission
CN101272402A
Method and device for informing system attribute updating
CN106055348A
Attribute information processing method and device
CN106850307A
System attribute monitoring method, terminal device and computer-readable storage medium
CN108052401A
Method and system for acquiring set top box data
CN110113343A