Television message display method and device, storage medium, and electronic device
By obtaining and updating the location attributes of the UI data source, the grouping, collapsing, and expanding of TV messages are realized, solving the problem of TV messages being scattered and inconvenient to delete in list display and improving the utilization of UI resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN COOCAA NETWORK TECH CO LTD
- Filing Date
- 2022-08-31
- Publication Date
- 2026-04-17
AI Technical Summary
TV messages cannot be grouped, collapsed, or expanded when displayed in a list, making it difficult to find and delete messages, and preventing deletion by group.
By obtaining the UI data source, configuring the target message set corresponding to the target category message according to the user's instructions, and updating the position attribute through UI callback, the message grouping, collapsing, and expanding can be achieved.
The system enables grouped display of TV messages, allowing users to focus on viewing messages of interest and collapse or delete uninteresting categories with a single command, thus improving UI resource utilization.
Smart Images

Figure CN115643443B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method and apparatus for displaying television messages, a storage medium, and an electronic device. Background Technology
[0002] In related technologies, television, as a user terminal, can receive and display messages. However, television messages in these technologies are displayed as a list on a single page, lacking grouping, collapsing, and expanding functions. This has at least the following drawbacks: the inability to group messages leads to scattered messages when there are many, making searching and locating them inconvenient; deletion is also inconvenient, as only one message or all messages can be deleted at a time, and group deletion is not possible.
[0003] There are currently no effective solutions to the aforementioned problems in the relevant technologies. Summary of the Invention
[0004] This invention provides a method and apparatus for displaying television messages, a storage medium, and an electronic device.
[0005] According to one aspect of the present invention, a method for displaying television messages is provided, comprising: acquiring a UI data source, wherein the UI data source contains a plurality of category messages, each category message corresponding to a category message set; configuring a target message set corresponding to a target category message according to a user instruction, wherein the user instruction is used to instruct the expansion or collapse of the target message set, the target message set including the target category message and non-category messages belonging to the same category as the target category message; performing a UI callback on the UI data source, and updating the position attribute of the target message set to update the display state of the target message set on the display interface.
[0006] Optionally, obtaining the UI data source includes: receiving a first TV message to be displayed; parsing the first message category to which the first TV message belongs; finding historical category messages that match the first message category; and updating the historical category messages of the first message category using the first TV message.
[0007] Optionally, updating the historical category message of the first message category using the first television message includes: reading a historical message set from a specified attribute field of the historical category message; obtaining the historical category message and the historical message set; and writing the historical category message and the historical message set into the specified attribute field of the first television message in the order of receipt.
[0008] Optionally, configuring the target message set corresponding to the target category message according to the user instruction includes: if the user instruction is an expand instruction, locating the first focus position of the expand instruction; determining the category message where the first focus position is located as the target category message; adding the target category message to the expand set, configuring the state attribute of each message object in the target message set as an expand attribute value, wherein the expand set is a set that stores category messages whose state attribute is an expand attribute value; inserting non-category messages in the target message set, excluding the target category message, into the UI data source at the next position after the target category message.
[0009] Optionally, if the user instruction is an expand instruction, a UI callback is performed on the UI data source, and the position attribute of the target message set is updated, including: calling the UI callback component of the operating system, and updating the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; traversing each message object in the UI data source, and for each traversed message object, parsing the message type and status attribute value of the current message object; if the message type of the current message object is a category message and the status attribute value is a collapsed attribute value, updating the first position attribute value of the category message using the position attribute value; if the message type of the current message object is a category message and the status attribute value is an expand attribute value, updating the first position attribute value of each message object in the target message set using the position attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0010] Optionally, configuring a specified message set corresponding to a specified category message according to a user instruction includes: if the user instruction is a collapse instruction, locating the second focus position of the collapse instruction; determining the target category message to be collapsed based on the second focus position; removing the target category message from the expanded set; obtaining the position attribute value of the target category message, determining a message interval based on the position attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; removing all message objects within the message interval from the UI data source, and configuring the attribute value of each message object in the target message set to an initial value.
[0011] Optionally, if the user instruction is an expand instruction, a UI callback is performed on the UI data source, and the position attribute of the target message set is updated, including: calling the UI callback component of the operating system, and updating the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; traversing each message object in the UI data source, and for each traversed message object, parsing the message type and status attribute value of the current message object; if the message type of the current message object is a category message and the status attribute value is an expand attribute value, updating the first position attribute value of the category message using the position attribute value; if the message type of the current message object is a category message and the status attribute value is a collapse attribute value, updating the first position attribute value of each message object in the target message set using the position attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0012] According to another aspect of the present invention, a television message display device is provided, comprising: an acquisition module, configured to acquire a UI data source, wherein the UI data source contains a plurality of category messages, each category message corresponding to a category message set; a configuration module, configured to configure a target message set corresponding to a target category message according to a user instruction, wherein the user instruction is used to instruct the expansion or collapse of the target message set, the target message set including the target category message and non-category messages belonging to the same category as the target category message; and an update module, configured to perform a UI callback on the UI data source and update the position attribute of the target message set to update the display state of the target message set on the display interface.
[0013] Optionally, the acquisition module includes: a receiving unit for receiving a first television message to be displayed; a parsing unit for parsing a first message category to which the first television message belongs; a searching unit for searching for historical category messages that match the first message category; and an updating unit for updating the historical category messages of the first message category using the first television message.
[0014] Optionally, the update unit includes: a reading subunit, configured to read a set of historical messages from a specified attribute field of the historical category messages; an acquisition subunit, configured to acquire the historical category messages and the set of historical messages; and a writing subunit, configured to write the historical category messages and the set of historical messages into the specified attribute field of the first television message in the order of receipt.
[0015] Optionally, the configuration module includes: a first positioning unit, configured to locate a first focus position of the expand instruction if the user instruction is an expand instruction; a first determining unit, configured to determine the category message where the first focus position is located as the target category message; a first configuration unit, configured to add the target category message to the expand set and configure the state attribute of each message object in the target message set as an expand attribute value, wherein the expand set is a set storing category messages whose state attribute is an expand attribute value; and an insertion unit, configured to insert non-category messages other than the target category message in the target message set into the UI data source at the next position after the target category message.
[0016] Optionally, if the user instruction is an expand instruction, the update module includes: a first update unit, configured to call the UI callback component of the operating system and update the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; a parsing unit, configured to traverse each message object in the UI data source and parse the message type and status attribute value of the current message object for each traversed message object; a second update unit, configured to update the first position attribute value of the category message using the position attribute value if the message type of the current message object is a category message and the status attribute value is a collapsed attribute value; and to update the first position attribute value of each message object in the target message set using the position attribute value if the message type of the current message object is a category message and the status attribute value is an expand attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0017] Optionally, the configuration module includes: a second positioning unit, configured to locate a second focus position of the folding instruction if the user instruction is a folding instruction; a second determining unit, configured to determine a target category message to be folded based on the second focus position; a removal unit, configured to remove the target category message from the expanded set; a third determining unit, configured to obtain the position attribute value of the target category message and determine a message interval based on the position attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; and a second configuration unit, configured to remove all message objects within the message interval from the UI data source and configure the attribute value of each message object in the target message set to an initial value.
[0018] Optionally, if the user instruction is an expand instruction, the update module includes: a first update unit, configured to call the UI callback component of the operating system and update the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; a parsing unit, configured to traverse each message object in the UI data source and parse the message type and status attribute value of the current message object for each traversed message object; a third update unit, configured to update the first position attribute value of the category message using the position attribute value if the message type of the current message object is a category message and the status attribute value is an expand attribute value; and to update the first position attribute value of each message object in the target message set using the position attribute value if the message type of the current message object is a category message and the status attribute value is a collapse attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0019] According to another aspect of the present invention, a storage medium is also provided, the storage medium including a stored program that executes the above-described steps when the program is run.
[0020] According to another aspect of the present invention, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the programs stored in the memory.
[0021] This invention also provides a computer program product containing instructions that, when run on a computer, causes the computer to perform the steps in the above-described method.
[0022] This invention obtains a UI data source containing several category messages, each category message corresponding to a category's message set. A target message set corresponding to a target category message is configured according to user instructions. These user instructions instruct the expansion or collapse of the target message set. The target message set includes target category messages and non-category messages belonging to the same category as the category messages. A UI callback is performed on the UI data source, and the position attribute of the target message set is updated to update its display status on the display interface. By configuring the target message set corresponding to the target category message and updating its position attribute, messages can be displayed in groups and collapsed, showing each group's category messages to the user. Messages of the same category can be expanded, allowing users to focus on viewing messages of their interests. Uninteresting categories can be collapsed or deleted with a single user instruction. This solves the technical problem of related technologies that waste UI resources by displaying all messages in a list, realizing the expansion and collapse of television messages and improving the utilization rate of television UI resources. Attached Figure Description
[0023] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0024] Figure 1 This is a hardware structure block diagram of a television set according to an embodiment of the present invention;
[0025] Figure 2 This is a flowchart of a method for displaying television messages according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the message data structure in an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the UI data source storing messages according to an embodiment of the present invention;
[0028] Figure 5 This is a flowchart illustrating the message display process of this invention;
[0029] Figure 6 This is a structural block diagram of a television message display device according to an embodiment of the present invention;
[0030] Figure 7 This is a structural block diagram of an electronic device that implements an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0033] Example 1
[0034] The method embodiment provided in Embodiment 1 of this invention can be executed in a television set, mobile phone, computer, or similar computing device. Taking its operation on a television set as an example, Figure 1 This is a hardware structure block diagram of a television set according to an embodiment of the present invention. Figure 1 As shown, a television set may include one or more ( Figure 1 Only one is shown in the image. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the television set may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the television set described above. For example, the television set may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0035] The memory 104 can be used to store television programs, such as application software programs and modules, like the television program corresponding to a television message display method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the television program stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the television via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the television's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0037] This embodiment provides a method for displaying television messages. Figure 2 This is a flowchart of a method for displaying television messages according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0038] Step S202: Obtain the UI data source, wherein the UI data source contains several category messages, and each category message corresponds to a category of message set;
[0039] The solution in this embodiment can be applied to network terminals such as televisions, mobile phones, and computers. A television will be used as an example for illustration. The UI data source in this embodiment provides an ordered collection of data for the UI display.
[0040] In this embodiment, the category message is the representative message of the message set corresponding to the category. By customizing the category message, such as selecting the most recently received message in a certain category's message set as the category message, it represents the latest message in a certain group. Messages in this embodiment can be categorized according to business type, priority, associated resources, etc. Each category's message set includes one category node and several non-category nodes. If a category message is deleted, all messages in the message set corresponding to that category message (including both category and non-category messages) will be deleted.
[0041] Step S204: Configure the target message set corresponding to the target category message according to the user instruction. The user instruction is used to instruct the expansion or collapse of the target message set. The target message set includes target category messages and non-category messages that belong to the same category as the target category messages.
[0042] Step S206: Perform a UI callback to the UI data source and update the position attribute of the target message set to update the display status of the target message set on the display interface;
[0043] The location attribute in this embodiment is used to characterize the position of the corresponding message in the UI data source. The initial value can be set to -1. When the current value is the initial value, it means that the message cannot be displayed in the UI data source.
[0044] Through the above steps, a UI data source is obtained, which contains several category messages. Each category message corresponds to a message set for that category. The target message set corresponding to the target category message is configured according to user instructions. These user instructions instruct the expansion or collapse of the target message set. The target message set includes target category messages and non-category messages belonging to the same category as the category messages. A UI callback is performed on the UI data source, and the position attribute of the target message set is updated to update its display status on the screen. By configuring the target message set corresponding to the target category message and updating its position attribute, messages can be displayed in groups and collapsed, showing each group of category messages to the user. Messages of the same category can be expanded, allowing users to focus on viewing messages of their interests. Uninteresting categories can be collapsed or deleted with a single user instruction. This solves the technical problem of wasting UI resources by displaying all messages in a list, enabling the expansion and collapse of TV messages and improving the utilization rate of TV UI resources.
[0045] In one embodiment of this example, obtaining the UI data source includes:
[0046] S11, Receive the first television message to be displayed;
[0047] S12, analyze the first message category to which the first television message belongs;
[0048] S13, search for historical category messages that match the first message category;
[0049] S14, update the historical category messages of the first message category using the first television message.
[0050] In some examples, updating the historical category messages of the first message category using the first TV message includes: reading the historical message set from a specified attribute field of the historical category message; obtaining the historical category messages and the historical message set; and writing the historical category messages and the historical message set into the specified attribute field of the first TV message in the order of receipt.
[0051] Figure 3 This is a schematic diagram of the data structure of a message in an embodiment of the present invention. The message can be a category message (category node) or a non-category message. Taking the latest message in a certain group as an example, this is illustrated here.
[0052] Message: Represents a message object; message-related data is represented by the Data entity.
[0053] data: The message data entity, in which the message information is encapsulated;
[0054] msgs: Represents a collection of messages (which can be sorted in reverse chronological order);
[0055] `is_expand(state attribute)`: Indicates the expanded state of the message. A boolean value represents the data type. `true`: Indicates the message is expanded; `false`: Indicates the message is collapsed. The initial value is `false`.
[0056] position (position property value): Indicates the position of the message in the UI data source, with an initial value of -1;
[0057] `first_position` (first position attribute value): Identifies the position of the category node within the UI data source, with an initial value of -1. For category nodes, this attribute value is equal to `position`; for other messages besides category nodes, `first_position` is equal to the `position` of that category node, used to find the category node belonging to its group.
[0058] In other examples of this embodiment, other message data structures may also be used, such as removing the msgs collection and using a global Map to index and store the remaining messages of the category node, such as non-category messages.
[0059] Figure 4 This is a schematic diagram of the UI data source storing messages in an embodiment of the present invention. The UI data source is abstracted as a multi-branch tree with a depth of 3. To vividly represent the concept of a list, leaf nodes and parent nodes are arranged side by side. The parent node of the leaf node is an elliptical Msg node, and the leaf node is a circular Msg node.
[0060] Multi-way tree 1 represents the state of the tree when the message is not expanded;
[0061] Multi-branch tree 2 represents the state of the tree when the first group of messages is expanded;
[0062] Multi-way tree 3 represents the state of the tree when all groups are expanded;
[0063] Circular root node: The root node of the tree, represented by Message. Its msgs is the UI data source. When not expanded, it contains all grouped category nodes, such as multi-branch tree 1. Each time a group of messages is expanded, the remaining messages in that group will be added to msgs, such as multi-branch tree 2 and multi-branch tree 3.
[0064] Elliptical Msg node: The latest message in a group, called the category node or category message, whose msgs stores the remaining messages in the group (excluding the category node itself);
[0065] Circular Msg node: A message in a group that is not the latest, whose msgs is empty.
[0066] In other examples of this embodiment, a multi-difference tree structure can be omitted, and only a list collection can be used to store category nodes. Elements can be added or deleted directly in the collection to implement the expansion and collapse logic.
[0067] In one embodiment of this example, configuring the target message set corresponding to the target category message according to the user instruction includes: if the user instruction is an expand instruction, locating the first focus position of the expand instruction; determining the category message where the first focus position is located as the target category message; adding the target category message to the expand set, configuring the state attribute of each message object in the target message set as an expand attribute value, wherein the expand set is a set that stores category messages whose state attribute is an expand attribute value; inserting non-category messages other than the target category message in the target message set into the UI data source at the next position after the target category message.
[0068] Based on the above implementation, if the user instruction is an expand instruction, a UI callback is performed on the UI data source, and the position attribute of the target message set is updated, including: calling the UI callback component of the operating system, and updating the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; traversing each message object in the UI data source, and for each traversed message object, parsing the message type and status attribute value of the current message object; if the message type of the current message object is a category message and the status attribute value is a collapse attribute value, updating the first position attribute value of the category message using the position attribute value; if the message type of the current message object is a category message and the status attribute value is an expand attribute value, updating the first position attribute value of each message object in the target message set using the position attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0069] In one embodiment of this example, configuring a specified message set corresponding to a specified category message according to a user instruction includes: if the user instruction is a folding instruction, locating the second focus position of the folding instruction; determining the target category message to be folded based on the second focus position; removing the target category message from the expanded set; obtaining the position attribute value of the target category message, determining the message range based on the position attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; removing all message objects within the message range from the UI data source, and configuring the attribute value of each message object in the target message set to the initial value.
[0070] In one example, determining the target category message to be collapsed based on the second focus position includes: determining whether the second focus position overlaps with the position of any category message; if they overlap, the category message whose second focus position overlaps is determined as the target category message; if they do not overlap, all category messages within the expanded set are determined as the target category messages. This example allows you to choose to collapse a single category of messages or collapse all categories of messages.
[0071] Based on the above implementation, if the user instruction is an expand instruction, a UI callback is performed on the UI data source, and the position attribute of the target message set is updated, including: calling the UI callback component of the operating system, and updating the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; traversing each message object in the UI data source, and for each traversed message object, parsing the message type and status attribute value of the current message object; if the message type of the current message object is a category message and the status attribute value is an expand attribute value, updating the first position attribute value of the category message using the position attribute value; if the message type of the current message object is a category message and the status attribute value is a collapse attribute value, updating the first position attribute value of each message object in the target message set using the position attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0072] Figure 5 This is a flowchart illustrating the message display process of this invention. The flowchart includes the overall process of message data loading, expansion, and collapse. The category nodes are the category messages in the above embodiments. The key descriptions of the flowchart are explained below:
[0073] UI: It is carried by the native Android RecyclerView, which is responsible for the presentation, expansion, collapse, animation and callback of messages;
[0074] UI data source: Represented by the root node msgs, the initial data consists of all grouped category nodes;
[0075] UI callback when UI data source changes: When the UI data source changes, it notifies the UI to refresh and generates a UI event callback to update the position of the Message object whose position has changed, so as to ensure that the position of all Message objects in the UI data source increases sequentially and avoid UI display errors.
[0076] Expand: Insert the message from the category node's msgs into the UI data source, with the insertion point being the value of the category node's position property + 1;
[0077] Folding: Find the category node from the UI data source using first_position, determine the removal interval (position, position + msgs.size) using the position and msgs of the category node, remove the messages in the interval (left open, right closed) from the UI data source, and update the position, first_position, and is_expand of the removed messages to their initial values.
[0078] Category nodes serve as plotting points for expansion or collapse;
[0079] Whether a category node can be expanded depends on whether the number of messages in that category is greater than 1;
[0080] Expanded set: Used to record category nodes in the expanded state (arranged in reverse chronological order). Category nodes are added when expanding and removed when collapsing.
[0081] The process of message unfolding is described in detail here, including:
[0082] Step 1: The user presses the OK button and clicks on a category node;
[0083] Step 2: If the msgs set of the clicked category node is empty, skip to step 10;
[0084] Step 3: Add the clicked category node to the expanded collection;
[0085] Step 4: Set the is_extend property value of the clicked category node itself and the Message object in its msgs to true;
[0086] Step 5: Insert all Message objects from the msgs collection of the clicked category node into the UI data source. The insertion point is the position attribute value of the category node + 1.
[0087] Step 6: Notify the UI to update;
[0088] Step 7: In the UI callback, update the position property value of the Message object (all message objects after the currently expanding category node). If the Message is a category node (including the currently expanding one and the category nodes that expand after it, because the UI data source starts from the position of the currently expanded node and the positions of subsequent category nodes have changed), then update its first_position property value. In addition, if its is_extend property value is true, then set the first_position property value of itself and all Message objects in the msgs property to the value of the currently updated position property of the category node.
[0089] Step 8: Execute the unfold animation;
[0090] Step 9: After the animation is complete, users can use the down arrow key to view the expanded message;
[0091] Step 10: Process ends.
[0092] The message folding process is described in detail here, and the flow includes:
[0093] Step 1: The user presses the back button and clicks on a message;
[0094] Step 2: If the current focus is on the expanded message (the is_expand property of the Message object is true), proceed to the next step; otherwise, proceed to step 10.
[0095] Step 3: Find the category node of the group based on the first_position attribute value of the currently clicked message object;
[0096] Step 4: Remove the message category from the expanded collection;
[0097] Step 5: Based on the position and msgs of the node of this category, determine the interval (position, position + msgs.size], remove the messages in the interval (left open, right closed) from the UI data source, and update the position, first_position, and is_expand of itself and the Message in msgs to the initial values (-1, -1, false).
[0098] Step 6: Notify the UI to update;
[0099] Step 7: In the UI callback, update the position property value of the Message object (all message objects after the currently collapsed category node). If the Message is a category node (including expanded category nodes after the currently collapsed category node, because the UI data source starts from the position of the currently collapsed node, and the positions of subsequent category nodes have changed), then update its first_position property value. In addition, if its is_extend property value is true, then update the first_position property value of all Messages in its msgs property to the currently updated position property value of the category node.
[0100] Step 8: Execute the folding animation;
[0101] Step 9: After the animation is complete, the remaining messages in this category disappear from the UI, the UI scrolls to the category node, and the focus falls on the category node, then jumps to step 15;
[0102] Step 10: Iterate through the expanded collection in reverse order, and remove messages from the UI data source in turn from each category within the range of (position, position + msgs.size). At the same time, update the position, first_position, and is_expand of the category node itself and the Message in its msgs to the initial values (-1, -1, false).
[0103] Step 11: Clear the expanded set;
[0104] Step 12: Notify the UI to refresh;
[0105] Step 13: In the UI callback, update the position and first_position property values of the Message object. At this time, the is_extend property value of all category nodes is false, and the Message in msgs has been updated in step 10. The Message in msgs will not be updated again in this step.
[0106] Step 14: Scroll the UI to the top and focus on the first and first category node;
[0107] Step 15: Process ends.
[0108] Using the method described in this embodiment, messages can be displayed in groups and collapsed, showing the latest messages in each group to the user; messages of the same category can be expanded, allowing users to view messages of categories they are interested in in one go; users can delete categories they are not interested in with a single delete operation.
[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0110] Example 2
[0111] This embodiment also provides a television message display device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0112] Figure 6 This is a structural block diagram of a television message display device according to an embodiment of the present invention, such as... Figure 6 As shown, the device includes: an acquisition module 60, a configuration module 62, and an update module 64, wherein,
[0113] The acquisition module 60 is used to acquire a UI data source, wherein the UI data source contains several category messages, and each category message corresponds to a category of message set;
[0114] Configuration module 62 is configured to configure a target message set corresponding to a target category message according to a user instruction, wherein the user instruction is used to instruct the target message set to be expanded or collapsed, and the target message set includes the target category message and non-category messages belonging to the same category as the target category message;
[0115] The update module 64 is used to perform UI callbacks to the UI data source and update the position attributes of the target message set in order to update the display status of the target message set on the display interface.
[0116] Optionally, the acquisition module includes: a receiving unit for receiving a first television message to be displayed; a parsing unit for parsing a first message category to which the first television message belongs; a searching unit for searching for historical category messages that match the first message category; and an updating unit for updating the historical category messages of the first message category using the first television message.
[0117] Optionally, the update unit includes: a reading subunit, configured to read a set of historical messages from a specified attribute field of the historical category messages; an acquisition subunit, configured to acquire the historical category messages and the set of historical messages; and a writing subunit, configured to write the historical category messages and the set of historical messages into the specified attribute field of the first television message in the order of receipt.
[0118] Optionally, the configuration module includes: a first positioning unit, configured to locate a first focus position of the expand instruction if the user instruction is an expand instruction; a first determining unit, configured to determine the category message where the first focus position is located as the target category message; a first configuration unit, configured to add the target category message to the expand set and configure the state attribute of each message object in the target message set as an expand attribute value, wherein the expand set is a set storing category messages whose state attribute is an expand attribute value; and an insertion unit, configured to insert non-category messages other than the target category message in the target message set into the UI data source at the next position after the target category message.
[0119] Optionally, if the user instruction is an expand instruction, the update module includes: a first update unit, configured to call the UI callback component of the operating system and update the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; a parsing unit, configured to traverse each message object in the UI data source and parse the message type and status attribute value of the current message object for each traversed message object; a second update unit, configured to update the first position attribute value of the category message using the position attribute value if the message type of the current message object is a category message and the status attribute value is a collapsed attribute value; and to update the first position attribute value of each message object in the target message set using the position attribute value if the message type of the current message object is a category message and the status attribute value is an expand attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0120] Optionally, the configuration module includes: a second positioning unit, configured to locate a second focus position of the folding instruction if the user instruction is a folding instruction; a second determining unit, configured to determine a target category message to be folded based on the second focus position; a removal unit, configured to remove the target category message from the expanded set; a third determining unit, configured to obtain the position attribute value of the target category message and determine a message interval based on the position attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; and a second configuration unit, configured to remove all message objects within the message interval from the UI data source and configure the attribute value of each message object in the target message set to an initial value.
[0121] Optionally, if the user instruction is an expand instruction, the update module includes: a first update unit, configured to call the UI callback component of the operating system and update the position attribute value of each message object in the target message set through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; a parsing unit, configured to traverse each message object in the UI data source and parse the message type and status attribute value of the current message object for each traversed message object; a third update unit, configured to update the first position attribute value of the category message using the position attribute value if the message type of the current message object is a category message and the status attribute value is an expand attribute value; and to update the first position attribute value of each message object in the target message set using the position attribute value if the message type of the current message object is a category message and the status attribute value is a collapse attribute value, wherein the first position attribute value is used to characterize the position of the category message of the corresponding message object in the UI data source.
[0122] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0123] Example 3
[0124] This application also provides an electronic device. Figure 7 This is a structural diagram of an electronic device according to an embodiment of the present invention, such as... Figure 7As shown, the system includes a processor 71, a communication interface 72, a memory 73, and a communication bus 74. The processor 71, communication interface 72, and memory 73 communicate with each other via the communication bus 74. The memory 73 stores computer programs. When the processor 71 executes the program stored in the memory 73, it performs the following steps: obtaining a UI data source, wherein the UI data source contains several category messages, each category message corresponding to a category message set; configuring a target message set corresponding to a target category message according to user instructions, wherein the user instructions are used to instruct the expansion or collapse of the target message set, the target message set including the target category message and non-category messages belonging to the same category as the target category message; performing a UI callback on the UI data source and updating the position attribute of the target message set to update the display state of the target message set on the display interface.
[0125] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0126] The communication interface is used for communication between the aforementioned terminal and other devices.
[0127] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0128] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0129] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the television message display methods described in the above embodiments.
[0130] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the television message display methods described in the above embodiments.
[0131] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0132] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
[0133] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method of presenting television messages, characterized by, include: Obtain a UI data source, wherein the UI data source contains several category messages, each category message corresponds to a message set of a category, and the category message is the representative message of the message set of the corresponding category; Configure a target message set corresponding to a target category message according to user instructions, wherein the user instructions are used to instruct the target message set to be expanded or collapsed, and the target message set includes the target category message and non-category messages belonging to the same category as the target category message; A UI callback is performed on the UI data source, and the position attribute of the target message set is updated to update the display status of the target message set on the display interface; The set of target messages corresponding to the target category messages configured according to user instructions includes: If the user command is an expand command, locate the first focus position of the expand command; The category message where the first focus position is located is determined as the target category message; The target category message is added to the expanded set, and the status attribute of each message object in the target message set is configured as the expanded attribute value. The expanded set is a set that stores category messages whose status attribute is the expanded attribute value. Insert non-category messages (excluding the target category messages) from the target message set into the UI data source at the position following the target category message; If the user instruction is an expand instruction, the step of performing a UI callback on the UI data source and updating the position attribute of the target message set includes: The UI callback component of the operating system is invoked, and the position attribute value of each message object in the target message set is updated through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; Iterate through each message object in the UI data source, and for each message object, parse the message type and status attribute value of the current message object; If the message type of the current message object is a category message and the status attribute value is a collapsed attribute value, the first position attribute value of the category message is updated using the position attribute value; if the message type of the current message object is a category message and the status attribute value is an expanded attribute value, the first position attribute value of each message object in the target message set is updated using the position attribute value, wherein the first position attribute value is used to represent the position of the category message of the corresponding message object in the UI data source; The specified message set corresponding to the specified category of messages configured according to user instructions includes: If the user instruction is a folding instruction, locate the second focus position of the folding instruction; The target category message to be folded is determined based on the second focus position; Remove the target category message from the expanded set; Obtain the location attribute value of the target category message, and determine the message range based on the location attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; Remove all message objects within the message range from the UI data source, and configure the attribute values of each message object in the target message set to their initial values.
2. The method according to claim 1, characterized in that, Obtaining UI data sources includes: Receive the first television message to be displayed; Analyze the first message category to which the first television message belongs; Find historical category messages that match the first message category; The first television message is used to update the historical category message of the first message category.
3. The method according to claim 2, characterized in that, Updating the historical category messages of the first message category using the first television message includes: Read the set of historical messages from the specified attribute fields of the historical category messages; Obtain the historical category messages and the historical message set; The historical category messages and the historical message set are written into the specified attribute field of the first television message in the order of receipt.
4. A device for displaying television messages, characterized in that, include: The acquisition module is used to acquire the UI data source, wherein the UI data source contains several category messages, each category message corresponds to a message set of a category, and the category message is the representative message of the message set of the corresponding category; A configuration module is used to configure a target message set corresponding to a target category message according to a user instruction, wherein the user instruction is used to instruct the target message set to be expanded or collapsed, and the target message set includes the target category message and non-category messages belonging to the same category as the target category message; The update module is used to perform UI callbacks to the UI data source and update the position attributes of the target message set in order to update the display status of the target message set on the display interface. The set of target messages corresponding to the target category messages configured according to user instructions includes: If the user command is an expand command, locate the first focus position of the expand command; The category message where the first focus position is located is determined as the target category message; The target category message is added to the expanded set, and the status attribute of each message object in the target message set is configured as the expanded attribute value. The expanded set is a set that stores category messages whose status attribute is the expanded attribute value. Insert non-category messages (excluding the target category messages) from the target message set into the UI data source at the position following the target category message; If the user instruction is an expand instruction, the step of performing a UI callback on the UI data source and updating the position attribute of the target message set includes: The UI callback component of the operating system is invoked, and the position attribute value of each message object in the target message set is updated through the UI callback component, wherein the position attribute value is used to indicate the position of the corresponding message object in the UI data source; Iterate through each message object in the UI data source, and for each message object, parse the message type and status attribute value of the current message object; If the message type of the current message object is a category message and the status attribute value is a collapsed attribute value, the first position attribute value of the category message is updated using the position attribute value; if the message type of the current message object is a category message and the status attribute value is an expanded attribute value, the first position attribute value of each message object in the target message set is updated using the position attribute value, wherein the first position attribute value is used to represent the position of the category message of the corresponding message object in the UI data source; The specified message set corresponding to the specified category of messages configured according to user instructions includes: If the user instruction is a folding instruction, locate the second focus position of the folding instruction; The target category message to be folded is determined based on the second focus position; Remove the target category message from the expanded set; Obtain the location attribute value of the target category message, and determine the message range based on the location attribute value and the message size, wherein the message size is the UI size occupied by non-category messages other than the target category message in the target message set; Remove all message objects within the message range from the UI data source, and configure the attribute values of each message object in the target message set to their initial values.
5. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein the computer program executes the method according to any one of claims 1 to 3 when it is run.
6. An electronic device comprising a processor, a communication interface, a memory, and a communication bus, wherein, The processor, communication interface, and memory communicate with each other via a communication bus; among which: Memory, used to store computer programs; A processor for performing the method of any one of claims 1 to 3 by running a program stored in memory.
Citation Information
Patent Citations
Message processing method, message processing device and electronic equipment
CN111835915A
Message display method and device and electronic equipment
CN112783594A