WO2019019249A1 - 执行网络请求的方法、装置、设备及计算机可读存储介质 - Google Patents
执行网络请求的方法、装置、设备及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2019019249A1 WO2019019249A1 PCT/CN2017/099547 CN2017099547W WO2019019249A1 WO 2019019249 A1 WO2019019249 A1 WO 2019019249A1 CN 2017099547 W CN2017099547 W CN 2017099547W WO 2019019249 A1 WO2019019249 A1 WO 2019019249A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request
- instance
- network request
- network
- executed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Definitions
- the present invention relates to the field of electronic device technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for performing a network request.
- the embodiment of the invention provides a method, a device, a device and a computer readable storage medium for executing a network request, which can save time for the user to wait for the network to request data loading, and improve the user experience.
- an embodiment of the present invention provides a method for performing a network request, where the method includes:
- the network request is a preset type of network request, controlling the application to send the network request to the management center;
- the management center controls the application to display a status after the network request is successfully executed and execute the network request.
- an embodiment of the present invention provides an apparatus for performing a network request, where the apparatus includes:
- a determining unit configured to determine, if the application is to send a network request, whether the network request is a preset type of network request
- control sending unit configured to: if the network request is a preset type of network request, control the application to send the network request to the management center;
- the management center is configured to control the application to display a status after the network request is successfully executed and execute the network request.
- an embodiment of the present invention provides a device for performing a network request, where the device includes: a memory and a processor; the memory stores executable program data; and the processor is configured to run the storage in the memory.
- the program data is to perform the method of the first aspect above.
- an embodiment of the present invention provides a computer readable storage medium, where the one or more program data is stored, and the one or more program data may be processed by one or more processes.
- the apparatus is executed to implement the method described in the first aspect above.
- the management center of the application when the application is started, the management center of the application is created. If it is detected that the application is to send a network request, it is determined whether it is a preset type of network request, and if so, the management center control application displays that the network request is successfully executed. The subsequent state and execution of the network request saves the time for the user to wait for the network to request data loading, thereby improving the user experience.
- FIG. 1 is a schematic flowchart of a method for executing a network request according to an embodiment of the present invention
- FIG. 2 is a schematic flowchart of a sub-method of a method for executing a network request according to an embodiment of the present invention
- FIG. 3 is a schematic flow chart of another sub-method of a method for executing a network request according to an embodiment of the present invention
- FIG. 4 is a schematic block diagram of an apparatus for executing a network request according to an embodiment of the present invention.
- FIG. 5 is a schematic block diagram of a management center according to an embodiment of the present invention.
- FIG. 6 is a schematic block diagram of a management center according to another embodiment of the present invention.
- FIG. 7 is a schematic block diagram of a management center according to another embodiment of the present invention.
- FIG. 8 is a schematic block diagram of an apparatus for performing a network request according to an embodiment of the present invention.
- the device described in the embodiments of the present invention includes, but is not limited to, a portable device such as a mobile phone, a laptop computer or a tablet computer that can execute an application. It should also be understood that in some embodiments, the device is not a portable communication device, but also includes a desktop computer, television, etc., that can execute an application. The device can install and execute various applications.
- FIG. 1 is a schematic flowchart diagram of a method for executing a network request according to an embodiment of the present invention.
- the method includes S101 ⁇ S104.
- S101 If the application is started, create a management center that can execute an application network request. Among them, the management center is created in the local background of the application, and the management center is part of the application. Creating a management center includes opening up storage space, configuring and saving some parameters, and more.
- the Management Center is created each time the application is launched. Each time the application is closed, the management center is destroyed to ensure that the management center is not destroyed and consumes device resources if the application is not started. In the management center, you can configure and save related parameters for executing network requests, such as preset number, preset time, preset number, and so on.
- the network request includes many parameters, such as the interface to be sent, the amount of data to be sent, the protocol used, the destination address, the type of network request data, and some other parameters, such as the priority of the network request. Determining whether the network request is a preset type of network request according to a parameter of the network request, wherein the preset type of network request refers to non-real-time or low-time requirements, and does not need to be quickly associated with other devices such as a server. There are further interactive network requests.
- the network request can send a circle of friends, a circle of friends sent by WeChat friends, a message of a friend circle, a message of a favorite message or a WeChat open, and a modified WeChat profile.
- the control application sends the network request to the management center.
- the control application sends the network request to the management center to save the network request in the management center and obtain a unique identifier assigned by the management center for the network request. If the network request is not a preset type of network request, a network request is sent to the server.
- the management center control application displays a status after the network request is successfully executed and executes the network request. For example, if the network request requests the friend circle message sent by the WeChat friend, the management center control application displays the status of the like success, and executes the network request that the friend circle liked for the WeChat friend. It can be understood that the network request is not actually executed, and the state after the network request is successfully executed is displayed first; then the management center executes the network request. In this way, if the network condition is not good, the user does not have to wait for the network request to be successfully executed, and the user can obtain more time to perform other operations in the next step, thereby improving the user experience.
- the management center of the application when the application is started, the management center of the application is created, and if it is detected that the application is to send a network request, it is determined whether it is a preset type of network request, and if so, the management center control application displays that the network request is successfully executed.
- the state and execution of the network request saves the time for the user to wait for the network to request data loading, which improves the user experience.
- S104 includes S201-S207 to further define how the management center controls the application to display the state after the network request is successfully executed and execute the network request.
- the related parameters of the network request including the preset time, the preset number of times, and the suspension waiting time, can be configured and saved in the management center.
- the preset time can be understood as the time when the request instance is executed once.
- One request instance can be executed once to send the network request only once, and can also send the network request multiple times; the preset number can be understood as the number of times the network request is automatically executed.
- S201 Create a request instance of the network request to control an application to display a status after the network request is successfully executed.
- the priority of the request instance is included in the request instance of the network request, and the preset time corresponding to the request instance, the preset number of times corresponding to the request instance, the suspension waiting time corresponding to the request instance, and the like. .
- different preset times, preset times, and pause waiting times can be set for request instances of different priorities. If the amount of data corresponding to the request instance is large, such as uploading multiple images, the preset time and the preset number of times corresponding to the request instance are larger.
- the relevant parameters in the request instance are taken as the priority, for example, the priority in the request instance is obtained.
- the relevant parameters of the network request configured by the management center shall prevail.
- the priority of the request instance can be determined according to the function of the application. If there are 5 different requests in the same webpage, according to the function of the application, if the application mainly displays images, the request instance requesting the display image has a higher priority than the request instance corresponding to the request data. level.
- the same preset time, the preset number of times, the suspension waiting time, and the like may be set for the request instances of different priorities. In other embodiments, the preset time, the preset number of times, and the like corresponding to the request instance may be the same or different for different applications.
- the control application displays the status after the network request is successfully executed. For the WeChat application, if the network request is a friend circle sent by the WeChat friend, if the request instance of the network request is successfully created, the callback function of the request instance creation success will cause the front end of the application to display that the network request is successfully executed. The state of the point, that is, the state of success.
- S202 Determine whether the number of network requests being executed reaches a preset number.
- the management center can perform multiple network requests at the same time to determine whether the number of network requests being executed reaches a preset number. If the preset number is reached, S203 is performed; if the preset number is not reached, S204 is performed. If no network request is currently being performed, the number of network requests being executed is zero.
- the management center can execute multiple network requests at the same time, maximizing the utilization of network resources and improving the efficiency of executing network requests.
- S203 Put the request instance into a corresponding waiting queue according to the priority of the request instance, and wait for execution.
- the request instance is divided into different priorities, and the request instances in the corresponding waiting queues with higher priority are preferentially executed to improve the user experience.
- S202 is executed to determine whether the request instance can be executed. For example, in the process of waiting, if the request instance is successfully executed, the number of network requests being executed does not reach the preset number, and the request instance in the waiting queue can be taken out. Perform a network request.
- S205 Determine whether the network request is successfully executed. If the network request is successfully executed, S206 is performed; otherwise, S207 is performed.
- the number of times the network request is executed according to the request instance is not specifically limited, such as three times.
- the management center when the management center performs the network request, if the number of network requests being executed by the management center reaches a preset number, the request instance is placed in the corresponding waiting queue according to the priority of the request instance, and the execution is performed. The number is set, the network request is executed according to the request instance; the network request is successfully executed, and if the execution is successful, the request instance is deleted, and if the execution is not successful, the network request is executed according to the request instance again.
- the foregoing embodiment may perform a network request according to the priority of the request instance, so as to preferentially process more important network requests and improve the user experience; and, multiple network requests are simultaneously executed, and the network resources are utilized to the maximum, and the efficiency of executing the network request is improved.
- the network request is automatically re-executed according to the request instance, and the network request is automatically executed multiple times, which ensures that the network request can be successfully executed without the user clicking to re-execute, thereby improving the user experience.
- FIG. 3 is a flow chart of method steps after the management center performs the network request multiple times according to the request instance, wherein the multiple times do not exceed the preset number of times, and are associated with the number of execution network requests of the embodiment of FIG. 2 .
- the multiple times of the embodiment are referred to twice; if the number of times the embodiment of FIG. 2 executes the network request is three times, then the multiple times of the embodiment refers to three times.
- the number of times the network request is executed by the embodiment of FIG. 2 is two times, and the multiple times of the location are referred to twice.
- the preset number of times is five times.
- the step after the management center performs the network request according to the request instance multiple times is still unsuccessful, and includes S301-S310.
- S301 If the network request is not successfully executed, determine whether the number of times the network request is executed according to the request instance reaches a preset number of times. If the preset number of times is not reached, S302 is performed; if the preset number of times is reached, S307 is performed.
- S302 Put the request instance into a corresponding suspension queue according to the priority of the request instance. Put the request instance into the corresponding deferred queue, and continue to execute the network request according to the request instance after the interval is suspended, thereby increasing the probability of successful execution of the network request.
- S303 Determine whether the waiting time is reached. If the waiting time is reached, S304 is executed; if the waiting time is not reached, it is determined whether the waiting time is reached.
- the request instance is taken out from the suspension queue and the network request is executed according to the request instance.
- S305 Determine whether the network request is successfully executed. If the network request is successfully executed, S306 is performed; if the execution is not successful, S301 is performed.
- S307. Destroy the request instance and obtain the reason why the network request is not successfully executed. If the number of times the network request is executed according to the request instance reaches a preset number, and the request instance is destroyed and the reason why the network request is not successfully executed is obtained, it is preferable to return the reason why the last execution of the network request failed.
- the reasons include the interface not found, the page not found, the network interruption, and so on.
- the control application displays the state before the network request is successfully executed. If it is not necessary to re-create a request instance that is identical to the request instance, the application is controlled according to the unique identifier to display the state before the network request was successfully executed, that is, the state after the successful execution of the network request is revoked.
- S310 Create a request instance of the network request. If you need to re-create a request instance that is identical to the request instance, create a request instance for the network request to request more requests from the network to increase the probability of successful network request execution. After the creation is completed, the process returns to S202, that is, the step of determining whether the number of network requests can be simultaneously executed reaches a preset number.
- the foregoing embodiment determines whether the number of times the network request is executed according to the request instance reaches a preset number. If the preset number of times is not reached, the network request is suspended, and the interval is suspended after the waiting time continues. The network request is executed to increase the probability that the network request is successfully executed. If the preset number of times is reached, the execution fails within the preset number of times, and the reason why the network request is not successfully executed is obtained. According to the reason, it is determined whether it is necessary to re-create a request instance that is identical to the request instance. If re-creation is required, a request instance of the network request is created to request more request opportunities for the network, thereby increasing the probability of success of the network request execution; There is no need to recreate, undoing the state after the successful execution of the network request.
- FIG. 4 is a schematic block diagram of an apparatus for performing a network request according to an embodiment of the present invention.
- the device 40 includes a creating unit 401, a determining unit 402, a control transmitting unit 403, and a management center 404.
- the creating unit 401 is configured to create a management center that can execute an application network request if the application is started.
- the management center is created in the local background of the application, and the management center is part of the application.
- Creating a management center includes opening up storage space, configuring and saving some parameters, and more.
- the Management Center is created each time the application is launched. Each time the application is closed, the management center is destroyed to ensure that the management center is not destroyed and consumes device resources if the application is not started.
- you can configure and save related parameters for executing network requests such as preset number, preset time, preset number, and so on.
- the determining unit 402 is configured to determine, if the application is to send a network request, whether the network request is a preset type of network request.
- the network request includes many parameters, such as the interface to be sent, the amount of data sent, the protocol used, the destination address, etc., and some other parameters, such as the priority of the network request. Determining whether the network request is a preset type of network request according to a parameter of the network request, wherein the preset type of network request refers to non-real-time or low-time requirements, and does not need to be quickly associated with other devices such as a server. There are further interactive network requests.
- the network request can send a circle of friends, a circle of friends sent by WeChat friends, a message of a friend circle, a message of a favorite message or a WeChat open, and a modified WeChat profile.
- the control sending unit 403 is configured to: if the network request is a preset type of network request, the control application sends the network request to the management center. The control application sends the network request to the management center to save the network request in the management center and obtain a unique identifier assigned by the management center for the network request.
- the management center 404 is used to control the application to display the status after the network request is successfully executed and execute the network request. For example, if the network request requests the friend circle message sent by the WeChat friend, the management center control application displays the status of the like success, and executes the network request that the friend circle liked for the WeChat friend. It can be understood that the network request is not actually executed, and the state after the network request is successfully executed is displayed first; then the management center executes the network request. In this way, if the network condition is not good, the user does not have to wait for the network request to be successfully executed, and the user can obtain more time to perform other operations in the next step, thereby improving the user experience.
- the management center of the application when the application is started, the management center of the application is created, and if it is detected that the application is to send a network request, it is determined whether it is a preset type of network request, and if so, the management center control application displays that the network request is successfully executed.
- the state and execution of the network request saves the time for the user to wait for the network to request data loading, which improves the user experience.
- the management center 50 includes a request instance creation unit 501, a control determination unit 502, a waiting unit 503, a request execution unit 504, a deletion unit 505, and a storage unit 506.
- the storage unit 506 is configured to save the request instance, and save the related parameters of the configured network request, and the related parameters of the network request include a preset time, a preset number of times, a suspension waiting time, and the like.
- the preset time can be understood as the time when the request instance is executed once.
- One request instance can be executed once to send the network request only once, and can also send the network request multiple times; the preset number can be understood as the number of times the network request is automatically executed.
- the request instance creation unit 501 is configured to create a request instance of the network request to control the state of the application after the network request is successfully executed.
- the priority of the request instance is included in the request instance of the network request, and the preset time corresponding to the request instance, the preset number of times corresponding to the request instance, the suspension waiting time corresponding to the request instance, and the like. .
- different preset times, preset times, and pause waiting times can be set for request instances of different priorities. If the amount of data corresponding to the request instance is large, such as uploading multiple images, the preset time and the preset number of times corresponding to the request instance are larger.
- the relevant parameters in the request instance are taken as the priority, for example, the priority in the request instance is obtained.
- the relevant parameters of the network request configured by the management center shall prevail.
- the priority of the request instance can be determined according to the function of the application. If there are 5 different requests in the same webpage, according to the function of the application, if the application mainly displays images, the request instance requesting the display image has a higher priority than the request instance corresponding to the request data. level.
- the same preset time, the preset number of times, the suspension waiting time, and the like may be set for the request instances of different priorities. In other embodiments, the preset time, the preset number of times, and the like corresponding to the request instance may be the same or different for different applications.
- the control application displays the status after the network request is successfully executed. For the WeChat application, if the network request is a friend circle sent by the WeChat friend, if the request instance of the network request is successfully created, the callback function will cause the front end of the application to display the state after the network request is successfully executed, that is, the point. Praise the state of success.
- the control judging unit 502 is configured to judge whether the number of network requests being executed reaches a preset number.
- the management center can simultaneously execute multiple network requests to determine whether the number of network requests being executed reaches a preset number. If no network request is currently being performed, the number of network requests being executed is zero.
- the management center can execute multiple network requests at the same time, maximizing the utilization of network resources and improving the efficiency of executing network requests.
- the waiting unit 503 is configured to: if the number of network requests being executed reaches a preset number, put the request instance into a corresponding waiting queue according to the priority of the request instance, and wait for execution.
- the request instance is divided into different priorities, and the request instances in the corresponding waiting queues with higher priority are preferentially executed to improve the user experience.
- the control judgment unit is triggered to determine whether the request instance can be executed. For example, in the process of waiting, if the request instance is successfully executed, the number of network requests being executed does not reach the preset number, and the request in the waiting queue can be taken out. An instance to execute a network request.
- the request execution unit 504 is configured to execute a network request according to the request instance if the number of network requests being executed does not reach a preset number. In addition, if in the process of waiting, if the request instance is successfully executed, the number of simultaneous network requests that the management center can execute at the same time does not reach the preset number, and the request instance in the waiting queue can be taken out to execute the network request.
- the control determining unit 502 is further configured to determine whether the network request is successfully executed.
- the deleting unit 505 is configured to delete the request instance if the network request is successfully executed.
- the request execution unit 504 is further configured to perform a network request according to the request instance again if the network request execution fails. If the request instance is not successfully executed, the network request is executed again according to the request instance. Then, the judging unit is triggered to judge whether the network request is successfully executed.
- the management center when the management center performs the network request, if the number of network requests being executed by the management center reaches a preset number, the request instance is placed in the corresponding waiting queue according to the priority of the request instance, and the execution is performed. The number is set, the network request is executed according to the request instance; the network request is successfully executed, and if the execution is successful, the request instance is deleted, and if the execution is not successful, the network request is executed according to the request instance again.
- the foregoing embodiment may perform a network request according to the priority of the request instance, so as to preferentially process more important network requests and improve the user experience; and, multiple network requests are simultaneously executed, and the network resources are utilized to the maximum, and the efficiency of executing the network request is improved.
- the network request is automatically re-executed according to the request instance, and is automatically executed multiple times, which ensures that the network request can be successfully executed without the user clicking to re-execute, thereby improving the user experience.
- FIG. 6 is a schematic block diagram of a management center according to another embodiment of the present invention.
- the management center 60 includes a request instance creation unit 601, a control determination unit 602, a waiting unit 603, a request execution unit 604, a deletion unit 605, a storage unit 606, and a suspension unit 607.
- the main difference between the management center 60 and the management center 50 in the embodiment of FIG. 5 is that the suspension unit 607 is added.
- the request instance creation unit 601, the control determination unit 602, the waiting unit 603, the request execution unit 604, the deletion unit 605, and the storage unit 606 refer to the description of the embodiment of FIG. 5, and details are not described herein again.
- the difference between this embodiment and the embodiment of Figure 5 is that:
- the control determining unit 602 is further configured to determine whether the number of times the network request is executed according to the request instance reaches a preset number of times if the network request is not successfully executed multiple times. Wherein, the number of times does not exceed a preset number of times, and is associated with the number of times the network request is executed in the embodiment of FIG. 2. If the number of times the network request is executed in the embodiment of FIG. 2 is two times, then the multiple times of the embodiment are referred to twice; if the number of times the embodiment of FIG. 2 executes the network request is three times, then the multiple times of the embodiment refers to three times. Preferably, the number of times the network request is executed by the embodiment of FIG. 2 is two times, and the multiple times of the location are referred to twice.
- the suspending unit 607 is configured to: when the number of times the network request is executed according to the request instance does not reach the preset number of times, the request instance is placed in the corresponding suspension queue according to the priority of the request instance. Put the request instance into the corresponding deferred queue, and continue to execute the network request according to the request instance after the interval is suspended, thereby increasing the probability of successful execution of the network request.
- the control judging unit 602 is further configured to determine whether the suspension waiting time is reached.
- the suspension unit 607 is further configured to: if the suspension waiting time is reached, take the request instance from the suspension queue and execute the network request according to the request instance. Then, the judging unit is triggered to judge whether the network request is successfully executed.
- the deleting unit 605 is further configured to delete the request instance if the network request is successfully executed. If the network request is not successfully executed, the determining unit is triggered to determine whether the number of times the network request is executed reaches a preset number of times.
- FIG. 7 is a schematic block diagram of a management center according to another embodiment of the present invention.
- the management center 70 includes a request instance creation unit 701, a control determination unit 702, a waiting unit 703, a request execution unit 704, a deletion unit 705, a storage unit 706, a suspension unit 707, a destruction unit 708, and a restoration unit 709.
- the main difference between the management center 70 and the management center 60 in the embodiment of FIG. 6 is that the destruction unit 708 and the restoration unit 709 are added.
- the request instance creation unit 701, the control determination unit 702, the waiting unit 703, the request execution unit 704, the deletion unit 705, the storage unit 706, and the suspension unit 707 are referred to the description of the embodiment of FIG. 6, and details are not described herein again.
- the difference between this embodiment and the embodiment of Fig. 6 is that:
- the destroying unit 708 is configured to: if the number of times the network request is executed according to the request instance reaches a preset number of times, destroy the request instance, and obtain a reason why the network request is not successfully executed. It is preferable to return the reason why the last execution of the network request failed.
- the reasons include the interface not found, the page not found, the network interruption, and so on.
- the control determining unit 702 is further configured to determine, according to the reason, whether a request instance that is identical to the request instance needs to be re-created. If the reason is that the interface is not found, the page is not found, etc., there is no need to recreate a request instance that is identical to the request instance. If the cause is a network outage, etc., then you need to recreate a request instance that is identical to the request instance.
- the restore unit 709 is configured to control the application to display the state before the network request was successfully executed without re-creating a request instance that is identical to the request instance.
- the application is controlled according to the unique identifier to display the state before the execution of the network request is successful, that is, to undo the state after the successful execution of the network request.
- the request instance creation unit 701 is further configured to create a request instance of the network request if it is necessary to re-create a request instance that is identical to the request instance. Create a request instance for the network request again to request more requests from the network, increasing the chances of successful network request execution. After the creation is completed, the control determination unit is triggered to determine whether the number of network requests being executed reaches a preset number.
- the above apparatus for executing a network request can be implemented in the form of a computer program that can be run on a device as shown in FIG.
- FIG. 8 is a schematic block diagram of an apparatus for performing a network request according to an embodiment of the present invention.
- the device 80 includes one or more input devices 801; one or more output devices 802, one or more memories 803, and one or more processors 804.
- the input device 801, the output device 802, the memory 803, and the processor 804 are connected by a bus 805. among them:
- the input device 801 is configured to provide a request for the user to send a network request, and provide a request instance for the user to re-send the network request.
- the input device 801 of the embodiment of the present invention may include a keyboard, a mouse, a photoelectric input device, a sound input device, a touch input device, and the like.
- the output device 802 is configured to display a status after the execution of the network request is successful, a reason why the network request is not successfully executed, and the like.
- the output device 802 of the embodiment of the present invention may include a display, a display screen, a touch screen, a sound output device, and the like.
- the memory 803 is used to store program data that implements a network request.
- the memory 803 of the embodiment of the present invention may be a system memory, such as a non-volatile (such as a ROM, a flash memory, etc.).
- the memory 803 of the embodiment of the present invention may also be an external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, or the like.
- the processor 804 is configured to run program data stored in the memory 803 to perform the following steps:
- the application If the application is started, creating a management center that can execute the application network request; if detecting that the application is to send a network request, determining whether the network request is a preset type of network request; if the network request is a preset a type of network request that controls the application to send the network request to the management center; the management center controls the application to display a status after the network request is successfully executed and execute the network request.
- the processor 804 also performs the following steps:
- the processor 804 also performs the following steps:
- the processor 804 also performs the following steps:
- the control application displays the state before the network request was successfully executed; if it is to be re-created, the request instance is created and the number of network requests that are determined to be executing is returned to a preset number step.
- the processor 804 also performs the following steps:
- the request instance is put into a waiting queue according to the priority of the request instance to wait for execution; if the network request is executed according to the request instance, the number of times is not executed. If the number of times the network request is executed according to the request instance does not reach the preset number of times, the request instance is put into the corresponding one according to the priority of the request instance. Deferred queue.
- the present invention also provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors, Implement the following steps:
- the application If the application is started, creating a management center that can execute the application network request; if detecting that the application is to send a network request, determining whether the network request is a preset type of network request; if the network request is a preset a type of network request that controls the application to send the network request to the management center; the management center controls the application to display a status after the network request is successfully executed and execute the network request.
- the program data may be executed by the processor to implement the following steps:
- the program data may be executed by the processor to implement the following steps:
- the program data may be executed by the processor to implement the following steps:
- the control application displays the state before the network request was successfully executed; if it is to be re-created, the request instance is created, and the number of network requests that determine whether the network request is being executed reaches a preset number A step of.
- the program data may be executed by the processor to implement the following steps:
- the request instance is put into a waiting queue according to the priority of the request instance to wait for execution; if the network request is executed according to the request instance, the number of times is not executed. If the number of times the network request is executed according to the request instance does not reach the preset number of times, the request instance is put into the corresponding one according to the priority of the request instance. Deferred queue.
- the disclosed apparatus, apparatus, and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface or unit, or may be an electrical, mechanical or other form of connection.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
- Including several instructions to make a device may be a personal computer, server, mobile device or network device, etc.
- the foregoing storage medium includes: a USB flash drive, a mobile hard disk, and a read only memory. (ROM, Read-Only Memory), disk or optical disc, etc.
- ROM Read-Only Memory
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
Claims (20)
- 一种执行网络请求的方法,其特征在于,所述方法包括:若应用程序启动,创建可执行所述应用程序网络请求的管理中心;若检测到应用程序将要发送网络请求,判断所述网络请求是否为预设类型的网络请求;若所述网络请求为预设类型的网络请求,控制所述应用程序将所述网络请求发送至所述管理中心;所述管理中心控制所述应用程序显示所述网络请求被成功执行后的状态并执行所述网络请求。
- 如权利要求1所述的方法,其特征在于,所述管理中心控制所述应用程序显示所述网络请求被成功执行后的状态并执行所述网络请求,包括:创建所述网络请求的请求实例以控制应用程序显示所述网络请求被成功执行后的状态;判断正在执行的网络请求的数量是否达到预设数量;若未达到预设数量,根据所述请求实例执行网络请求;判断网络请求是否执行成功;若网络请求执行成功,删除所述请求实例;若网络请求在预设时间内未执行成功,再次根据所述请求实例执行网络请求。
- 如权利要求2所述的方法,其特征在于,所述方法还包括:若网络请求未执行成功,判断根据所述请求实例执行网络请求的次数是否达到预设次数;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列;判断是否达到暂缓等待时间;若达到暂缓等待时间,从所述暂缓队列中取出所述请求实例并根据所述请求实例执行网络请求。
- 如权利要求3所述的方法,其特征在于,所述方法还包括:若根据所述请求实例执行网络请求的次数达到预设次数,销毁所述请求实例,并获取网络请求未执行成功的原因;根据所述原因判断是否需重新创建一个与所述请求实例完全相同的请求实例;若无需重新创建,控制所述应用程序显示所述网络请求被成功执行之前的状态;若需要重新创建,则创建请求实例;且返回所述判断正在执行的网络请求的数量是否达到预设数量的步骤。
- 如权利要求3所述的方法,其特征在于,所述请求实例包括优先级,所述方法还包括:若所述管理中心正在执行的网络请求的数量超过预设数量,根据所述请求实例的优先级将所述请求实例放入等待队列里等待执行;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列,包括:若根据所述请求实例执行网络请求的次数未达到预设次数,根据所述请求实例的优先级将所述请求实例放入对应的暂缓队列。
- 一种执行网络请求的装置,其特征在于,所述装置包括:创建单元,用于若应用程序启动,创建可执行所述应用程序网络请求的管理中心;判断单元,用于若检测到应用程序将要发送网络请求,判断所述网络请求是否为预设类型的网络请求;控制发送单元,用于若所述网络请求为预设类型的网络请求,控制所述应用程序将所述网络请求发送至所述管理中心;所述管理中心,用于控制所述应用程序显示所述网络请求被成功执行后的状态并执行所述网络请求。
- 如权利要求6所述的装置,其特征在于,所述管理中心包括请求实例创建单元、控制判断单元、请求执行单元、删除单元、存储单元;其中,所述请求实例创建单元用于创建所述网络请求的请求实例以控制应用程序显示所述网络请求被成功执行后的状态;所述控制判断单元用于判断正在执行的网络请求的数量是否达到预设数量;所述请求执行单元用于若正在执行的网络请求的数量未达到预设数量,根据所述请求实例执行网络请求;所述控制判断单元还用于判断网络请求是否执行成功;所述删除单元用于若网络请求执行成功,删除所述请求实例;所述请求执行单元用于若网络请求在预设时间内未执行成功,再次根据所述请求实例执行网络请求;所述存储单元,用于存储请求实例以及网络请求的相关参数,其中,所述相关参数包括预设数量。
- 如权利要求7所述的装置,其特征在于,所述管理中心还包括暂缓单元,所述相关参数还包括预设次数、暂缓等待时间:所述控制判断单元还用于判断根据所述请求实例执行网络请求的次数是否达到预设次数;所述暂缓单元用于若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列;所述控制判断单元还用于判断是否达到暂缓等待时间;所述暂缓单元还用于若达到暂缓等待时间,从所述暂缓队列中取出所述请求实例并根据所述请求实例执行网络请求。
- 如权利要求8所述的装置,其特征在于,所述管理中心还包括:销毁单元、还原单元;其中,所述销毁单元用于若根据所述请求实例执行网络请求的次数达到预设次数,销毁所述请求实例,并获取网络请求未执行成功的原因;所述控制判断单元还用于根据所述原因判断是否需重新创建一个与所述请求实例完全相同的请求实例;还原单元用于若无需重新创建一个与所述请求实例完全相同的请求实例,控制所述应用程序显示所述网络请求被成功执行之前的状态;所述请求实例创建单元还用于若需要重新创建一个与所述请求实例完全相同的请求实例,则创建请求实例;接着触发控制判断单元以判断正在执行的网络请求的数量是否达到预设数量。
- 如权利要求8所述的装置,其特征在于,所述请求实例包括优先级,所述管理中心还包括:等待单元;其中,所述等待单元用于若所述管理中心正在执行的网络请求的数量超过预设数量,根据所述请求实例的优先级将所述请求实例放入等待队列里等待执行;所述请求执行单元还用于若根据所述请求实例执行网络请求的次数未达到预设次数,根据所述请求实例的优先级将所述请求实例放入对应的暂缓队列。
- 一种执行网络请求的设备,其特征在于,所述设备包括:存储器和处理器;所述存储器存储有实现执行网络请求的程序数据;所述处理器用于运行所述存储器中存储的所述程序数据,以执行如下步骤:若应用程序启动,创建可执行所述应用程序网络请求的管理中心;若检测到应用程序将要发送网络请求,判断所述网络请求是否为预设类型的网络请求;若所述网络请求为预设类型的网络请求,控制所述应用程序将所述网络请求发送至所述管理中心;所述管理中心控制所述应用程序显示所述网络请求被成功执行后的状态并执行所述网络请求。
- 如权利要求11所述的设备,其特征在于,所述处理器还执行如下步骤:创建所述网络请求的请求实例以控制应用程序显示所述网络请求被成功执行后的状态;判断正在执行的网络请求的数量是否达到预设数量;若未达到预设数量,根据所述请求实例执行网络请求;判断网络请求是否执行成功;若网络请求执行成功,删除所述请求实例;若网络请求在预设时间内未执行成功,再次根据所述请求实例执行网络请求。
- 如权利要求12所述的设备,其特征在于,所述处理器还执行如下步骤:若网络请求未执行成功,判断根据所述请求实例执行网络请求的次数是否达到预设次数;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列;判断是否达到暂缓等待时间;若达到暂缓等待时间,从所述暂缓队列中取出所述请求实例并根据所述请求实例执行网络请求。
- 如权利要求13所述的设备,其特征在于,所述处理器还执行如下步骤:若根据所述请求实例执行网络请求的次数达到预设次数,销毁所述请求实例,并获取网络请求未执行成功的原因;根据所述原因判断是否需重新创建一个与所述请求实例完全相同的请求实例;若无需重新创建,控制所述应用程序显示所述网络请求被成功执行之前的状态;若需要重新创建,则创建请求实例;且返回所述判断正在执行的网络请求的数量是否达到预设数量的步骤。
- 如权利要求13所述的设备,其特征在于,所述请求实例包括优先级,所述处理器还执行如下步骤:若所述管理中心正在执行的网络请求的数量超过预设数量,根据所述请求实例的优先级将所述请求实例放入等待队列里等待执行;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列,包括:若根据所述请求实例执行网络请求的次数未达到预设次数,根据所述请求实例的优先级将所述请求实例放入对应的暂缓队列。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现如下步骤:若应用程序启动,创建可执行所述应用程序网络请求的管理中心;若检测到应用程序将要发送网络请求,判断所述网络请求是否为预设类型的网络请求;若所述网络请求为预设类型的网络请求,控制所述应用程序将所述网络请求发送至所述管理中心;所述管理中心控制所述应用程序显示所述网络请求被成功执行后的状态并执行所述网络请求。
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述步骤还包括:创建所述网络请求的请求实例以控制应用程序显示所述网络请求被成功执行后的状态;判断正在执行的网络请求的数量是否达到预设数量;若未达到预设数量,根据所述请求实例执行网络请求;判断网络请求是否执行成功;若网络请求执行成功,删除所述请求实例;若网络请求在预设时间内未执行成功,再次根据所述请求实例执行网络请求。
- 如权利要求17所述的计算机可读存储介质,其特征在于,所述步骤还包括:若网络请求未执行成功,判断根据所述请求实例执行网络请求的次数是否达到预设次数;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列;判断是否达到暂缓等待时间;若达到暂缓等待时间,从所述暂缓队列中取出所述请求实例并根据所述请求实例执行网络请求。
- 如权利要求18所述的计算机可读存储介质,其特征在于,所述步骤还包括:若根据所述请求实例执行网络请求的次数达到预设次数,销毁所述请求实例,并获取网络请求未执行成功的原因;根据所述原因判断是否需重新创建一个与所述请求实例完全相同的请求实例;若无需重新创建,控制所述应用程序显示所述网络请求被成功执行之前的状态;若需要重新创建,则创建请求实例;且返回所述判断正在执行的网络请求的数量是否达到预设数量的步骤。
- 如权利要求18所述的计算机可读存储介质,其特征在于,所述请求实例包括优先级,所述步骤还包括:若所述管理中心正在执行的网络请求的数量超过预设数量,根据所述请求实例的优先级将所述请求实例放入等待队列里等待执行;若根据所述请求实例执行网络请求的次数未达到预设次数,将所述请求实例放入暂缓队列,包括:若根据所述请求实例执行网络请求的次数未达到预设次数,根据所述请求实例的优先级将所述请求实例放入对应的暂缓队列。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710607890.6A CN107682389B (zh) | 2017-07-24 | 2017-07-24 | 一种执行网络请求的方法、终端及计算机可读存储介质 |
| CN201710607890.6 | 2017-07-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019019249A1 true WO2019019249A1 (zh) | 2019-01-31 |
Family
ID=61133081
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/099547 Ceased WO2019019249A1 (zh) | 2017-07-24 | 2017-08-30 | 执行网络请求的方法、装置、设备及计算机可读存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107682389B (zh) |
| WO (1) | WO2019019249A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111158871A (zh) * | 2019-12-05 | 2020-05-15 | 智七网络科技(上海)有限公司 | 数据包并发请求处理方法、装置、电子设备及存储介质 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111629056B (zh) * | 2020-05-27 | 2023-04-07 | 浙江百世技术有限公司 | 一种网络请求处理方法及应用 |
| CN112231604B (zh) * | 2020-06-12 | 2024-12-31 | 北京沃东天骏信息技术有限公司 | 一种页面显示方法、装置、电子设备和存储介质 |
| CN112269710A (zh) * | 2020-09-18 | 2021-01-26 | 天地互联科技(广州)有限公司 | 机载监控系统和其监控方法 |
| CN113918301B (zh) * | 2021-10-20 | 2025-09-19 | 北京达佳互联信息技术有限公司 | 请求处理方法、装置、电子设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102508716A (zh) * | 2011-09-29 | 2012-06-20 | 用友软件股份有限公司 | 任务控制装置和任务控制方法 |
| CN104166590A (zh) * | 2013-05-20 | 2014-11-26 | 阿里巴巴集团控股有限公司 | 一种实现任务调度的方法及系统 |
| CN105490956A (zh) * | 2015-12-07 | 2016-04-13 | 方正移动传媒技术(北京)有限公司 | 一种网络请求处理方法及装置 |
| CN106790453A (zh) * | 2016-12-07 | 2017-05-31 | 竞技世界(北京)网络技术有限公司 | 一种操作请求的执行方法及装置 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4240330B2 (ja) * | 2006-10-24 | 2009-03-18 | ソニー株式会社 | データベース作成方法、データベース作成プログラム、データベース作成装置及び映像コンテンツ記録装置 |
| CN101621458A (zh) * | 2008-06-30 | 2010-01-06 | 国际商业机器公司 | 异步处理网络请求的方法和系统 |
| CN102750291A (zh) * | 2011-04-21 | 2012-10-24 | 中国移动通信集团安徽有限公司 | 用户定制分析装置、通讯终端及其访问互联网方法和系统 |
| CN103491162B (zh) * | 2013-09-18 | 2017-03-01 | 广州华多网络科技有限公司 | 基于移动互联网的信息分享方法及系统 |
| CN105099989B (zh) * | 2014-04-24 | 2019-11-22 | 阿里巴巴集团控股有限公司 | 用于处理业务请求及获取业务处理结果的方法、装置和系统 |
| CN106775901A (zh) * | 2017-01-22 | 2017-05-31 | 上海卓悠网络科技有限公司 | 一种数据预加载方法及装置 |
-
2017
- 2017-07-24 CN CN201710607890.6A patent/CN107682389B/zh active Active
- 2017-08-30 WO PCT/CN2017/099547 patent/WO2019019249A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102508716A (zh) * | 2011-09-29 | 2012-06-20 | 用友软件股份有限公司 | 任务控制装置和任务控制方法 |
| CN104166590A (zh) * | 2013-05-20 | 2014-11-26 | 阿里巴巴集团控股有限公司 | 一种实现任务调度的方法及系统 |
| CN105490956A (zh) * | 2015-12-07 | 2016-04-13 | 方正移动传媒技术(北京)有限公司 | 一种网络请求处理方法及装置 |
| CN106790453A (zh) * | 2016-12-07 | 2017-05-31 | 竞技世界(北京)网络技术有限公司 | 一种操作请求的执行方法及装置 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111158871A (zh) * | 2019-12-05 | 2020-05-15 | 智七网络科技(上海)有限公司 | 数据包并发请求处理方法、装置、电子设备及存储介质 |
| CN111158871B (zh) * | 2019-12-05 | 2024-02-23 | 智七网络科技(上海)有限公司 | 数据包并发请求处理方法、装置、电子设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107682389B (zh) | 2020-02-14 |
| CN107682389A (zh) | 2018-02-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019019249A1 (zh) | 执行网络请求的方法、装置、设备及计算机可读存储介质 | |
| WO2016165556A1 (zh) | 一种视频流的数据处理方法、装置和系统 | |
| WO2019128174A1 (zh) | 音频播放方法、智能电视及计算机可读存储介质 | |
| WO2016000560A1 (en) | File transmission method, file transmission apparatus, and file transmission system | |
| WO2015109865A1 (zh) | 空调运行模式自定义控制方法及系统 | |
| WO2018233370A1 (zh) | 镜像同步方法、系统、设备及计算机可读存储介质 | |
| WO2019051902A1 (zh) | 终端控制方法、空调器及计算机可读存储介质 | |
| WO2018014567A1 (zh) | 一种提高虚拟机性能的方法、终端、设备及计算机可读存储介质 | |
| WO2018076811A1 (zh) | 数据分享方法、装置、存储介质及电子设备 | |
| WO2014026526A1 (zh) | 自然人信息设置方法及电子设备 | |
| WO2018120430A1 (zh) | 一种页面构建方法、终端、计算机可读存储介质及页面构建设备 | |
| WO2018113187A1 (zh) | 一种显示控制方法及显示装置 | |
| WO2018126888A1 (zh) | 电视功能的快捷启动设置方法及装置 | |
| WO2016058258A1 (zh) | 终端远程控制方法和系统 | |
| WO2014000635A1 (zh) | 阅读器提供服务的方法、阅读器、终端及计算机存储介质 | |
| WO2019052164A1 (zh) | 一种视频回访方法、装置、设备及存储介质 | |
| WO2017201943A1 (zh) | 显示屏驱动方法及装置 | |
| WO2017152526A1 (zh) | 外部设备自动挂载和通知的控制方法及系统 | |
| WO2017190451A1 (zh) | 图片推送方法和装置 | |
| WO2017036208A1 (zh) | 显示界面中的信息提取方法及系统 | |
| WO2018006581A1 (zh) | 智能电视的播放方法及装置 | |
| WO2014086174A1 (zh) | 影像获取方法、电子装置、电子设备及储存介质 | |
| WO2019085301A1 (zh) | 座机未接来电的反馈方法、装置、设备及可读存储介质 | |
| WO2019210574A1 (zh) | 消息处理方法、装置、设备及可读存储介质 | |
| WO2019062102A1 (zh) | 磁盘阵列的挂载方法、Android设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17919482 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17919482 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05.08.2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17919482 Country of ref document: EP Kind code of ref document: A1 |