Method and apparatus for broadcasting notification within a simulation client, device
By sending broadcast notification data from the emulator to the iOS client, and having the client encapsulate and broadcast it, the problem of cumbersome operations in app development and testing is solved, improving efficiency and coverage.
Patent Information
- Application Number
- CN202111290100.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-10-30
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2037-10-30
AI Technical Summary
During app development and testing, broadcast notifications require users to perform cumbersome operations on the app itself, resulting in low development and testing efficiency.
The system obtains broadcast notification data from the emulator and sends it to the client. The client then encapsulates the data and broadcasts it through the notification center, thus avoiding user interaction on the app.
It simplifies the app development and testing process, improves efficiency, and in particular, can trigger broadcast notifications for complex operation chains, covering all scenarios.
Smart Images

Figure CN114090285B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the field of software technology, and in particular, to a method and device for simulating broadcast notification in a client. BACKGROUND
[0002] In the development and testing process of an application (App), a broadcast notification function in various operating systems is usually used to broadcast various broadcast notifications in the App. For example, the Notifications function of iOS. On the one hand, a broadcast listener in the App will take corresponding processing actions after listening to a business-specified broadcast name. On the other hand, a broadcast notification can inform the current state or behavior of the entire App.
[0003] In the related art, a broadcast notification that is broadcast in an App often needs to be triggered by a user using the App, and some broadcast notifications even need the user to make a relatively cumbersome operation in the App, resulting in a low App development and testing efficiency. SUMMARY
[0004] Therefore, one or more embodiments of the present specification provide a method and device for simulating broadcast notification in a client.
[0005] To achieve the above object, the technical solutions provided by one or more embodiments of the present specification are as follows:
[0006] In one aspect, a method for simulating broadcast notification in a client is provided, comprising:
[0007] A simulation end obtains data for generating a broadcast notification by a client, and sends the data to the client; wherein the client is an application installed on a mobile operating system iOS;
[0008] The client encapsulates the data in a message to generate a broadcast notification;
[0009] The client broadcasts the broadcast notification to a broadcast listener corresponding to the broadcast notification through a notification center in the client.
[0010] In another aspect, a method for simulating broadcast notification in a client is provided, applied to a simulation end, comprising:
[0011] Obtaining data for generating a broadcast notification by a client; wherein the client is an application installed on a mobile operating system iOS;
[0012] send the obtained data to the client to make the client encapsulate the data in a message to generate a broadcast notification, and make the client broadcast the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0013] In yet another aspect, a method for simulating a broadcast notification in a client is provided, which is applied to a client, the client being an application installed on a mobile operating system iOS; the method comprises:
[0014] receiving data for the client to generate a broadcast notification, which is obtained and sent by a simulation end;
[0015] generating a broadcast notification by encapsulating the data in a message;
[0016] broadcasting the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0017] In one aspect, a device for simulating a broadcast notification in a client is provided, which is applied to a simulation end and comprises:
[0018] an obtaining module for obtaining data for a client to generate a broadcast notification; wherein the client is an application installed on a mobile operating system iOS;
[0019] a sending module for sending the obtained data to the client to make the client encapsulate the data in a message to generate a broadcast notification, and make the client broadcast the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0020] In another aspect, a device for simulating a broadcast notification in a client is provided, which is applied to a client, the client being an application installed on a mobile operating system iOS; the device comprises:
[0021] a receiving module for receiving data for the client to generate a broadcast notification, which is obtained and sent by a simulation end;
[0022] a generating module for generating a broadcast notification by encapsulating the data in a message;
[0023] a broadcasting module for broadcasting the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0024] In one aspect, a simulation end device is provided, which comprises:
[0025] a processor;
[0026] a memory for storing processor-executable instructions;
[0027] the processor is configured to:
[0028] obtain data for the client to generate a broadcast notification; wherein the client is an application installed on a mobile operating system iOS;
[0029] send the obtained data to the client to enable the client to generate a broadcast notification by encapsulating the data in a message, and to enable the client to broadcast the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0030] In another aspect, a client device is provided, the client being an application installed on a mobile operating system iOS; the client device comprising:
[0031] a processor;
[0032] a memory for storing processor-executable instructions;
[0033] the processor is configured to:
[0034] receive data obtained and sent by the simulation end for the client to generate a broadcast notification;
[0035] generate a broadcast notification by encapsulating the data in a message;
[0036] broadcast the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client.
[0037] As can be seen from the above technical solutions, the simulation end is used to store data for generating a broadcast notification, and when the simulation end and the client establish a connection, the simulation end can be used to send data for the client to generate a broadcast notification to the client, so that the client broadcasts the broadcast notification to a broadcast listening object in the client. This solution can avoid the user from operating the client (i.e. the developed or tested App) to trigger the broadcast notification, thereby simplifying the user's operation during the development and testing process and improving the App development and testing efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 An exemplary scenario is shown;
[0039] Figure 2 A method flow (executed by a simulation end device) for simulating a broadcast notification in a client is provided in an exemplary embodiment;
[0040] Figure 3A method flow for simulating in-client broadcast notification (performed by a client device) is shown in an exemplary embodiment;
[0041] Figure 4 A module diagram of an apparatus (applied in a simulation end) for simulating in-client broadcast notification is shown in an exemplary embodiment;
[0042] Figure 5 A module diagram of an apparatus (applied in a client) for simulating in-client broadcast notification is shown in an exemplary embodiment;
[0043] Figure 6 A structure of a simulation end device or a client device is shown in an exemplary embodiment. DETAILED DESCRIPTION
[0044] Figure 1 A scenario is shown in an exemplary embodiment, which includes a client device (i.e. a client to be tested) installed with a client (i.e. an App to be tested) and a simulation end device installed with a simulation end application (for providing data for generating in-App broadcast notification). The client device / simulation end device can include, but is not limited to, various personal computers (PCs), mobile phones, etc. The simulation end application can have functions of editing, displaying and managing data for generating broadcast notification, etc.
[0045] Figure 2 A method flow for simulating in-client broadcast notification (performed by a simulation end device) is shown in an exemplary embodiment. As shown in Figure 2 In an embodiment, the method includes the following steps:
[0046] In step 101, a simulation end establishes a connection with a client, wherein the simulation end stores data for generating broadcast notification.
[0047] In an embodiment, the simulation end and the client can establish a connection through a dynamic link library (DLL) integrated in the client. Of course, the data communication mode between the client and the simulation end includes, but is not limited to, Socket, USB, TCP / IP protocol, Bluetooth protocol, etc.
[0048] In step 102, after successfully establishing a connection, the simulation end sends data for generating broadcast notification to the client, and the broadcast notification is broadcasted by the client to broadcast listeners in the client.
[0049] In an embodiment, the simulation terminal can provide a user interface for editing the data, and the simulation terminal can store the edited data. The developer of the App can edit the data of various broadcast notifications according to actual business requirements and store the data in the simulation terminal for backup. In addition, the developer can also manage all the data in the simulation terminal (such as adding, deleting, modifying, and searching the data).
[0050] In an embodiment, the client can be an application installed on a mobile operating system iOS. In iOS, an iOS App needs to use the Notifications (a notification mechanism of iOS), and the iOS App can include multiple objects that can send broadcast notifications (i.e., broadcast initiator objects) and multiple objects that can receive broadcast notifications (i.e., broadcast listener objects). The key of the Notifications is the Notification Center, which manages the registration and deregistration of the broadcast listener objects, and the sending and receiving of the broadcast notifications. For the broadcast initiator objects, they do not need to care about which broadcast listener objects need to listen to the specific broadcast notifications they send, and for the broadcast listener objects, they also do not need to care about which broadcast initiator objects send the specific broadcast notifications they need to listen to, thereby reducing the coupling degree between the broadcast initiator objects and the broadcast listener objects. In some embodiments, each iOS App can have a Notification Center, which can broadcast a broadcast notification in the App after receiving the broadcast notification, without caring about which broadcast listener objects or receive the broadcasted message. The broadcast listener objects in the App can obtain some information encapsulated in the broadcast notification after receiving the broadcast notification, and then perform corresponding processing actions according to the information. Of course, the notification mechanism is not limited to the Notifications function of iOS.
[0051] In an embodiment, the above step 102 can be specifically as follows:
[0052] The simulation terminal obtains the stored (such as locally stored or stored in memory or remotely stored) data for generating the broadcast notification by the client in response to a specific operation (such as selecting a specific broadcast name in a list in the simulation terminal and clicking “start sending broadcast”) made by a user on the simulation terminal, and sends the obtained data to the client. The data for generating various broadcast notifications can include but is not limited to the name of the broadcast (used to indicate a broadcast notification, generally a string), the content of the broadcast (such as objects that need to be carried by the broadcast and some additional information, etc.). Of course, the way for the user to trigger the broadcast notification is not limited, for example, one operation of the user on the simulation terminal can trigger multiple broadcast notifications, or the simulation terminal can be automatically triggered (such as timing triggering), etc.
[0053] Figure 3 An example embodiment provides a method flow for simulating a broadcast notification in a client (executed by a client device), which corresponds to the process described above Figure 2 The method includes the following steps:
[0054] In step 201, the client establishes a connection with a simulation end, wherein the simulation end stores data used to generate a broadcast notification.
[0055] In step 202, after the connection is successfully established, the client receives data sent by the simulation end for the client to generate a broadcast notification.
[0056] In step 203, the client generates the broadcast notification using the data, wherein the process of “generating” can be encapsulating the received data in a message.
[0057] In step 204, the client broadcasts the broadcast notification to broadcast listeners in the client.
[0058] The number of broadcast listeners receiving the broadcast notification is greater than or equal to 0, depending on the specific business of the App. In fact, the client broadcasts the generated broadcast notification in the App through its notification center, and does not need to care about which listeners actually receive the broadcast notification. The object receiving the broadcast can perform corresponding processing actions. For App developers, after the simulation end sends the above data, the test results can be obtained by observing the processing actions of the App.
[0059] Based on the embodiments shown in the above Figure 2 and Figure 3 The following effects can be achieved:
[0060] App developers can conveniently trigger any broadcast notification needed through the simulation end. In addition, App developers can also edit data for generating broadcast notifications on the simulation end to meet different business needs. The present solution avoids the need for users to operate on the App end to trigger various broadcast notifications during App development, thereby simplifying the operation of users during the development and testing process and improving the App development and testing efficiency. In particular, for broadcast notifications that need a relatively long operation link (i.e., a series of operations) to trigger, the present solution can trigger them with one key after editing data on the simulation end. Using the present solution, the development and testing of the App can cover all scenarios (including some special scenarios).
[0061] Corresponding to the above method, the present solution also provides an apparatus for simulating a broadcast notification in a client, which can be implemented by software.
[0062] Figure 4 A module diagram of an apparatus 400 (application in the simulation side) for simulating a broadcast notification in a client is shown. As Figure 4 shown, in an embodiment, the simulation side stores data to be used to generate a broadcast notification, and the apparatus 400 comprises a connection establishing module 410 and a sending module 420, wherein:
[0063] The connection establishing module 410 is configured to establish a connection with a client.
[0064] The sending module 420 is configured to, after successfully establishing the connection, send data to the client for the client to generate a broadcast notification, which is broadcasted by the client to broadcast listening objects in the client.
[0065] In an embodiment, the apparatus 400 further provides a user interface for editing the data to be used to generate the broadcast notification, and stores the edited data.
[0066] In an embodiment, the sending module 410 can be configured to:
[0067] in response to a specific operation for triggering the broadcast notification made by a user through the user interface, obtain the stored data to be used by the client to generate the broadcast notification, and send the obtained data to the client.
[0068] Figure 5 A module diagram of an apparatus 500 (application in the client) for simulating a broadcast notification in a client is shown. As Figure 5 shown, in an embodiment, the apparatus 500 comprises a connection establishing module 510, a receiving module 520, a generating module 530 and a broadcasting module 540, wherein:
[0069] The connection establishing module 510 is configured to establish a connection with a simulation side, which stores data to be used to generate a broadcast notification;
[0070] The receiving module 520 is configured to, after successfully establishing the connection, receive data sent by the simulation side for the client to generate a broadcast notification;
[0071] The generating module 530 is configured to generate the broadcast notification using the data;
[0072] The broadcasting module 540 is configured to broadcast the broadcast notification to broadcast listening objects in the client.
[0073] As Figure 6As shown, one or more embodiments of the present specification provide a client device or a simulation end device, which can include a processor, an internal bus, a network interface, a memory (including an internal memory and a non-volatile memory), and of course, other hardware required by the business. The processor can be one or more instances of a central processing unit (CPU), a processing unit, a processing circuit, a processor, an application-specific integrated circuit (ASIC), a microprocessor, or other processing logic of executable instructions. The processor reads the corresponding program from the non-volatile memory into the internal memory and then runs it. Of course, in addition to the software implementation, one or more embodiments of the present specification do not exclude other implementations, such as a logic device or a combination of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0074] In an embodiment, for the simulation end device, the processor can be configured to:
[0075] The simulation end device establishes a connection with the client device, and the simulation end device stores data used to generate a broadcast notification;
[0076] After the connection is successfully established, the simulation end device sends the data used by the client device to generate a broadcast notification to the client device, and the broadcast notification is broadcasted by the client device to a broadcast listening object in the client device.
[0077] In an embodiment, for the client device, the processor can be configured to:
[0078] The client device establishes a connection with the simulation end device, and the simulation end device stores data used to generate a broadcast notification;
[0079] After the connection is successfully established, the client device receives the data sent by the simulation end device and used by the client device to generate a broadcast notification;
[0080] The client device generates the broadcast notification using the data;
[0081] The client device broadcasts the broadcast notification to a broadcast listening object in the client device.
[0082] Each embodiment in the present specification is described in a progressive manner, and the same / similar parts between each embodiment can be referred to each other, and each embodiment mainly describes the difference from other embodiments. In particular, for the simulation end device / client device embodiment and the apparatus embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0083] The systems, apparatuses, modules, or units disclosed in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0084] For the sake of description, the above apparatuses are described in various units by functions for description. Of course, the functions of the units can be implemented in one or more software and / or hardware when implementing one or more embodiments of the present specification.
[0085] Those skilled in the art will understand that embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0086] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The device that implements the functions specified in one or more flows and / or blocks.
[0087] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the flow Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The device that implements the functions specified in one or more flows and / or blocks.
[0088] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 Figure 1
[0089] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0090] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the computer stores the information. The memory is an example of computer readable media.
[0091] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to computing devices. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0092] It should also be noted that the terms "comprising", "comprises", "including", "includes" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article or apparatus that includes the recited element.
[0093] As will be appreciated by one skilled in the art, embodiments of one or more of the present embodiments can be provided as a method, system or computer program product. Accordingly, embodiments of one or more of the present embodiments can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of one or more of the present embodiments can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable program code.
[0094] One or more of the embodiments of the present disclosure can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. One or more of the embodiments of the present disclosure can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0095] The foregoing is merely illustrative of the embodiments of one or more of the present embodiments and is not intended to limit the scope of one or more of the present embodiments. The disclosure of one or more of the embodiments of the present embodiments is to be considered within its spirit and principles, and all changes, modifications functional and / or structural alterations together with all their equivalents arising out of the claims of one or more of the present embodiments are to be considered as falling within the scope of one or more of the present embodiments.
Claims
1. A method for simulating a broadcast notification in a client, applied to a scenario comprising a client device and a simulation device having a simulation application installed, the method comprising: the simulation device obtaining data for the client to generate a broadcast notification and sending the data to the client; wherein the client is an application installed on a mobile operating system iOS; the client encapsulating the data in a message to generate a broadcast notification; the client broadcasting the broadcast notification to a broadcast listener corresponding to the broadcast notification through a notification center in the client; further comprising: the simulation device and the client establishing a connection through a dynamic library integrated in the client; the sending of the data to the client comprises: after a successful connection, the simulation device sends data for the client to generate a broadcast notification to the client. 2.The method of claim 1, wherein the simulation device provides a user interface for editing the data, and the simulation device stores the edited data, which is the data for the client to generate a broadcast notification. 3.The method of claim 2, wherein the sending of the data to the client comprises: in response to a specific operation for triggering a broadcast notification made by a user on the simulation device, the simulation device obtains the stored data for the client to generate the broadcast notification and sends the obtained data to the client. 4.A method for simulating a broadcast notification in a client, applied to a simulation device in a scenario comprising a client device and the simulation device having a simulation application installed, the method comprising: obtaining data for the client to generate a broadcast notification; wherein the client is an application installed on a mobile operating system iOS; sending the obtained data to the client to enable the client to encapsulate the data in a message to generate a broadcast notification and to enable the client to broadcast the broadcast notification to a broadcast listener corresponding to the broadcast notification through a notification center in the client; further comprising: establishing a connection with the client through a dynamic library integrated in the client; the sending of the data to the client comprises: after a successful connection, the simulation device sends data for the client to generate a broadcast notification to the client. 5.A method for simulating a broadcast notification in a client, applied to a client in a scenario comprising a client device and a simulation device having a simulation application installed, the client being an application installed on a mobile operating system iOS; the method comprising: receiving data obtained and sent by the simulation device for the client to generate a broadcast notification; encapsulating the data in a message to generate a broadcast notification; broadcasting the broadcast notification to a broadcast listener corresponding to the broadcast notification through a notification center in the client; further comprising: establishing a connection with the simulation device through a dynamic library integrated in the client; the receiving of the data obtained and sent by the simulation device for the client to generate a broadcast notification comprises: After successfully establishing the connection, the receiving module receives data for generating the broadcast notification by the client and sends the data to the client.
6. An apparatus for simulating a broadcast notification in a client, applied to a client in a scenario comprising a client device and a simulation device having a simulation application installed thereon, comprising: an obtaining module configured to obtain data for generating a broadcast notification by a client, wherein the client is an application installed on a mobile operating system iOS; a sending module configured to send the obtained data to the client, so that the client encapsulates the data in a message to generate a broadcast notification, and so that the client broadcasts the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client; the sending module is further configured to establish a connection with the client through a dynamic library integrated in the client, and after successfully establishing the connection, send data for generating the broadcast notification by the client to the client.
7. An apparatus for simulating a broadcast notification in a client, applied to a client in a scenario comprising a client device and a simulation device having a simulation application installed thereon, wherein the client is an application installed on a mobile operating system iOS; the apparatus comprising: a receiving module configured to receive data for generating a broadcast notification by the client, wherein the client is an application installed on a mobile operating system iOS; a generating module configured to encapsulate the data in a message to generate a broadcast notification; a broadcasting module configured to broadcast the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client; the receiving module is further configured to establish a connection with the simulation device through a dynamic library integrated in the client, and after successfully establishing the connection, receive data for generating the broadcast notification by the client from the simulation device.
8. A simulation device, comprising: a processor; a memory for storing processor-executable instructions; the processor is configured to: obtain data for generating a broadcast notification by a client, wherein the client is an application installed on a mobile operating system iOS; send the obtained data to the client, so that the client encapsulates the data in a message to generate a broadcast notification, and so that the client broadcasts the broadcast notification to a broadcast listening object corresponding to the broadcast notification through a notification center in the client; further comprising: establish a connection with the client through a dynamic library integrated in the client; the sending of the data to the client comprises: after successfully establishing the connection, the simulation device sends data for generating the broadcast notification by the client to the client.
9. A client device, wherein the client is an application installed on a mobile operating system iOS; the client device comprising: a processor; a memory for storing processor-executable instructions; the processor is configured to: receive data for generating a broadcast notification by the client, wherein the client is an application installed on a mobile operating system iOS; encapsulate the data in a message to generate a broadcast notification; Broadcast the broadcast notification to the broadcast notification corresponding broadcast listener through the notification center in the client; Further comprising: Connect with the simulation end through the dynamic library integrated in the client; The data for the client to generate the broadcast notification, which is acquired and sent by the receiving simulation end, comprises: After the connection is successfully established, acquire and send the data for the client to generate the broadcast notification by the receiving simulation end.
Citation Information
Patent Citations
Response test method and device of application program for system broadcast
CN104090836A