Request processing method and apparatus
By monitoring the task progress on the server side and displaying the request progress information on the terminal, the problem of users not being able to know the task progress is solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-18
- Publication Date
- 2026-03-20
AI Technical Summary
Users are unable to track task progress when operating services with complex logic, leading to long waiting times and a poor user experience.
By monitoring the progress of tasks on the server side, converting it into request progress information, saving it, and displaying it on the terminal interface, users can learn about the task progress in real time.
This improves the user experience, allowing users to know the task progress in real time and avoiding the annoyance of long waits and interface refreshes.
Smart Images

Figure CN116069426B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer application, financial technology and information technology industry, and particularly relates to a request processing method and device. BACKGROUND
[0002] Many systems provide services to the outside through terminal interfaces, and users interact with the systems by operating the terminal interfaces. For some services with complex logic, after a user submits a service request, the service interface response time will be very long, and the user cannot learn the current task progress and can only wait and constantly refresh the service interface, which brings a poor user experience. SUMMARY
[0003] Therefore, the embodiments of the present application provide a request processing method and device, which can display request progress information on the interface of a terminal and improve the user experience.
[0004] In a first aspect, the embodiments of the present application provide a request processing method applied to a server, comprising:
[0005] receiving a task request sent by a terminal and determining a request identifier corresponding to the task request;
[0006] generating and executing at least one processing task corresponding to the task request;
[0007] obtaining task progress information corresponding to each processing task;
[0008] determining request progress information corresponding to the task request according to the task progress information corresponding to each processing task;
[0009] saving the correspondence between the request identifier and the request progress information, so that the terminal displays the request progress information on the interface of the terminal according to the correspondence.
[0010] Optionally, the task request is used for downloading a target resource.
[0011] The determination of the request progress information corresponding to the task request according to the task progress information corresponding to each processing task comprises:
[0012] for each processing task, determining a downloaded size corresponding to the processing task according to the task progress information corresponding to the processing task;
[0013] determining the request progress information corresponding to the task request according to the downloaded size corresponding to each processing task and a resource size of the target resource.
[0014] Optionally, the task request is used for downloading a plurality of target resources.
[0015] determining the request progress information corresponding to the task request according to the task progress information corresponding to each processing task, comprises:
[0016] for each processing task, determining the downloaded resource corresponding to the processing task according to the task progress information corresponding to the processing task;
[0017] merging the downloaded resource corresponding to each processing task to determine the request progress information corresponding to the task request.
[0018] Optionally, the task request is used to execute a target task.
[0019] determining the request progress information corresponding to the task request according to the task progress information corresponding to each processing task, comprises:
[0020] for each processing task, determining the total task amount corresponding to the processing task; and determining the completed task amount corresponding to the processing task according to the task progress information corresponding to the processing task;
[0021] determining the request progress information corresponding to the task request according to the total task amount and the completed task amount corresponding to each processing task.
[0022] Optionally, the saving of the correspondence between the request identifier and the request progress information comprises:
[0023] determining whether the progress information corresponding to the request identifier exists in the target storage;
[0024] in response to the existence of the progress information corresponding to the request identifier in the target storage, updating the progress information corresponding to the request identifier by using the correspondence between the request identifier and the request progress information;
[0025] in response to the non-existence of the progress information corresponding to the request identifier in the target storage, inserting the correspondence between the request identifier and the request progress information into the target storage.
[0026] In a second aspect, an embodiment of the present application provides a request processing method applied to a terminal, comprising:
[0027] receiving a task request sent by a user;
[0028] sending the task request to a server;
[0029] requesting the request progress information of the task request from the server by using the request identifier corresponding to the task request, and displaying the request progress information on an interface of the terminal.
[0030] Optionally, the request progress information of the task request is requested from the server by using the request identifier corresponding to the task request, and the request progress information of the task request is obtained from the server by using the request identifier corresponding to the task request.
[0031] The request number of times of requesting the request progress information by the terminal is determined.
[0032] The current time interval is determined according to the request number of times.
[0033] The current request time is determined according to the current time interval.
[0034] The request progress information of the task request is requested from the server by using the request identifier corresponding to the task request in response to the system time reaching the current request time.
[0035] In a third aspect, an embodiment of the present application provides a request processing apparatus applied to a server and comprising:
[0036] An identifier determination module configured to receive a task request sent by a terminal, and determine a request identifier corresponding to the task request.
[0037] A task generation module configured to generate and execute at least one processing task corresponding to the task request.
[0038] An information acquisition module configured to acquire task progress information corresponding to each processing task.
[0039] An information determination module configured to determine request progress information corresponding to the task request according to the task progress information corresponding to each processing task.
[0040] An information storage module configured to store a corresponding relationship between the request identifier and the request progress information, so that the terminal displays the request progress information on an interface of the terminal according to the corresponding relationship.
[0041] Optionally, the task request is used for downloading a target resource.
[0042] The information determination module is specifically configured to:
[0043] For each processing task, the downloaded size corresponding to the processing task is determined according to the task progress information corresponding to the processing task.
[0044] The request progress information corresponding to the task request is determined according to the downloaded size corresponding to each processing task and the resource size of the target resource.
[0045] Optionally, the task request is used for downloading a plurality of target resources.
[0046] The information determination module is specifically configured to:
[0047] For each processing task, according to task progress information corresponding to the processing task, determine downloaded resources corresponding to the processing task;
[0048] Merge the downloaded resources corresponding to each processing task to determine request progress information corresponding to the task request.
[0049] Optionally, the task request is used to execute a target task;
[0050] The information determining module is specifically configured to:
[0051] For each processing task, determine total task quantity corresponding to the processing task; and according to task progress information corresponding to the processing task, determine completed task quantity corresponding to the processing task;
[0052] According to the total task quantity and the completed task quantity corresponding to each processing task, determine request progress information corresponding to the task request.
[0053] In a fourth aspect, an embodiment of the present application provides a request processing apparatus applied to a terminal, and including:
[0054] A request receiving module is configured to receive a task request sent by a user;
[0055] A request sending module is configured to send the task request to a server;
[0056] An information displaying module is configured to request request progress information of the task request from the server by using a request identifier corresponding to the task request, and display the request progress information on an interface of the terminal.
[0057] In a fifth aspect, an embodiment of the present application provides an electronic device, including:
[0058] One or more processors;
[0059] A storage device configured to store one or more programs,
[0060] When the one or more programs are executed by the one or more processors, the one or more processors implement the method in any of the above embodiments.
[0061] In a sixth aspect, an embodiment of the present application provides a computer readable medium, which stores a computer program, and the program is executed by a processor to implement the method in any of the above embodiments.
[0062] In a seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and the program is executed by a processor to implement the method in any of the above embodiments.
[0063] An embodiment of the above application has the following advantages or beneficial effects: after the server receives the task request sent by the terminal, the server acquires the task progress information corresponding to each processing task corresponding to the task request. By monitoring the task progress information corresponding to each processing task, the server determines the request progress information corresponding to the task request, and saves the request progress information of the task request. The terminal displays the request progress information on the interface of the terminal according to the request progress information saved by the server, so that the user can know the current task progress through the interface of the terminal, and the use experience of the user is improved.
[0064] Further effects of the above non-conventional optional mode will be described in the following in combination with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0065] The accompanying drawings are used to better understand the application, and do not constitute undue limitations on the application. Among them:
[0066] Figure 1 is a flowchart of a request processing method provided by the first embodiment of the application;
[0067] Figure 2 is a flowchart of a request processing method provided by the second embodiment of the application;
[0068] Figure 3 is a flowchart of a request processing method provided by the third embodiment of the application;
[0069] Figure 4 is a structural schematic diagram of a request processing device provided by the embodiment of the application;
[0070] Figure 5 is a structural schematic diagram of another request processing device provided by the embodiment of the application;
[0071] Figure 6 is a structural schematic diagram of a computer system of a terminal device or a server suitable for realizing the embodiment of the application. DETAILED DESCRIPTION
[0072] The exemplary embodiments of the application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the application to help understanding, and should be considered only as exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the application. Also, in order to be clear and concise, the description in the following description omits the description of well-known functions and structures.
[0073] It should be noted that in the technical solutions of the present application, the collection, analysis, use, transmission, storage, etc. of user personal information are in line with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, disclosed or sold outside these legal uses, and are subject to supervision and management of regulatory departments. Necessary measures should be taken for user personal information to prevent illegal access to such personal information data, to ensure that personnel with access to personal information data comply with relevant laws and regulations, and to ensure the security of user personal information. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0074] Figure 1 is a flowchart of a request processing method provided by the first embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0075] Step 101: receiving a task request sent by a terminal and determining a request identifier corresponding to the task request.
[0076] The scheme of the embodiment of the present application is applied to a server. After a terminal receives a task request issued by a user, the terminal sends the task request to the server. The task request is identified by a request identifier, which can be obtained from the task request, and the server can also automatically generate a request identifier corresponding to the task request and return the request identifier to the terminal.
[0077] Step 102: generating and executing at least one processing task corresponding to the task request.
[0078] To improve the processing efficiency of the system, at least one processing task corresponding to the task request can be generated. Each processing task can be executed in parallel or in sequence.
[0079] Step 103: obtaining task progress information corresponding to each processing task.
[0080] The task progress information is used to represent the execution progress of the processing task, such as the proportion of completed job processing to the total job processing that needs to be completed, etc. In the case where the processing task is used to download target resources, the task progress information can be the ratio of the size of the downloaded resources to the size of the target resources, the identifier of the downloaded resources, the identifier of the undownloaded resources, etc. In the case where the processing task is used to execute target tasks, the task progress information can be the ratio of the amount of completed tasks to the total amount of tasks, etc.
[0081] Step 104: determining request progress information corresponding to the task request according to the task progress information corresponding to each processing task.
[0082] The request progress information is used for representing the execution progress of the task request, such as the proportion of completed job processing in the total job processing to be completed. In the case that the task request is used for downloading the target resource, the request progress information can be the ratio of the downloaded resource size to the target resource size, the downloaded resource identifier, the undownloaded resource identifier, etc. In the case that the task request is used for executing the target task, the request progress information can be the ratio of the completed task quantity to the total task quantity, etc.
[0083] Step 105: saving the correspondence between the request identifier and the request progress information, so that the terminal displays the request progress information on the interface of the terminal according to the correspondence.
[0084] The steps 103 to 105 can be executed in a preset period to update the correspondence between the request identifier and the request progress information in a time manner. The correspondence between the request identifier and the request progress information can be saved in the memory or the cache to accelerate the system response speed.
[0085] The terminal can send a progress acquisition request of the task request to the server, and the progress acquisition request is used for requesting the progress information of the task request from the server. The progress acquisition request includes the request identifier of the task request.
[0086] In the embodiment of the application, after the server receives the task request sent by the terminal, the server acquires the task progress information corresponding to each processing task corresponding to the task request. By monitoring the task progress information corresponding to each processing task, the request progress information corresponding to the task request is determined, and the request progress information of the task request is saved. The terminal displays the request progress information on the interface of the terminal according to the request progress information saved by the server, so that the user can know the current task progress through the interface of the terminal, and the use experience of the user is improved.
[0087] The scheme of the embodiment of the application can include that the terminal initiates an asynchronous task request, and queries the request progress information of the task request in a time manner; the server executes the asynchronous task corresponding to the task request through a general task pool; the server updates the request progress information in the cache in a time manner; and the terminal interface displays the prompt information of the completed download when the task request is completed.
[0088] The server end deploys a task processing program, and the task processing program is responsible for acquiring the task state, adding the request, updating the task progress information, updating the request progress information, acquiring the request progress information, etc. The method of acquiring the request progress information supports passing the request identifier as a parameter. The method of adding the request supports passing the request identifier as a parameter. The method of updating the request progress information supports passing the request identifier, the request state, the prompt information, the file path, the file name, etc. as parameters.
[0089] The terminal asynchronously requests the server's interface, simultaneously requesting current request progress information from the server at preset time intervals. The request interval can be gradually increased, ceasing further increase once a threshold is reached. The threshold can be 10 seconds, 20 seconds, etc. The terminal makes a maximum of a preset number of requests to the server, such as 100 or 50, to prevent incessant requests due to server failure. If the request progress information indicates that the task request has been completed, subsequent requests are terminated, and a message indicating the task request has ended is displayed on the terminal interface, or other operation interfaces are displayed on the terminal after the task request is completed. This method avoids timeouts for complex requests or large file downloads.
[0090] The solution in this invention uses asynchronous tasks to solve the problem of timeouts for complex requests or large file downloads. By periodically updating the task request status, users can check the current progress without repeatedly refreshing the interface. Upon completion of the task request, the terminal automatically displays a notification box, resulting in a user-friendly interface.
[0091] In one embodiment of the present invention, a task request is used to download a target resource; determining the request progress information corresponding to the task request based on the task progress information corresponding to each processing task includes: for each processing task, determining the downloaded size corresponding to the processing task based on the task progress information corresponding to the processing task; and determining the request progress information corresponding to the task request based on the downloaded size corresponding to each processing task and the resource size of the target resource.
[0092] The request progress information is used to characterize the execution progress of the task request. The request progress information can be 10%, 50%, 98%, etc. Specifically, the total downloaded size corresponding to each processing task is determined, and then the ratio of this total to the resource size of the target resource is used as the request progress information corresponding to the task request.
[0093] In one embodiment of the present invention, a task request is used to download multiple target resources; determining the request progress information corresponding to the task request based on the task progress information corresponding to each processing task includes: for each processing task, determining the downloaded resources corresponding to the processing task based on the task progress information corresponding to the processing task; merging the downloaded resources corresponding to each processing task to determine the request progress information corresponding to the task request.
[0094] The request progress information can include the resource identifier and resource name of downloaded resources. Specifically, the resource identifiers or resource names of downloaded resources corresponding to each processing task are merged to determine the request progress information corresponding to the task request. The request progress information includes the collection of downloaded resources corresponding to each processing task. The resource identifier and resource name of downloaded resources are displayed on the terminal interface so that users can easily know which resources have been downloaded.
[0095] In an embodiment of the present application, the task request is used to execute a target task; according to the task progress information corresponding to each processing task, the request progress information corresponding to the task request is determined, including: for each processing task, determining the total task amount corresponding to the processing task; according to the task progress information corresponding to the processing task, determining the completed task amount corresponding to the processing task; according to the total task amount and the completed task amount corresponding to each processing task, determining the request progress information corresponding to the task request.
[0096] The request progress information is used to represent the execution progress of the task request, and the request progress information can be 30%, 65%, 100%, etc. The total task amount can be represented by a preset execution time length, and the completed task amount can be represented by an executed time length. Specifically, the sum of the total task amount corresponding to each processing task and the sum of the completed task amount corresponding to each processing task are determined, and the ratio of the sum of the completed task amount to the sum of the total task amount is determined as the request progress information.
[0097] Figure 2 is a flowchart of a request processing method provided by a second embodiment of the present application, as shown in Figure 2 , the method comprises:
[0098] Step 201: receiving a task request sent by a terminal, and determining a request identifier corresponding to the task request.
[0099] Step 202: generating and executing at least one processing task corresponding to the task request.
[0100] Step 203: acquiring task progress information corresponding to each processing task at a preset monitoring period.
[0101] Steps 203 to 206 are executed at a preset monitoring period. The preset monitoring period can be set according to specific requirements. As a kind of implementable mode, the execution time of task request is determined. According to the execution time, the monitoring period is determined. The shorter the execution time, the shorter the monitoring period. As the execution time becomes longer, the monitoring period also gradually becomes longer to save system resources. The monitoring period can be gradually increased, and the monitoring period no longer increases after reaching the period threshold. The period threshold can be 10 seconds, 20 seconds, etc.
[0102] Step 204: according to the task progress information corresponding to each processing task, determining the request progress information corresponding to the task request.
[0103] Step 205: determining whether the progress information corresponding to the request identifier exists in the target storage.
[0104] If the progress information corresponding to the request identifier exists in the target storage, step 206 is executed. If the progress information corresponding to the request identifier does not exist in the target storage, step 207 is executed.
[0105] Step 206: updating the progress information corresponding to the request identifier by using the correspondence between the request identifier and the request progress information.
[0106] Step 207: inserting the correspondence between the request identifier and the request progress information into the target storage.
[0107] The target storage can be a memory, a cache, a disk, a database, or a preset file, etc.
[0108] In the embodiment of the application, the task progress information corresponding to each processing task is continuously acquired in a preset monitoring period, and the request progress information of the task request is generated. The task progress information in the target storage is updated by using the newly generated request progress information, so that the terminal can update and display the progress information of the task request in time, and the progress information in the terminal interface is prevented from being not updated for a long time.
[0109] Figure 3 is a flowchart of a request processing method provided by a third embodiment of the application, as shown in Figure 3 The method comprises the following steps.
[0110] Step 301: receiving a task request sent by a user.
[0111] Step 302: sending the task request to a server.
[0112] Step 303: requesting the request progress information of the task request from the server by using a request identifier corresponding to the task request, and displaying the request progress information on the interface of the terminal.
[0113] The scheme of the embodiment of the application is applied to a terminal. The terminal can send a progress acquisition request of a task request to a server, and request the progress information of the task request from the server through the progress acquisition request. The request identifier of the task request is included in the progress acquisition request. The terminal displays the request progress information on the interface of the terminal according to the request progress information returned by the server, so that the user can know the current task progress through the interface of the terminal, and the use experience of the user is improved.
[0114] In an embodiment of the application, the request of the request progress information of the task request from the server by using the request identifier corresponding to the task request comprises the following steps: determining the request times of the terminal for the request progress information; determining the current time interval according to the request times; determining the current request time according to the current time interval; and in response to the system time reaching the current request time, requesting the request progress information of the task request from the server by using the request identifier.
[0115] The correspondence between the request number and the time interval can be preset in the system. When the task starts to be executed, the interval time is short, and the subsequent interval time gradually becomes long, so as to better meet the observation habit of the user and save the system resources. Specifically, the request time interval can be gradually increased, and the time interval is no longer increased when the time interval reaches an interval threshold. The interval threshold can be 10 seconds, 20 seconds, etc. After the terminal sends a preset number of progress acquisition requests to the server, the terminal no longer sends the progress acquisition request to the server, and the preset number can be 100, 50, etc., which can prevent the terminal from continuously requesting due to server failure. If the request progress information represents that the task request has ended, the terminal terminates sending the progress acquisition request to the server, and displays prompt information that the task request has ended on the terminal interface, or displays other operation interfaces after the task request is completed on the terminal. Through the above manner, the complex request or the large file download time-out can be avoided.
[0116] Figure 4 is a structural schematic diagram of a request processing device provided by an embodiment of the application, which is applied to a server, as shown in the figure, the device comprises: Figure 4
[0117] An identification determination module 401 is configured to receive a task request sent by a terminal, and determine a request identification corresponding to the task request.
[0118] A task generation module 402 is configured to generate and execute at least one processing task corresponding to the task request.
[0119] An information acquisition module 403 is configured to acquire task progress information corresponding to each processing task.
[0120] An information determination module 404 is configured to determine request progress information corresponding to the task request according to the task progress information corresponding to each processing task.
[0121] An information saving module 405 is configured to save the correspondence between the request identification and the request progress information, so that the terminal displays the request progress information on the interface of the terminal according to the correspondence.
[0122] Optionally, the task request is used for downloading a target resource.
[0123] The information determination module 404 is specifically configured to:
[0124] For each processing task, determine a downloaded size corresponding to the processing task according to the task progress information corresponding to the processing task.
[0125] Determine the request progress information corresponding to the task request according to the downloaded size corresponding to each processing task and the resource size of the target resource.
[0126] Optionally, the task request is used for downloading a plurality of target resources.
[0127] Information determination module 404 is specifically used for:
[0128] For each processing task, the downloaded resources corresponding to the processing task are determined based on the task progress information.
[0129] Merge the downloaded resources corresponding to each processing task and determine the request progress information corresponding to the task request.
[0130] Optionally, a task request is used to execute a target task;
[0131] Information determination module 404 is specifically used for:
[0132] For each processing task, determine the total workload corresponding to the processing task; based on the task progress information corresponding to the processing task, determine the amount of completed tasks corresponding to the processing task.
[0133] Based on the total workload and the amount of completed tasks for each processing task, determine the request progress information corresponding to the task request.
[0134] Optionally, the information storage module 405 is specifically used for:
[0135] Determine if progress information corresponding to the request identifier exists in the target storage;
[0136] If progress information corresponding to the request identifier exists in the target storage, update the progress information corresponding to the request identifier using the correspondence between the request identifier and the request progress information;
[0137] If the progress information corresponding to the request identifier does not exist in the target storage, the mapping relationship between the request identifier and the request progress information is inserted into the target storage.
[0138] Figure 5 This is a schematic diagram of another request processing device provided in an embodiment of the present invention, applied to a terminal, such as... Figure 5 As shown, the device includes:
[0139] The request receiving module 501 is used to receive task requests sent by users.
[0140] The request sending module 502 is used to send task requests to the server;
[0141] The information display module 503 is used to request the request progress information of the task request from the server using the request identifier corresponding to the task request, and to display the request progress information on the terminal interface.
[0142] Optionally, the information display module 503 is specifically used for:
[0143] Determine the number of times the terminal requests progress information;
[0144] determine the current time interval according to the request times;
[0145] determine the current request time according to the current time interval;
[0146] in response to the system time reaching the current request time, request the request progress information of the task request from the server by using the request identifier.
[0147] An electronic device is provided in an embodiment of the present application, comprising:
[0148] one or more processors;
[0149] a storage device configured to store one or more programs,
[0150] When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0151] A computer program product is provided in an embodiment of the present application, comprising a computer program which, when executed by a processor, implements the enterprise risk assessment method in the embodiments of the present application.
[0152] Reference is made below to Figure 6 which shows a structural schematic diagram of a computer system 600 of a terminal device suitable for being used to implement the embodiments of the present application. Figure 6 The terminal device shown is merely an example and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0153] As shown in Figure 6 , the computer system 600 comprises a central processing unit (CPU) 601 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or programs loaded from a storage portion 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602 and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0154] The following components are connected to the I / O interface 605: an input part 606 including a keyboard, a mouse, etc.; an output part 607 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 608 including a hard disk, etc.; and a communication part 609 including a network interface card such as a LAN card, a modem, etc. The communication part 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as necessary. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 610 as necessary, so that a computer program read out therefrom is installed in the storage part 608 as necessary.
[0155] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-described functions defined in the system of the present disclosure are executed.
[0156] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0157] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the figures. For example, two blocks that are shown in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0158] The modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. The modules described can be arranged in a processor, for example, and can be described as an identity determination module, a task generation module, an information acquisition module, an information determination module and an information storage module. In some cases, the names of these modules do not limit the modules themselves, for example, the identity determination module can also be described as a module that receives a task request sent by a terminal and determines a request identity corresponding to the task request.
[0159] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to include:
[0160] receive a task request sent by a terminal and determine a request identity corresponding to the task request;
[0161] generate and execute at least one processing task corresponding to the task request;
[0162] acquire task progress information corresponding to each processing task;
[0163] determine request progress information corresponding to the task request according to the task progress information corresponding to each processing task;
[0164] save a corresponding relationship between the request identity and the request progress information, so that the terminal displays the request progress information on an interface of the terminal according to the corresponding relationship.
[0165] According to the technical solution of the embodiments of the present application, after the server receives a task request sent by a terminal, the server acquires task progress information corresponding to each processing task corresponding to the task request. By monitoring the task progress information corresponding to each processing task, the server determines request progress information corresponding to the task request and saves the request progress information of the task request. The terminal displays the request progress information on an interface of the terminal according to the request progress information saved by the server, so that a user can learn the current task progress through the interface of the terminal, thereby improving the user experience.
[0166] The above detailed description does not limit the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made depending on design requirements and other factors. Any modification, equivalent replacement and improvement made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A request processing method, characterized in that, Applied to servers, including: The system receives a task request from a terminal and determines the request identifier corresponding to the task request. The server deploys a task processing program responsible for obtaining task status, adding requests, updating task progress information, updating request progress information, and obtaining request progress information. The method for obtaining request progress information supports passing the request identifier as a parameter; the method for adding requests supports passing the request identifier as a parameter; and the method for updating progress information supports passing the request identifier, request status, prompt information, file path, and filename as parameters. The terminal makes asynchronous requests to the server's interface, gradually increasing the request time interval. Once the time interval reaches the threshold, it stops increasing. The terminal makes a maximum of a preset number of requests to the server. If the request progress information indicates that the task request has ended, the subsequent requests are terminated, and a prompt message indicating that the task request has ended is displayed on the terminal interface, or other operation interfaces after the task request has been completed are displayed on the terminal interface. Generate and execute at least one processing task corresponding to the task request; Obtain the task progress information corresponding to each of the processing tasks; The step of obtaining the task progress information corresponding to each of the processing tasks includes: obtaining the task progress information corresponding to each processing task with a preset monitoring period; wherein, the monitoring period is determined according to the execution time of the task request, and as the execution time increases, the monitoring period also gradually increases, and the monitoring period no longer increases after reaching the period threshold. Based on the task progress information corresponding to each of the processing tasks, determine the request progress information corresponding to the task request; The correspondence between the request identifier and the request progress information is saved so that the terminal displays the request progress information on the terminal interface according to the correspondence. The step of saving the correspondence between the request identifier and the request progress information includes: determining whether there is progress information corresponding to the request identifier in the target storage at a preset monitoring period; if there is progress information corresponding to the request identifier in the target storage, updating the progress information corresponding to the request identifier using the correspondence between the request identifier and the request progress information. The task request is used to download multiple target resources; determining the request progress information corresponding to the task request based on the task progress information corresponding to each processing task includes: for each processing task, determining the downloaded resources corresponding to the processing task based on the task progress information corresponding to the processing task; merging the resource identifiers or resource names of the downloaded resources corresponding to each processing task to determine the request progress information corresponding to the task request, so as to display the resource identifiers and resource names of the downloaded resources on the interface of the terminal; wherein, the request progress information includes the collection of downloaded resources corresponding to each processing task.
2. The method according to claim 1, characterized in that, The task request is used to download the target resource; The step of determining the request progress information corresponding to the task request based on the task progress information corresponding to each of the processing tasks includes: For each of the processing tasks, the downloaded size of the processing task is determined based on the task progress information corresponding to the processing task. Based on the downloaded size of each processing task and the resource size of the target resource, the request progress information corresponding to the task request is determined.
3. The method according to claim 1, characterized in that, The task request is used to execute the target task; The step of determining the request progress information corresponding to the task request based on the task progress information corresponding to each of the processing tasks includes: For each of the processing tasks, determine the total workload corresponding to the processing task; based on the task progress information corresponding to the processing task, determine the amount of completed tasks corresponding to the processing task. Based on the total task volume and the number of completed tasks corresponding to each processing task, the request progress information corresponding to the task request is determined.
4. The method according to claim 1, characterized in that, The process of saving the correspondence between the request identifier and the request progress information includes: Determine whether progress information corresponding to the request identifier exists in the target storage; In response to the absence of progress information corresponding to the request identifier in the target storage, the correspondence between the request identifier and the request progress information is inserted into the target storage.
5. A request processing method, characterized in that, Applied to terminals, including: Receive task requests from users; The task request is sent to the server; wherein the server is configured to perform the method as described in any one of claims 1-4; Using the request identifier corresponding to the task request, request progress information of the task request is requested from the server, and the request progress information is displayed on the interface of the terminal.
6. The method according to claim 5, characterized in that, The step of requesting the request progress information of the task request from the server using the request identifier corresponding to the task request includes: Determine the number of times the terminal requests the request progress information; The time interval is determined based on the number of requests. The time of this request is determined based on the aforementioned time interval; In response to the system time reaching the current request time, the system uses the request identifier to request the request progress information of the task request from the server.
7. A request processing apparatus, characterized in that, Applied to servers, including: The identifier determination module is used to receive task requests sent by the terminal and determine the request identifier corresponding to the task request. The server-side deploys a task processing program responsible for obtaining task status, adding requests, updating task progress information, updating request progress information, and obtaining request progress information. The method for obtaining request progress information supports passing the request identifier as a parameter; the method for adding requests supports passing the request identifier as a parameter; and the method for updating progress information supports passing the request identifier, request status, prompt information, file path, and filename as parameters. The terminal makes asynchronous requests to the server's interface, gradually increasing the request time interval. Once the time interval reaches the threshold, it stops increasing. The terminal makes a maximum of a preset number of requests to the server. If the request progress information indicates that the task request has ended, the subsequent requests are terminated, and a prompt message indicating that the task request has ended is displayed on the terminal interface, or other operation interfaces after the task request has been completed are displayed on the terminal interface. The task generation module is used to generate and execute at least one processing task corresponding to the task request; The information acquisition module is used to acquire the task progress information corresponding to each of the processing tasks; The information acquisition module is specifically used to: acquire task progress information corresponding to each processing task according to a preset monitoring period; wherein, the monitoring period is determined according to the execution time of the task request, and as the execution time increases, the monitoring period also gradually increases, and the monitoring period no longer increases after reaching the period threshold. The information determination module is used to determine the request progress information corresponding to the task request based on the task progress information corresponding to each of the processing tasks. An information storage module is used to store the correspondence between the request identifier and the request progress information, so that the terminal displays the request progress information on the terminal interface according to the correspondence; the information storage module is specifically used to: determine whether there is progress information corresponding to the request identifier in the target storage at a preset monitoring period; if there is progress information corresponding to the request identifier in the target storage, update the progress information corresponding to the request identifier using the correspondence between the request identifier and the request progress information. The task request is used to download multiple target resources; the information determination module is specifically used to: for each processing task, determine the downloaded resources corresponding to the processing task based on the task progress information corresponding to the processing task; merge the resource identifiers or resource names of the downloaded resources corresponding to each processing task to determine the request progress information corresponding to the task request, so as to display the resource identifiers and resource names of the downloaded resources on the interface of the terminal; wherein, the request progress information includes the collection of downloaded resources corresponding to each processing task.
8. The apparatus according to claim 7, characterized in that, The task request is used to download the target resource; The information determination module is specifically used for: For each of the processing tasks, the downloaded size of the processing task is determined based on the task progress information corresponding to the processing task. Based on the downloaded size of each processing task and the resource size of the target resource, the request progress information corresponding to the task request is determined.
9. The apparatus according to claim 7, characterized in that, The task request is used to download multiple target resources; The information determination module is specifically used for: For each of the processing tasks, the downloaded resources corresponding to the processing task are determined based on the task progress information corresponding to the processing task. Merge the downloaded resources corresponding to each of the processing tasks to determine the request progress information corresponding to the task request.
10. The apparatus according to claim 7, characterized in that, The task request is used to execute the target task; The information determination module is specifically used for: For each of the processing tasks, determine the total workload corresponding to the processing task; based on the task progress information corresponding to the processing task, determine the amount of completed tasks corresponding to the processing task. Based on the total task volume and the number of completed tasks corresponding to each processing task, the request progress information corresponding to the task request is determined.
11. A request processing apparatus, characterized in that, Applied to terminals, including: The request receiving module is used to receive task requests sent by users. A request sending module is configured to send the task request to a server; wherein the server is configured to execute the method as described in any one of claims 1-4; The information display module is used to request the request progress information of the task request from the server using the request identifier corresponding to the task request, and to display the request progress information on the interface of the terminal.
12. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
13. A computer-readable medium having a computer program stored thereon, characterized in that... When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Task management method and device for quantifying task value
CN103778510A
Asynchronous task inquiry method and device
CN107798108A
Task processing progress management method and device
CN113868687A
Information query method and device, electronic equipment and computer readable storage medium
CN115391655A