Method and apparatus for maximizing a number of connections that can be executed from a mobile application

A computer implemented method and system for maximizing a number of connections that can be executed from a mobile application is disclosed. The method comprises determining whether a connection slot is available for a received call request; executing the call when a connection slot is available; processing the call request when a connection slot is not available, where processing comprises: determining a priority level for the request; when the determined priority level is a low priority, putting the request in a queue for later processing; and when the determined priority level is a high priority, when a low priority call is in progress, performing the steps of: canceling the in-progress low priority call; placing the cancelled low priority call in a queue for later processing; and executing the high priority call; and when no low priority call is in progress, placing the high priority call request in the queue.

BACKGROUND OF THE INVENTION

Field of the Invention

Embodiments of the present invention generally relate to mobile application performance, and more specifically to a method for maximizing a number of connections that can be executed from a mobile application.

Description of the Related Art

A finite number of connections may be executed concurrently from a mobile application. When the number of connections that are needed exceed the number of available connections, call requests, sometimes important call requests, are blocked while other less important call requests finished. For example, in a mobile application where thumbnail images are displayed, thirty or more thumbnails may need to be fetched from a server. However, other more important tasks must also be performed, such as maintaining updated content on the mobile application. If there are for example, ten connections available for the mobile application, the more important content update will be blocked until the thumbnail images are finished downloading. The downloading images may no longer be relevant to the mobile application, yet the low priority download takes precedent over the higher priority content update due to the first-come-first-serve nature of requests. This creates an unresponsive mobile application and a poor user experience.

Therefore, there is a need for a method for maximizing a number of connections that can be executed from a mobile application.

SUMMARY OF THE INVENTION

An apparatus and/or method is provided for maximizing a number of connections that can be executed from a mobile application substantially as shown in and/or described in connection with at least one of the FIGS.

DETAILED DESCRIPTION OF EMBODIMENTS

Techniques are disclosed for an apparatus and method for maximizing a number of connections that can be executed from a mobile application, according to embodiments of the invention. The disclosed method for maximizing a number of connections that can be executed from a mobile application, includes setting a priority for each call request that is possible from a mobile application. The priorities may be as simple as high and low and within each priority level, there may be secondary priorities rankings. For example, within the high priority category, there may be three or more secondary categories HP1, HP2, HP3, and the like, where HP1 is a higher priority call than HP2, and HP2 is a higher priority than HP3, and so on. Similarly, the low priority level may also include secondary low priority categories, such as LP1, LP2, LP3, and the like. The secondary priorities order calls that are waiting. If a first call request has a priority of HP3 and a second call request with a priority of HP2 is received after the HP3 call request is already in queue, the HP2 call request will be serviced ahead of the HP3 call request when a slot becomes available.

A number of allowable concurrent connections is determined for the mobile application. Each call request or response uses a connection. As used herein, the connection used by a call request or response is referred to as a “slot”. A number of slots that may be run concurrently is allocated such that one slot for each priority level is reserved and remains available for authentication requests, re-authentication requests, and renewing token requests, referred to herein as a “reserved slot”. When a low priority call request is received, if a slot is available, the slot is given to the call request. However, if no slot is available, then the call request is placed in a queue until a slot becomes available. When a high priority call request is received, it is given an available slot. However, if no slot is available, a low priority request that is currently executing is cancelled and placed in the queue and the high priority request is given the slot that was used by the low priority call. The reserved slots remain available for authentication requests, re-authentication requests, and renewing token requests.

FIG. 1depicts a block diagram of an system100for maximizing a number of connections that can be executed from a mobile application, according to one or more embodiments of the invention. The system100includes a mobile device102, a server104, communicatively connected via network106.

