Data processing method and device
By receiving and processing batch operation requests in the background management system, obtaining and storing task execution status, and displaying it on the front end, the problems of degraded interface performance and poor user experience in asynchronous batch operations are solved, and the task status is timely displayed and user-friendly is realized Improvement of experience.
Patent Information
- Application Number
- CN202411441562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-18
AI Technical Summary
In the background management system, when batch operations are processed asynchronously, the interface performance deteriorates, resulting in timeout exceptions, and the user cannot perceive the execution of each option in time, which makes the user experience poor.
Provides a data processing method, which receives batch operation requests from the front-end, processes tasks asynchronously, obtains the execution status of each task, and stores it. Receive the front-end task query request, query and return the execution status of each task, so that the front-end can timely display the execution status of the task.
It realizes that in asynchronous batch operations, the execution status of each task is displayed lightly and at low cost, improving the user's interactive experience, and helping users quickly find the tasks and reasons for the failure.
Smart Images

Figure CN119474149A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method and device. Background Art
[0002] In the backend management system, there are scenarios where you need to select multiple options for batch operations, such as bulk product listing and bulk product deletion. However, if the underlying logic is complex, the call link is long, or the interface needs to be called cyclically, the interface performance will be degraded and the interface timeout exception will occur.
[0003] In the related art, the interface adopts asynchronous processing, which first prompts the user through the page that the batch operation is successfully initiated, and then waits for a period of time before refreshing to check whether all options have been executed. However, this method makes it impossible for the user to perceive the execution status of each option in the batch operation in time, and the user experience is poor. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a data processing method and device, which can realize the timely display of the execution status of each task in asynchronous batch operation on the front-end interface in a lightweight and low-cost manner, thereby improving the user's interactive experience.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a data processing method is provided, comprising:
[0006] Receiving a batch operation request sent by a front end, wherein the batch operation request includes a batch operation identifier and a plurality of task identifiers;
[0007] Returning a response result corresponding to the batch operation request to the front end, and asynchronously processing a plurality of tasks corresponding to the plurality of task identifiers;
[0008] Obtaining the execution status of each task, and storing the batch operation identifier and the execution status of each task in correspondence;
[0009] receiving a task query request sent by the front end, wherein the task query request includes the batch operation identifier;
[0010] The execution status of each task corresponding to the batch operation identifier is queried and returned to the front end, so that the front end displays the execution status of one or more tasks.
[0011] Optionally, obtaining the execution status of each task and storing the batch operation identifier and the execution status of each task in correspondence includes:
[0012] The batch operation identifier and the execution status of each task are stored in a cache in the form of key-value pairs;
[0013] When a change in the execution state of any task is detected, the execution state of any task in the key-value pair in the cache is updated.
[0014] Optionally, causing the front end to display the execution status of one or more tasks includes:
[0015] The front end is enabled to display the execution status of one or more tasks on a pop-up window interface of the front end, wherein the pop-up window interface is popped up after the front end sends the batch operation request.
[0016] Optionally, the method further comprises:
[0017] After receiving the task query request sent by the front end, determining whether the task query request contains a clearing flag;
[0018] In response to the task query request including the clearing identifier, the key-value pair corresponding to the batch operation identifier is cleared.
[0019] Another aspect of an embodiment of the present invention provides a data processing method, including:
[0020] Generate a corresponding batch operation identifier according to the batch operation instruction, wherein the batch operation instruction includes multiple task identifiers;
[0021] Sending a batch operation request to a backend according to the batch operation identifier and the multiple task identifiers;
[0022] receiving a response result corresponding to the batch operation request returned by the backend, so that the backend asynchronously processes the multiple tasks corresponding to the multiple task identifiers;
[0023] Send a task query request to the backend according to the batch operation identifier, receive the execution status of each task corresponding to the batch operation identifier returned by the backend, and display the execution status of one or more tasks.
[0024] Optionally, displaying the execution status of one or more tasks includes: filtering out one or more tasks that meet preset conditions according to the execution status of each task, and displaying the execution status of the one or more tasks on a pop-up window interface;
[0025] Sending a task query request to the backend according to the batch operation identifier includes: monitoring a closing instruction of the pop-up window interface and generating a clear identifier; sending a task query request to the backend according to the clear identifier and the batch operation identifier, so that the backend clears the execution status of each task corresponding to the batch operation identifier according to the clear identifier.
[0026] Optionally, the task query request is sent according to a scheduled task, and the method further includes:
[0027] When a closing instruction of the pop-up window interface is detected or the execution status of each task is detected to indicate that the execution is completed, the scheduled task is cleared.
[0028] According to another aspect of the embodiment of the present invention, there is provided a data processing system, including: a front end and a back end;
[0029] The front end generates a corresponding batch operation identifier according to the batch operation instruction, wherein the batch operation identifier includes multiple task identifiers; and sends a batch operation request to the back end according to the batch operation identifier and the multiple task identifiers;
[0030] The backend receives the batch operation request, returns a response result to the batch operation request to the frontend, asynchronously processes the multiple tasks corresponding to the multiple task identifiers, obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence;
[0031] The front end receives the response result returned by the back end, and sends a task query request to the back end, wherein the task query request includes the batch operation identifier;
[0032] The backend queries the task execution status of each task according to the batch operation identifier in the task query request and returns it to the frontend;
[0033] The front end receives the task execution status of each task returned by the back end, and displays the execution status of one or more tasks.
[0034] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0035] one or more processors;
[0036] a storage device for storing one or more programs,
[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided by the present invention.
[0038] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the data processing method provided by the present invention is implemented.
[0039] One embodiment of the above invention has the following advantages or beneficial effects: the data processing method of the embodiment of the present invention, after receiving the batch operation request sent by the front end, returns the response result corresponding to the batch operation request to the front end, and asynchronously processes multiple tasks corresponding to multiple task identifiers; obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence; after receiving the task query request sent by the front end, queries the execution status of each task based on the batch operation identifier and returns it to the front end, so that the front end displays the execution status of one or more tasks. This method provides a lightweight and low-cost way to solve the problem that asynchronous batch operations cannot be displayed in the front end interface in a timely manner, improves the user's interactive experience, and at the same time, helps users quickly find the failed tasks and the reasons for the failure.
[0040] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0042] Figure 1 is a schematic diagram of the main flow of a data processing method according to an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of the main flow of another data processing method according to an embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of the main flow of a data processing method according to an embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of main modules of a data processing device according to an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of main modules of another data processing device according to an embodiment of the present invention;
[0047] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0048] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0050] Figure 1 is a schematic diagram of the main flow of a data processing method according to an embodiment of the present invention, such as Figure 1 As shown, the data processing method comprises the following steps:
[0051] Step S101: receiving a batch operation request sent by a front end, the batch operation request including a batch operation identifier and multiple task identifiers;
[0052] Step S102: returning the response result corresponding to the batch operation request to the front end, and asynchronously processing multiple tasks corresponding to the multiple task identifiers;
[0053] Step S103: Obtain the execution status of each task, and store the batch operation identifier and the execution status of each task in correspondence;
[0054] Step S104: receiving a task query request sent by the front end, the task query request including a batch operation identifier;
[0055] Step S105: query the execution status of each task corresponding to the batch operation identifier and return it to the front end, so that the front end displays the execution status of one or more tasks.
[0056] In an embodiment of the present invention, the execution subject of the data processing method may be a backend. The backend receives a batch operation request sent by the frontend, the batch operation request includes a batch operation identifier and multiple task identifiers, the batch operation identifier is used to identify the batch operation request, the batch operation request is sent after the user selects a batch option at the frontend, each option may be each commodity to be put on the shelf, each commodity to be deleted, or each commodity inventory, etc., each option has a corresponding option identifier, such as the option identifier may be a commodity identifier, each task identifier is used to identify each task to be executed, and each task to be executed corresponds to an option identifier.
[0057] In an embodiment of the present invention, after receiving a batch operation request sent by the front end, a response result corresponding to the batch operation request is returned to the front end, and the response result indicates that the batch operation request is sent successfully. Then the back end asynchronously processes multiple tasks corresponding to multiple task identifiers. For multiple tasks, multiple tasks can be executed in parallel, or batch logic processing can be executed in a loop. The execution logic of the task is determined according to the specific business, and the original logic can be kept unchanged.
[0058] In an embodiment of the present invention, when each task is processed asynchronously, the execution status of each task is obtained, and then the batch operation identifier and the execution status of each task are stored correspondingly. The execution status of each task may include not executed, executing, successful or failed execution and the reason for failure, etc. By obtaining the execution status of each task and storing it correspondingly with the batch operation identifier, the execution status of each task can be obtained through the batch operation identifier, thereby realizing the tracking of the execution status of each task in the batch operation request.
[0059] In an embodiment of the present invention, the execution status of each task is obtained, and the batch operation identifier and the execution status of each task are stored correspondingly, including: storing the batch operation identifier and the execution status of each task in a cache in the form of a key-value pair; monitoring that the execution status of any task changes, and updating the execution status of any task in the key-value pair in the cache.
[0060] In an embodiment of the present invention, after receiving a batch operation request, the execution status of all tasks is initialized to "not executed", and then the batch operation identifier and the execution status of each task can be stored in a map (an object that maps keys to values) object in the form of a key-value pair, and the map object is stored in a backend cache, which can be a distributed cache, such as a redis cache or a distributed cache based on redis. That is, the structure of the map object includes a batch operation identifier, each task identifier, and the execution status and failure reason corresponding to each task identifier, etc., wherein the batch operation identifier is the key, and each task identifier and the corresponding execution status and failure reason are the value.
[0061] In an embodiment of the present invention, during the asynchronous processing, the execution status of each task is monitored in real time or periodically. When a change in the execution status of any task is detected, the execution status of the task in the key-value pair in the cache can be updated in real time or periodically. For example, after one or more tasks are executed successfully or failed, the execution status of the task in the map object in the cache is updated periodically or in real time to achieve timely update of the task execution status, so that users can perceive the execution status of each task and improve user experience.
[0062] In an embodiment of the present invention, enabling the front end to display the execution status of one or more tasks includes: enabling the front end to display the execution status of one or more tasks on a pop-up window interface of the front end, where the pop-up window interface pops up after the front end sends a batch operation request.
[0063] In an embodiment of the present invention, after receiving the response result, the front end can send a task query request to the back end, and the task query request includes a batch operation identifier. After receiving the task query request, the back end queries the execution status of each task corresponding to the batch operation identifier from the cache, and returns the execution status of each task to the front end, so that the front end displays the execution status of one or more tasks on the pop-up window interface, which is convenient for the user to view intuitively. Among them, the pop-up window interface can be popped up by the front end after sending the batch operation request. The pop-up window interface is used to display the execution status of the task, which can be the execution status of one or more tasks, or the execution status of all tasks corresponding to the batch operation identifier. The specific settings can be customized, such as the pop-up window interface can be set to display the execution status of the task in execution or failed execution and the reason for its failure. The pop-up window interface can also be popped up after receiving the response result, or it can be popped up after the front end sends the task query request.
[0064] By querying the execution status of each task corresponding to the batch operation identifier from the cache and displaying it in the pop-up window interface, users can observe the execution status of each task in a timely manner in an asynchronous scenario, and make corresponding modifications to the tasks that failed to execute, thereby achieving timely processing of tasks.
[0065] In an embodiment of the present invention, the data processing method further includes: after receiving a task query request sent by the front end, determining whether the task query request contains a clear flag; in response to the task query request containing a clear flag, clearing the key-value pair corresponding to the batch operation flag.
[0066] Specifically, after receiving the task query request sent by the front end, the back end can determine whether the task query request contains a clear flag. The clear flag is generated by the front end after detecting the close instruction of the pop-up interface and passed into the task query request. If the task query request contains a clear flag, the key-value pairs corresponding to the batch operation flag in the cache, such as map objects, are cleared to achieve redundant data cleaning.
[0067] In an embodiment of the present invention, the key-value pairs in the cache can also be cleaned up regularly, that is, an expiration time or storage duration is set for each key-value pair such as a map object, and automatic data cleaning is achieved when the expiration time or storage duration is reached.
[0068] The data processing method of the embodiment of the present invention, after receiving the batch operation request sent by the front end, returns the response result corresponding to the batch operation request to the front end, and asynchronously processes multiple tasks corresponding to multiple task identifiers; obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence; after receiving the task query request sent by the front end, queries the execution status of each task based on the batch operation identifier and returns it to the front end, so that the front end displays the execution status of one or more tasks. This method provides a lightweight and low-cost way to solve the problem that asynchronous batch operations cannot be displayed in the front end interface in a timely manner, improves the user's interactive experience, and at the same time, helps users quickly find the failed tasks and the reasons for the failure.
[0069] Another aspect of the embodiment of the present invention is as follows Figure 2 As shown, a data processing method is provided, comprising:
[0070] Step S201: Generate a corresponding batch operation identifier according to a batch operation instruction, where the batch operation instruction includes multiple task identifiers;
[0071] Step S202: Sending a batch operation request to the backend according to the batch operation identifier and multiple task identifiers;
[0072] Step S203: receiving a response result corresponding to the batch operation request returned by the backend, so that the backend asynchronously processes multiple tasks corresponding to the multiple task identifiers;
[0073] Step S204: sending a task query request to the backend according to the batch operation identifier, receiving the execution status of each task corresponding to the batch operation identifier returned by the backend, and displaying the execution status of one or more tasks.
[0074] In an embodiment of the present invention, the execution subject of the data processing method is a front end. At the front end, the user generates a batch operation instruction by batch checking multiple options. The batch operation instruction includes multiple task identifiers, and each task identifier corresponds to an option identifier. After monitoring the user's batch operation instruction, a batch operation identifier is generated based on the batch operation instruction. The batch operation identifier can be generated based on the current timestamp corresponding to the batch operation instruction, or the batch operation identifier can be generated by a method of generating a random number, or other methods for generating the batch operation identifier of the batch operation request can be used.
[0075] A batch operation request is sent to the backend according to the batch operation identifier and multiple task identifiers, that is, a batch operation request is generated based on the batch operation identifier and multiple task identifiers. The batch operation identifier or multiple task identifiers can be used as input parameters of the batch operation request or put into the parameters of the request header to be transmitted to the backend.
[0076] In an embodiment of the present invention, after the front end sends a batch operation request to the back end, the back end returns a response result corresponding to the batch operation request. At the same time, the back end asynchronously processes multiple tasks corresponding to multiple task identifiers. Multiple tasks can be executed in parallel or in a loop. In addition, the back end stores the execution status of each task and the batch operation identifier in the form of a key-value pair such as a map object in the cache of the back end for easy query. After receiving the response result returned by the back end, the front end sends a task query request to the back end to query the execution status of each task corresponding to the batch operation identifier from the cache of the back end, thereby displaying the execution status of one or more tasks.
[0077] In an embodiment of the present invention, displaying the execution status of one or more tasks includes: filtering out one or more tasks that meet preset conditions according to the execution status of each task, and displaying the execution status of the one or more tasks on a pop-up window interface;
[0078] Sending a task query request to the backend according to the batch operation identifier includes: monitoring a closing instruction of the pop-up window interface and generating a clear identifier; sending a task query request to the backend according to the clear identifier and the batch operation identifier, so that the backend clears the execution status of each task corresponding to the batch operation identifier according to the clear identifier.
[0079] In an embodiment of the present invention, after receiving a response result indicating that a batch operation request has been successfully sent, the front end starts a scheduled task, i.e., a timer, and can periodically send a task query request with a batch operation identifier as an input parameter to query the execution status and failure reasons of all corresponding tasks, and display them on a pop-up window interface. Specifically, one or more tasks that meet the preset conditions can be screened out according to the execution status of each task. The preset condition can be a task with an execution status of being executed or failed, so that the tasks in execution or failed and their failure reasons can be displayed on a pop-up window interface. The pop-up window interface can be popped up after the front end sends a batch operation request, or it can be popped up after the task query request with the batch operation identifier is sent for the first time.
[0080] In an embodiment of the present invention, a task query request is sent according to a scheduled task, and the method further includes: when a closing instruction of a pop-up window interface is detected or when the execution status of each task indicates that the execution is finished, the scheduled task is cleared. That is, when a closing instruction of a pop-up window interface is detected, the scheduled task of the front end is cleared, or, when the execution status of all tasks corresponding to the batch task identifier is successful or failed, it indicates that all tasks have been executed and the scheduled task can be cleared. Furthermore, after a closing instruction of a pop-up window interface is detected, a clearing identifier is generated, and the clearing identifier is passed into the task query request, so that after receiving the clearing identifier, the back end clears the key-value pair corresponding to the batch operation identifier, i.e., the map object.
[0081] In an embodiment of the present invention, the method may further include: when a close instruction of the pop-up window interface is detected, the scheduled task of the front end may continue to be executed in the background, and a thumbnail of the execution progress is displayed in a floating ball on the page, and the user can query the execution status of each task in real time by clicking the floating ball. The method may also include: storing the execution status of each task in the local cache of the front-end browser, and re-calling the task execution status after the page is loaded.
[0082] The data processing method of the embodiment of the present invention first generates a batch operation identifier according to a batch operation instruction, sends a batch operation request to the backend based on the batch operation identifier and multiple task identifiers; receives a response result returned by the backend so that the backend processes multiple tasks asynchronously; sends a task query request to the backend according to the batch operation identifier to obtain the execution status of each task, and displays the execution status of one or more tasks. This method provides a lightweight and low-cost way to solve the problem that asynchronous batch operations cannot be displayed in a front-end interface in a timely manner, improves the user's interactive experience, and at the same time helps users quickly find failed tasks and reasons for failure.
[0083] Figure 3 The present invention is a flowchart of a data processing method according to an embodiment of the present invention. In the front-end interface, the user generates a batch operation identifier by checking the batch option, and initiates a batch operation request to the back-end based on the batch operation identifier; the back-end interface receives the batch operation request, returns a response result of the successful request, and asynchronously processes each task, and processes in parallel or executes in a loop; the batch operation identifier and the execution status of each task are stored in the distributed cache; in the distributed cache, the batch operation identifier is used as the key to store the execution status of each task, and the initial status is "not executed". If the execution status of a task changes, the corresponding execution status is updated to "success" or "failure", and the reason for the failure is recorded; when the front-end receives the response result returned by the back-end, the response result may be a prompt on the pop-up window interface that the batch task has been processed; the front-end can start a scheduled task, call the interface regularly, use the batch operation identifier as an input parameter, and call the back-end interface to query the execution status of each task; the back-end interface queries the execution status of each task from the distributed cache according to the batch operation identifier and returns it to the front-end; the front-end displays the execution status of one or more tasks on the pop-up window interface.
[0084] According to another aspect of the embodiment of the present invention, Figure 4 As shown, a data processing device 400 is provided, including:
[0085] A first receiving module 401 receives a batch operation request sent by a front end, wherein the batch operation request includes a batch operation identifier and a plurality of task identifiers;
[0086] A first sending module 402 returns a response result corresponding to the batch operation request to the front end, and asynchronously processes multiple tasks corresponding to the multiple task identifiers;
[0087] The acquisition module 403 acquires the execution status of each task and stores the batch operation identifier and the execution status of each task in correspondence;
[0088] A second receiving module 404 receives a task query request sent by the front end, wherein the task query request includes the batch operation identifier;
[0089] The query module 405 queries the execution status of each task corresponding to the batch operation identifier and returns it to the front end, so that the front end displays the execution status of one or more tasks.
[0090] In an embodiment of the present invention, the acquisition module 403 is further used to: store the batch operation identifier and the execution status of each task in the cache in the form of a key-value pair; upon detecting a change in the execution status of any task, update the execution status of any task in the key-value pair in the cache.
[0091] In the embodiment of the present invention, the query module 405 is further used to: enable the front end to display the execution status of one or more tasks on a pop-up window interface of the front end, and the pop-up window interface pops up after the front end sends the batch operation request.
[0092] In an embodiment of the present invention, the device also includes a clearing module, which is used to: after receiving the task query request sent by the front end, determine whether the task query request contains a clearing identifier; in response to the task query request containing the clearing identifier, clear the key-value pair corresponding to the batch operation identifier.
[0093] According to another aspect of the embodiment of the present invention, Figure 5 As shown, a data processing device 500 is provided, comprising:
[0094] A generating module 501 generates a corresponding batch operation identifier according to a batch operation instruction, wherein the batch operation instruction includes a plurality of task identifiers;
[0095] A second sending module 502 sends a batch operation request to a backend according to the batch operation identifier and the multiple task identifiers;
[0096] A third receiving module 503 receives a response result corresponding to the batch operation request returned by the backend, so that the backend asynchronously processes the multiple tasks corresponding to the multiple task identifiers;
[0097] The display module 504 sends a task query request to the backend according to the batch operation identifier, receives the execution status of each task corresponding to the batch operation identifier returned by the backend, and displays the execution status of one or more tasks.
[0098] In the embodiment of the present invention, the display module 504 is further used to: filter out one or more tasks that meet the preset conditions according to the execution status of each task, and display the execution status of the one or more tasks on the pop-up window interface;
[0099] The display module 504 is further used to: monitor the closing instruction of the pop-up interface and generate a clear mark; send a task query request to the backend according to the clear mark and the batch operation mark, so that the backend clears the execution status of each task corresponding to the batch operation mark according to the clear mark.
[0100] In an embodiment of the present invention, the task query request is sent according to a scheduled task, and the device also includes a clearing module for: clearing the scheduled task upon detecting a closing instruction of the pop-up interface or detecting that the execution status of each task indicates that the execution is completed.
[0101] According to another aspect of the embodiment of the present invention, there is provided a data processing system, including: a front end and a back end;
[0102] The front end generates a corresponding batch operation identifier according to the batch operation instruction, wherein the batch operation identifier includes multiple task identifiers; and sends a batch operation request to the back end according to the batch operation identifier and the multiple task identifiers;
[0103] The backend receives the batch operation request, returns a response result to the batch operation request to the frontend, asynchronously processes the multiple tasks corresponding to the multiple task identifiers, obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence;
[0104] The front end receives the response result returned by the back end, and sends a task query request to the back end, wherein the task query request includes the batch operation identifier;
[0105] The backend queries the task execution status of each task according to the batch operation identifier in the task query request and returns it to the frontend;
[0106] The front end receives the task execution status of each task returned by the back end, and displays the execution status of one or more tasks.
[0107] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided by the present invention.
[0108] According to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the data processing method provided by the present invention is implemented.
[0109] Figure 6 An exemplary system architecture 600 is shown to which the data processing method or data processing device according to the embodiment of the present invention can be applied.
[0110] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0111] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0112] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0113] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0114] It should be noted that the data processing method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the data processing device is generally disposed in the server 605 .
[0115] It should be understood that Figure 6The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0116] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0117] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0118] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0119] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0120] It should be noted that the computer-readable medium shown in the present invention may 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 be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0121] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor including a sending module, a receiving module, a query module, and a display module. The names of these modules do not constitute limitations on the modules themselves in certain cases. For example, the sending module may also be described as "a module that generates a corresponding batch operation identifier according to a batch operation instruction, and the batch operation identifier includes multiple task identifiers; a module that sends a batch operation request to the back end according to the batch operation identifier and multiple task identifiers".
[0123] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a batch operation request sent by the front end, the batch operation request includes a batch operation identifier and multiple task identifiers; returning a response result corresponding to the batch operation request to the front end, and asynchronously processing multiple tasks corresponding to multiple task identifiers; obtaining the execution status of each task, and storing the batch operation identifier and the execution status of each task in correspondence; receiving a task query request sent by the front end, the task query request includes a batch operation identifier; querying the execution status of each task corresponding to the batch operation identifier and returning it to the front end, so that the front end displays the execution status of one or more tasks.
[0124] According to the technical solution of the embodiment of the present invention, the data processing method of the embodiment of the present invention, after receiving the batch operation request sent by the front end, returns the response result corresponding to the batch operation request to the front end, and asynchronously processes multiple tasks corresponding to multiple task identifiers; obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence; after receiving the task query request sent by the front end, queries the execution status of each task based on the batch operation identifier and returns it to the front end, so that the front end displays the execution status of one or more tasks. This method provides a lightweight and low-cost way to solve the problem that asynchronous batch operations cannot be displayed in the front-end interface in a timely manner, improves the user's interactive experience, and at the same time, helps users quickly find failed tasks and reasons for failure.
[0125] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data processing method, characterized in that: include: Receiving a batch operation request sent by a front end, wherein the batch operation request includes a batch operation identifier and a plurality of task identifiers; Returning a response result corresponding to the batch operation request to the front end, and asynchronously processing a plurality of tasks corresponding to the plurality of task identifiers; Obtaining the execution status of each task, and storing the batch operation identifier and the execution status of each task in correspondence; receiving a task query request sent by the front end, wherein the task query request includes the batch operation identifier; The execution status of each task corresponding to the batch operation identifier is queried and returned to the front end, so that the front end displays the execution status of one or more tasks.
2. The method according to claim 1, characterized in that: Obtaining the execution status of each task, and storing the batch operation identifier and the execution status of each task in correspondence, including: The batch operation identifier and the execution status of each task are stored in a cache in the form of key-value pairs; When a change in the execution state of any task is detected, the execution state of any task in the key-value pair in the cache is updated.
3. The method according to claim 2, characterized in that The front end is caused to display the execution status of one or more tasks, including: The front end is enabled to display the execution status of one or more tasks on a pop-up window interface of the front end, wherein the pop-up window interface is popped up after the front end sends the batch operation request.
4. The method according to claim 3, characterized in that The method further comprises: After receiving the task query request sent by the front end, determining whether the task query request contains a clearing flag; In response to the task query request including the clearing identifier, the key-value pair corresponding to the batch operation identifier is cleared.
5. A data processing method, characterized in that: include: Generate a corresponding batch operation identifier according to the batch operation instruction, wherein the batch operation instruction includes multiple task identifiers; Sending a batch operation request to a backend according to the batch operation identifier and the multiple task identifiers; receiving a response result corresponding to the batch operation request returned by the backend, so that the backend asynchronously processes the multiple tasks corresponding to the multiple task identifiers; Send a task query request to the backend according to the batch operation identifier, receive the execution status of each task corresponding to the batch operation identifier returned by the backend, and display the execution status of one or more tasks.
6. The method according to claim 5, characterized in that Displaying the execution status of one or more tasks, including: filtering out one or more tasks that meet preset conditions according to the execution status of each task, and displaying the execution status of the one or more tasks on a pop-up window interface; Sending a task query request to the backend according to the batch operation identifier includes: monitoring a closing instruction of the pop-up window interface and generating a clear identifier; sending a task query request to the backend according to the clear identifier and the batch operation identifier, so that the backend clears the execution status of each task corresponding to the batch operation identifier according to the clear identifier.
7. The method according to claim 6, characterized in that The task query request is sent according to a scheduled task, and the method further includes: When a closing instruction of the pop-up window interface is detected or the execution status of each task is detected to indicate that the execution is completed, the scheduled task is cleared.
8. A data processing system, characterized in that: include: Front-end and back-end; The front end generates a corresponding batch operation identifier according to the batch operation instruction, wherein the batch operation identifier includes a plurality of task identifiers; Sending a batch operation request to the backend according to the batch operation identifier and the multiple task identifiers; The backend receives the batch operation request, returns a response result to the batch operation request to the frontend, asynchronously processes the multiple tasks corresponding to the multiple task identifiers, obtains the execution status of each task, and stores the batch operation identifier and the execution status of each task in correspondence; The front end receives the response result returned by the back end, and sends a task query request to the back end, wherein the task query request includes the batch operation identifier; The backend queries the task execution status of each task according to the batch operation identifier in the task query request and returns it to the frontend; The front end receives the task execution status of each task returned by the back end, and displays the execution status of one or more tasks.
9. An electronic device, characterized in that: include: one or more processors; a 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 according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.