Embodiments of the present invention relate generally to widgets and, more particularly, relate to a method, apparatus, and computer program product for inter-widget communications using file input and/or output operations.
With the rapid advance of web technology, more and more applications are emerging that are operated completely over the Internet. One such application is a widget.
A widget is a stand-alone application that may be executed in a third party widget engine and/or may be executed within another application. Currently, there are several widget engines, these engines include Apple® Dashboard, Microsoft® gadgets, Portlets, Opera browser's rendering engine, Nokia® QT web runtime, etc. Widgets are growing in popularity and as the number of widgets increases, it is possible that they may be combined together (e.g. widget collaboration) to provide rich Internet applications.
A method, apparatus and computer program product are therefore provided according to an example embodiment to enable inter-widget communications. In some example embodiments described herein, inter-widget communications are accomplished using file input and output operations. A first file, such as a data file, may be used to receive messages from and transfer messages to a plurality of widgets. The data file therefore allows for concurrent reading of the data file by one or more of the plurality of widgets. Further, multiple widgets may write to the data file based on example embodiments described below. A second file, such as an information file, may also be used to record the status of the first file to ensure concurrent reading and writing to the data file by the plurality of widgets will not cause any inconsistencies.
One example method may include receiving a message from a first widget of a plurality of widgets for storage in a data file. The method may also include concurrently enabling another message in the data file to be accessed by at least a second widget of the plurality of widgets. The method may further include causing an information file to record a status of the data file to enable concurrent receiving and accessing of messages in the data file.
An example apparatus may include at least one processor and at least one memory storing computer program code, wherein the at least one memory and stored computer program code are configured, with the at least one processor, to cause the apparatus to at least receive a message from a first widget of a plurality of widgets for storage in a data file. The at least one memory and stored computer program code are further configured, with the at least one processor, to cause the apparatus to concurrently enable another message in the data file to be accessed by at least a second widget of the plurality of widgets. The at least one memory and stored computer program code are further configured, with the at least one processor, to cause the apparatus to cause an information file to record a status of the data file to enable concurrent receiving and accessing of messages in the data file.
In a further embodiment, a computer program product is provided that includes at least one non-transitory computer-readable storage medium having computer-readable program instructions stored therein, the computer-readable program instructions includes program instructions configured to receive a message from a first widget of a plurality of widgets for storage in a data file. The computer-readable program instructions also include program instructions configured to program instructions configured to concurrently enable another message in the data file to be accessed by at least a second widget of the plurality of widgets. The computer-readable program instructions also include program instructions configured to cause an information file to record a status of the data file to enable concurrent receiving and accessing of messages in the data file.
One example apparatus may include means for receiving a message from a first widget of a plurality of widgets for storage in a data file. The apparatus may also include means for concurrently enabling another message in the data file to be accessed by at least a second widget of the plurality of widgets. The apparatus may further include means for causing an information file to record a status of the data file to enable concurrent receiving and accessing of messages in the data file.
Having thus described embodiments of the invention in general terms, reference will now be made to the accompanying drawings, which are not necessarily drawn to scale, and wherein:
Some example embodiments will now be described more fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments are shown. Indeed, the example embodiments may take many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will satisfy applicable legal requirements. Like reference numerals refer to like elements throughout. The terms “data,” “content,” “information,” and similar terms may be used interchangeably, according to some example embodiments, to refer to data capable of being transmitted, received, operated on, and/or stored. Moreover, the term “exemplary”, as may be used herein, is not provided to convey any qualitative assessment, but instead merely to convey an illustration of an example. Thus, use of any such terms should not be taken to limit the spirit and scope of embodiments of the present invention.
As used herein, the term ‘circuitry’ refers to all of the following: (a) hardware-only circuit implementations (such as implementations in only analog and/or digital circuitry); (b) to combinations of circuits and software (and/or firmware), such as (as applicable): (i) to a combination of processor(s) or (ii) to portions of processor(s)/software (including digital signal processor(s)), software, and memory(ies) that work together to cause an apparatus, such as a mobile phone or server, to perform various functions); and (c) to circuits, such as a microprocessor(s) or a portion of a microprocessor(s), that require software or firmware for operation, even if the software or firmware is not physically present.
This definition of ‘circuitry’ applies to all uses of this term in this application, including in any claims. As a further example, as used in this application, the term ‘circuitry’ would also cover an implementation of merely a processor (or multiple processors) or portion of a processor and its (or their) accompanying software and/or firmware. The term ‘circuitry’ would also cover, for example and if applicable to the particular claim element, a baseband integrated circuit or application specific integrated circuit for a mobile phone or a similar integrated circuit in a server, a cellular network device, or other network device.
In an embodiment, an information file 14 may then act as a backup as it is configured to record the status of the data file during read and/or write operations. Thus, multiple widgets 10 may concurrently interact with the data file 12 and in an instance in which the data file 12 becomes corrupted the information file 14 may be used to cure any inconsistencies in the data file 12.
In some example embodiments, the inter-widget communications system of
In one embodiment, for example, the mobile terminal may be embodied as or otherwise include an apparatus 15 as generically represented by the block diagram of
In this regard,
As shown, the apparatus 15 may include an antenna 17 (or multiple antennas 17) in communication with a transmitter 18 and a receiver 19. The apparatus 15 may also include a processor 20 configured to provide signals to and receive signals from the transmitter and receiver, respectively. The processor 20 may, for example, be embodied as various means including circuitry, one or more microprocessors with accompanying digital signal processor(s), one or more processor(s) without an accompanying digital signal processor, one or more coprocessors, one or more multi-core processors, one or more controllers, processing circuitry, one or more computers, various other processing elements including integrated circuits such as, for example, an ASIC (application specific integrated circuit) or FPGA (field programmable gate array), or some combination thereof. Accordingly, although illustrated in
Some Narrow-band Advanced Mobile Phone System (NAMPS), as well as Total Access Communication System (TACS), mobile terminals may also benefit from some embodiments of this invention, as should dual or higher mode phones (e.g., digital/analog or TDMA/CDMA/analog phones). Additionally, the apparatus 15 may be capable of operating according to Wireless Fidelity (Wi-Fi) or Worldwide
Interoperability for Microwave Access (WiMAX) protocols.
It is understood that the processor 20 may comprise circuitry for implementing audio/video and logic functions of the apparatus 15. For example, the processor 20 may comprise a digital signal processor device, a microprocessor device, an analog-to-digital converter, a digital-to-analog converter, and/or the like. Control and signal processing functions of the apparatus 15 may be allocated between these devices according to their respective capabilities. Further, the processor may comprise functionality to operate one or more software programs, which may be stored in memory. For example, the processor 20 may be capable of operating a connectivity program, such as a web browser. The connectivity program may allow the apparatus 15 to transmit and receive web content, such as location-based content, according to a protocol, such as Wireless Application Protocol (WAP), hypertext transfer protocol (HTTP), and/or the like. The apparatus 15 may be capable of using a Transmission Control Protocol/Internet Protocol (TCP/IP) to transmit and receive web content across the internet or other networks.
The apparatus 15 may also comprise a user interface including, for example, an earphone or speaker 24, a ringer 22, a microphone 26, a display 28, a user input interface, and/or the like, which may be operationally coupled to the processor 20. In this regard, the processor 20 may comprise user interface circuitry configured to control at least some functions of one or more elements of the user interface, such as, for example, the speaker 24, the ringer 22, the microphone 26, the display 28, and/or the like. The processor 20 and/or user interface circuitry comprising the processor 20 may be configured to control one or more functions of one or more elements of the user interface through computer program instructions (e.g., software and/or firmware) stored on a memory accessible to the processor 20 (e.g., volatile memory 40, non-volatile memory 42, and/or the like). Although not shown, the mobile terminal may comprise a battery for powering various circuits related to the mobile terminal, for example, a circuit to provide mechanical vibration as a detectable output. The user input interface may comprise devices allowing the mobile terminal to receive data, such as a keypad 30, a touch display (not shown), a joystick (not shown), and/or other input device. In some embodiments including a keypad, the keypad may comprise numeric (0-9) and related keys (#, *), and/or other keys for operating the mobile terminal.
The apparatus 15 may comprise memory, such as a smart cart, subscriber identity module or subscriber identification module (SIM), a removable user identity module (R-UIM), and/or the like, which may store information elements related to a mobile subscriber. In addition to the SIM, the mobile terminal may comprise other removable and/or fixed memory. The apparatus 15 may include other non-transitory memory, such as at least one of a volatile memory 40 and/or at least one of a non-volatile memory 42. For example, volatile memory 40 may include Random Access Memory (RAM) including dynamic and/or static RAM, on-chip or off-chip cache memory, and/or the like. Non-volatile memory 42, which may be embedded and/or removable, may include, for example, read-only memory, flash memory, magnetic storage devices (e.g., hard disks, floppy disk drives, magnetic tape, etc.), optical disc drives and/or media, non-volatile random access memory (NVRAM), and/or the like. Like volatile memory 40 non-volatile memory 42 may include a cache area for temporary storage of data. The memories may store one or more software programs, instructions, pieces of information, data, and/or the like which may be used by the mobile terminal for performing functions of the mobile terminal. For example, the memories may comprise an identifier, such as an international mobile equipment identification (IMEI) code, capable of uniquely identifying the apparatus 15.
A inter-widget communications module 44 may be embodied as various means, such as circuitry, hardware, a computer program product comprising computer readable program instructions stored on a computer readable medium (e.g., the memory 40) and executed by a processing device (e.g., the processor 20), or some combination thereof and, in one embodiment, is embodied as or otherwise controlled by the processor 20. In an embodiment, wherein the inter-widget communications module 44 is embodied separately from the processor 20, the inter-widget communications module 44 may be in communication with the processor 20. The inter-widget communications module 44 may further be in communication with one or more of the memory 40 and/or 42, the transmitter 18, and the receiver 19, such as via a bus.
The inter-widget communications module 44 may be configured to enable inter-widget communication by providing a connection between the widgets, such as widgets 10 in
In an embodiment, the inter-widget communications module 44 may be configured to enable at least one widget to send a message (e.g. a writing operation) and/or to access a message (e.g. reading operation). The inter-widget communications module 44 may receive a request for a widget to access a data file.
In order to access a data file, the widget may be assigned a position indicator. The position indicator may then identify the next message to be read in the data file and/or may identify the last message that was read by the widget. In instances in which a widget does not yet have a position indicator, the inter-widget communications module 44 may be configured to provide a position indicator for the widget. For example a position indicator may initially identify the oldest message in the data file, and then may subsequently be moved from one message to the next chronologically. Alternatively or additionally, a head field from the information file may be used to position the position indicator at the oldest message in the data file.
In an embodiment, once a position indicator has been assigned to a widget, the inter-widget communications module may then be configured to determine whether there is a message for that widget in the data file by looping through all of the messages in the data file. For example, there may be messages for any one of a plurality of widgets and some messages may not apply to all of the widgets. The inter widget communications module 44, is further configured to look at each message in the data file to determine a widget target. In an instance in which a message identifies the widget as the target or at least one of the targets, then the payload of the message may be retrieved and used by the widget during widget operations.
The inter-widget communications module 44 may also be configured to cause the data file to receive a message from a widget. In some embodiments, the inter-widget communications module 44 may cause the data file to be locked from receiving messages from other widgets until it concludes its current receiving operations. In other embodiments, a message may be stored in the queue for later transfer to the data file, the information file and/or the like. A binary exponential back off algorithm may also be used to avoid conflicts. Alternatively or additionally, the inter-widget communications module 44 may also indicate that the data file is locked by using a flag, which may be located in the start of the information file. Such a flag may be similar to mutex exclusion semaphore and/or the like.
In an embodiment, and once a widget has a lock on the data file, the inter-widget communications module 44 may then cause a message generated by the widget to be written to an available area in the data file. In particular, a message may be formatted for storage in the data file. For example, the inter-widget communications module 44 may determine an available area border for the message and then may try to allocate the size of a length field of the message from the current available area. An allocating algorithm may be used such as a first fit, a best fit, a worse fit, or the like which may be similar to memory allocation system of the apparatus 20.
In an instance in which the allocation is successful, the inter-widget communications module 44 may be configured to write the message to the data file and may also provide any updates to the fields of the data file. The inter-widget communications module 44 may then release the lock and allow other widgets to write to the data file. In an embodiment and in an instance in which the message could not be allocated, then the inter-widget communications module 44 may clean up the data file by deleting old messages to make the requisite space available and/or may reallocate the message.
The data file 12 also may include available area that is separate from the message space. The available area is comprised of a number of discrete blocks and a block table is used to delineate the available space.
As is shown in area 502, a message may not have been confirmed by any widgets and therefore the target list includes the target widgets by name. At area 504, widget 2 may confirm the message and thus the message may remove widget 2 from the list. At area 506, widget 1 confirms and similarly widget 1 is removed from the list. At area 508, widget 3 may confirm the message and thus all widgets have confirmed receiving the message. Once a message has been confirmed by all targets, it may be cleared from the data file.
In an embodiment and by way of example, a widget may send a message such as MsgN+1 after obtaining the lock as is described with reference to the inter-widget communications module 44 of
Accordingly, blocks of the flowchart support combinations of means for performing the specified functions and combinations of operations for performing the specified functions. It will also be understood that one or more blocks of the flowcharts, and combinations of blocks in the flowcharts, can be implemented by special purpose hardware-based computer systems which perform the specified functions, or combinations of special purpose hardware and computer instructions.
In some embodiments, certain ones of the operations herein may be modified or further amplified as described below. Moreover, in some embodiments additional optional operations may also be included. It should be appreciated that each of the modifications, optional additions or amplifications below may be included with the operations above either alone or in combination with any others among the features described herein.
As is shown in operation 1108, the apparatus 15 may include means, such as the processor 20, the inter-widget communications module 44, or the like, for concurrently enabling a message in the data file to be accessed by at least a second widget of the plurality of widgets. In order for the message to be accessed, as is shown in operation 1110, the apparatus 15 may include means, such as the processor 20, the inter-widget communications module 44, or the like, for determining a position indicator for the second widget in the data file, wherein the position indicator identifies a next message to be accessed and causing the message in the data file to be accessed based on the determined position indicator. As is shown in operation 1112, the apparatus 15 may include means, such as the processor 20, the inter-widget communications module 44, or the like, for determining a target for the message; and in an instance in which the second widget is the target, enabling the widget to access the message. As is shown in operation 1114, the apparatus 15 may include means, such as the processor 20, the inter-widget communications module 44, or the like, for causing an information file to record a status of the data file to enable concurrent receiving and transmitting of messages to and from the data file.
Advantageously, the inter-widget communications systems as described herein may, for example, allow for the combination of widgets and to allow for widgets to communicate in such a way that allows for an improved user experience. Additionally, for example, the inter-widget communications system may enable cross engine communications(across runtime environments). Alternatively or additionally, some embodiments described herein may also allow for increased efficiency, may not require server support, may support unicast, multicast and broadcast and may ultimately be more reliable. Although widget is used throughout the description, the systems and methods described herein may also be functional for mobile applications (apps), desktop applications and/or other executable files that are capable of read/write operations.
Many modifications and other embodiments of the inventions set forth herein will come to mind to one skilled in the art to which these inventions pertain having the benefit of the teachings presented in the foregoing descriptions and the associated drawings. Therefore, it is to be understood that the inventions are not to be limited to the specific embodiments disclosed and that modifications and other embodiments are intended to be included within the scope of the appended claims. Moreover, although the foregoing descriptions and the associated drawings describe example embodiments in the context of certain example combinations of elements and/or functions, it should be appreciated that different combinations of elements and/or functions may be provided by alternative embodiments without departing from the scope of the appended claims. In this regard, for example, different combinations of elements and/or functions than those explicitly described above are also contemplated as may be set forth in some of the appended claims. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN2011/080485 | 9/30/2011 | WO | 00 | 4/2/2014 |