The mobile device102is a computing device, such as a desktop computer, laptop, tablet computer, smartphone, smartwatch or other wearable, smart speaker with a screen, and the like. The mobile device102includes a Central Processing Unit (CPU)108, support circuits110, a display112, and a memory114. The CPU108may include one or more commercially available microprocessors or microcontrollers that facilitate data processing and storage. The various support circuits110facilitate the operation of the CPU108and include one or more clock circuits, power supplies, cache, input/output circuits, and the like. The memory114includes at least one of Read Only Memory (ROM), Random Access Memory (RAM), disk drive storage, optical storage, removable storage and/or the like. The memory114includes an operating system116, application118, a call manager120, a call classification manager122, stored call priorities124, and a queue126. The operating system116may include various commercially known operating systems. The server104may be in the cloud and may be the backend server for the application118. In some embodiments, there may be a plurality of servers104. Call requests from the application118may use network106to communication with server104.

The call classification manager122sets a priority for each type of network call request that may be made from the application118. For example, an authentication request or a call that affects the experience of a user, such as a synchronization (e.g., favoriting or deleting content) call may be classified as high priority calls. Displaying thumbnail images may be classified as high priority but may be considered secondary to an authentication call. As such, synchronization calls may be given an HP1 classification, while thumbnail display calls may be given an HP2 classification. Calls that may be temporarily delayed without noticeable impact on the user experience may be classified as low priority (LP1). The call classifications are stored as call priorities124.

The call manager120determines a number of allowable concurrent network connections for the application118. Each call request or response uses a connection (i.e., takes up one slot). The call manager120allocates a number of slots such that for each priority level, the call manager120allocates one slot, referred to as a “reserved slot”. In some embodiments, the call manager120allocates reserved slots based on the needs of the application118. For example, the application118may only require one type of authentication. In such case, the call manager120would allocate one reserved slot. If the application118requires authentication and re-authentications, the call manager120may reserve two slots. When a call request is received, the call manager120processes the call request. If a slot is available, the slot is given to the call request and the call associated with the call request is executed. However, if no slot is available, then the call manager120determines the priority level of the call request using the call priorities124. If the call request is a low priority call, the call manager120places the low-priority call request in the queue126. However, if the call request is a high priority call request then the call manager120determines whether there is a low priority call among the calls that are in progress. If there are low-priority calls in progress, a low priority call is cancelled and placed in the queue126until a slot becomes available for its execution. In some embodiments, the call manager120selects the low priority call with the lowest secondary priority and cancels and queues said low-priority call. If the call request is a high priority call request and no slots are available, and the call manager120determines that all slots are being utilized for high priority call execution, then high priority call request is placed in queue126. If a high priority call request is received that requires a re-authentication and all slots are filled with high and low priority calls, the call manager120executes the re-authentication request in a reserved slot and executes the high priority in a slot according to the above description.

When a call completes, the call manager120gives the newly available slot to the call request in the queue126with the highest priority.

FIG. 2depicts a flow diagram of a method200for maximizing a number of connections that can be executed from a mobile application, according to one or more embodiments of the invention. The method200starts at step202and proceeds to step204.

At step204, a plurality of connection slots is allocated for network calls. As an example, a mobile application allows ten concurrent network connections. The number of concurrent network connections allowed may be defined by the mobile device. In the present example, where there are ten slots allowed, two slots may be reserved, one for each priority level. In some embodiments, the number of reserved and non-reserved slots is configurable based on the needs of the mobile application. For example, if the mobile application simply requires authentication, one reserve slot may be allocated. However, if the mobile application requires authentication and re-authentication, two reserve slots may be allocated.

At step206, a call request is received. The call request is from the mobile application and requires a network connection.

At step208, it is determined whether there are any non-reserved slots available for the call request. If there are available slots, then at step210, the call is executed using one of the available slots. However, if there are no non-reserved slots available, then the method200proceeds to step212.

At step212, it is determined whether the call request is a high priority call request or a low priority call request. If the call request is a low priority call request, then the method proceeds to step220, where the call request is placed in a queue until a connection slot becomes available for the call request. However, if the call request is a high priority call request, then the method200proceeds to step214.

