Task processing method, device, equipment and storage medium
By using event processing modules to handle online and offline requests in cloud computing, big data and Internet of Things systems, the problems of high code coupling and repeated encoding are solved, and the system is low-coupled, high cohesive and efficient development are achieved.
Patent Information
- Application Number
- CN202411749923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-04
AI Technical Summary
Existing cloud computing, big data and IoT systems have high code coupling and repeated encoding between online and offline modules, resulting in increased system maintenance difficulty and limited code reusability, while increasing service deployment complexity and increased resource usage costs.
The event processing module sends the target request to the target service module, and the event processing module takes into account both the online processing logic and the offline processing logic, avoiding the system being divided into two independent modules: online and offline.
It effectively reduces the overall complexity and maintenance difficulty of the system, realizes low coupling and high cohesion of codes between modules, reduces resource costs, and improves the development efficiency of the system.
Smart Images

Figure CN119759515A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to technical fields such as cloud computing, big data, and the Internet of Things. Background Art
[0002] With the rapid evolution of cloud computing, big data and the Internet of Things, the complexity of the backend processing logic of online interfaces has increased dramatically. To meet this challenge, the system often adopts a modular design, for example, dividing the system into two independent modules, online and offline. Although this approach can meet specific needs to a certain extent, from a global perspective, there are problems such as high code coupling and repeated coding between modules, which not only increases the difficulty of system maintenance, but also limits the reusability of the code.
[0003] In addition, subdividing the system into the above two modules also brings additional challenges, such as increased complexity of service deployment and increased resource usage costs. These problems have an adverse impact on the overall performance and development efficiency of the system. Summary of the invention
[0004] The present disclosure provides a task processing method, apparatus, device and storage medium.
[0005] According to one aspect of the present disclosure, there is provided a task processing method, comprising:
[0006] Based on the acquired target request, an event processing module is called; wherein the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request;
[0007] Triggering a sending operation for a target request through at least one event pushing unit in the event processing module to send the target request;
[0008] When the service calling unit in the event processing module monitors the target request, the service calling unit sends the target request to the target service module, so as to at least use the target service module to process the target request belonging to the online request or the target request belonging to the offline request.
[0009] According to another aspect of the present disclosure, there is provided a task processing device, comprising:
[0010] A response unit, used to call an event processing module based on the acquired target request; wherein the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request;
[0011] A processing unit is used to trigger a sending operation for a target request through at least one event pushing unit in an event processing module to send the target request; when a business calling unit in the event processing module monitors the target request, the target request is sent to a target business module through the business calling unit to at least use the target business module to process the target request belonging to an online request or the target request belonging to an offline request.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0018] In this way, the disclosed solution can use the event processing module to send the acquired target request to the target business module, so as to at least use the target business module to process the target request belonging to the online request or the target request belonging to the offline request. In this way, compared with the existing modular design method, the disclosed solution no longer needs to divide the system into two major modules: online and offline. In other words, the disclosed solution takes into account both the online processing logic and the offline processing logic through the event processing module, effectively solving the problems of high code coupling and repeated coding in the existing solutions, thereby providing strong support for achieving low coupling and high cohesion of codes between modules, and at the same time, it also provides strong support for reducing the complexity and maintenance difficulty of the system.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0021] Figure 1 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 1 ;
[0022] Figure 2 This is a schematic diagram of the structure of an event processing module according to an embodiment of the present application. Figure 1 ;
[0023] Figure 3 This is a schematic diagram of the structure of an event processing module according to an embodiment of the present application. Figure 2 ;
[0024] Figure 4 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 2 ;
[0025] FIG. 5( a ) is a schematic diagram of the structure of an event processing module according to an embodiment of the present application. Figure 3 ;
[0026] FIG. 5( b ) is a schematic diagram of the structure of an event processing module according to an embodiment of the present application. Figure 4 ;
[0027] Figure 6 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 3 ;
[0028] FIG. 7( a ) and FIG. 7( b ) are schematic diagrams of an event processing module in a specific example according to an embodiment of the present application;
[0029] Figure 8 is a structural diagram of a task processing device according to an embodiment of the present application;
[0030] Fig. 9 It is a block diagram of an electronic device used to implement the task processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure 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 of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0032] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them. They do not mean to limit the order or to limit them to only two. For example, the first feature and the second feature refer to two types / two features. The first feature can be one or more, and the second feature can also be one or more.
[0033] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the specific embodiments below. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0034] The disclosed solution provides a task processing method, which achieves low coupling and high cohesion between modules by optimizing the overall architecture of the system, thus laying a foundation for exploring more efficient resource utilization strategies. For example, the disclosed solution can use the event processing module to process online requests or offline requests. In other words, the disclosed solution uses the event processing module to take into account both online processing logic and offline processing logic, so that the system no longer needs to be divided into online and offline modules, effectively reducing the overall complexity of the system. At the same time, low coupling and high cohesion between modules are achieved, thereby reducing the resource cost required for system development.
[0035] Specifically, Figure 1 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 1 The method may be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices.
[0036] Further, the method includes at least part of the following contents. Figure 1 As shown, including:
[0037] Step S101: Based on the acquired target request, an event processing module is called.
[0038] Here, the target request carries identification information. Further, the identification information can be used to identify whether the target request is an online request or an offline request. In other words, according to the identification information carried by the target request, it can be determined whether the target request is an online request or an offline request.
[0039] It should be pointed out that in this example, online requests can be specifically understood as requests that require real-time responses; for online requests, while waiting for the system (or server) to process the online request, the target object needs to maintain a connection with the system so that the processing result can be obtained immediately after the processing is completed. Correspondingly, offline requests can be specifically understood as requests that do not require real-time responses (also known as slow responses).
[0040] Step S102: triggering a sending operation for a target request through at least one event pushing unit in the event processing module to send the target request.
[0041] Step S103: When the service calling unit in the event processing module monitors the target request, the service calling unit sends the target request to the target service module, so as to at least use the target service module to process the target request belonging to the online request or the target request belonging to the offline request.
[0042] In this way, the disclosed solution can use the event processing module to send the acquired target request to the target business module, so as to at least use the target business module to process the target request belonging to the online request or the target request belonging to the offline request. In this way, compared with the existing modular design method, the disclosed solution no longer needs to divide the system into two major modules: online and offline. In other words, the disclosed solution takes into account both the online processing logic and the offline processing logic through the event processing module, effectively solving the problems of high code coupling and repeated coding in the existing solutions, thereby providing strong support for achieving low coupling and high cohesion of codes between modules, and at the same time, it also provides strong support for reducing the complexity and maintenance difficulty of the system.
[0043] Furthermore, since the event processing module of the disclosed solution integrates two processing logics for online requests and offline requests, it effectively saves the resources required for system development and reduces the resource cost required for service deployment, thereby effectively improving the overall development efficiency of the system.
[0044] For example, if Figure 2 As shown, in one example, an event processing module (e.g., also referred to as an Event module) includes at least one event push unit and a business call unit (e.g., referred to as a Consume unit); further, after obtaining a target request, the event processing module is called, and at least one event push unit in the event processing module is used to send the obtained target request, and when the business call unit in the event processing module monitors the target request, the monitored target request is sent to the target business module through the business call unit, so that the target request can be processed by the target business module.
[0045] It should be noted that, in one example, the business call unit (for example, it can be called a Consume unit) can achieve the following functions: first, monitor the relevant events of the event push unit and push the monitored data to the business module; second, the unit also supports asynchronous parallel processing of multiple tasks.
[0046] Further, in a specific example, the above-mentioned calling the event processing module based on the acquired target request (for example, step S101) may specifically include: acquiring the target request initiated by the target object; performing parameter verification on the target request, and calling the event processing module when the parameter verification passes. In this way, the security requirements are effectively compatible.
[0047] For example, in one example, an external target request is received through a request receiving module (such as an application programming interface (API) of the Hypertext Transfer Protocol (HTTP), and the request receiving module is used to determine whether the obtained target request is an abnormal request. When it is determined that the target request is not an abnormal request, the event processing module is called. In this way, the security and stability of the system are ensured by timely identifying and blocking abnormal requests, thereby improving the user experience.
[0048] Furthermore, in a specific example, in order to take into account the needs of online requests and offline requests on the basis of integrating online processing and offline processing logic, different processing channels (for example, queues) can be set for online requests and offline requests, so as to effectively meet the needs of online requests while taking into account the needs of offline requests. Specifically, the above-mentioned sending of the target request to the target business module through the business calling unit (for example, step S103) specifically includes:
[0049] Step S103-1: Through the service calling unit, the target request is added to the target processing path matching the identification information.
[0050] Here, the event processing module at least includes a first processing path for processing online requests and a second processing path for processing offline requests, and the target processing path is the first processing path or the second processing path.
[0051] For example, in one example, the processing path can be implemented through a queue. For example, at least two queues are set in the event processing module, namely an online queue and an offline queue, wherein the online queue is used to store online requests and the offline queue is used to store offline requests.
[0052] Step S103 - 2 : Send the target request to the target service module through the target processing path.
[0053] For example, if Figure 3 As shown, a first processing path and a second processing path are set in the business calling unit; further, according to the identification information carried by the target request, the target request is added to the target processing path matching the identification information. For example, if the identification information indicates that the target request is an online request, the target request is added to the first processing path; similarly, if the identification information indicates that the target request is an offline request, the target request is added to the second processing path; further, the target request is sent to the target business module.
[0054] In this way, the disclosed solution can utilize the business call unit to send the target request to the target business module through different processing paths. This is conducive to the rational allocation of system resources and improves the processing efficiency of the system. Moreover, the disclosed solution can select appropriate processing paths according to different request types, thereby enhancing the compatibility of the system in processing different requests, thereby further optimizing system performance.
[0055] Figure 4 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 2 The method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It can be understood that the above Figures 1 to 3 The relevant contents of the method shown can also be applied to this example, and the relevant contents will not be described in detail in this example.
[0056] Further, the method includes at least part of the following contents. Figure 4 As shown, including:
[0057] Step S401: Based on the acquired target request, an event processing module is called.
[0058] Here, the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request.
[0059] It should be noted that the relevant content of the target request can be referred to the above example and will not be repeated here.
[0060] Step S402: triggering a sending operation for a target request through the first pushing unit in the event processing module to send the target request.
[0061] Step S403: Perform a monitoring operation through the second push unit in the event processing module.
[0062] Step S404: Determine whether there is a target request; if so, proceed to step S405; otherwise, return to step S403 and continue to perform the monitoring operation.
[0063] Step S405: When a target request is monitored, a sending operation for the target request is triggered through the second push unit. Then, the process proceeds to step S406.
[0064] Step S406: When the service calling unit in the event processing module monitors the target request, the service calling unit sends the target request to the target service module, so as to at least use the target service module to process the target request belonging to the online request or the target request belonging to the offline request.
[0065] For example, in one example, as shown in Figure 5(a), the event processing module (for example, it can also be called an Event module) includes a first push unit (for example, it can also be called a Push unit), a second push unit (for example, it can also be called a Pop unit) and a business call unit (for example, it can also be called a Consume unit); further, after obtaining the target request and calling the event processing module, the first push unit is used to trigger a sending operation for the target request, and then the target request is sent out; further, the second push unit is used to monitor and determine whether there is a target request, and further, when the target request is monitored, the second push unit is used to trigger a sending operation for the target request to send out the monitored target request; further, when the business call unit (for example, the Consume unit) in the event processing module monitors the target request, the target request is sent to the target business module, so that the target business module can be used to process the target request.
[0066] In this way, the disclosed solution can utilize the first push unit and the second push unit in the event processing module to send out the acquired target request, and when the business calling unit monitors the target request, the business calling unit sends the monitored target request to the target business module. In this way, through the newly added event processing module, target requests of any type (such as online requests, offline requests) can be processed, which effectively solves the problem of repeated coding in the system, thereby reducing the complexity and maintenance difficulty of the system.
[0067] It should be noted that, in actual applications, the first push unit may not be able to normally send the target request due to abnormal reasons, or the second push unit may not be able to normally monitor the target request. At this time, in order to avoid the occurrence of the above-mentioned abnormal events, the first push unit may also store the target request in the target database, and accordingly, the second push unit may retrieve from the target database whether there is a target request that has not been successfully processed; specifically, in an example, the above-mentioned at least one event push unit in the event processing module triggers the sending operation for the target request (the above-mentioned step S102), and may also specifically include:
[0068] Step S102 - 1 : The target request is stored in the target database through the first push unit in the event processing module.
[0069] Here, in one example, the target database also supports corresponding operations such as adding, deleting, querying, and updating for the stored data, and the disclosed solution does not impose specific restrictions on the related operations of the target database.
[0070] Step S102-2: obtaining at least one unprocessed request from the target database through the second push unit in the event processing module.
[0071] Step S102 - 3 : When the at least one request includes a target request, triggering a sending operation for the target request to send the target request.
[0072] For example, in one example, as shown in Figure 5(b), when the first push unit cannot normally issue the target request due to abnormal reasons, or the second push unit cannot normally monitor the target request, the first push unit (such as the Push unit) stores the acquired target request in the target database; accordingly, the second push unit can obtain at least one unsuccessful request from the target database, and when it is determined that the target request exists in the acquired request, the target request is sent out through the second push unit; and then when the business call unit (such as the Consume unit) in the event processing module monitors the target request, the business call unit sends the target request to the target business module to use the target business module to process the target request.
[0073] It should be noted that the above step S102-1 can be performed when the target request is not successfully sent in the above step S402, or the above step S102-1 can be executed synchronously with the above step S402, so as to ensure that the target request can be responded to in a timely manner, thereby effectively avoiding the problem of being unable to respond to the target request due to abnormal reasons.
[0074] For example, in one example, the first push unit (also known as the Push unit) implements the following functions: First, persist the relevant parameters of the target request, for example, by storing them in the target database. Second, actively trigger the Push event (for example, the sending operation described above). The above two steps can be performed simultaneously.
[0075] Furthermore, in another example, the second push unit (also known as the Pop unit) implements the following functions: first, it listens to the Push event of the Push unit and actively triggers the Pop event (for example, the sending operation described above); second, it periodically pulls unprocessed data from the target database, such as requests that have not been successfully processed, and triggers the Pop event (for example, the sending operation described above).
[0076] In this way, the security of data is effectively ensured, and technical support is provided for the normal operation of the subsequent system. In addition, since the first push unit can store the target request in the target database, it can also effectively avoid the related problems caused by the inability of the subsequent unit to obtain the target request, thus providing strong support for ensuring the normal transmission of data, the stable operation of the system, and thus improving the user experience.
[0077] Figure 6 This is a schematic flow chart of a task processing method according to an embodiment of the present application. Figure 3 The method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It can be understood that the above Figure 1 The relevant contents of the method shown in FIG. 5 can also be applied to this example, and the relevant contents will not be described in detail in this example.
[0078] Further, the method includes at least part of the following contents. Figure 6 As shown, including:
[0079] Step S601: Based on the acquired target request, an event processing module is called.
[0080] Here, the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request.
[0081] It should be noted that the relevant content of the target request can be referred to the above example and will not be repeated here.
[0082] Step S602: triggering a sending operation for a target request through at least one event pushing unit in the event processing module to send the target request.
[0083] It should be noted that the relevant content about the event processing module can be referred to the above example and will not be repeated here.
[0084] Step S603: When the service calling unit in the event processing module monitors the target request, the service calling unit sends the target request to the target service module, so as to at least use the target service module to process the target request belonging to the online request or the target request belonging to the offline request.
[0085] Step S604: Receive a first return result for the target request through the service control unit in the event processing module.
[0086] Step S605: When it is determined based on the target request that other business modules need to be called, the business control unit in the event processing module calls the at least one event push unit to trigger the sending operation for the first return result through the at least one event push unit, and when the business call unit monitors the first return result, the first return result is sent to other business modules to obtain the target result for the target request.
[0087] That is to say, in this example, the event processing module also includes a business control unit (for example, it can be called a Control unit), which is used to receive the processing result returned by the target business module (that is, the first return result); specifically, when the business control unit obtains the processing result returned by the target business module (that is, the first return result), if it is determined based on the target request that other business modules need to be called, the business control unit will return the processing result of the target business module to the event push unit in the event processing module to trigger the sending operation of the processing result of the target business module. Furthermore, when the business calling unit monitors the processing result of the target business module, the processing result of the target business module is sent to other business modules for further processing by other business modules, and so on, until all business modules required for the target request are called to complete. At this time, the processing result of the last business module is used as the target result for the target request to be returned to the client.
[0088] For example, suppose that the target request needs to call two business modules, for example, business module 1 and business module 2; at this time, as shown in FIG7(a), the business call unit in the event processing module is used to send the target request to business module 1, and the first processing result for the target request (also referred to as the processing result of business module 1) is received through the business control unit (for example, the Control unit). Further, it is determined that the target request needs to continue to call business module 2 for processing, and at least one event push unit is called, for example, the first processing result is sent to the first push unit, so that the first processing result is sent out through the first push unit, and when the second push unit monitors the first processing result, the second push unit is used to send the monitored first processing result out, and then when the business call unit monitors the first processing result, the business call unit is used to send the first processing result to business module 2 to obtain the second processing result. At this time, the second processing result is the target result for the target request.
[0089] It should be noted that in actual applications, the business control unit (for example, it can be called a Control unit) can also implement the following functions: first, perform secondary processing on the return value of the interface of the target business module; second, perform delay processing on the current request; third, retry the current request; fourth, support business customization logic.
[0090] It should be noted that the above is only an example. The specific number of business modules can be set according to actual needs, and the present disclosure does not limit this.
[0091] Step S606: returning the target result for the target request to the client corresponding to the target request through the service control unit.
[0092] Continuing with FIG. 7(a) as an example, after all the business modules required to be called for the target request are completed, as shown in FIG. 7(b), the target result for the target request can also be obtained and returned to the client corresponding to the target request through the business control unit.
[0093] In this way, the disclosed solution can support multiple business modules to process target requests to obtain target results for the target requests, and return the target results to the client corresponding to the target request. In this way, different business processing logics are effectively supported, providing strong support for subsequent engineering promotion.
[0094] The disclosed solution provides a task processing device, such as Figure 8 As shown, including:
[0095] The response unit 801 is used to call the event processing module based on the acquired target request; wherein the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request;
[0096] The processing unit 802 is used to trigger a sending operation for a target request through at least one event pushing unit in the event processing module to send the target request; when the business calling unit in the event processing module monitors the target request, the target request is sent to the target business module through the business calling unit to at least use the target business module to process the target request belonging to an online request or the target request belonging to an offline request.
[0097] In a specific example of the disclosed solution, the processing unit is specifically used to:
[0098] By means of the service calling unit, the target request is added to the target processing path matching the identification information, wherein the event processing module at least includes a first processing path for processing online requests and a second processing path for processing offline requests, and the target processing path is the first processing path or the second processing path;
[0099] The target request is sent to the target business module through the target processing path.
[0100] In a specific example of the disclosed solution, the processing unit is specifically used to:
[0101] triggering a sending operation for a target request through a first push unit in the event processing module to send the target request;
[0102] Monitoring whether there is a target request through the second push unit in the event processing module;
[0103] In the case of monitoring the target request, a sending operation for the target request is triggered through the second pushing unit.
[0104] In a specific example of the disclosed solution, the processing unit is specifically used to:
[0105] The target request is stored in the target database through the first push unit in the event processing module;
[0106] Obtaining at least one unsuccessfully processed request from the target database through the second push unit in the event processing module;
[0107] In a case where the at least one request includes a target request, a sending operation for the target request is triggered.
[0108] In a specific example of the disclosed solution, the processing unit is further used for:
[0109] Receiving, through the service control unit in the event processing module, a first return result for the target request;
[0110] When it is determined based on the target request that other business modules need to be called further, the business control unit calls the at least one event push unit to trigger the sending operation for the first return result through the at least one event push unit, and when the business call unit monitors the first return result, the first return result is sent to other business modules to obtain the target result for the target request.
[0111] In a specific example of the disclosed solution, the processing unit is further used for:
[0112] The target result for the target request is returned to the client corresponding to the target request through the service control unit.
[0113] For the description of the specific functions and examples of each unit of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0114] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0115] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0116] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0117] like Fig. 9As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0118] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0119] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as task processing methods. For example, in some embodiments, the task processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the task processing method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the task processing method in any other appropriate manner (e.g., by means of firmware).
[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0122] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0124] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0125] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0127] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A task processing method, comprising: Based on the acquired target request, an event processing module is called; wherein the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request; Triggering a sending operation for a target request through at least one event pushing unit in the event processing module to send the target request; When the service calling unit in the event processing module monitors the target request, the service calling unit sends the target request to the target service module, so as to at least use the target service module to process the target request belonging to the online request or the target request belonging to the offline request.
2. The method according to claim 1, wherein: The step of sending the target request to the target service module through the service calling unit includes: By means of the service calling unit, the target request is added to the target processing path matching the identification information, wherein the event processing module at least includes a first processing path for processing online requests and a second processing path for processing offline requests, and the target processing path is the first processing path or the second processing path; The target request is sent to the target business module through the target processing path.
3. The method according to claim 1 or 2, wherein: The triggering of the sending operation for the target request through at least one event pushing unit in the event processing module includes: Triggering a sending operation for a target request through a first push unit in the event processing module to send the target request; Monitoring whether there is a target request through the second push unit in the event processing module; In the case of monitoring the target request, a sending operation for the target request is triggered through the second pushing unit.
4. The method according to claim 1 or 2, wherein: The triggering of the sending operation for the target request through at least one event pushing unit in the event processing module includes: The target request is stored in the target database through the first push unit in the event processing module; Obtaining at least one unsuccessfully processed request from the target database through the second push unit in the event processing module; In a case where the at least one request includes a target request, a sending operation for the target request is triggered.
5. The method according to claim 1, further comprising: Receiving, through the service control unit in the event processing module, a first return result for the target request; When it is determined based on the target request that other business modules need to be called further, the business control unit calls the at least one event push unit to trigger the sending operation for the first return result through the at least one event push unit, and when the business call unit monitors the first return result, the first return result is sent to other business modules to obtain the target result for the target request.
6. The method according to claim 5, further comprising: The target result for the target request is returned to the client corresponding to the target request through the service control unit.
7. A task processing device, comprising: A response unit, used to call an event processing module based on the acquired target request; wherein the target request carries identification information, and the identification information is used to identify whether the target request is an online request or an offline request; A processing unit is used to trigger a sending operation for a target request through at least one event pushing unit in an event processing module to send the target request; when a business calling unit in the event processing module monitors the target request, the target request is sent to a target business module through the business calling unit to at least use the target business module to process the target request belonging to an online request or the target request belonging to an offline request.
8. The device according to claim 7, wherein: The processing unit is specifically used for: By means of the service calling unit, the target request is added to the target processing path matching the identification information, wherein the event processing module at least includes a first processing path for processing online requests and a second processing path for processing offline requests, and the target processing path is the first processing path or the second processing path; The target request is sent to the target business module through the target processing path.
9. The device according to claim 7 or 8, wherein: The processing unit is specifically used for: Triggering a sending operation for a target request through a first push unit in the event processing module to send the target request; Monitoring whether there is a target request through the second push unit in the event processing module; In the case of monitoring the target request, a sending operation for the target request is triggered through the second pushing unit.
10. The device according to claim 7 or 8, wherein: The processing unit is specifically used for: The target request is stored in the target database through the first push unit in the event processing module; Obtaining at least one unsuccessfully processed request from the target database through the second push unit in the event processing module; In a case where the at least one request includes a target request, a sending operation for the target request is triggered.
11. The device according to claim 7, wherein: The processing unit is further used for: Receiving, through the service control unit in the event processing module, a first return result for the target request; When it is determined based on the target request that other business modules need to be called further, the business control unit calls the at least one event push unit to trigger the sending operation for the first return result through the at least one event push unit, and when the business call unit monitors the first return result, the first return result is sent to other business modules to obtain the target result for the target request.
12. The device according to claim 11, wherein The processing unit is further used for: The target result for the target request is returned to the client corresponding to the target request through the service control unit.
13. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.