Data request processing method and system

A data request and processing method technology, applied in the field of communication, can solve problems such as frequent interface refreshes, impact on mobile phone battery life, client fluency, and unpredictable timing of data return, so as to avoid frequent refreshes

Inactive Publication Date: 2018-06-29
贵阳语玩科技有限公司
View PDF6 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

If these network requests are performed separately, due to cross-process and cross-network communication, the timing of data return cannot be predicted, causing the client to refresh the interface once every callback, resulting in frequent refresh of the interface and affecting the battery life of the mobile phone And the fluency of the client, bringing bad user experience
[0004] There is such a scenario: the data that the client needs to display on a certain UI interface is completed by two or more API interfaces, and the network request cannot be made in the main thread and the main thread cannot be blocked to wait for the network request to complete

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Data request processing method and system
  • Data request processing method and system
  • Data request processing method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0016] The specific implementation of the present invention will be described in detail below in conjunction with the accompanying drawings.

[0017] figure 1 is a flowchart of a data request processing method according to an embodiment of the present invention. Such as figure 1 As shown, the processing method of the data request includes:

[0018] Step S101: the UI thread initiates multiple data requests in an asynchronous manner;

[0019] Step S103: the data management class calls a method to encapsulate the above-mentioned multiple data requests into a combined observable object, and register the above-mentioned UI thread as an observer of the above-mentioned combined observable object;

[0020] Step S105: using the observable object of the above combination to send the above multiple data requests, blocking the thread called by the above method, and waiting for the result corresponding to each request to be returned in a synchronous manner;

[0021] Step S107: After al...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a data request processing method and system. The method comprises the following steps: initiating requests for multiple data in an asynchronous mode by a UI thread; encapsulating the requests for the multiple data into a combined observable object by a data management class calling method, and registering the UI thread as an observer of the combined observable object; usingthe combined observable object to send the requests for the multiple data, blocking the thread called by the method, and waiting for returning a result corresponding to each request in a synchronousmode; after all the results are returned, assembling all the results by using the combined observable object, and notifying the UI thread of the assembled result; and refreshing a client interface bythe UI thread according to the assembled result. According to the technical scheme provided by the invention, multiple asynchronous network requests can be simultaneously performed without blocking amain thread, and the client interface can be prevented from being frequently refreshed.

Description

technical field [0001] The present invention relates to the communication field, in particular, to a data request processing method and system. Background technique [0002] In the Android application development process, two network request methods based on HTTP and TCP are often involved. For HTTP-based methods, there are already many mature open source solutions to handle synchronous requests and asynchronous callbacks. However, there is still a lack of mature processing solutions for processing TCP-based network requests accessed through native development tools (Native Development Kit, NDK for short), especially when it is necessary to deal with the problem of completing multiple asynchronous requests at the same time and asynchronously calling back the results at the same time . [0003] The Android application calls the network request callback interface written in C / C++ through the NDK, and these interfaces may be in different processes from the Android application...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08
CPCH04L67/02H04L67/565H04L67/60
Inventor 卢林清段凌云白国松
Owner 贵阳语玩科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products