At step214, it is determined whether there are any low priority calls in progress (i.e., executing in one of the connection slots). If there is a low priority call in progress, then at step216, the low priority call is canceled and placed in the queue until a connection slot becomes available for the call request. At step218, the high priority call is initiated in the slot that was just made available by canceling the low priority call and the method200proceeds to step222.

However, if at step214, it is determined that no low priority calls are in progress (i.e., all calls in progress are high priority calls), then the method200proceeds to step220, where the call request is placed in a queue until a connection slot becomes available for the call request.

At step222, the method200ends.

FIGS. 3A-3Gdepict connections slots300during processing of incoming calls, according to one or more embodiments of the invention. InFIG. 3A, there are ten (10) connection slots available. Slots302,304,306,308,310,312,314, and316are allocated as non-reserved slots. Slots318and320are reserved, for special call requests, such as authentication call requests, re-authentication call requests, renewing token requests, and the like, when needed and to avoid blocking high priority calls. Although the slots are numbered for ease of description, in practice, there is no order to the connection slots.

FIG. 3Bdepicts the connection slots300while a number of network calls are being executed. Slots302,304,306, and308are high priority calls in execution. Slots310,312,314, and316are low priority calls in execution. Slots318and320are free in the event an authentication/re-authentication/token call request is received.

FIG. 3Cdepicts the transition from connection slots300inFIG. 3Bto connection slots300when new high priority calls are received. InFIG. 3C, two new high priority calls are initiated. Slots302,304,306, and308are already being used for high priority calls in execution. Slots310and312are taken for execution of the two new high priority calls. The low priority calls that had been executing in slots310and312are canceled and put into a queue for execution when slots are freed up Slots314and316remain in use for the low priority calls in execution. Slots318and320remain free in the event an authentication/re-authentication/token call request is received.

FIG. 3Ddepicts the transition from the connection slots inFIG. 3Cto connection slots300where a number of high priority calls complete and low priority calls from in queue are placed in the newly available slots. Three high priority calls complete. As such slots302,304, and306remain in use for high priority calls in execution. Slots308and310are able to be used for low priority calls with the additional slots312,314, and316available for low priority calls. Slots318and320are free in case a new high priority call request is received. With five slots available for low priority calls, the two low priority calls fromFIG. 3Ccontinue to execute while three low priority calls may be pulled off the queue. In the present example, there are five low priority calls in the queue, with priorities of LP1, LP3, LP2, LP2, and LP1, respectively. As such, the low priority calls with higher secondary priorities (LP1 and LP2) are executed first. As such, LP1, LP1, and LP2 are executed in slots312,314, and316. Now, three high priority calls are executing, five low priority calls are executing, two slots (slot318and320) remain free in the event an authentication/re-authentication/token call request is received, and two low priority calls still in the queue.

FIG. 3Edepicts the transition from the connection slots inFIG. 3Dto connection slots300where one high priority call completes. Slots302and304are being used for high priority calls in execution. Slot306is freed when the high priority call completes. As such a low priority call that is still in the queue may use slot306. The low priority call with the highest secondary priority (L2) is selected to be executed in slot306. Slots308,310,312,314, and316are being used for low priority calls in execution. Slots318and320are free in the event an authentication/re-authentication/token call request is received.

FIG. 3Fdepicts the transition from the connection slots inFIG. 3Eto connection slots300where one more high priority call completes. Slot302is still being used for a high priority call in execution. Slot304is freed when the high priority call in slot304completes. As such a low priority call that is still in the queue may use slot304. Slots306,308,310,312,314, and316are being used for low priority calls in execution. Slots318and320remain free in the event an authentication/re-authentication/token call request is received.

FIG. 3Gdepicts the transition from the connection slots inFIG. 3Fto connection slots300where a reserved slot must be utilized. Slot302is being used fora high priority call in execution. Slots304,306,308,310,312,314, and316are being used for low priority calls in execution. Slots318and320are free in the event a new high priority call request is received. The high priority call request in slot302requires a re-authentication. All of the slots are in use. As such, the authentication call uses the reserved slot318. The slot318may be used immediately to avoid delay in waiting for a slot to become available. When the re-authentication call is complete, the high priority call may proceed and the reserved slot318if free and waiting for a next authentication/re-authentication/token call request.

