Task request processing method, device and computer equipment
By obtaining and matching the task requests of terminal accounts and the version of the specified running environment in the SaaS system, the problem that existing systems cannot perform task requests on specific service nodes is solved, and efficient processing of task requests and improving system stability is achieved.
Patent Information
- Application Number
- CN202411578165.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-07
AI Technical Summary
Existing SaaS systems cannot perform task requests on specific service nodes and cannot effectively meet business needs.
By responding to the task request sent by the terminal account, obtain the version of the current running environment, and use the task identifier in the task request to identify the terminal account from the preset account task relationship table, and find the corresponding specifications of the terminal account from the account version relationship table. The running environment version, if the version matches, the current running environment will handle the task request.
It realizes that task requests for terminal accounts are processed on the version of the specified running environment, reducing errors and failures that may be caused by inconsistencies in versions, improving system stability and performance, and enhancing the security and controllability of task request processing.
Smart Images

Figure CN119094620B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for processing task requests. Background Art
[0002] With the rapid development of cloud computing and software services, SaaS (Software as a Service) technology has emerged. In the process of deploying new functions or versions of SaaS systems, in order to achieve balanced load on service nodes, the service nodes (i.e., operating environments) that process task requests usually have a certain degree of randomness. However, in most cases, existing technologies require that task requests be specifically assigned to specific service nodes for processing, while current SaaS systems cannot execute these task requests on specific service nodes, and cannot effectively meet business needs. Summary of the invention
[0003] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for processing task requests in response to the above technical problems.
[0004] In a first aspect, the present application provides a method for processing a task request. The method comprises:
[0005] In response to a task request sent by a terminal account, obtaining a version of a current operating environment of the server;
[0006] In the case that the version of the current operating environment is not the target version, using the task identifier in the task request to identify the terminal account from a preset account-task relationship table;
[0007] Searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0008] When the version of the designated operating environment is found and the version of the designated operating environment is the same as the version of the current operating environment, the task request is processed using the current operating environment.
[0009] In one embodiment, the specified operating environment version includes a single specified operating environment version, and the processing of the task request using the current operating environment includes:
[0010] Adding the version identifier of the current operating environment to the consumer-side configuration file of the task request;
[0011] Sending the task request to the message queue corresponding to the consumer end;
[0012] The consumer end is used to process the task request in the message queue.
[0013] In one embodiment, the specified operating environment version includes multiple specified operating environment versions, and the processing of the task request using the current operating environment includes:
[0014] Establishing a number of consumer ends of the specified operating environment versions, and adding version identifiers corresponding to the operating environments to the configuration files of the consumer ends of the task requests;
[0015] Sending the task request to the message queue corresponding to the consumer end;
[0016] Determine whether the version identifier of each consumer end is the same as the version identifier corresponding to the task request stored in the message queue;
[0017] When the version identifier of the configuration file of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue, the task request in the message queue is processed by the consumer end.
[0018] In one embodiment, searching the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table includes:
[0019] When the account level of the terminal account is the first level, searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0020] When the account level of the terminal account is the second level, the task request is processed using the current operating environment.
[0021] In one embodiment, when the version of the current operating environment is not the target version, using the task identifier in the task request to identify the terminal account from a preset account task relationship table includes:
[0022] In a case where the version of the current operating environment is the target version, using the current operating environment to process the task request;
[0023] In the case that the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
[0024] In one embodiment, the method further comprises:
[0025] In the case where the version of the specified operating environment is not found, processing the task request using the current operating environment;
[0026] When the version of the designated operating environment is found and the version of the designated operating environment is different from the version of the current operating environment, the task request is responded to again after the version of the current operating environment is switched.
[0027] In a second aspect, the present application also provides a task request processing device. The device comprises:
[0028] A version acquisition module, used to obtain the version of the current operating environment of the server in response to a task request sent by a terminal account;
[0029] An account identification module, used to identify the terminal account from a preset account-task relationship table using the task identifier in the task request when the version of the current operating environment is not the target version;
[0030] A version search module, used to search for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0031] The request processing module is used to process the task request using the current operating environment when the version of the specified operating environment is found and the version of the specified operating environment is the same as the version of the current operating environment.
[0032] In one of the embodiments, the specified operating environment version includes a single specified operating environment version, and the request processing module includes:
[0033] A configuration file setting submodule, used to add the version identifier of the current operating environment to the consumer-side configuration file of the task request;
[0034] A request sending submodule, used to send the task request to the message queue corresponding to the consumer end;
[0035] The request processing submodule is used to process the task requests in the message queue using the consumer end.
[0036] In one embodiment, the specified operating environment version includes multiple specified operating environment versions, and the request processing module includes:
[0037] A consumer end establishment submodule is used to establish the consumer ends of the specified number of versions of the operating environment, and to add the version identifiers corresponding to the operating environment to the configuration files of the consumer ends of the task request respectively;
[0038] A request sending submodule, used to send the task request to the message queue corresponding to the consumer end;
[0039] A version determination submodule, used to determine whether the version identifier of each consumer end is the same as the version identifier corresponding to the task request stored in the message queue;
[0040] The request processing submodule is used to process the task request in the message queue using the consumer end when the version identifier of the configuration file of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue.
[0041] In one embodiment, the version search module is further used to:
[0042] When the account level of the terminal account is the first level, searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0043] When the account level of the terminal account is the second level, the task request is processed using the current operating environment.
[0044] In one embodiment, the account identification module is further used to:
[0045] In a case where the version of the current operating environment is the target version, using the current operating environment to process the task request;
[0046] In the case that the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
[0047] In one embodiment, the request processing module is further used to:
[0048] In the case where the version of the specified operating environment is not found, processing the task request using the current operating environment;
[0049] When the version of the designated operating environment is found and the version of the designated operating environment is different from the version of the current operating environment, the task request is responded to again after the version of the current operating environment is switched.
[0050] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for processing a task request as described in any one of the embodiments of the present disclosure is implemented.
[0051] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for processing a task request as described in any one of the embodiments of the present disclosure is implemented.
[0052] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for processing a task request as described in any one of the embodiments of the present disclosure is implemented.
[0053] The above-mentioned task request processing method, device, computer equipment, storage medium and computer program product obtain the current operating environment version by responding to the task request sent by the terminal account, and identify the terminal account according to the task request; find the specified operating environment version corresponding to the terminal account from the preset account version relationship table; when the specified operating environment version is found and the specified operating environment version is the same as the current operating environment version, the task request is processed with the current operating environment version. The version of the current operating environment of the server can be dynamically monitored and compared with the version of the specified operating environment, so that the task request of the terminal account is processed on the version of the specified operating environment. Thereby reducing the errors and failures that may be caused by version inconsistency, and improving the stability and performance of the system. At the same time, by finding the version of the specified operating environment of the terminal account in the account version relationship table, the security and controllability of task request processing are also enhanced, which is convenient for task management and environmental maintenance, providing efficient services for terminal accounts, and effectively managing and optimizing the use of server resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 An application environment diagram of a method for processing a task request in one embodiment;
[0055] Figure 2 A flowchart of a method for processing a task request in an embodiment;
[0056] Figure 3 A first flow chart of task request processing in one embodiment;
[0057] Figure 4 A second flow chart of task request processing in one embodiment;
[0058] Figure 5 A schematic diagram of a process for processing different terminal account levels in one embodiment;
[0059] Figure 6 A schematic diagram of a request processing flow in different versions in one embodiment;
[0060] Figure 7A third flow chart of task request processing in one embodiment;
[0061] Figure 8 A flowchart of a method for processing a task request in one embodiment;
[0062] Fig. 9 A structural block diagram of a device for processing task requests in one embodiment;
[0063] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] The task request processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal account sends a task request to the server 104 through the terminal 102, and the server 104 responds to the task request sent by the terminal 102 and processes the task request accordingly. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0066] In one embodiment, Figure 2 As shown, a method for processing a task request is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0067] Step S100, in response to a task request sent by a terminal account, obtaining a version of the current operating environment of the server.
[0068] In an exemplary embodiment, the task request processing method may be run on a SaaS system (Software as a Service) or the like; wherein the terminal account may include a tenant of the SaaS system or the like.
[0069] In an exemplary embodiment, the version of the current operating environment of the server can be obtained by adjusting the version of the current operating environment through user customization of the management user.
[0070] In an exemplary embodiment, the task request may include a scheduled task request, etc.; the task request may include a task identifier, a task frequency, a task processing time, a task content, etc.; specifically, the task identifier may include an identifier corresponding to the task provided by SaaS to the tenant, for example, sending a notification is task 1; interactive data is task 2, etc.; the task frequency may process task requests according to the task frequency, etc.; for example, processing task 1 (for example, sending a notification, etc.) every other day, etc.; the task processing time may include the time for processing the task, etc.; for example, sending a notification at XX time, etc.; the task content may include the content of task processing, etc.; for example, if the task is to send a notification, the task content may include the content of the notification sent, etc.; if the task is interactive data, the task content may include interactive data, etc.
[0071] Step S200, when the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
[0072] In an exemplary embodiment, the target version may include any version, etc.; it can be understood that the any version here is a version, not any version; specifically, when the current operating environment version is any version, it means that all versions will be regarded as the same version at this time, and the task request can be sent to any version for processing, etc.; for example, when the method is run in a SaaS system, the target version is a blue-green environment, etc.
[0073] In an exemplary embodiment, when the version of the current operating environment is not the target version, it may include that the current operating environment is specifically a version, etc.; for example, it may be a blue version, or a green version, etc.
[0074] In an exemplary embodiment, the account-task relationship table may include an association relationship between a task identifier and a terminal account, etc.; the task relationship table may also include a task type, task data, etc.
[0075] Step S300: searching the preset account version relationship table for the version of the specified operating environment corresponding to the terminal account.
[0076] In an exemplary embodiment, the version relationship table may include the association between the version of the operating environment and the terminal account, etc.; specifically, the version relationship table may include the terminal account that needs to run in the blue environment; the terminal account that needs to run in the green environment; the terminal account that needs to run in the test environment, etc.
[0077] In an exemplary embodiment, the version relationship table can be used by the administrator to send the task request corresponding to the terminal account to the version processing of the designated operating environment, etc. For example, the terminal account in the account version relationship table in the blue environment can include that the terminal account is designated to be processed in the blue environment, etc.
[0078] Step S400: When the version of the designated operating environment is found and the version of the designated operating environment is the same as the version of the current operating environment, the task request is processed using the current operating environment.
[0079] In an exemplary embodiment, the finding of the designated operating environment may include the administrator having a designated operating environment version for the terminal account, etc.; at this time, if the version of the designated operating environment is the same as the version of the current operating environment, the current operating environment can be directly used to process the task request, etc.
[0080] In the above-mentioned task request processing method, by responding to the task request sent by the terminal account, the current operating environment version is obtained, and the terminal account is identified according to the task request; from the preset account version relationship table, the specified operating environment version corresponding to the terminal account is searched; when the specified operating environment version is found and the specified operating environment version is the same as the current operating environment version, the task request is processed with the current operating environment version. The version of the current operating environment of the server can be dynamically monitored and compared with the version of the specified operating environment, so that the task request of the terminal account is processed on the version of the specified operating environment. Thereby reducing the errors and failures that may be caused by version inconsistency, and improving the stability and performance of the system. At the same time, by searching the version of the specified operating environment of the terminal account in the account version relationship table, the security and controllability of task request processing are also enhanced, which is convenient for task management and environmental maintenance, providing efficient services for terminal accounts, and effectively managing and optimizing the use of server resources.
[0081] In one embodiment, Figure 3 As shown, the specified operating environment version includes a single specified operating environment version, and the processing of the task request using the current operating environment includes:
[0082] Step S401: Add the version identifier of the current operating environment to the consumer-side configuration file of the task request.
[0083] In an exemplary embodiment, the configuration file may include a version identifier of the operating environment, etc.; the consumer end may obtain the corresponding operating environment through the version identifier of the operating environment in the configuration file, and process the task request, etc.
[0084] Step S402: sending the task request to a message queue corresponding to the consumer end.
[0085] Step S403: Using the consumer end to process the task request in the message queue.
[0086] In an exemplary embodiment, the consumer end can obtain the corresponding operating environment through the configuration file, and use the obtained operating environment to process the task request in the message queue, etc.; specifically, the message queue may include Kafka, etc.
[0087] In an exemplary embodiment, when adding the version identifier of the current operating environment to the consumer-side configuration file of the task request, it can also include adding the task configuration information of the terminal account to the configuration file at the same time to ensure that the corresponding task request is processed using the task configuration corresponding to the terminal account, etc., while also preventing the task configuration information of other terminal accounts from affecting the task requests of other terminal accounts, etc.
[0088] In this embodiment, by adding the version identifier of the operating environment to the configuration file of the consumer end, and sending the task request to the corresponding message queue, the consumer end is used to process the task request in the message queue. Adding the version identifier of the current operating environment to the consumer end configuration file of the task request can effectively track and manage the task execution between different versions; it ensures that each task request can be processed in the corresponding environment, thereby improving the accuracy and efficiency of the processing. At the same time, sending the task request to the corresponding message queue of the consumer end realizes asynchronous processing, reduces the coupling degree of the system, and enhances the scalability and reliability of the system. By processing the task request in the message queue by the consumer end, it is possible to flexibly respond to high concurrency scenarios and ensure the stability and efficiency of the system.
[0089] In one embodiment, Figure 4 As shown, the specified operating environment version includes multiple specified operating environment versions, and the processing of the task request using the current operating environment includes:
[0090] Step S411, establishing a number of consumer ends of the specified operating environment versions, and adding version identifiers corresponding to the operating environments to configuration files of the consumer ends of the task requests.
[0091] In an exemplary embodiment, when it is matched from the account version relationship table that the terminal account has multiple specified operating environment versions, it may include the need to use multiple consumer groups to process task requests, etc.; in another exemplary embodiment, when multiple consumer groups are required to process task requests, the corresponding identifier can be obtained when sending the task request.
[0092] Step S412: sending the task request to a message queue corresponding to the consumer end.
[0093] Step S413, determining whether the version identifier of each consumer end is the same as the version identifier corresponding to the task request stored in the message queue.
[0094] Step S414: When the version identifier of the configuration file of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue, the task request in the message queue is processed by the consumer end.
[0095] In an exemplary embodiment, the multiple specified operating environment versions may include the need to process task requests through multiple operating environment versions, etc.; specifically, it may include multiple operating environment versions processing task requests in sequence, or multiple operating environment versions processing task requests at the same time, etc.; in actual use, if multiple operating environment versions process task requests in sequence, it can be determined whether it is processed by the specified consumer end, that is, whether the version identifier of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue; for example, there are two subtasks in the task, namely task 1 and task 2; the corresponding task 1 requires version a, and task 2 requires version b; to run tasks 1 and task 2 in sequence, it is necessary to run task 1 through the consumer end storing version a and the consumer end storing version b at the same time; the consumer end matching the storage version a is processed, while the consumer end storing version b is not processed; until running task 2, the two consumer ends are used again to determine whether the operating environment version of the consumer end is the same as the operating environment version in the message queue, etc.
[0096] In the present embodiment, by establishing a consumer end of the number of versions of a specified operating environment, and storing the corresponding version identifier in the corresponding configuration file, when the version identifier of the task request stored in the message queue is the same as the version identifier in the consumer end configuration file, the task request is processed. By creating multiple consumer ends and adding their respective version identifiers to the configuration space of the task request, the isolation of multiple consumer ends is achieved. Not only can it ensure that each consumer end processes the task request corresponding to its own version, avoiding processing errors caused by inconsistent versions, but also improving the flexibility and maintainability of the system. By judging the version identifier of the task request in the message queue, it is ensured that only the consumer end that meets the version requirements can be processed, thereby further improving the accuracy and security of task processing. At the same time, this isolation mechanism is also convenient for subsequent version upgrades and function iterations, reducing the impact on the overall system.
[0097] In one embodiment, Figure 5 As shown, searching the version of the specified operating environment corresponding to the terminal account from the preset account version relationship table includes:
[0098] Step S301, when the account level of the terminal account is the first level, searching for the version of the designated operating environment corresponding to the terminal account from a preset account version relationship table.
[0099] In an exemplary embodiment, obtaining the account level of the terminal account may include storing the account level and the terminal account in an account version relationship table, etc.; or storing the terminal account and the account level in other files, etc.
[0100] In an exemplary embodiment, the first level may include user level, etc.; when the task level is user level, it may include that the task can be specified by the administrator to be processed in a version of a certain operating environment, and the account version relationship table can be used to find out whether the task is specified by the administrator to be processed in a version of a certain operating environment, etc.
[0101] Step S302: When the account level of the terminal account is the second level, the task request is processed using the current operating environment.
[0102] In an exemplary embodiment, the second level may include a management level, etc. When the task level is the management level, it means that the task can be input by an administrator, and the administrator input can be directly run on the version of the current running environment, etc.
[0103] In this embodiment, the account level of the terminal account corresponding to the task request is determined through the account-task relationship table, and the version of the specified operating environment or the current operating environment is obtained according to the account level to process the task request. The flexibility and efficiency of the system can be effectively improved by determining the processing method according to the different levels of the terminal account. When the account is at the first level, the appropriate operating environment version is selected from the preset version relationship table to ensure that the task can be executed in the most matching environment; at the second level, the current operating environment is directly used to process the request, reducing additional search and switching time. This method not only optimizes the use of resources, but also enables the system to dynamically adjust the operating strategy according to actual needs, thereby enhancing the overall responsiveness and maintainability.
[0104] In one embodiment, Figure 6 As shown, when the version of the current operating environment is not the target version, the terminal account is identified from a preset account task relationship table using the task identifier in the task request, including:
[0105] Step S201, when the version of the current operating environment is the target version, use the current operating environment to process the task request.
[0106] Step S202, when the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
[0107] In an exemplary embodiment, the target version may include a blue-green environment, etc.; that is, tasks will be randomly assigned to a blue environment or a green environment, etc.; in this case, it can be understood that the system is quickly processing task requests; it can be understood that when specifying an environment, it may cause one environment to run more and other environments to run less, which will cause an unbalanced load on each system. Therefore, when there are more tasks, the blue-green environment can be used to run quickly, and when there are relatively fewer tasks, the version of the running environment can be specified.
[0108] In this embodiment, by judging whether the version of the current environment is the target version, if it is the target version, it will be run directly through the current version. If it is not the target version, it is necessary to further determine the terminal account of the task request. When the version of the current operating environment is the target version, the system can directly process the task regardless of the type of task, which greatly improves the processing efficiency and response speed. When the current operating environment is not the target version, the system can identify the terminal account through the account task relationship table, further determine whether the environment matches, and realize the designation of the terminal account task operating environment version, which improves the accuracy of task request processing.
[0109] In one embodiment, Figure 7 As shown, the method also includes:
[0110] Step S500: If the version of the specified operating environment is not found, the task request is processed using the current operating environment.
[0111] Step S600: when the version of the designated operating environment is found and the version of the designated operating environment is different from the version of the current operating environment, respond to the task request again after the version of the current operating environment is switched.
[0112] In an exemplary embodiment, when the specified operating environment version is not found, it may include that the administrator has not specified the version of the operating environment for the terminal account of the task request, then the task can be regarded as a blue-green environment, that is, the version of the current operating environment can process the task request; therefore, the current operating environment is used to process the task request, etc.
[0113] In an exemplary embodiment, the version of the specified operating environment is found, but the version of the specified operating environment is different from the version of the current operating environment. This may include that the administrator specifies the version of the operating environment for the terminal account of the task request, but the version of the specified operating environment is different from the version of the current operating environment, so it is necessary to respond to the task request again when the version of the current operating environment is switched.
[0114] In this embodiment, when the version of the specified operating environment is not found, the current operating environment is used to process the task request; when the version of the specified operating environment is found but the version of the specified operating environment is different from the version of the current operating environment, wait for the operating environment version to switch and then respond again. When the version of the specified operating environment is not found, the system can quickly use the current operating environment to process the task request, thereby improving the response speed and resource utilization efficiency. When the version of the specified operating environment is successfully found but does not match the current operating environment, the system will re-respond to the task request after the version of the current operating environment is switched. It can ensure that in the case of environment mismatch, the task can still be executed in the correct environment, maintain the accuracy and consistency of the processing, and then realize the version of the specified operating environment.
[0115] In an exemplary embodiment, the task request processing method may be as follows: Figure 8 The flowchart shown is implemented, specifically including:
[0116] Step S901, obtaining a task identifier of a task to be executed; wherein the task to be executed may include a task request sent by a terminal account;
[0117] Step S902, determine whether the version of the current operating environment is a blue-green version; if so, proceed to step S910; if not, proceed to step S903;
[0118] Step S903, obtaining task details through the account-task relationship table; wherein the main fields of the account-task relationship table may include task id, task type, associated terminal account, blue-green version, task data, task level, etc.;
[0119] Step S904, determine the task level; if it is the second level, proceed to step S908; if it is the first level, proceed to step S905; specifically, the second level may include the management level, etc., and the first level may include the user level, etc.;
[0120] Step S905, obtaining the version of the specified operating environment in the account version relationship table;
[0121] Step S906, determining whether the version of the specified operating environment is found; if not, proceeding to step S908; if yes, proceeding to step S907; it can be understood that failure to find the version of the specified operating environment may include the administrator not specifying the operating environment for the task, etc.;
[0122] Step S907, determine whether the version of the specified environment of the task matches the version of the current environment; if so, proceed to step S908; if not, proceed to step S909;
[0123] Step S908, determine whether the version of the current environment matches the version of the operating environment in the message queue; if so, proceed to step S910, if not, proceed to step S909. Specifically, a task may require multiple versions of the operating environment to run, that is, multiple consumer groups are required; the version of the current operating environment is the operating environment version of the consumer group, etc.; further, the version of the operating environment can be added to the configuration file of the consumer end; and the task request is sent to the message queue corresponding to the consumer end, and the consumer end is used to process the message queue. Since there may be multiple message queues, it is necessary to compare and match the operating environment version of the consumer end with the operating environment version of the message queue, etc.;
[0124] Step S909, return and perform the next round of scheduling polling;
[0125] Step S910, executing the task, that is, the consumer end performs consumption;
[0126] Step S911, the task log records the environment version, etc.
[0127] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0128] Based on the same inventive concept, the embodiment of the present application also provides a task request processing device for implementing the task request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the processing device for one or more task requests provided below can refer to the limitations of the task request processing method above, and will not be repeated here.
[0129] In one embodiment, Fig. 9 As shown, a task request processing device 200 is provided, comprising: a version acquisition module 201, an account identification module 202, a version search module 203 and a request processing module 204, wherein:
[0130] A version acquisition module, used to obtain the version of the current operating environment of the server in response to a task request sent by a terminal account;
[0131] An account identification module, used to identify the terminal account from a preset account-task relationship table using the task identifier in the task request when the version of the current operating environment is not the target version;
[0132] A version search module, used to search for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0133] The request processing module is used to process the task request using the current operating environment when the version of the specified operating environment is found and the version of the specified operating environment is the same as the version of the current operating environment.
[0134] In one of the embodiments, the specified operating environment version includes a single specified operating environment version, and the request processing module includes:
[0135] A configuration file setting submodule, used to add the version identifier of the current operating environment to the consumer-side configuration file of the task request;
[0136] A request sending submodule, used to send the task request to the message queue corresponding to the consumer end;
[0137] The request processing submodule is used to process the task requests in the message queue using the consumer end.
[0138] In one embodiment, the specified operating environment version includes multiple specified operating environment versions, and the request processing module includes:
[0139] A consumer end establishment submodule is used to establish the consumer ends of the specified number of versions of the operating environment, and to add the version identifiers corresponding to the operating environment to the configuration files of the consumer ends of the task request respectively;
[0140] A request sending submodule, used to send the task request to the message queue corresponding to the consumer end;
[0141] A version determination submodule, used to determine whether the version identifier of each consumer end is the same as the version identifier corresponding to the task request stored in the message queue;
[0142] The request processing submodule is used to process the task request in the message queue using the consumer end when the version identifier of the configuration file of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue.
[0143] In one embodiment, the version search module is further used to:
[0144] When the account level of the terminal account is the first level, searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table;
[0145] When the account level of the terminal account is the second level, the task request is processed using the current operating environment.
[0146] In one embodiment, the account identification module is further used to:
[0147] In a case where the version of the current operating environment is the target version, using the current operating environment to process the task request;
[0148] In the case that the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
[0149] In one embodiment, the request processing module is further used to:
[0150] In the case where the version of the specified operating environment is not found, processing the task request using the current operating environment;
[0151] When the version of the designated operating environment is found and the version of the designated operating environment is different from the version of the current operating environment, the task request is responded to again after the version of the current operating environment is switched.
[0152] Each module in the processing device of the task request can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0153] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store task request data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing a task request is implemented.
[0154] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0155] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0156] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0157] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0158] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing a task request, characterized in that: Applied to a server, the method comprises: In response to a task request sent by a terminal account, obtaining a version of a current operating environment of the server; In the case that the version of the current operating environment is not the target version, using the task identifier in the task request to identify the terminal account from a preset account-task relationship table; Searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table; When the version of the specified operating environment is found and the version of the specified operating environment is the same as the version of the current operating environment, determining the number of versions of the specified operating environment; In the case that the version of the designated operating environment is single, adding the version identifier of the current operating environment to the consumer-side configuration file of the task request, sending the task request to a message queue corresponding to the consumer-side, and using the consumer-side to process the task request in the message queue; In the case where there are multiple versions of the specified operating environment, consumer ends with the same number of versions of the specified operating environment are established, and version identifiers corresponding to the operating environments are respectively added to configuration files of the consumer ends of the task requests, and the task requests are sent to the message queues corresponding to the consumer ends, and it is determined whether the version identifiers of the consumer ends are the same as the version identifiers corresponding to the task requests stored in the message queues. In the case where the version identifiers of the configuration files of the consumer ends are the same as the version identifiers corresponding to the task requests stored in the message queues, the task requests in the message queues are processed by the consumer ends.
2. The method according to claim 1, characterized in that: The searching, from a preset account version relationship table, for a version of a specified operating environment corresponding to the terminal account includes: When the account level of the terminal account is the first level, searching for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table; When the account level of the terminal account is the second level, the task request is processed using the current operating environment.
3. The method according to claim 1, characterized in that In the case where the version of the current operating environment is not the target version, using the task identifier in the task request to identify the terminal account from a preset account task relationship table includes: In a case where the version of the current operating environment is the target version, using the current operating environment to process the task request; In the case that the version of the current operating environment is not the target version, the terminal account is identified from a preset account-task relationship table using the task identifier in the task request.
4. The method according to claim 1, characterized in that: The method further comprises: In the case where the version of the specified operating environment is not found, processing the task request using the current operating environment; When the version of the designated operating environment is found and the version of the designated operating environment is different from the version of the current operating environment, the task request is responded to again after the version of the current operating environment is switched.
5. A task request processing device, characterized in that: The device comprises: A version acquisition module, used to respond to a task request sent by a terminal account and acquire the version of the current operating environment of the server; An account identification module, used to identify the terminal account from a preset account-task relationship table using the task identifier in the task request when the version of the current operating environment is not the target version; A version search module, used to search for the version of the specified operating environment corresponding to the terminal account from a preset account version relationship table; The request processing module is used to determine the number of versions of the specified operating environment when the version of the specified operating environment is found and the version of the specified operating environment is the same as the version of the current operating environment; when the version of the specified operating environment is single, add the version identifier of the current operating environment to the consumer-end configuration file of the task request, send the task request to the message queue corresponding to the consumer end, and use the consumer end to process the task request in the message queue; when there are multiple versions of the specified operating environment, establish consumer ends of the number of versions of the specified operating environment, and add the version identifiers corresponding to the operating environments to the configuration files of the consumer end of the task request, respectively, send the task request to the message queue corresponding to the consumer end, and respectively determine whether the version identifiers of each consumer end are the same as the version identifiers corresponding to the task request stored in the message queue. When the version identifier of the configuration file of the consumer end is the same as the version identifier corresponding to the task request stored in the message queue, use the consumer end to process the task request in the message queue.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Software system upgrading method and device of hardware module, storage medium and terminal
CN110908683A
Data acquisition method and device, equipment and storage medium
CN116708585A