Event execution method and device, equipment and storage medium
By obtaining the interactive operations of desktop components in the terminal and passing the execution parameters to the application, the problem of duplicate code caused by desktop component triggering events is solved, achieving efficient event response and flexible event triggering.
Patent Information
- Application Number
- CN202510862495.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-17
AI Technical Summary
In existing technologies, when a desktop component triggers an event, a method with the same name needs to be set in both the application and the desktop component, resulting in a large amount of duplicate code.
By obtaining the target event triggered by the interaction of desktop components in the terminal and passing the corresponding execution parameters to the application, the application executes the target event in the background. The parameter passing and event response are implemented using management classes and notification mechanisms, avoiding code duplication.
This allows desktop components to support the triggering of different events simultaneously, eliminating the need to repeatedly set methods with the same name in the application and desktop components, reducing code redundancy, and improving event response efficiency and flexibility.
Smart Images

Figure CN120803581A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of desktop components, and in particular to an event execution method and device, equipment and a storage medium. BACKGROUND
[0002] By setting a desktop component corresponding to an application program in a desktop of a terminal, the service of the application program can be provided without starting the application program.
[0003] The desktop component supports triggering events, for example, triggering an event of playing a song. In the case of triggering an event by the desktop component, the application program can execute a method corresponding to the event triggered by the desktop component to respond to the event triggered by the desktop component. In the related art, in order to enable the application program to execute the event triggered by the desktop component in the background, the developer sets a method with the same name for the desktop component and the application program, and in the case of triggering a method with a certain name by the desktop component, the application program executes a method with the same name in the background to execute the event triggered by the desktop component.
[0004] By executing the event triggered by the desktop component in the above manner, in the case of supporting triggering multiple events by the desktop component, a method with the same name needs to be set in the application program and the desktop component respectively for different events, resulting in a large amount of repeated code. SUMMARY
[0005] The present application provides an event execution method, device, equipment and storage medium, which can avoid a large amount of repeated code. The technical solution is as follows:
[0006] According to an aspect of the present application, an event execution method is provided, which is applied to a terminal, the terminal is installed with an application program, and a desktop component corresponding to the application program is set in a user interface of the terminal, an operating system of the terminal supports the desktop component calling a function in the application program, and the method comprises:
[0007] In response to an interactive operation on the desktop component, a target event triggered by the interactive operation is acquired;
[0008] An execution parameter corresponding to the target event is transmitted to the application program;
[0009] The target event is executed in the background by the application program according to the execution parameter.
[0010] According to an aspect of the present application, an event execution device is provided, which is installed with an application program, and a desktop component corresponding to the application program is set in a user interface of the device, an operating system of the device supports the desktop component calling a function in the application program, and the device comprises:
[0011] an obtaining module, configured to obtain a target event triggered by an interactive operation on the desktop component in response to the interactive operation;
[0012] a delivering module, configured to deliver an execution parameter corresponding to the target event to the application program;
[0013] an executing module, configured to execute the target event according to the execution parameter in the background by the application program.
[0014] In an optional design, the desktop component is provided with a management class, and the management class is provided with a mapping relationship between different events and different execution parameters; the obtaining module is configured to:
[0015] obtain the execution parameter corresponding to the target event through the mapping relationship in the management class;
[0016] the delivering module is configured to:
[0017] deliver the execution parameter to the application program.
[0018] In an optional design, the management class is registered with a notification mechanism, the management class is associated with the application program and the desktop component, and the notification mechanism is configured to realize bidirectional communication between associated objects of the management class; the delivering module is configured to:
[0019] deliver a notification message to the application program through the notification mechanism;
[0020] The notification message carries the execution parameter corresponding to the target event.
[0021] In an optional design, the apparatus further includes:
[0022] the obtaining module is configured to obtain at least one event triggered by a user account in the application program and a trigger number of each event in a historical period;
[0023] a determining module, configured to determine an event with the largest trigger number as a recommended event;
[0024] a displaying module, configured to display an interactive element for triggering the recommended event in the desktop component.
[0025] In an optional design, the apparatus further includes:
[0026] the obtaining module is configured to obtain a face image of a user account corresponding to the application program in a case where the desktop component is displayed;
[0027] A recognition module, configured to obtain an expression corresponding to the facial image by recognizing the facial image;
[0028] A display module is used to display a display element matching the expression in the desktop component.
[0029] In an optional design, the device further includes:
[0030] The acquisition module is used to acquire semantic information corresponding to the expression;
[0031] a matching module, configured to match the semantic information with lyrics keywords of candidate songs in the application program to obtain matching scores corresponding to different candidate songs;
[0032] A display module is used to display a play control in the desktop component, wherein the play control is used to trigger a play event, and the play event is used to play the song with the highest matching score.
[0033] In an optional design, the operating system is an IOS system, and the data structure corresponding to the execution parameter is implemented based on the connection parameters in the IOS system.
[0034] In an optional design, the operating system is an IOS system, and the management class is implemented based on an application intent protocol in the IOS system.
[0035] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the event execution method described above.
[0036] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one program is stored. The at least one program is loaded and executed by a processor to implement the event execution method described above.
[0037] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to execute the event execution method provided in various optional implementations of the above aspects.
[0038] The beneficial effects of the technical solution provided by this application include at least:
[0039] The execution parameter corresponding to the target event triggered in the desktop component is passed to the application program, so that the application program executes the target event according to the execution parameter in the background. Since different execution parameters can be used to execute different events in the same type of event, it is not necessary to set the same name method in the application program and the desktop component for different events, so that the desktop component can support the triggering of different events at the same time, and a large amount of repeated code is avoided. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0041] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0042] Figure 2 is a schematic diagram of an execution event process provided by an exemplary embodiment of the present application;
[0043] Figure 3 is a flowchart of an execution method of an event provided by an exemplary embodiment of the present application;
[0044] Figure 4 is a flowchart of an execution method of an event provided by an exemplary embodiment of the present application;
[0045] Figure 5 is a schematic diagram of a desktop component provided by an exemplary embodiment of the present application;
[0046] Figure 6 is a schematic diagram of a desktop component provided by an exemplary embodiment of the present application;
[0047] Figure 7 is a schematic diagram of a desktop component provided by an exemplary embodiment of the present application;
[0048] Figure 8 is a structural schematic diagram of an event execution device provided by an exemplary embodiment of the present application;
[0049] Figure 9 is a structural schematic diagram of an event execution device provided by an exemplary embodiment of the present application;
[0050] Figure 10 is a structural schematic diagram of an event execution device provided by an exemplary embodiment of the present application;
[0051] Figure 11is a structural schematic diagram of an event execution device provided by an exemplary embodiment of the present application;
[0052] Figure 12 is a structural schematic diagram of a terminal provided by an exemplary embodiment of the present application.
[0053] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the present application. DETAILED DESCRIPTION
[0054] For the purpose of making the objects, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0055] Firstly, the terms involved in the present application are introduced:
[0056] Desktop component: the desktop component is a lightweight component for information display and / or providing interactive function, the desktop component has an association relationship with the application program corresponding thereto, and the desktop component is used for providing the service of the application program corresponding thereto. In the display aspect, the desktop component is different from the icon of the application program corresponding thereto. The desktop component can also be called a widget, for example, the desktop component in the present application can be understood as a widget in the IOS system.
[0057] For example, the desktop component comprises at least one of the following features: (1) extracting information from the application program: the desktop component supports presenting timely and personalized data in a concise visual form, for example, the desktop component corresponding to the weather application program supports displaying weather data in the weather application program, the desktop component corresponding to the calendar application program supports displaying schedule data in the calendar application program, and the desktop component corresponding to the sports application program supports displaying sports progress data in the sports application program; (2) without starting the application program: by setting the desktop component in the user interface such as the home screen, the lock screen and the negative one screen of the operating system, the function of the corresponding application program can be viewed or operated through the desktop component without starting the application program; (3) cross-platform adaptation: the desktop component can support different types of devices of the same or similar operating system; (4) dynamic updating: the desktop component supports refreshing the content periodically, for example, refreshing stock market information, express status information, etc. periodically; (5) interactivity: the desktop component supports interactive operation, for example, starting the timer by clicking operation, jumping to the specified user interface in the corresponding application program by clicking operation, etc.; (6) multi-size support: the desktop component provides multiple display sizes, for example, supporting small, medium and large display sizes to adapt to different layout requirements.
[0058] App Intent: App Intent is a protocol in IOS system, which is used to expose the functions of an application to system-level services (such as desktop components) to trigger the functions of the application without opening the application. App Intent can also be understood as an interaction framework based on semantic operations in IOS system, allowing cross-component intent transmission and response through predefined structures.
[0059] Link parameter: Link parameter is a dynamic parameter in IOS system that is transmitted through a Uniform Resource Locator (URL) scheme or a custom protocol, which is used to identify the source of the desktop component, the type of operation, and the data identifier, etc. For example, Link parameters include the following three types: Universal Link, URL Scheme, and SwiftUI Link. Among them, Universal Link is the official recommended Hypertext Transfer Protocol Secure (HTTPS) link, which supports seamless jumping to a specified page within the application. URL Scheme belongs to a custom protocol that needs to be registered and parsed, and SwiftUI Link is a SwiftUI native component used for navigation or opening a URL.
[0060] Struct: Struct is a lightweight data type in Swift language (a programming language for IOS system) that is used to encapsulate data and behavior, and supports protocols (such as AudioPlaybackIntent) to implement standardized interfaces. Struct can also be understood as a value type data type that is used to encapsulate a set of related properties and methods.
[0061] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 100 includes a terminal 110 and a server 120.
[0062] The terminal 110 is installed and runs an application 111 supporting a desktop component for providing services of the application 111. The application 111 includes any one of a song listening application, a song application, a singing application, a live broadcast application, a social application, an office application, a game application, a take-out application, an online shopping application, a video on demand application, a short video application, a financial application, a life service application, a navigation application, a medical application, a learning application, and a mini program. In some embodiments, the application 111 is a client. The terminal 110 is a terminal used by a user 112, and the user account of the user 112 can be logged in on the application 111. The terminal 110 can refer to one of a plurality of terminals. Optionally, the device type of the terminal 110 includes at least one of a smart phone, a tablet computer, a smart watch, an e-book reader, an MP3 player, an MP4 player, and a notebook computer.
[0063] The terminal 110 is connected to the server 120 through a wireless network or a wired network.
[0064] The server 120 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The server 120 is configured to provide background services for the application 111 supporting the desktop component. Optionally, the server 120 undertakes the main computing work, and the terminal 110 undertakes the secondary computing work; or the server 120 undertakes the secondary computing work, and the terminal 110 undertakes the main computing work; or the server 120 and the terminal 110 adopt a distributed computing architecture for collaborative computing.
[0065] In an illustrative example, the server 120 includes a processor 121, a user account database 122, a service module 123, and a user-oriented I / O interface 124. The processor 121 is configured to load instructions stored in the server 120, and process data in the user account database 122 and the service module 123; the user account database 122 is configured to store data of user accounts used by the terminal 110 and other terminals, such as an avatar of a user account, a nickname of a user account, a group to which a user account belongs, and the like; the service module 123 is configured to provide corresponding services for function implementation of the application 111, for example, providing corresponding data when the application 111 plays a song; and the user-oriented I / O interface 124 is configured to establish communication with the terminal 110 through a wireless network or a wired network to exchange data.
[0066] In combination with the above introduction of the implementation environment related to the present application, the method provided by the embodiments of the present application will be described below.
[0067] Figure 2 is a schematic diagram of performing an event process according to an example embodiment of the present application. As shown, an application, such as application 201 and application 202 shown in Figure 2 , is installed in a terminal, and a user interface, such as desktop 203 shown in Figure 2 , of the terminal is provided with a desktop component 204 corresponding to the application 201. The desktop component 204 is used to provide a service in the application 201, and the desktop component 204 corresponding to the application 201 is different from an icon of the application 201 displayed in the terminal. In some embodiments, an operating system of the terminal supports the desktop component 204 to invoke a function in the application 201, and / or the operating system of the terminal does not support inter-process communication or cross-process communication between a process corresponding to the desktop component 204 and a process corresponding to the application 201. Figure 2
[0068] In response to an interactive operation on the desktop component 204, the terminal obtains a target event triggered by the interactive operation. For example, the interactive operation is a click operation on a play control in the desktop component 204, and the target event is an event for playing a song triggered by the play control. After obtaining the target event, the terminal delivers an execution parameter 205 corresponding to the target event to the application 201, and the execution parameter 205 includes a parameter used in execution of the target event process. After obtaining the execution parameter 205, the application 201 executes the target event in the background according to the execution parameter 205. For example, the target event is used to play the third song in a play list of the application, and the execution parameter 205 includes a parameter used to indicate the third song in the play list of the application. After obtaining the execution parameter 205, the application 201 executes the target event in the background according to the execution parameter 205 to play the third song in the play list of the application.
[0069] In some embodiments, the operating system of the terminal in the present embodiment is an IOS system, and a data structure corresponding to the execution parameter is implemented based on a Link parameter in the IOS system. A program or code used to deliver the execution parameter 205 between the desktop component 204 and the application 201 is implemented through an App Intent protocol in the IOS system.
[0070] By delivering the execution parameter corresponding to the target event triggered in the desktop component to the application, the application executes the target event in the background according to the execution parameter. Since different execution parameters can be used to implement different events in the same type of event, it is not necessary to set the same method in the application and the desktop component for different events, so that the desktop component can support triggering of different events at the same time, and a large amount of repeated codes can be avoided.
[0071] Figure 3 is a flowchart of an execution method of an event provided by an example embodiment of the present application. The method can be used in a terminal. As shown in the figure, the method comprises the following steps. Figure 3
[0072] Step 302: In response to the interactive operation on the desktop component, obtaining a target event triggered by the interactive operation.
[0073] The terminal in the embodiment of the present application is installed with an application program, and a desktop component corresponding to the application program is arranged in the user interface of the terminal, and the application program supports setting the corresponding desktop component. In some embodiments, the application program includes any one of a song listening application program, a song application program, a singing application program, a live broadcast application program, a social application program, an office application program, a game application program, a take-out application program, an online shopping application program, a video on demand application program, a short video application program, a financial application program, a life service application program, a navigation application program, a medical application program, a learning application program, and a small program. The desktop component corresponding to the application program is used to provide the service of the application program, and the desktop component displayed by the terminal is different from the icon of the application program corresponding thereto. It should be noted that the desktop component can also be referred to as a small component. The user interface of the terminal can be the user interface in the operating system of the terminal, and the user interface used to set the desktop component includes at least one of the home screen, the lock screen, and the minus one screen of the operating system. It can be understood that the desktop component can also be arranged in other user interfaces in addition to the above-mentioned user interfaces, and the embodiments of the present application do not limit this.
[0074] The operating system of the terminal supports the desktop component to call the function in the application program. Optionally, calling the function in the application program includes at least one of displaying information in the application program and triggering the execution of the function in the application program. For example, the desktop component corresponding to the weather application program supports displaying weather data in the weather application program, and the desktop component corresponding to the memo application program supports adding memo data for the memo application program.
[0075] In some embodiments, in the process of the operating system of the terminal, there are a process corresponding to the desktop component and a process corresponding to the application program corresponding to the desktop component, and the operating system of the terminal does not support inter-process communication or cross-process communication between the process corresponding to the desktop component and the process corresponding to the application program. Since the process corresponding to the desktop component and the process corresponding to the application program cannot directly communicate, it is necessary to perform parameter transmission through the method provided by the embodiments of the present application. In some embodiments, the operating system of the terminal in the embodiment of the present application is an IOS system.
[0076] Optionally, the interaction operation on the desktop component includes a touch operation on the desktop component, and the touch operation includes at least one of a single-click operation, a double-click operation, a continuous multi-click operation, a long-press operation, and a sliding operation. In some embodiments, one or more interaction controls are displayed in the desktop component, and the interaction operation on the desktop component can be an interaction operation on the interaction controls, and different interaction controls can trigger different target events. The target event is used to trigger a function in the application program, and the application program executes a method corresponding to the target event, thereby implementing execution of the target event.
[0077] Step 304: passing the execution parameter corresponding to the target event to the application program.
[0078] The execution parameter corresponding to the target event includes a parameter used in the process of executing the target event, and the execution parameters corresponding to different target events are different, and part of the execution parameters of the same type of target event are different. Optionally, the execution parameter corresponding to the target event includes a parameter for indicating the target event and / or a parameter for indicating the desktop component. Optionally, the mapping relationship between different events and different execution parameters is set in the desktop component, and after the triggered target event is obtained, the execution parameter corresponding to the target event can be determined according to the set mapping relationship.
[0079] For example, the target event 1 and the target event 2 are the same type of target event, and are both used to trigger the application program to play a song. The target event 1 is used to instruct the application program to play the first song in the playlist, and the target event 2 is used to instruct the application program to play the second song in the playlist, and the difference between the execution parameters corresponding to the target event 1 and the target event 2 is that the execution parameter corresponding to the target event 1 includes a parameter for indicating the first song in the playlist, and the execution parameter corresponding to the target event 2 includes a parameter for indicating the second song in the playlist.
[0080] Step 306: executing the target event according to the execution parameter in the background by the application program.
[0081] After the execution parameter of the target event is obtained by the application program corresponding to the desktop component, the target event is executed according to the execution parameter in the background to respond to the target event. For example, the execution parameter is used to instruct the application program to play the first song in the playlist, and the application program will trigger the first song in the playlist to be played according to the instruction of the execution parameter.
[0082] In some embodiments, the application program executes the target event according to the execution parameter in the background, which means that the application program will not be displayed in the foreground in the process of executing the target event, that is, the terminal will not display the user interface of the application program in the process of executing the target event.
[0083] In summary, the method provided in this embodiment passes the execution parameter corresponding to the target event triggered in the desktop component to the application program, so that the application program executes the target event in the background according to the execution parameter. Since different execution parameters can be used to execute different events in the same type of event, it is not necessary to set the same name method in the application program and the desktop component for different events, so that the desktop component can support the triggering of different events at the same time, and a large amount of repeated code is avoided.
[0084] Figure 4 FIG. 1 is a flowchart of an event execution method provided in an example embodiment of the present application. The method can be used in a terminal. As shown in FIG. 1, the method includes the following steps. Figure 4
[0085] Step 402: In response to the interactive operation on the desktop component, a target event triggered by the interactive operation is obtained.
[0086] The terminal in the embodiment of the present application is installed with an application program, and a desktop component corresponding to the application program is set in the user interface of the terminal. The application program supports setting the corresponding desktop component. The desktop component corresponding to the application program is used to provide the service of the application program, and the desktop component displayed by the terminal is different from the icon of the application program corresponding thereto. It should be noted that the desktop component can also be referred to as a widget. The user interface of the terminal can be the user interface in the operating system of the terminal, and the user interface used to set the desktop component includes at least one of the home screen, the lock screen and the minus one screen of the operating system.
[0087] The operating system of the terminal supports the desktop component to call the function in the application program. Optionally, calling the function in the application program includes at least one of displaying the information in the application program and triggering the execution of the function in the application program. In some embodiments, in the process of the operating system of the terminal, there are a process corresponding to the desktop component and a process corresponding to the application program corresponding to the desktop component, and the operating system of the terminal does not support the inter-process communication or cross-process communication between the process corresponding to the desktop component and the process corresponding to the application program. In some embodiments, the operating system of the terminal in the embodiment of the present application is an IOS system.
[0088] Optionally, the interactive operation on the desktop component includes a touch operation on the desktop component, and the touch operation includes at least one of a single-click operation, a double-click operation, a continuous multi-click operation, a long-press operation and a sliding operation. In some embodiments, one or more interactive controls are displayed in the desktop component, and the interactive operation on the desktop component can be an interactive operation on the interactive control. Different interactive controls can trigger different target events. The target event is used to trigger the function in the application program, and the application program executes the method corresponding to the target event, so as to execute the target event.
[0089] For example, Figure 5 Fig. 1 is a schematic diagram of a desktop component according to an example embodiment of the present application. As shown in Fig. 1, a desktop component 100 is displayed in a main screen 101 of an operating system of a terminal. The desktop component 100 displays an interactive control 102, an interactive control 103, an interactive control 104 and an interactive control 105. The interactive control 102 triggers an event of displaying a playlist, the interactive control 103 triggers an event of playing a previous song of a current song (song 1), the interactive control 104 triggers an event of continuing to play the current song, and the interactive control 105 triggers an event of playing a next song of the current song. By clicking the interactive control 102, the event corresponding to the interactive control 102 is triggered; by clicking the interactive control 103, the event corresponding to the interactive control 103 is triggered; by clicking the interactive control 104, the event corresponding to the interactive control 104 is triggered; and by clicking the interactive control 105, the event corresponding to the interactive control 105 is triggered. Figure 5 As shown in Fig. 5, a desktop component 502 and icons of four application programs are displayed in a main screen 501 of an operating system of a terminal. The desktop component 502 displays an interactive control 503, an interactive control 504, an interactive control 505 and an interactive control 506. The interactive control 503 triggers an event of displaying a playlist, the interactive control 504 triggers an event of playing a previous song of a current song (song 1), the interactive control 505 triggers an event of continuing to play the current song, and the interactive control 506 triggers an event of playing a next song of the current song. By clicking the interactive control 503, the event corresponding to the interactive control 503 is triggered; by clicking the interactive control 504, the event corresponding to the interactive control 504 is triggered; by clicking the interactive control 505, the event corresponding to the interactive control 505 is triggered; and by clicking the interactive control 506, the event corresponding to the interactive control 506 is triggered.
[0090] In step 404, the execution parameter corresponding to the target event is obtained through the mapping relationship in the management class.
[0091] The execution parameter corresponding to the target event includes parameters used in the process of executing the target event. The execution parameter corresponding to different target events is different, and part of the execution parameter corresponding to the same type of target events is different. For example, for a type of target events of playing songs, if the played songs are different, part of the parameters in the execution parameter for indicating the played songs can be different. Alternatively, the execution parameter corresponding to the target event includes parameters for indicating the target event and / or parameters for indicating the desktop component.
[0092] For example, the target event is an event of playing a song, and the execution parameter corresponding to the target event includes "songid=xxx&action=xxx&widgetid=xxx...". The songid is used to indicate the identification of the played song, the action is used to indicate the identification of the singer corresponding to the played song, and the widgetid is used to indicate the desktop component triggering the target event.
[0093] The management class is configured in the desktop component, and is used to manage or process an event triggered in the desktop component, that is, in the case that an event is triggered in the desktop component, the triggered event is managed or processed by the management class. The management class is configured with a mapping relationship between different events and different execution parameters, and the mapping relationship can be set by a developer. Alternatively, the mapping relationship is defined by a key-value pair. The management class can be a program or a method implemented by software code, and the class is a concept in object-oriented programming (OOP), which will not be described herein.
[0094] In some embodiments, the operating system of the terminal is an IOS system, and the management class is implemented based on an App Intent protocol in the IOS system. For the introduction of the App Intent protocol, reference can be made to the related content in the foregoing description, which will not be described herein. The implementation based on the App Intent protocol can be understood as that the management class conforms to the App Intent protocol or the code of the management class is written based on the App Intent protocol. Through the App Intent protocol, the application program can be implemented to execute a target event in the background.
[0095] In some embodiments, the operating system of the terminal is an IOS system, and the data structure corresponding to the execution parameter is implemented based on a Link parameter in the IOS system. For the introduction of the Link parameter, reference can be made to the related content in the foregoing description, which will not be described herein. The implementation based on the Link parameter can be understood as that the data structure corresponding to the execution parameter conforms to the data structure of the Link parameter, or the splicing manner of the execution parameter conforms to the requirement of the Link parameter, or the splicing manner of the execution parameter is consistent with the splicing manner of the Link parameter.
[0096] Step 406: passing the execution parameter corresponding to the target event to the application program.
[0097] In some embodiments, the management class registers a notification mechanism, and the management class is associated with an application and a desktop component. For example, the management class is associated with an identifier of the application and an identifier of the desktop component corresponding to the application. The identifier of the application can be a target corresponding to an output of compiling the application. The identifier of the desktop component can be a target corresponding to an output of compiling the desktop component. The notification mechanism is used for bidirectional communication between the associated objects of the management class. That is, bidirectional communication between the application and the desktop component corresponding to the application can be implemented through the notification mechanism. In some embodiments, the operating system of the terminal is an IOS system, and the notification mechanism refers to a notification center (NotificationCenter) in the IOS system. In the process of delivering the execution parameter corresponding to the target event to the application, the terminal delivers a notification message to the application through the notification mechanism, and the notification message carries the execution parameter corresponding to the target event.
[0098] In some embodiments, in the process of delivering the execution parameter, the terminal encapsulates the execution parameter into a structure (Struct). For details of the structure, refer to the related content in the foregoing description, which will not be repeated here. For example, part of the code of the management class is as follows:
[0099]
[0100]
[0101] The NotificationCenter in the above example represents the notification mechanism, and the management class in the above example is implemented based on the AppIntent protocol.
[0102] Step 408: executing the target event according to the execution parameter in the background through the application.
[0103] After the application corresponding to the desktop component obtains the execution parameter of the target event, the application executes the target event according to the execution parameter in the background to respond to the target event. In some embodiments, executing the target event according to the execution parameter in the background through the application means that the application will not be displayed in the foreground during the execution of the target event. That is, the terminal will not display the user interface of the application during the execution of the target event.
[0104] For example, Figure 6 is a schematic diagram of a desktop component provided by an example embodiment of the present application. As shown in Figure 5 and 6 As shown in Figure 5In the case of the interaction control 503 shown, an event of displaying a playlist is triggered, and the terminal transmits an execution parameter corresponding to the event to the application program. After the application program acquires the data of the playlist by executing the event, the application program feeds back the data of the playlist to the desktop component 502 through the above-mentioned bidirectional communication mechanism, so that the desktop component 502 displays the playlist 506 according to the data of the playlist.
[0105] For example, Figure 7 FIG. 1 is a schematic diagram of a desktop component provided by an example embodiment of the present application. As shown in FIG. 1, the desktop component 502 is displayed on the terminal, and the desktop component 502 includes a first interaction control 501 and a second interaction control 502. Figures 5-7 As shown in FIG. 1, the first interaction control 501 is used to trigger an event of displaying a playlist. In the case of clicking the first interaction control 501, an event of displaying a playlist is triggered, and the terminal transmits an execution parameter corresponding to the event to the application program. After the application program acquires the data of the playlist by executing the event, the application program feeds back the data of the playlist to the desktop component 502 through the above-mentioned bidirectional communication mechanism, so that the desktop component 502 displays the playlist 506 according to the data of the playlist. Figure 6 As shown in FIG. 1, the second interaction control 502 is used to trigger an event of playing a song. In the case of clicking the second interaction control 502, an event of playing a song is triggered, and the terminal transmits an execution parameter corresponding to the event to the application program. After the application program acquires the execution parameter, the application program starts to play the song, and responds to the event of playing the song through the above-mentioned bidirectional communication mechanism. After the desktop component 502 acquires the response, the desktop component 502 switches the current song to the song, and displays the second interaction control 503 shown in FIG. 1 as the second interaction control 504 shown in FIG. 1. The second interaction control 504 triggers an event of displaying a playlist. Figure 5 As shown in FIG. 1, the second interaction control 502 is used to trigger an event of playing a song. In the case of clicking the second interaction control 502, an event of playing a song is triggered, and the terminal transmits an execution parameter corresponding to the event to the application program. After the application program acquires the execution parameter, the application program starts to play the song, and responds to the event of playing the song through the above-mentioned bidirectional communication mechanism. After the desktop component 502 acquires the response, the desktop component 502 switches the current song to the song, and displays the second interaction control 503 shown in FIG. 1 as the second interaction control 504 shown in FIG. 1. The second interaction control 504 triggers an event of displaying a playlist.
[0106] In some embodiments, the terminal acquires at least one event triggered by a user account in an application program and a number of times of triggering each event in a historical period. The historical period can be set by the user account in the application program, or can be pre-set in the application program, for example, the last week, the last month, etc. The user account can be an account logged in by a user of the application program in the application program. Then, the terminal determines an event with the largest number of times of triggering as a recommended event, and displays an interaction element for triggering the recommended event in the desktop component. The interaction element can be a control displayed in the desktop component, for example, a button displayed in the desktop component. Through an interaction operation on the control, for example, a clicking operation on the control, the recommended event can be triggered through the desktop component.
[0107] It should be noted that the process of displaying the interaction element can be executed by the terminal through the application program and the desktop component corresponding to the application program.
[0108] In some embodiments, when the desktop component is displayed, for example, in the process of displaying the desktop component, the terminal acquires a face image of a user account corresponding to an application, for example, by capturing the face image of the user account through a front camera of the terminal. By recognizing the face image, an expression corresponding to the face image can be obtained. Optionally, the terminal recognizes the expression corresponding to the face image through an artificial intelligence (AI) model, which can be an expression recognition model constructed based on a convolutional neural network (CNN). The expression recognition model is trained through different sample expressions corresponding to expression images. After determining the expression corresponding to the face image, the terminal displays a display element matching the expression in the desktop component. The display element is used to reflect the expression corresponding to the face image. Optionally, the display element is an emoji corresponding to the expression corresponding to the face image. A plurality of emojis are pre-set in the desktop component, and a corresponding relationship between different emojis and different expressions in the plurality of emojis is pre-set in the desktop component. After the desktop component acquires the expression corresponding to the face image, the corresponding relationship can be used to acquire an emoji matching the expression corresponding to the face image, so that the emoji matching the expression is displayed in the desktop component.
[0109] In some embodiments, after determining the expression corresponding to the face image, the terminal obtains semantic information corresponding to the expression. For example, if the recognition result of the expression corresponding to the face image is 1, the terminal obtains semantic information corresponding to the expression as a smile; if the recognition result of the expression corresponding to the face image is 2, the terminal obtains semantic information corresponding to the expression as surprise; and if the recognition result of the expression corresponding to the face image is 3, the terminal obtains semantic information corresponding to the expression as anger. After obtaining the semantic information corresponding to the expression, the terminal matches the semantic information with the lyric keywords of the candidate songs in the application program to obtain matching scores corresponding to different candidate songs. The matching score reflects the matching degree of the lyric keywords of the candidate song and the semantic information. The higher the matching score, the higher the matching degree of the lyric keywords of the candidate song and the semantic information. The lower the matching score, the lower the matching degree of the lyric keywords of the candidate song and the semantic information. Optionally, the candidate songs include n songs recently played by the user account of the application program or n songs with the most play times by the user account of the application program, where n is a positive integer greater than 1. Optionally, the terminal determines the matching scores corresponding to the candidate songs by using a large language model (LLM). In the process of determining the matching scores, the lyrics of the candidate songs, the semantic information corresponding to the expression, and prompt information are input into the LLM to obtain the matching scores corresponding to the candidate songs. The prompt information is used to prompt the LLM to extract the lyric keywords in the lyrics of the candidate songs and output the matching degree of the semantic information and the lyric keywords in the form of a score. After obtaining the matching scores corresponding to different candidate songs, the terminal displays a play control in the desktop component. The play control is used to trigger a play event, and the play event is used to play the song with the highest matching score. The play control can be a play button, and the play button can display information of the song with the highest matching score, such as the name of the song with the highest matching score.
[0110] It should be noted that the above process of displaying the display element and the play control can be performed by the terminal through the application program and the desktop component corresponding to the application program.
[0111] In summary, the method provided in the embodiment can pass the execution parameter corresponding to the target event triggered in the desktop component to the application program, so that the application program executes the target event in the background according to the execution parameter. Since different execution parameters can be used to execute different events in the same type of event, it is not necessary to set the same name method in the application program and the desktop component for different events, so that the desktop component can support the triggering of different events at the same time, and a large amount of repeated code is avoided.
[0112] The method provided in the embodiment further sets a management class to achieve obtaining corresponding execution parameters according to a target event, and achieves enabling a desktop component to support triggering of different events at the same time without setting a method with the same name. The method can achieve timely delivery of execution parameters to an application program, to ensure timeliness of execution of a target event, by registering a notification mechanism to deliver execution parameters to the application program corresponding to the desktop component. The method can achieve triggering of frequently triggered events through the desktop component without opening the application program, to improve efficiency of triggering of events, by displaying an interactive element of a recommended event in the desktop component according to a number of times of triggering of the event in the application program. The method provides an interesting display mode of the desktop component, by identifying an expression of a face image and displaying a corresponding display element in the desktop component. The method provides a scheme of playing a recommended song without opening an application program, to improve efficiency of playing of the recommended song, by recommending a song according to an expression and displaying a play control in the desktop component.
[0113] With the method provided in the embodiment applied to a terminal deploying an IOS system as an example, the method provided in the embodiment can enable real-time and flexible delivery of parameters between a small component and a main program (an application program corresponding to the small component) in the IOS system. The method provided in the embodiment at least includes the following contents:
[0114] 1. A management class for event processing of the small component is designed, which is associated with a Target of the main program and the small component, to prepare for bidirectional communication.
[0115] 2. A notification is registered in the management class, to implement a channel for message communication between the two Targets.
[0116] 3. A set of extensible notification message data structures are defined, to deliver messages between the two Targets.
[0117] 4. The message structure defined in 3 can be used under App Intent and Link, to solve compatibility problems of different IOS system versions.
[0118] 5. The main program uniformly processes logic, to support analysis of parameter data and execution of user operations.
[0119] The method provided in the embodiment enables communication between the main program and the small component through sharing of the management class. The method implements cross-version system adaptation by simultaneously supporting App Intent protocol and Link parameter delivery by using a structure in Swift language. The method uniformly processes App Intent and traditional event response logic by broadcasting standardized execution parameters through a notification center. The method can support dynamic extension of playing content and additional operations based on a URL Scheme analysis rule.
[0120] It should be noted that, before collecting the relevant data of the user and in the process of collecting the relevant data of the user, the application can display a prompt interface, a pop-up window or output voice prompt information for prompting that the relevant data of the user is currently being collected, so that the application only starts to perform the relevant steps of obtaining the relevant data of the user after obtaining the confirmation operation of the user to the prompt interface or the pop-up window, otherwise (that is, without obtaining the confirmation operation of the user to the prompt interface or the pop-up window), ending the relevant steps of obtaining the relevant data of the user, that is, not obtaining the relevant data of the user. In other words, all the user data collected by the application is collected under the condition that the user agrees and authorizes, and the collection, use and processing of the relevant user data need to comply with the relevant laws, regulations and standards of the country and region.
[0121] It should be noted that the order of the method steps provided by the embodiments of the application can be appropriately adjusted, and the steps can be increased or decreased as appropriate. Any person skilled in the art can easily think of changes within the technical range disclosed in the application, which should be covered within the protection scope of the application, and therefore will not be described again.
[0122] Figure 8 is a structural schematic diagram of an event execution device provided by an example embodiment of the application. The device is installed with an application program, and a desktop component corresponding to the application program is arranged in the user interface of the device, and the operating system of the device supports the desktop component to call the function in the application program. As shown in the figure, the device includes: Figure 8
[0123] The obtaining module 801 is configured to obtain a target event triggered by an interactive operation of the desktop component in response to the interactive operation.
[0124] The delivery module 802 is configured to deliver an execution parameter corresponding to the target event to the application program.
[0125] The execution module 803 is configured to execute the target event according to the execution parameter in the background through the application program.
[0126] In an optional design, a management class is arranged in the desktop component, and a mapping relationship between different events and different execution parameters is arranged in the management class; the obtaining module 801 is configured to:
[0127] obtain the execution parameter corresponding to the target event through the mapping relationship in the management class.
[0128] The delivery module 802 is configured to:
[0129] pass the execution parameter to the application program.
[0130] In an optional design, a notification mechanism is registered in the management class, the management class is associated with the application program and the desktop component, and the notification mechanism is used for bidirectional communication between associated objects of the management class; the passing module 802 is configured to:
[0131] pass a notification message to the application program through the notification mechanism;
[0132] The notification message carries an execution parameter corresponding to the target event.
[0133] In an optional design, as shown in Figure 9 The apparatus further includes:
[0134] The obtaining module 801 is configured to obtain at least one event triggered by a user account in the application program in a historical period and a number of times of triggering each event;
[0135] The determining module 804 is configured to determine an event with the largest number of times of triggering as a recommended event;
[0136] The display module 805 is configured to display an interactive element for triggering the recommended event in the desktop component.
[0137] In an optional design, as shown in Figure 10 The apparatus further includes:
[0138] The obtaining module 801 is configured to obtain a face image of a user account corresponding to the application program in a case where the desktop component is displayed;
[0139] The recognition module 806 is configured to obtain an expression corresponding to the face image by recognizing the face image;
[0140] The display module 805 is configured to display a display element matched with the expression in the desktop component.
[0141] In an optional design, as shown in Figure 11 The apparatus further includes:
[0142] The obtaining module 801 is configured to obtain semantic information corresponding to the expression;
[0143] The matching module 807 is configured to match the semantic information with lyric keywords of candidate songs in the application program to obtain a matching score corresponding to different candidate songs;
[0144] The display module 805 is configured to display a play control in the desktop component, the play control being used to trigger a play event, the play event being used to play the song with the highest matching score.
[0145] In an optional design, the operating system is an IOS system, and the data structure corresponding to the execution parameter is based on a connection parameter in the IOS system.
[0146] In an optional design, the operating system is an IOS system, and the management class is based on an application intent protocol in the IOS system.
[0147] It should be noted that the event execution apparatus provided in the above embodiments is only used as an example for the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the event execution apparatus and the event execution method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be repeated here.
[0148] Embodiments of the present application also provide a computer device, which comprises a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, and the processor loads and executes the at least one instruction, the at least one program, the code set or the instruction set to implement the event execution method provided in the above method embodiments.
[0149] In some embodiments, the computer device is a terminal. For example, Figure 12 FIG. 1 is a structural schematic diagram of a terminal according to an example embodiment of the present application.
[0150] Generally, the terminal 1200 comprises a processor 1201 and a memory 1202.
[0151] The processor 1201 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1201 can be implemented in the form of at least one of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 1201 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1201 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 1201 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.
[0152] The memory 1202 can include one or more computer-readable storage media that can be non-transitory. The memory 1202 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one instruction for being executed by the processor 1201 to implement the event execution method provided by the method embodiment of the present application.
[0153] In some embodiments, the terminal 1200 can also optionally include a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral device interface 1203 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1203 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1208.
[0154] The peripheral interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202 and the peripheral interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202 and the peripheral interface 1203 can be implemented on a separate chip or circuit board, and the embodiments of the present application do not limit this.
[0155] The radio frequency circuit 1204 is used to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1204 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 1204 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1204 can also include NFC (Near Field Communication) related circuitry, and the present application does not limit this.
[0156] The display screen 1205 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 1205 is a touch display screen, the display screen 1205 is further configured to capture touch signals on or above the surface of the display screen 1205. The touch signals can be input to the processor 1201 as control signals for processing. In this case, the display screen 1205 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 1205 can be one, arranged on the front panel of the terminal 1200; in other embodiments, the display screen 1205 can be at least two, arranged on different surfaces of the terminal 1200 or in a folding design; in still other embodiments, the display screen 1205 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal 1200. Even, the display screen 1205 can also be arranged in an irregular shape other than a rectangle, i.e., a special-shaped screen. The display screen 1205 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0157] The camera assembly 1206 is configured to capture images or videos. Optionally, the camera assembly 1206 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is arranged on the front panel of the terminal 1200, and the rear-facing camera is arranged on the back of the terminal. In some embodiments, the rear-facing camera is at least two, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function by fusing the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function by fusing the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 1206 can further include a flash. The flash can be a single-color-temperature flash or a dual-color-temperature flash. The dual-color-temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.
[0158] The audio circuit 1207 can include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into an electrical signal input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 1200. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can it convert electrical signals into sound waves that humans can hear, but it can also convert electrical signals into sound waves that humans cannot hear for ranging purposes. In some embodiments, the audio circuit 1207 can also include a headphone jack.
[0159] The power supply 1208 is used to supply power to each component in the terminal 1200. The power supply 1208 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 1208 includes a rechargeable battery, the rechargeable battery can be a wired charging battery or a wireless charging battery. The wired charging battery is a battery charged through a wired line, and the wireless charging battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0160] In some embodiments, the terminal 1200 also includes one or more sensors 1209. The one or more sensors 1209 include, but are not limited to, an acceleration sensor 1210, a gyroscope sensor 1211, a pressure sensor 1212, an optical sensor 1213, and a proximity sensor 1214.
[0161] The acceleration sensor 1210 can detect the acceleration magnitude in three coordinate axes of the coordinate system established by the terminal 1200. For example, the acceleration sensor 1210 can be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 1201 can control the touch display 1205 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1210. The acceleration sensor 1210 can also be used for game or user motion data collection.
[0162] The gyroscope sensor 1211 can detect the body orientation and rotation angle of the terminal 1200, and the gyroscope sensor 1211 can collect 3D actions of the user on the terminal 1200 in cooperation with the acceleration sensor 1210. The processor 1201 can realize the following functions according to the data collected by the gyroscope sensor 1211: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization when shooting, game control, and inertial navigation.
[0163] The pressure sensor 1212 can be disposed at the side frame of the terminal 1200 and / or the lower layer of the touch display screen 1205. When the pressure sensor 1212 is disposed at the side frame of the terminal 1200, the holding signal of the user to the terminal 1200 can be detected, and the left-hand or right-hand recognition or the shortcut operation can be performed by the processor 1201 according to the holding signal collected by the pressure sensor 1212. When the pressure sensor 1212 is disposed at the lower layer of the touch display screen 1205, the controllable control on the UI interface can be controlled by the processor 1201 according to the pressure operation of the user to the touch display screen 1205. The controllable control includes at least one of the button control, the scroll bar control, the icon control and the menu control.
[0164] The optical sensor 1213 is used to collect the ambient light intensity. In an embodiment, the processor 1201 can control the display brightness of the touch display screen 1205 according to the ambient light intensity collected by the optical sensor 1213. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1205 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1205 is decreased. In another embodiment, the processor 1201 can also dynamically adjust the shooting parameter of the camera assembly 1206 according to the ambient light intensity collected by the optical sensor 1213.
[0165] The proximity sensor 1214, also called the distance sensor, is usually disposed at the front panel of the terminal 1200. The proximity sensor 1214 is used to collect the distance between the user and the front of the terminal 1200. In an embodiment, when the proximity sensor 1214 detects that the distance between the user and the front of the terminal 1200 gradually decreases, the processor 1201 controls the touch display screen 1205 to switch from the bright screen state to the screen-off state; when the proximity sensor 1214 detects that the distance between the user and the front of the terminal 1200 gradually increases, the processor 1201 controls the touch display screen 1205 to switch from the screen-off state to the bright screen state.
[0166] Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the terminal 1200, and the terminal 1200 can include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement. Figure 12
[0167] The computer readable storage medium in the embodiments of the present application stores at least one instruction, at least one program, a code set or an instruction set. When the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor of the computer device, the execution method of the event provided by the above-mentioned method embodiments is realized.
[0168] The application further provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the event execution method provided by each method embodiment.
[0169] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing relevant hardware to complete, and the programs can be stored in a computer readable storage medium. The readable storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.
[0170] The above only describes optional embodiments of the application and is not used to limit the application. Any modification, equivalent switching, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A method for executing an event, characterized in that: The method is applied to a terminal, wherein the terminal has an application installed thereon, and a desktop component corresponding to the application is provided in a user interface of the terminal, and the operating system of the terminal supports the desktop component invoking a function in the application. The method includes: In response to an interactive operation on the desktop component, obtaining a target event triggered by the interactive operation; Passing the execution parameters corresponding to the target event to the application; The target event is executed in the background according to the execution parameters by the application program.
2. The method according to claim 1, characterized in that The desktop component is provided with a management class, wherein the management class is provided with a mapping relationship between different events and different execution parameters; The step of transmitting the execution parameter corresponding to the target event to the application program includes: Obtaining the execution parameters corresponding to the target event through the mapping relationship in the management class; The execution parameters are passed to the application.
3. The method according to claim 2, characterized in that A notification mechanism is registered in the management class, the management class is associated with the application and the desktop component, and the notification mechanism is used for two-way communication between objects associated with the management class; The step of passing the execution parameter to the application program includes: delivering a notification message to the application via the notification mechanism; The notification message carries the execution parameters corresponding to the target event.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtain at least one event triggered by the user account in the application during a historical period and the number of times each event is triggered; Determine the event with the largest number of triggering times as a recommended event; An interactive element for triggering the recommendation event is displayed in the desktop component.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the desktop component is displayed, obtaining a facial image of the user account corresponding to the application; Obtaining an expression corresponding to the facial image by recognizing the facial image; A display element matching the expression is displayed in the desktop component.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining semantic information corresponding to the expression; Matching the semantic information with lyrics keywords of candidate songs in the application to obtain matching scores corresponding to different candidate songs; A play control is displayed in the desktop component, where the play control is used to trigger a play event, and the play event is used to play the song with the highest matching score.
7. The method according to any one of claims 1 to 3, characterized in that: The operating system is an IOS system, and the data structure corresponding to the execution parameter is implemented based on the connection parameters in the IOS system.
8. The method according to any one of claims 1 to 3, characterized in that: The operating system is an IOS system, and the management class is implemented based on an application intent protocol in the IOS system.
9. An event execution device, characterized in that: The device is installed with an application, and a desktop component corresponding to the application is set in the user interface of the device, and the operating system of the device supports the desktop component to call functions in the application, and the device includes: An acquisition module, configured to acquire, in response to an interaction operation on the desktop component, a target event triggered by the interaction operation; A transfer module, configured to transfer the execution parameters corresponding to the target event to the application program; An execution module is used to execute the target event in the background according to the execution parameters through the application program.
10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the event execution method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that The readable storage medium stores at least one program, and the at least one program is loaded and executed by a processor to implement the event execution method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the event execution method as described in any one of claims 1 to 8.