Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Network request sending method of dependency relationship, terminal device and storage medium

A technology of network requests and dependencies, applied in the computer field, can solve the problem of code redundancy in the initiation method, and achieve the effect of facilitating later maintenance, simplifying logical relationships, and reducing code redundancy.

Pending Publication Date: 2020-06-16
WUHAN DOUYU NETWORK TECH CO LTD
View PDF5 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In view of this, an embodiment of the present invention provides a method for sending a network request with dependencies, a terminal device, and a storage medium, which are used to solve the problem of code redundancy in existing methods for initiating network requests with dependencies

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
  • Network request sending method of dependency relationship, terminal device and storage medium
  • Network request sending method of dependency relationship, terminal device and storage medium
  • Network request sending method of dependency relationship, terminal device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0025] see figure 1 , a schematic flowchart of a method for collecting network performance parameters provided by an embodiment of the present invention, including the following steps:

[0026] S101. When the user initiates a network request, store the network request objects with dependencies in a predefined array;

[0027] The network request is generally a data request sent by the client to the server through the network, and each data request is initiated by sending a corresponding network request object. In the embodiment of the present invention, a network request class is defined, and a network request object is generated by instantiating the class, and the server-side response data is transmitted back to the client through the network request object. Preferably, the network request is a network request in IOS.

[0028] The dependency relationship refers to two network requests. The initiation of one network request depends on the successful initiation and response of...

Embodiment 2

[0042] exist figure 1 On the basis of the program code as an example, combined with figure 2 The specific implementation process of processing network requests is described in detail as follows:

[0043] After the user initiates a network request, the client sends the request data to the server through the request object, and the server returns the response data to the client. In the embodiment of the present invention, the network request object can not only carry the initiation data, but also receive the response data , returns the response result.

[0044] S201. Object-based encapsulation of network requests

[0045]When a user initiates a network request, the network request needs to be objectified and encapsulated through a predefined class to generate a network request object. Generally, the network request object will carry various request parameters to initiate a request to the server.

[0046] Exemplarily, first create a network request class named 'DYRequest', d...

Embodiment 3

[0064] A network request method is mainly described above, and a network request terminal device will be described in detail below.

[0065] image 3 A schematic diagram showing the structure of a terminal device sending a network request of dependencies, including:

[0066] Storage module 310: used for storing network request objects with dependencies into a predefined array when a user initiates a network request;

[0067] The network request is generally a data request sent by the client to the server through the network, and each data request is initiated by sending a corresponding network request object. In the embodiment of the present invention, a network request class is defined, and a network request object is generated by instantiating the class, and the server-side response data is transmitted back to the client through the network request object. Preferably, the network request is a network request in IOS. The dependency relationship refers to two network reques...

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 network request sending method of a dependency relationship, a terminal device and a storage medium. The method is suitable for the field of application development. The method provided by the invention comprises the following steps: when a user initiates a network request, storing a network request object with a dependency relationship into a predefined array; defining callback of the network request object, and setting to control initiation of a next network request according to a return result of the current network request object when the current network request is successful in the callback; and acquiring a first network request object in the array to initiate a network request. According to the invention, the logic relationship between different initiated network requests can be simplified, the code redundancy is reduced, and the later maintenance is facilitated.

Description

technical field [0001] The present invention relates to the field of computer technology, and in particular to a method for sending a dependency network request, a terminal device and a storage medium. Background technique [0002] When entering a website and opening a new page, it is often necessary to load new page resources, which are obtained by initiating a network request. In practice, the initiation of a network request often depends on the completion of another request. Since each resource request is initiated, multiple network requests are sent at the same time, and there are complex logical relationships among these network requests. For network requests with dependencies, the usual solution is to define various complex internal processing logic to manage the initiation of network requests. This method not only produces a lot of code redundancy, but also is not easy to maintain. [0003] Therefore, it is necessary to propose a method that can simplify the processi...

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
IPC IPC(8): H04L29/08H04L29/06
CPCH04L67/62H04L67/01
Inventor 张骏
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products