FIG. 4depicts a computer system that can be used to implement the method ofFIG. 2in various embodiments of the present invention. Various embodiments of a method and apparatus for maximizing a number of connections that can be executed from a mobile application, as described herein, may be executed on one or more computer systems, which may interact with various other devices. One such computer system is computer system400illustrated byFIG. 4, which may in various embodiments implement any of the elements or functionality illustrated inFIGS. 1-3. In various embodiments, computer system400may be configured to implement methods described above. The computer system400may be used to implement any other system, device, element, functionality or method of the above-described embodiments. In the illustrated embodiments, computer system400may be configured to implement method200, as processor-executable executable program instructions422(e.g., program instructions executable by processor(s)410) in various embodiments.

In the illustrated embodiment, computer system400includes one or more processors410coupled to a system memory420via an input/output (I/O) interface430. Computer system400further includes a network interface440coupled to I/O interface430, and one or more input/output devices450, such as cursor control device460, keyboard470, and display(s)480. In various embodiments, any of components may be utilized by the system to receive user input described above. In various embodiments, a user interface (e.g., user interface430) may be generated and displayed on display480. In some cases, it is contemplated that embodiments may be implemented using a single instance of computer system400, while in other embodiments multiple such systems, or multiple nodes making up computer system400, may be configured to host different portions or instances of various embodiments. For example, in one embodiment some elements may be implemented via one or more nodes of computer system400that are distinct from those nodes implementing other elements. In another example, multiple nodes may implement computer system400in a distributed manner.

In various embodiments, computer system400may be a uniprocessor system including one processor410, or a multiprocessor system including several processors410(e.g., two, four, eight, or another suitable number). Processors410may be any suitable processor capable of executing instructions. For example, in various embodiments processors410may be general-purpose or embedded processors implementing any of a variety of instruction set architectures (ISAs), such as the x96, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of processors410may commonly, but not necessarily, implement the same ISA.

System memory420may be configured to store program instructions422and/or data432accessible by processor410. In various embodiments, system memory420may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic RAM (SDRAM), nonvolatile/flash-type memory, persistent storage (magnetic or solid state), or any other type of memory. In the illustrated embodiment, program instructions and data implementing any of the elements of the embodiments described above may be stored within system memory420. In other embodiments, program instructions and/or data may be received, sent or stored upon different types of computer-accessible media or on similar media separate from system memory420or computer system400.

In one embodiment, I/O interface430may be configured to coordinate I/O traffic between processor410, system memory420, and any peripheral devices in the system, including network interface440or other peripheral interfaces, such as input/output devices450, In some embodiments, I/O interface430may perform any necessary protocol, timing or other data transformations to convert data signals from one component (e.g., system memory420) into a format suitable for use by another component (e.g., processor410). In some embodiments, I/O interface430may include support for devices attached through various types of peripheral buses, such as a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some embodiments, the function of I/O interface430may be split into two or more separate components, such as a north bridge and a south bridge, for example. Also, in some embodiments some or all of the functionality of I/O interface430, such as an interface to system memory420, may be incorporated directly into processor410.

Input/output devices450may, in some embodiments, include one or more display terminals, keyboards, keypads, touch pads, scanning devices, voice or optical recognition devices, or any other devices suitable for entering or accessing data by one or more computer systems400. Multiple input/output devices450may be present in computer system400or may be distributed on various nodes of computer system400. In some embodiments, similar input/output devices may be separate from computer system400and may interact with one or more nodes of computer system400through a wired or wireless connection, such as over network interface440.

In some embodiments, the illustrated computer system may implement any of the methods described above, such as the method illustrated by the flowchart ofFIG. 2. In other embodiments, different elements and data may be included.