Service card generation method and related equipment
By receiving user operations and generating service cards in the terminal device, the problem that fixed-style cards cannot meet diverse needs is solved, and flexible card generation and rich content display are achieved.
Patent Information
- Application Number
- CN202410285732.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-12
- Publication Date
- 2025-09-12
AI Technical Summary
In the prior art, terminal devices can only generate service cards of fixed styles, which cannot meet the diverse needs of users.
Generate a service card based on the content selected by the user in the user interface of the application, by receiving user operations, obtaining a view tree and generating a service card according to preset rules, including at least part of the content selected by the user.
It meets the diverse needs of users, enriches card content, and improves the flexibility of card generation and user experience.
Smart Images

Figure CN120631473A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for generating a service card and related equipment. Background Art
[0002] Service cards are a form of user interface display. On terminal devices, important application information or operations can be pre-placed on the service card, allowing users to directly operate the application through the service card, reducing the level of application usage.
[0003] Currently, terminal devices can only generate fixed-style service cards for applications, which cannot meet the diverse needs of users. Summary of the Invention
[0004] The present application provides a method for generating a service card and related devices, which are applied to the field of terminal technology. In an embodiment of the present application, a service card for an application can be generated based on the content selected by the user in the user interface of the application, thereby meeting the diverse needs of users.
[0005] In a first aspect, the present application provides a method for generating a service card, which is applied to a terminal and includes: receiving a first user operation, where the first user operation is used to select a first content in a user interface of a first application; receiving a second user operation, where the second user operation is used to instruct generation of a service card for the first application; and generating the service card based on the first content, where the service card includes at least part of the first content.
[0006] As an example, the method can be executed by a terminal, or by a chip system, hardware circuit and / or software module applied to the terminal, or by other devices that can realize the functions of the terminal, without limitation here.
[0007] As an example, the first application may be an application program or application service installed in the terminal. The application service may be understood as a program form that can provide convenient services to the user after being installed in the background of the terminal's operating system program framework without being explicitly installed on the terminal's desktop.
[0008] As an example, the first content may be part or all of the content displayed in the user interface of the first application. The first content may include: pictures, text content, posts, web pages, or hyperlinks.
[0009] As an example, a terminal may display a user interface of a first application. When a user browses the content in the user interface and wishes to display the first content in the user interface as a service card on the terminal's desktop or service center, the user may input a first user operation to select the first content in the user interface and input a second user operation to instruct the generation of a service card for the first application. This allows the terminal to generate a service card for the first application based on the first content selected by the user. It should be noted that there is no restriction on the order in which the first user operation and the second user operation are input.
[0010] As an example, the first user operation may include long pressing, clicking (such as single clicking, double clicking, or triple clicking), or dragging, etc., which are not limited here.
[0011] As an example, the second user operation may include long pressing or clicking the screen of the terminal, sliding the screen or back cover of the terminal in a specific trajectory, or clicking buttons distributed on both sides of the terminal, etc., which are not limited here.
[0012] In this technical solution, the terminal can generate a service card based on the first content selected by the user, thereby meeting the diverse needs of the user, enriching the content included in the card, and improving the flexibility of generating the card.
[0013] In combination with the first aspect, in certain implementations of the first aspect, generating the service card based on the first content, the service card containing at least part of the first content, includes: obtaining a view tree of the first content; generating the service card based on the view tree, the service card containing at least one element in the view tree, and the at least one element satisfies a first preset rule.
[0014] In this implementation, the terminal may determine the first content selected by the user based on a first user operation, obtain a view tree of the first content, and identify at least one element contained in the view tree. After identifying the at least one element in the view tree, the terminal may filter the at least one element contained in the view tree based on a first preset rule to select a first element contained in a service card, and reorganize the first element to generate a service card. It should be understood that the service card contains at least one element in the view tree.
[0015] It should be noted that the main components of the view tree are views and view groups. Views and view groups are nested layer by layer in a tree structure to form the view tree. In some embodiments, views and view groups in the view tree can be referred to as nodes or components of the view tree, and a component can host one or more elements. Therefore, a service card can contain at least one element in the view tree, which can be understood as a service card containing at least one element hosted by at least one component in the view tree.
[0016] As an example, the elements in the view tree may be at least one of the following: a picture, a data list, text content, a hyperlink, or a video.
[0017] As an example, the first preset rule can be set according to actual needs and is not limited here.
[0018] In combination with the first aspect, in certain implementations of the first aspect, the first preset rule includes at least one of the following: size specifications of the service card, display priority of elements in the service card, layout of elements in the service card, or text content extraction rules when the element is text content.
[0019] As an example, the size of the service card may include at least one of the following: 1*2, 2*2, 2*4, or 4*4. In some embodiments, the size of the service card may also be referred to as the size of the service card, the size of the service card, or the specification of the service card, which is not limited here.
[0020] As an example, the size of the service card can be designed based on the application type, for example, the service card of the browser can be of one size, and the service card of the memo can be of another size.
[0021] As an example, the display priority of elements in a service card may be arranged from high to low as: title, text content. In this example, when the view tree of the first content contains multiple elements, the title and text content are displayed first.
[0022] For example, the layout of elements in a service card can be understood as the card display layout style, or can be understood as the display order or display position of each element in the service card. For example, elements can be displayed from left to right, or from right to left, or from the center to both sides, based on priority, without limitation. For another example, an image can be displayed as the background thumbnail of a service card.
[0023] As an example, when the element is text content, the text content extraction rules may include: intelligent extraction according to the size specifications of the service card and refined description method.
[0024] As an example, the first preset rule may also include elements that are not displayed in the service card, such as video.
[0025] As an example, the terminal can determine the first element based on the size specifications of the service card, the display priority of the elements in the service card, the text content extraction rules when the element is text content, or the elements not displayed in the service card, and reorganize the first element based on the layout of the elements in the service card. Reorganization can be understood as layout or arrangement.
[0026] In combination with the first aspect, in some implementations of the first aspect, the service card further includes a control, and an event click rule of the control satisfies a second preset rule.
[0027] As an example, a service card may also include controls, such as a "Favorite" control, a "Like" control, etc. Controls may also be called buttons.
[0028] As an example, the second preset rule may be: after clicking the control in the service card, the first application is pulled up and the user interface of the first application is jumped to. The designated user interface is the user interface that includes the content displayed in the service card.
[0029] As an example, the second preset rule may be: after clicking a control in the service card, capturing a click event in the control area, and after capturing the click event, communicating with the application through inter-process communication (IPC) to achieve synchronization.
[0030] As an example, the second preset rule can be set according to actual needs and is not specifically limited here.
[0031] As an example, when a service card includes controls, the controls can be displayed with a lower priority than the title and text content.
[0032] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: in response to the first user operation, displaying a first interface, the first interface including a control for indicating the generation of a service card; wherein, receiving the second user operation includes: receiving the second user operation on the first interface.
[0033] As an example, when a terminal receives a first user operation in the user interface of a first application, the terminal may display a first interface in response to the first user operation, where the first interface includes a control for instructing the generation of a service card. At this point, if the user determines to generate a service card for the first application, the terminal may input a second user operation in the first interface to instruct the generation of a service card for the first application. For example, the second user operation may be clicking the control for instructing the generation of a service card.
[0034] As an example, the first interface may be displayed on the user interface of the first application, or the first interface may be jumped from the user interface of the first application, which is not limited here.
[0035] In combination with the first aspect, in certain implementations of the first aspect, after generating the service card based on the first content, the method further includes: displaying a second interface, wherein the second interface includes the service card; receiving a third user operation on the second interface; and displaying the service card on the desktop of the terminal.
[0036] As an example, after generating a service card for the first application, the terminal can display the service card in the second interface and receive a third user operation in the second interface. The third user operation instructs to display the service card on the desktop of the terminal, so that the terminal can display the service card on the desktop.
[0037] In some embodiments, the service card may also be displayed on a service center of the terminal, which may be a negative one screen.
[0038] As an example, the second interface may also be referred to as a preview interface or a card candidate interface, which is not limited here.
[0039] As an example, after generating the service card of the first application, the terminal may display the second interface on the user interface of the first application, or directly jump to the second interface from the user interface of the first application, which is not limited here.
[0040] In a second aspect, the present application provides a device for generating a service card, which includes modules for implementing the method in the first aspect or any one of the implementations thereof, and each module can be implemented in the form of hardware and / or software.
[0041] For example, the device may include a transceiver module and a processing module. The transceiver module is configured to receive a first user operation for selecting first content in a user interface of a first application; the transceiver module is further configured to receive a second user operation for instructing generation of a service card for the first application; and the processing module is configured to generate the service card based on the first content, the service card including at least a portion of the first content.
[0042] In combination with the second aspect, in certain implementations of the second aspect, the processing module is also used to obtain the view tree of the first content; the processing module is also used to generate the service card based on the view tree, and the service card contains at least one element in the view tree, and the at least one element satisfies the first preset rule.
[0043] In combination with the second aspect, in certain implementations of the second aspect, the first preset rule includes at least one of the following: size specifications of the service card, display priority of elements in the service card, layout of elements in the service card, or text content extraction rules when the element is text content.
[0044] In combination with the second aspect, in some implementations of the second aspect, the service card further includes a control, and an event click rule of the control satisfies a second preset rule.
[0045] In conjunction with the second aspect, in certain implementations of the second aspect, the device may further include: a display module configured to display a first interface in response to the first user operation, the first interface including a control for instructing the generation of a service card; and a transceiver module configured to receive the second user operation on the first interface.
[0046] In combination with the second aspect, in certain implementations of the second aspect, the display module is also used to display a second interface, which includes the service card; the transceiver module is also used to receive a third user operation on the second interface; and the display module is also used to display the service card on the desktop of the terminal.
[0047] In some implementations, the modules included in the device may be implemented using software and / or hardware. In this implementation, the device may include a processor and a transceiver. For example, the processing module and the display module may be implemented by the processor executing program code stored in a memory, and the transceiver module may be implemented by a transceiver. Optionally, the device may also include a memory.
[0048] In one possible implementation, the device may be a terminal, or a chip system, hardware circuit and / or software module applied in a terminal.
[0049] In a third aspect, the present application provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device can execute the method described in the first aspect or any possible implementation method thereof.
[0050] In a possible implementation, the electronic device may be a terminal.
[0051] In a fourth aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, the communication interface and the at least one processor being interconnected by a line, the at least one processor being configured to execute a computer program or instruction to perform the method described in any possible implementation of the first aspect. The communication interface in the chip may be an input / output interface, a pin, or a circuit.
[0052] In a fifth aspect, the present application provides a computer-readable storage medium, which stores a computer program or instructions. When the computer program or instructions are executed, the method described in the first aspect or any possible implementation method thereof is implemented.
[0053] In a sixth aspect, the present application provides a computer program product comprising computer program code, wherein when the computer program code is executed on a computer, the computer executes the method as described in the first aspect or any possible implementation thereof. In some embodiments, the computer program code may be instructions.
[0054] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0056] Figure 2 This is an exemplary illustration of a service card;
[0057] Figure 3 A schematic flow chart of a card generation method provided in one embodiment of the present application;
[0058] Figure 4 An exemplary diagram illustrating a view tree provided for one embodiment of the present application;
[0059] Figure 5 An exemplary diagram illustrating the dimensions of a service card provided in one embodiment of the present application;
[0060] Figure 6 A schematic flow chart of a card generation method provided in yet another embodiment of the present application;
[0061] Figure 7 An exemplary diagram illustrating the generation of a service card according to an embodiment of the present application;
[0062] Figure 8An exemplary diagram illustrating a service card provided in accordance with an embodiment of the present application;
[0063] Figure 9 A schematic diagram of a service card framework provided in one embodiment of the present application;
[0064] Figure 10 A schematic flow chart of a card generation method provided in another embodiment of the present application;
[0065] Figure 11 A schematic diagram of the structure of a device for generating a service card provided in one embodiment of the present application;
[0066] Figure 12 A schematic structural diagram of a device for generating a service card provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0067] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0068] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0069] The embodiments of the present application can be applied to terminal devices, including but not limited to: mobile phones, tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, and virtual reality devices. The embodiments of the present application do not impose any restrictions on these. In the embodiments of the present application, the terminal device can be simply referred to as a terminal.
[0070] In order to better understand the embodiments of the present application, the structure of the terminal in the embodiments of the present application is exemplarily introduced below.
[0071] Figure 1 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. Figure 1As shown, the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0072] Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0073] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0075] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0076] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0077] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0078] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0079] Terminal 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor capable of full-screen window dragging, connecting display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0080] In an embodiment of the present application, the terminal supports adding service cards, that is, it supports displaying important information or operations of the application in the form of service cards on the desktop or service center of the terminal, and the application can provide the content displayed in the service card. In this way, the user can browse the application information without opening the application (APP), or directly achieve the purpose of operating the application by operating the service card, reducing the use level of the application. For example, the user can quickly understand the weather information through the weather card displayed on the desktop. The terminal supports adding service cards, which can also be called the terminal supports creating or generating service cards. In an embodiment of the present application, the service card can also be called a card.
[0081] Figure 2 This is an exemplary diagram of a service card. Figure 2 As shown, the desktop of the terminal includes application icons such as clock, music, camera, and sports health service card 201. The service card 201 includes two parts: today's steps and "start exercise" control. In the embodiment of the present application, the control can also be called a button.
[0082] However, currently, only service cards of fixed styles or fixed templates provided by applications can be generated in terminals, which cannot meet the diverse needs of users. For example, users cannot generate service cards according to their desired application information.
[0083] In light of this, this application proposes a method and related equipment for generating service cards. The technical solution provided by this application enables the generation of service cards for an application based on the content selected by the user in the application's user interface, thereby meeting users' diverse needs for service cards, improving the user experience, increasing the flexibility of service card generation, and enriching the content displayed in service cards. The user interface can also be referred to as a user page. In the technical solution provided by this application, users can generate cards while browsing application information.
[0084] The technical solution of this application is described in detail below with reference to specific embodiments.
[0085] Figure 3 This is a schematic flow chart of a card generation method provided in one embodiment of the present application. Figure 3 As shown, the method may include S301, S302 and S303.
[0086] The method can be executed by the terminal, or by a chip system, hardware circuit and / or software module applied to the terminal, or by other devices capable of realizing the functions of the terminal, without limitation herein.
[0087] S301: Receive a first user operation, where the first user operation is used to select first content in a user interface of a first application.
[0088] In this embodiment, the first application may be an application or application service installed in the terminal. An application service may be understood as a program that does not require explicit installation on the desktop and can provide convenient services to users after being installed in the background of the operating system program framework. As an example, the application service may be an atomic service in the Harmony operating system (OS), which is not limited in this application.
[0089] It should be understood that the first application should support the service card, or in other words, the first application can provide the content displayed in the service card.
[0090] As an example, the first content may be part or all of the content displayed in the user interface of the first application. The first content may include: pictures, text content, posts, web pages, or hyperlinks.
[0091] As an example, a terminal may display a user interface of a first application. When a user browses the content in the user interface and wishes to display the first content in the user interface as a service card on the terminal's desktop or in a service center, the user may enter a first user operation in the user interface to select the first content in the user interface. After receiving the first user operation, the terminal may determine the first content selected by the user based on the first user operation. The service center may be understood as the negative one screen.
[0092] It should be noted that the first user operation is not specifically limited in the embodiments of the present application. For example, the first user operation may include a long press, a click (such as a single click, a double click, or a triple click), or a drag operation.
[0093] S302: Receive a second user operation, where the second user operation is used to instruct generation of a service card for the first application.
[0094] As an example, the terminal can display the user interface of the first application. When the user browses the content in the user interface, if the user wants to display part or all of the content in the user interface in the form of a service card on the desktop or service center of the terminal, the user can enter a second user operation to instruct the generation of a service card for the first application.
[0095] As an example, the second user operation may include long pressing or clicking the screen of the terminal, sliding the screen or back cover of the terminal in a specific trajectory, or clicking buttons distributed on both sides of the terminal, etc., which are not limited here.
[0096] It should be understood that in this embodiment, the order of executing S301 and S302 is not limited. S301 can be executed first and then S302, or S302 can be executed first and then S301.
[0097] S303: Generate a service card for the first application based on the first content, where the service card includes at least part of the first content.
[0098] In this embodiment, after receiving the first user operation and the second user operation, the terminal may generate a service card for the first application based on the first content in response to the second user operation. The service card may include part or all of the first content.
[0099] As an example, after determining the first content, the terminal may obtain a view tree of the first content and generate a service card for the first application based on the view tree of the first content. The service card may include at least one element in the view tree, and the at least one element satisfies a first preset rule. As an example, the element in the view tree may be at least one of the following: an image, a data list, text content, a hyperlink, or a video.
[0100] It should be noted that each user interface of the first application corresponds to a view tree that describes its layout structure and content. Figure 4 This is an exemplary diagram of a view tree provided in one embodiment of the present application. Figure 4 As shown, views and view groups are the main components of the view tree, or in other words, views and view groups are the basic components of the user interface. Views and view groups are nested layer by layer in a tree structure to form a view tree. In some embodiments, views and view groups in the view tree can be referred to as nodes or components of the view tree, and components can carry one or more elements. At this time, a service card can contain at least one element in the view tree, which can be understood as a service card can contain at least one element carried by at least one component in the view tree. In some embodiments, views and view groups in the view tree can also be referred to as nodes, components, or elements of the view tree, which are not limited here.
[0101] For example, the first preset rule includes at least one of the following: the size of the service card, the display priority of elements in the service card, the layout of elements in the service card, or, when the element is text content, the extraction rule of text content. In some embodiments, the size of the service card may also be referred to as the size of the service card, the size of the service card, or the specification of the service card, which is not limited in this application.
[0102] In some embodiments, the first preset rule may also include elements that are not displayed in the service card, such as complex elements (such as videos).
[0103] In the embodiments of the present application, the area of the terminal desktop that can be used to display an application icon can be referred to as a grid. Thus, the terminal desktop can be divided into a grid of N rows and M columns, and the size of the service card can be determined by the number and distribution of grids occupied by the service card. As an example, the size specifications of the service card can include at least one of the following: 1*2, 2*2, 2*4, or 4*4.
[0104] In some embodiments, the size of the service card can be designed based on the application type. For example, the service card of the browser has one size, and the service card of the memo has another size.
[0105] Figure 5 This is an exemplary diagram illustrating the size specifications of a service card provided in one embodiment of the present application. Figure 5 As shown, each dotted box represents a grid. Figure 5 3 service cards of different sizes are shown, namely service card 501, service card 502 and service card 503. It can be understood that service card 501 occupies two adjacent grids in the same row, and its size can be expressed as 1*2. Similarly, the size of service card 502 can be expressed as 2*2, and the size of service card 503 can be expressed as 2*4.
[0106] As an example, the display priority of elements in a service card may be arranged from high to low as: title, text content. In this example, when the view tree of the first content contains multiple elements, the title and text content are displayed first.
[0107] As an example, the layout of elements in a service card can be understood as the card display layout style, or can be understood as the display order or display position of each element in the service card. For example, elements can be displayed from left to right, or from right to left, or from the center to both sides according to priority, but this application does not limit this. For example, an image can be displayed as a background thumbnail of a service card.
[0108] As an example, when the element is text content, the text content extraction rules may include: intelligent extraction according to the size specifications of the service card and refined description method.
[0109] As an example, after obtaining a view tree of the first content, the terminal may identify each element based on an identifier (TAG) of each element in at least one element in the view tree, and after identifying each element in the view tree, filter out a first element included in a service card from at least one element in the view tree based on a first preset rule, and reorganize the first element to determine the display content in the service card and the style or layout of each display content. Reorganization can be understood as layout or arrangement.
[0110] As an example, the terminal may identify the element based on the name of each element. For example, when the suffix of the element name is Joint Photographic Experts Group (JPG), the element may be considered to be a picture.
[0111] As an example, the terminal can determine the first element in at least one element in the view tree based on the size specifications of the service card, the display priority of elements in the service card, the text content extraction rules when the element is text content, or the elements not displayed in the service card.
[0112] As an example, if the view tree of the first content includes text, the text content displayed in the service card can be determined based on a text content extraction rule.
[0113] For example, if the view tree of the first content only contains static content such as images, there is no need to reorganize the static content. In this case, only the image is displayed in the service card. Static content refers to static files, such as images and videos, whose data is the same across different requests.
[0114] As an example, if the view tree of the first content includes text, pictures, and videos, the video element can be excluded based on the elements not displayed in the service card, and the text and pictures can be reorganized based on the layout of the elements in the service card.
[0115] In some embodiments, the terminal may take a screenshot of the text content in the view tree or a frame of the video to generate static content such as an image.
[0116] As an example, the first preset rule can be set according to actual needs, and this application does not impose any restrictions on this.
[0117] As an example, the first preset rule may be pre-configured in the terminal in advance, which is not limited here.
[0118] As an example, the first preset rule may be provided by an application developer of the first application, or by a developer of the terminal operating system, or by other means, and this application does not impose any restrictions on this.
[0119] In this embodiment, the terminal can generate a service card based on the first content selected by the user, thereby meeting the diverse needs of the user, enriching the content included in the card, and improving the flexibility of generating the card.
[0120] Figure 6 This is a schematic flow chart of a card generation method provided in another embodiment of the present application. Figure 6 As shown, the method may include S601 to S607.
[0121] The method can be executed by the terminal, or by a chip system, hardware circuit and / or software module applied to the terminal, or by other devices capable of realizing the functions of the terminal, without limitation herein.
[0122] S601: Receive a first user operation, where the first user operation is used to select first content in a user interface of a first application.
[0123] In this embodiment, the specific implementation of S601 can refer to S301 and will not be repeated here.
[0124] It should be noted that the first user operation is not specifically limited in the embodiments of the present application. As an example, when the terminal displays the user interface of the first application, the user can long press the user interface until a cursor appears in the user interface. The user can then drag one side of the cursor to the starting position of the first content and the other side of the cursor to the ending position of the first content, thereby selecting the first content, or in other words, achieving selection of the first content.
[0125] S602: In response to a first user operation, display a first interface, where the first interface includes a control for instructing to generate a service card.
[0126] As an example, when the terminal receives a first user operation in the user interface of the first application, the terminal may display a first interface in response to the first user operation, where the first interface includes a control for instructing to generate a service card.
[0127] As an example, the first interface may be displayed on the user interface of the first application, or the first interface may be jumped from the user interface of the first application, which is not limited here.
[0128] Figure 7 This is an exemplary diagram of generating a service card provided by one embodiment of the present application. Figure 7 As shown, Figure 7 (a) in the figure is the user interface of the first application, which contains text content (such as news A, news B) and pictures. The user inputs a first user operation in the user interface, and the terminal responds to the first user operation by displaying the first interface on the user interface, such as Figure 7 As shown in (b), the first interface includes a "Create Card" control, and the "Create Card" control is used to instruct the generation of a service card for the first application.
[0129] S603: Receive a second user operation, where the second user operation is used to instruct generation of a service card for the first application.
[0130] For example, when the terminal displays the first interface in response to a first user operation, if the user determines to generate a service card based on the first content, the terminal can enter a second user operation in the first interface to instruct the terminal to generate a service card for the first application. Accordingly, the terminal can receive the second user operation on the first interface.
[0131] As an example, the second user operation may be clicking a “Create Card” control in the first interface.
[0132] S604: Generate a service card for the first application based on the first content, where the service card includes at least part of the first content.
[0133] In this embodiment, the specific implementation of S604 can refer to S303 and will not be repeated here.
[0134] As an example, after generating the service card, the terminal may directly display the generated service card on the terminal desktop or service center, and in this case, steps S605 to S607 may not be performed.
[0135] like Figure 7 As shown in (c), after generating the service card 701 of the first application, the terminal can directly display the service card 701 on the desktop of the terminal. In some embodiments, the background of the service card 701 can be a picture displayed in the user interface or a thumbnail of the picture.
[0136] S605: Display a second interface, which includes a service card of the first application.
[0137] As an example, after generating the service card of the first application, the terminal may display the second interface, which includes the generated service card 701 of the first application, such as Figure 7 The second interface may also be referred to as a preview interface, a card preview interface, or a card candidate interface, which is not limited here.
[0138] As an example, Figure 7 As shown in (d), the second interface may also include an "Add to Desktop" control and / or an "Add to Service Center" control.
[0139] As an example, the second interface can be displayed on the user interface of the first application, or the second interface can be directly jumped from the user interface of the first application. This application does not impose any restrictions on this.
[0140] S606: Receive a third user operation on the second interface.
[0141] As an example, the third user operation may be clicking an “add to desktop” control in the second interface.
[0142] As an example, the third user operation may be clicking an “add to service center” control in the second interface.
[0143] S607: Display the service card on the desktop of the terminal.
[0144] As an example, after receiving the third user operation on the second interface, the terminal may display a service card of the first application generated based on the first content on the desktop of the terminal in response to the third user operation, such as Figure 7 It should be understood that if the third user operation is to click the "Add to Service Center" control in the second interface, the terminal can display the service card of the first application generated based on the first content in the service center of the terminal in response to the third user operation.
[0145] In the method provided in this embodiment, cards can be generated based on content that users like or pay attention to, which meets the users' diverse needs for service cards, greatly enriches the content displayed in the cards, increases the frequency of card usage, improves the user experience, and increases user stickiness.
[0146] In some embodiments, the service card generated based on the first content selected by the user may further include a control, and the event click rule of the control satisfies the second preset rule.
[0147] As an example, when a service card includes controls, the controls can be displayed with a lower priority than the title and text content.
[0148] Figure 8 An exemplary illustration of a service card provided for one embodiment of the present application. Figure 8 The service card 801 shown in FIG is a service card of the first application generated based on the first content, and the service card 801 includes a control 802. As an example, the control 802 can be a "Like" event button or a "Favorite" event button, which is not limited here.
[0149] As an example, the second preset rule can be set according to actual needs, and this application does not impose any restrictions on this.
[0150] As an example, the second preset rule may be pre-configured in the terminal in advance.
[0151] As an example, the second preset rule may be: after clicking the control in the service card, the first application is pulled up and the user interface of the first application is jumped to. The designated user interface is the user interface that includes the content displayed in the service card.
[0152] As an example, the second preset rule may be: after clicking a control in the service card, capturing a click event in the control area, and after capturing the click event, communicating with the application through inter-process communication (IPC) to achieve event synchronization.
[0153] Figure 9 This is a schematic diagram of a service card framework provided by an embodiment of the present application. Figure 9 As shown, the service card framework primarily consists of five components: card users, card providers, card management services, content identification modules, and system services. It should be understood that the card users, card management services, content identification modules, and system services can be located in the terminal. It should be noted that remote procedure calls (RPCs) can be used between the various components of the framework.
[0154] The card user refers to the host application that displays the service card. Card users include the terminal's desktop and service center.
[0155] The card provider is used to provide the content displayed in the card, such as the first content. The card provider can be understood as an application.
[0156] The card management service is used to manage the card provider and the cards in the card host, including pulling up the card provider to obtain card services, loading cards, etc. In some embodiments, the card management service can be part of the terminal's operating system.
[0157] The content recognition module identifies and reorganizes the first content selected by the user. In some embodiments, the content recognition module can also generate a service card. In some embodiments, the content recognition module can be part of a card management service or part of an operating system of the terminal, which is not limited in this application.
[0158] The system service is used to provide a card creation interface so that the card provider can call the card creation interface to provide content displayed in the service card; it is also used to obtain the view tree of the first content. In some embodiments, the system service can be part of the terminal's operating system.
[0159] It should be noted that the operating system of the terminal is not specifically limited in the embodiments of the present application. For example, the operating system includes but is not limited to Hongmeng operating system, open Hongmeng operating system, Android operating system, Apple operating system (iPhone operating system, IOS), etc.
[0160] It can be understood that the names of card users, card providers, card management services, content identification modules and system services are merely examples. Any service or application with the same function as the card user here can be included in the scope of card users in the embodiments of this application. Any service or application with the same function as the card provider here can be included in the scope of card providers in the embodiments of this application. Any service or application with the same function as the card management service here can be included in the scope of card management services in the embodiments of this application. Any service or application with the same function as the content identification module here can be included in the scope of the content identification module in the embodiments of this application. Any service or application with the same function as the system service here can be included in the scope of system services in the embodiments of this application.
[0161] Figure 10 This is a schematic flow chart of a card generation method provided in another embodiment of the present application. Figure 10 As shown, the method may include S1001 to S1009.
[0162] S1001 (not shown in the figure): receiving a first user operation, where the first user operation is used to select first content in a user interface of a first application.
[0163] As an example, the specific implementation of S1001 may refer to S301 or S601, which will not be described in detail here.
[0164] As an example, when a user inputs a first user operation in the user interface of a first application, the first user operation can be received by the system service or by the first application, without limitation. It should be noted that the function of the first application is implemented based on the terminal's operating system, so the system service in the operating system can be informed of the operation or function performed by the first application. It can also be understood that the first application can communicate with the system service to achieve synchronization.
[0165] S1002 (not shown in the figure): in response to a first user operation, a first interface is displayed, where the first interface includes a control for instructing to generate a service card.
[0166] As an example, the specific implementation of S1002 can refer to S602 and will not be described in detail here.
[0167] As an example, when the system service receives the first user operation, it can respond to the first user operation by displaying the first interface on the user interface of the first application, or implementing the operation of jumping the user interface of the first application to the first interface, which is not limited here.
[0168] As an example, when the first application receives the first user operation, it can display the first interface on the user interface of the first application in response to the first user operation.
[0169] S1003 (not shown in the figure): receiving a second user operation, where the second user operation is used to instruct generation of a service card for the first application.
[0170] As an example, the specific implementation of S1003 may refer to S603 and will not be described in detail here.
[0171] As an example, when the user inputs a second user operation in the first interface, the second user operation may be received by the system service.
[0172] S1004: The system service obtains a view tree of the first content in response to the second user operation.
[0173] As an example, when the system service receives the second user operation, it can obtain the view tree of the first content in response to the second user operation.
[0174] S1005: The system service sends the view tree of the first content to the card provider.
[0175] As an example, the card provider may be understood as the first application.
[0176] As an example, after obtaining the view tree of the first content, the system service may send the view tree of the first content to the card provider.
[0177] S1006: The card provider sends the view tree of the first content to the content identification module.
[0178] As an example, after obtaining the view tree of the first content, the card provider may call a create card interface provided by the system service to send the view tree of the first content to the content identification module.
[0179] In some embodiments, the card provider may also send a control included in the service card to the content identification module, where the click rule of the control satisfies the second preset rule. Detailed information can be found in the above embodiments and will not be repeated here.
[0180] S1007: The content identification module generates a service card for the first application based on the view tree of the first content.
[0181] As an example, after receiving the view tree of the first content, the content identification module can identify each element based on the identifier (TAG) of each element in the view tree, and determine the first element included in the service card of the first application based on the first preset rule, and reorganize the first element to determine the display content in the service card and the style or layout of each display content, and then generate the service card of the first application. For details, please refer to the content in S303 and will not be repeated here.
[0182] As an example, the first preset rule may be formulated by the card provider.
[0183] S1008: The content identification module sends a service card to the card user through the card management service.
[0184] As an example, after generating a service card for the first application, the content identification module may send the service card to the card user via the card management service, wherein the card management service may manage (eg, save) the service card.
[0185] In some embodiments, after determining the display content in the service card, the content identification module can send the display content in the service card to the card management service. The card management service can determine the style or layout of each display content in the service card based on the first preset rule, and then generate a service card for the first application, and send the generated service card to the card user.
[0186] In some embodiments, the content identification module can send the display content and the style or layout of each display content in the service card to the card management service after determining it. The card management service generates a service card for the first application and sends the generated service card to the card user.
[0187] S1009: The card user displays the service card.
[0188] As an example, the card user may display the service card sent by the card management service on the desktop of the terminal or in the service center.
[0189] In some embodiments, after the card user displays the service card of the first application, an indication message of successful card creation may be sent to the system service via the card management service, the content identification module, and the card provider.
[0190] Figure 11 This is a schematic diagram of a device for generating a service card according to an embodiment of the present application. The device 1100 of this embodiment may be in the form of software and / or hardware. The device 1100 may be a terminal, or a device provided in a terminal. Figure 11 As shown, the apparatus 1100 may include a transceiver module 1101 and a processing module 1102 .
[0191] In one possible implementation, the apparatus 1100 may be used to implement Figure 3 The operations or steps in the method shown are performed by the terminal.
[0192] As an example, the apparatus 1100 implements Figure 3When the method is implemented by the terminal, the transceiver module 1101 can be used to execute S301 and S302, and the processing module 1102 can be used to execute S303.
[0193] In some embodiments, the apparatus 1100 may further include a display module 1103 .
[0194] In one possible implementation, the apparatus 1100 may be used to implement Figure 6 The operations or steps in the method shown are performed by the terminal.
[0195] As an example, the apparatus 1100 implements Figure 6 When the method is implemented by the terminal, the transceiver module 1101 can be used to execute S601, S603 and S606, the processing module 1102 can be used to execute S604, and the display module 1103 can be used to execute S602, S605 and S607.
[0196] In one possible implementation, the apparatus 1100 may be used to implement Figure 10 The steps or operations performed by the card user, card provider, card management service, content identification module and system services.
[0197] As an example, the apparatus 1100 implements Figure 10 When the method is implemented by the card user, the transceiver module 1101 can be used to implement the operation performed by the card user in S1008, and the display module 1103 can be used to execute S1009.
[0198] As an example, the apparatus 1100 implements Figure 10 When the method is implemented by the card management service in S1008, the transceiver module 1101 can be used to implement the operation performed by the card management service in S1008.
[0199] As an example, the apparatus 1100 implements Figure 10 When the method is implemented by the content identification module, the transceiver module 1101 can be used to implement the operations performed by the card management service in S1006 and S1008, and the processing module 1102 can be used to implement S1007.
[0200] As an example, the apparatus 1100 implements Figure 10 When the method is implemented by the card provider, the transceiver module 1101 can be used to implement the operations performed by the card provider in S1005 and S1006.
[0201] As an example, the apparatus 1100 implements Figure 10 When the method is implemented by the system service in S1005, the transceiver module 1101 can be used to implement the operation performed by the system service in S1005, and the processing module 1102 can be used to implement S1004.
[0202] Figure 12 This is a structural diagram of a device for generating a service card provided in another embodiment of the present application. Figure 12 As shown, apparatus 1200 may include a processor 1201 and an interface circuit 1202. Processor 1201 and interface circuit 1202 are coupled to each other. It will be appreciated that interface circuit 1202 may be a transceiver or an input / output interface. Optionally, apparatus 1200 may further include a memory 1203 for storing instructions executed by processor 1201, input data required by processor 1201 to execute instructions, or data generated after processor 1201 executes instructions.
[0203] As an example, the processor 1201 may be used to implement the functions of the processing module 1102 and the display module 1103. The interface circuit 1202 may be used to implement the functions of the transceiver module 1101.
[0204] The device 1200 may be a terminal, or a chip used in a terminal.
[0205] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0206] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory, flash memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in device 1200. Of course, the processor and storage medium can also exist in device 1200 as discrete components.
[0207] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. A computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer 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, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disk; or it can be a semiconductor medium, such as a solid-state drive.
[0208] In the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0209] It is understood that the various numbers used in the embodiments of this application are merely for ease of description and are not intended to limit the scope of the embodiments of this application. The order of the sequence numbers of the above-mentioned processes does not necessarily imply a specific order of execution; the order of execution of the processes should be determined by their functions and inherent logic.
Claims
1. A method for generating a service card, characterized in that: The method is applied to a terminal, and includes: receiving a first user operation for selecting first content in a user interface of a first application; receiving a second user operation, where the second user operation is used to instruct generation of a service card for the first application; The service card is generated based on the first content, and the service card includes at least part of the first content.
2. The method according to claim 1, characterized in that Generating the service card based on the first content, wherein the service card includes at least part of the first content, includes: Obtaining the view tree of the first content; The service card is generated based on the view tree, where the service card includes at least one element in the view tree, and the at least one element satisfies a first preset rule.
3. The method according to claim 2, characterized in that The first preset rule includes at least one of the following: size specifications of the service card, display priority of elements in the service card, layout of elements in the service card, or text content extraction rules when the elements are text content.
4. The method according to any one of claims 1 to 3, characterized in that The service card further includes a control, and an event click rule of the control satisfies a second preset rule.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In response to the first user operation, displaying a first interface, wherein the first interface includes a control for instructing to generate a service card; The receiving of the second user operation includes: The second user operation is received on the first interface.
6. The method according to any one of claims 1 to 5, characterized in that After generating the service card based on the first content, the method further includes: Displaying a second interface, wherein the second interface includes the service card; receiving a third user operation on the second interface; The service card is displayed on the desktop of the terminal.
7. A device for generating a service card, characterized in that: The method comprises various functional modules for implementing the method according to any one of claims 1 to 6.
8. An electronic device, characterized in that: include: processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or instructions, and when the computer program or instructions are executed, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The method comprises a computer program code, which, when executed on a computer, causes the computer to implement the method according to any one of claims 1 to 6.