Task conversion method and device, electronic device and storage medium

By acquiring and converting business data to determine target tasks and driving event notifications, the problem of complexity of business subdomain connection and asynchronous operation under the domain-driven design model is solved, communication efficiency and computing resource utilization are improved, and software stability is ensured.

CN115098065BActive Publication Date: 2024-12-06BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210663515.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2024-12-06
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

Under the domain-driven design model, the existing technology is difficult to effectively support the close functional connection and asynchronous operation between various business subdomains, resulting in increased software design complexity and inability to guarantee stability.

Method used

By obtaining the business data generated by each business system, determining the target task to be run based on the first business data, and converting it into a target event to notify the execution status, realizing an event-driven method, improving communication efficiency and calculation between business systems and improving communication systems Resource savings.

Benefits of technology

实现了在检测到业务数据时根据其确定待运行的目标任务,并通过事件驱动方式通知执行状态,提高了业务系统之间的沟通效率,解决了任务与业务系统耦合性导致的领域划分不清晰 Problem, save computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098065B_ABST
    Figure CN115098065B_ABST
Patent Text Reader

Abstract

The present disclosure is about a task conversion method and device, electronic device and storage medium, wherein the method includes: obtaining business data generated by each business system; in the case of detecting first business data, determining a target task to be run according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution; executing the target task and converting the target task into a target event, wherein the target event is used to notify the execution status of the target task. The present disclosure can achieve the technical effect of saving computing resources and isolating responsibilities between various business systems by converting tasks into event-driven to drive the logical execution of various business systems, and solves the technical problem in the related technology that the coupling between tasks and business systems will destroy the division of fields and lead to unclear boundaries of responsibilities in various fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and in particular to a task conversion method and device, an electronic device, and a storage medium. Background Art

[0002] With the development of informatization, software design has shifted from the traditional MVC (Model View Controller) architecture to the increasingly popular DDD (Domain Driven Design) development model. Under the DDD model, the original software design is divided into independent business subdomains, and each business subdomain is associated through the support domain and the general domain, which greatly improves the development efficiency and the division of the team's domain scope.

[0003] At the same time, as the software design method transforms to domain-driven, the requirements for basic public components are often getting higher and higher. Due to the decoupling between domains and the division of responsibility boundaries, a supporting domain model is needed to closely connect the functions between each subdomain in an event-driven way. At the same time, in some traditional software development processes, some heavier and time-consuming interfaces also need to be asynchronously split to design some heavier business logics independently, so as to improve the throughput of the interface and avoid the waste of computing resources. In addition, there are often some scheduled tasks that need to be developed during the development process, but scheduled tasks are often coupled with the business, which will destroy the division of domains and make the responsibility boundaries of each domain unclear.

[0004] Due to the lack of a simple and effective support method for the support between various fields, asynchronous operation of software, and driving of scheduled tasks, it is usually necessary to introduce a variety of complex strategies to effectively support related functions, making software design more and more complex and stability cannot be effectively guaranteed. Therefore, how to implement a reliable and effective event-driven solution to meet relevant business scenarios is an urgent problem to be solved.

[0005] Public Content

[0006] The present disclosure provides a task conversion method and device, an electronic device and a storage medium to at least solve the technical problem of low task conversion performance in the related art. The technical solution of the present disclosure is as follows:

[0007] According to a first aspect of an embodiment of the present disclosure, a task conversion method is provided, comprising: acquiring business data generated by each business system; when first business data is detected, determining a target task to be run based on the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution; executing the target task and converting the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0008] Exemplarily, determining the target task to be run based on the first business data includes: determining the type of the target task based on the first business data; when the type of the target task is an asynchronous task, determining the target task to be executed immediately when the first business data is detected.

[0009] Exemplarily, determining the target task to be executed based on the first business data includes: determining the type of the target task based on the first business data; when the type of the target task is a scheduled task, determining the target task to be executed after the first business data is detected and a first preset time period has passed.

[0010] Exemplarily, before obtaining the business data generated by each business system, the method also includes: obtaining target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system; writing the business data of each business system into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

[0011] Exemplarily, executing the target task includes: obtaining target business data from the task data center, wherein the target business data is the business data required to execute the target task; when the target business data is obtained, locking the target business data; when the target business data is locked successfully, executing the target task; when the target business data fails to be locked, configuring the target task to a pending state to wait for a second preset time period before re-locking the target business data.

[0012] Exemplarily, converting the target task into a target event includes: when the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed; when the target task fails to execute, determining a preset number of retries of the target task according to the target configuration data; when the current number of executions of the target task is less than the preset number of retries, re-executing the target task; when the current number of executions of the target task is greater than or equal to the preset number of retries, canceling the execution of the target task and converting the target task into the second event, wherein the second event is used to indicate that the target task fails to execute.

[0013] Exemplarily, executing the target task includes: acquiring target block information, wherein the target block information is used to determine a target thread for executing the target task; and executing the target task on the target thread.

[0014] Exemplarily, the method also includes: obtaining second business data generated by multiple tasks executed at the current moment and first context information at the previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment; inputting the second business data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment; and adjusting the target configuration data according to the second context operation information.

[0015] According to the second aspect of an embodiment of the present disclosure, a task conversion device is provided, including: an acquisition module, used to acquire business data generated by each business system; a determination module, used to determine a target task to be run according to the first business data when first business data is detected, wherein the target task is a pre-configured task that is triggered by the first business data to start execution; an execution module, used to execute the target task and convert the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0016] Exemplarily, the device is used to determine a target task to be run according to the first business data in the following manner: determining a type of the target task according to the first business data; and when the type of the target task is an asynchronous task, determining the target task to be executed immediately when the first business data is detected.

[0017] Exemplarily, the device is used to determine a target task to be run based on the first business data in the following manner: determining a type of the target task based on the first business data; when the type of the target task is a scheduled task, determining the target task to be executed after the first business data is detected and a first preset time period has passed.

[0018] Exemplarily, the device is also used to: before obtaining the business data generated by each business system, obtain target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system; write the business data of each business system into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

[0019] Exemplarily, the device is used to execute the target task in the following manner: obtaining target business data from the task data center, wherein the target business data is the business data required to execute the target task; when the target business data is obtained, locking the target business data; when the target business data is locked successfully, executing the target task; when the target business data fails to be locked, configuring the target task to a pending state to wait for a second preset period of time before re-locking the target business data.

[0020] Exemplarily, the device is used to convert the target task into a target event in the following manner: when the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed; when the target task fails to execute, determining a preset number of retries of the target task based on the target configuration data; when the current number of executions of the target task is less than the preset number of retries, re-executing the target task; when the current number of executions of the target task is greater than or equal to the preset number of retries, canceling the execution of the target task and converting the target task into the second event, wherein the second event is used to indicate that the target task fails to execute.

[0021] Exemplarily, the device is used to execute the target task in the following manner: obtaining target block information, wherein the target block information is used to determine a target thread for executing the target task; and executing the target task on the target thread.

[0022] Exemplarily, the device is also used to: obtain second business data generated by multiple tasks executed at the current moment and first context information at the previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment; input the second business data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment; and adjust the target configuration data according to the second context operation information.

[0023] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device for task conversion, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the task conversion method as described above.

[0024] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the conversion method of the above-mentioned task when running.

[0025] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: by acquiring the business data generated by each business system, when the first business data is detected, the target task to be run is determined according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution, the target task is executed, and the target task is converted into a target event, wherein the target event is used to notify the execution status of the target task, thereby achieving that when the first business data is detected, the target task to be run can be determined according to the first business data, and when the target task is executed, the execution status of the target task can be notified by converting the target task into a target event, thereby improving the communication efficiency between the various business systems, and by converting the task into an event-driven method to drive the logical execution of each business system, the technical effect of saving computing resources and isolating responsibilities between the various business systems is achieved, and the technical problem that the coupling between tasks and business systems in the related technology will destroy the division of fields and lead to unclear boundaries of responsibilities of various fields is solved.

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0028] Figure 1is a schematic diagram of an application environment of a task conversion method according to an exemplary embodiment;

[0029] Figure 2 is a flowchart of a task conversion method according to an exemplary embodiment;

[0030] Figure 3 is a schematic diagram of an application scenario of a task conversion method according to an exemplary embodiment;

[0031] Figure 4 is a schematic diagram of an application scenario of another task conversion method according to an exemplary embodiment;

[0032] Figure 5 is a schematic diagram of an application scenario of another task conversion method according to an exemplary embodiment;

[0033] Figure 6 is a flowchart of another task conversion method according to an exemplary embodiment;

[0034] Figure 7 is a flowchart of another task conversion method according to an exemplary embodiment;

[0035] Figure 8 is a neural network schematic diagram of a task conversion method according to an exemplary embodiment;

[0036] Fig. 9 is a structural diagram of a task conversion device according to an exemplary embodiment;

[0037] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0038] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0040] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretation:

[0041] DDD (Domain Driven Design): The domain model enables developers to express rich software functional requirements, so that the software implemented can meet the real needs of users. Therefore, it is recognized as the key to software design.

[0042] The present invention will be described below in conjunction with embodiments:

[0043] According to one aspect of an embodiment of the present invention, a task conversion method is provided. Optionally, in this embodiment, the task conversion method can be applied to Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1 As shown, the server 101 is connected to the terminal 103 through a network, and can be used to provide services for the terminal device or the client installed on the terminal device. The client can be a video client, an instant messaging client, a browser client, an education client, a game client, etc. A database 105 can be set on the server or independently of the server to provide data storage services for the server 101, for example, an image data storage server. The above network can include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The terminal device 103 can be a terminal configured with an application, and can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices, mobile Internet devices), a PAD, a desktop computer, a smart TV and other computer devices. The above server can be a single server, or a server cluster composed of multiple servers, or a cloud server. The application 107 using the above task conversion method is displayed through the client installed on the terminal device 103 or the server 101.

[0044] Combination Figure 1 As shown, the above task conversion method can be implemented in the terminal device 103 through the following steps:

[0045] S1, obtaining business data generated by each business system on the terminal device 103;

[0046] S2, when the first service data is detected on the terminal device 103, determining a target task to be executed according to the first service data, wherein the target task is a pre-configured task that is triggered by the first service data to start execution;

[0047] S3, executing the target task on the terminal device 103, and converting the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0048] Optionally, in this embodiment, the above task conversion method may also be implemented on the server 101 in a similar manner, or may be implemented asynchronously by the server 101 and the terminal device 103 .

[0049] The above is only an example and is not specifically limited in this embodiment.

[0050] Optionally, as an optional implementation, as Figure 2 As shown, the conversion method for the above task includes:

[0051] S202, obtaining business data generated by each business system;

[0052] S204, when the first business data is detected, determining a target task to be executed according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution;

[0053] S206, executing the target task and converting the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0054] In an exemplary embodiment, the above-mentioned business systems may include but are not limited to business subdomains in a domain model. The domain model generally includes but is not limited to a business domain, a support domain, a general domain, and a core domain. The above-mentioned business systems can be understood as at least one subdomain for processing business in the domain model.

[0055] In an exemplary embodiment, the first business data is the relevant business data that needs to be converted into events for notification and is preset in the task data generated by each business system and received by the data access module. When the business data, scheduled task data, etc. that need to be converted by the business enter the data access module, it can be understood that the first business data is detected in the data access module.

[0056] It should be noted that the above-mentioned first business data may include but is not limited to being pre-configured by the staff, and the staff may also pre-configure the detection conditions to determine the business data that meets the detection conditions as the above-mentioned first business data.

[0057] In an exemplary embodiment, the target task to be executed is a task configured by a staff member, and the staff member pre-configures the business data to be converted, and then, when the business data is detected, the target task to be executed is determined.

[0058] It should be noted that when the above-mentioned first business data enters the data access module, it will obtain the corresponding configuration data through the task configuration center, such as block data, failed retry data, lock expiration time, etc. After obtaining the relevant configuration, it will be completed into a complete target task and written into the database.

[0059] In an exemplary embodiment, the above-mentioned target task is a pre-configured task that is triggered to start execution by the first business data, and may include but is not limited to a task that is triggered to start execution immediately when the data access module detects the above-mentioned first business data. It may also be but is not limited to a task that is triggered to start execution after waiting for a preset period of time when the data access module detects the above-mentioned first business data. That is, the above-mentioned target task may include but is not limited to asynchronous tasks, scheduled tasks, etc.

[0060] In an exemplary embodiment, the above-mentioned execution of the target task may include but is not limited to executing the above-mentioned target task according to the established strategy issued by the task policy module. For example, when executing the target task, the task engine requires corresponding policy data to enable each machine to operate according to the established strategy (specifically, including but not limited to consistent hashing, sequential sharding according to designated machines, and task allocation using a greedy algorithm). At the same time, the operating data of the target task is collected and sorted according to different dimensions to facilitate the conversion of the target task into a target event and notify the execution status of the target task.

[0061] In an exemplary embodiment, the target task is converted into a target event for notifying the execution status of the target task, so that the corresponding business system can know the execution status of the predecessor task.

[0062] For example, Figure 3 is a schematic diagram of an application scenario of a task conversion method according to an exemplary embodiment. Figure 3 As shown, by writing the business data of each business system into the database and executing it through the task execution engine, when the business data is written to the system through the REST API, MQ, RPC, etc., the task strategy component is used to determine the writing parameters of the relevant tasks, and the business data is placed in the task data center. The tasks are converted into events to help each business subsystem perform its duties. It only needs to care about the occurrence of events, convert some task-driven and asynchronous tasks into event-driven, and collect the execution data of the task system for prediction and timely alarm.

[0063] Through the embodiments of the present application, by acquiring the business data generated by each business system, when the first business data is detected, the target task to be run is determined according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution, the target task is executed, and the target task is converted into a target event, wherein the target event is used to notify the execution status of the target task. Furthermore, when the first business data is detected, the target task to be run can be determined according to the first business data. When executing the target task, the target task can be converted into a target event to notify the execution status of the target task, thereby improving the communication efficiency between the various business systems, and by converting the task into an event-driven method to drive the logical execution of each business system, the technical effect of saving computing resources and isolating responsibilities between the various business systems is achieved, and the technical problem that the coupling between tasks and business systems in the related technology will destroy the division of fields and lead to unclear boundaries of responsibilities of various fields is solved.

[0064] As an optional example, determining the target task to be executed according to the first business data includes:

[0065] Determine the type of the target task according to the first business data;

[0066] In a case where the type of the target task is an asynchronous task, the target task is determined to be executed immediately when the first service data is detected.

[0067] In an exemplary embodiment, the above-mentioned asynchronous tasks may include but are not limited to the existence of multiple tasks, and the multiple tasks are tasks executed asynchronously. The above-mentioned multiple tasks may include but are not limited to being executed by one or more business systems. For example, task A and task B constitute two asynchronous tasks. When task A is completed, task B is executed asynchronously, wherein task A is executed by business system a and task B is executed by business system b. When business system a completes task A, it determines that the target task B to be executed is an asynchronous task based on the first business data obtained after the completion of task A, and when the first business data is detected, it immediately notifies business system b through an event to execute target task B.

[0068] The above is only an example, and the embodiments of the present application do not make any specific limitations.

[0069] Through the embodiments of the present application, asynchronous tasks can be converted into target events to notify the execution status of asynchronous tasks, thereby improving the communication efficiency between various business systems that execute asynchronous tasks, achieving the technical effect of saving computing resources and isolating responsibilities between various business systems, and solving the technical problem in related technologies that the coupling between tasks and business systems will destroy the division of fields and lead to unclear boundaries of responsibilities between various fields.

[0070] As an optional example, determining the target task to be executed according to the first business data includes:

[0071] Determine the type of the target task according to the first business data;

[0072] In the case that the type of the target task is a scheduled task, the target task is determined to be executed after the first business data is detected and a first preset time period has passed.

[0073] In an exemplary embodiment, the first preset duration may include but is not limited to being pre-set by a staff member, and may also include but is not limited to being configured when a scheduled task is issued or predicted based on the usage of computing resources of each machine.

[0074] In an exemplary embodiment, the above-mentioned scheduled tasks may include but are not limited to the existence of one or more tasks, and one or more tasks are tasks that are executed at a scheduled time. The above-mentioned scheduled tasks may include but are not limited to being executed by one or more business systems. For example, Task A and Task B are both scheduled tasks. Task A is scheduled to be executed at 3:00, and Task B is scheduled to be executed at 3:10. When the first business data is detected, it is determined whether the current system time reaches the above-mentioned 3:00 or 3:10. When it reaches 3:00, the business system is notified through an event to execute the target task A. When it reaches 3:10, the business system is notified through an event to execute the target task B.

[0075] The above is only an example, and the embodiments of the present application do not make any specific limitations.

[0076] Through the embodiments of the present application, the scheduled task can be converted into a target event to notify the execution status of the scheduled task, so that the scheduled task can be executed after a first preset time period has passed, avoiding maintaining the execution process of the task for a long time. During the execution of the scheduled task, a target event is generated to notify other business systems, thereby improving the communication efficiency between the various business systems that execute the scheduled task, achieving the technical effect of saving computing resources and isolating responsibilities between various business systems, and solving the technical problem in the related technology that the coupling between tasks and business systems will destroy the division of fields and lead to unclear boundaries of responsibilities of various fields.

[0077] As an optional example, before obtaining the business data generated by each business system, the method further includes:

[0078] Acquiring target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system;

[0079] The business data of each business system is written into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

[0080] In an exemplary embodiment, the target configuration data is the task strategy data pre-configured by the staff for each task. Each business system can perform the corresponding task according to the target configuration data. For example, the task engine requires the target configuration data during operation to enable each machine to operate according to the established strategy (consistent hashing, sequential sharding according to the specified machine, and task allocation using a greedy algorithm). At the same time, the operation data collection system of each task is sorted according to different dimensions. The task data center is used to store business data.

[0081] For example, Figure 4 is a schematic diagram of an application scenario of another task conversion method according to an exemplary embodiment. Figure 4 As shown in the figure, by writing the business data of each business system into the database, executing it through the task execution engine, and writing the business data into the task data center through the rest api, mq, rpc, etc., the task strategy component is used to determine the writing parameters of the relevant tasks and put the business data into the task data center. After the task execution engine monitors the qualified data for execution, it sends the converted events to each related business subsystem through the rest api, mq, and rpc for notification.

[0082] The above is only an example, and the embodiments of the present application do not make any specific limitations.

[0083] Through the embodiments of the present application, the pre-configured target configuration data is obtained to write the business data of each business system into the task data center according to the target configuration data. Then, the converted events can be subsequently sent to each related business system through REST API, MQ, and RPC to achieve the isolation of responsibilities of each business system while ensuring the rapid completion of task execution of each business system.

[0084] As an optional example, the executing the target task includes:

[0085] Acquire target business data from the task data center, wherein the target business data is business data required to perform the target task;

[0086] When the target business data is acquired, locking the target business data;

[0087] When the target business data is locked successfully, executing the target task;

[0088] In the case where the target business data fails to be locked, the target task is configured as a pending state to wait for a second preset time period before re-locking the target business data.

[0089] In an exemplary embodiment, the target business data is the business data required to execute the target task, that is, when the first business data is detected, the target business data is actually stored in the task data center, and the business data is directly used when executing the target task.

[0090] Specifically, after obtaining the corresponding block information, go to the data center to find the task data to be executed and lock it. After the lock is successful, the corresponding business logic can be executed. When the execution fails, the task strategy module will obtain the number of retries to determine whether the maximum number of retries has been reached. If the maximum number of retries has been reached, the execution is judged to have failed. If not, the task is set to the pending state and waits for the next round of execution. If the data to be executed is not obtained during data acquisition, it will rest for one second to give up computing resources.

[0091] In an exemplary embodiment, the pending execution state may include but is not limited to placing the target task into a pending task queue, and re-locking the target business data to execute the target task when the target business data is acquired next time.

[0092] In an exemplary embodiment, the second preset time period may include but is not limited to being the same as the first preset time period, or may be a separately configured time period for waiting to lock the target business data.

[0093] As an optional example, converting the target task into a target event includes:

[0094] When the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed;

[0095] In the event that the target task fails to be executed, determining a preset number of retries for the target task according to the target configuration data;

[0096] If the number of times the target task is currently executed is less than the preset number of retries, re-execute the target task;

[0097] When the number of times the target task is currently executed is greater than or equal to the preset number of retries, the execution of the target task is canceled and the target task is converted into the second event, wherein the second event is used to indicate that the execution of the target task has failed.

[0098] In an exemplary embodiment, determining whether the target task is being executed, completed, or failed is implemented by the task management background. Specifically, for example, Figure 5 is a schematic diagram of an application scenario of another task conversion method according to an exemplary embodiment. Figure 5 As shown, the execution status of the target task may be determined through processes including but not limited to task heartbeat detection, reporting of execution traces after task execution, and task registration and service governance.

[0099] In an exemplary embodiment, the preset number of retries is pre-configured by a worker through a task strategy component and encapsulated in the target configuration data.

[0100] For example, Figure 6 is a flowchart of another task conversion method according to an exemplary embodiment. Figure 6 As shown in the figure, after successfully locking the target business data, the corresponding business logic can be executed. When the execution fails, the preset number of retries will be obtained in the task strategy module to determine whether the maximum number of retries has been reached. If the maximum number of retries has been reached, the execution is determined to have failed. If not, the task will be placed in a pending state and wait for the next round of execution. If the data to be executed is not obtained during data acquisition, it will rest for one second to give up computing resources.

[0101] As an optional example, the executing the target task includes:

[0102] Acquire target block information, wherein the target block information is used to determine a target thread for executing the target task;

[0103] The target task is executed on the target thread.

[0104] In an exemplary embodiment, the target segment information is determined by the task strategy component according to the target configuration data. After the task is started, it will be registered with the task management background. The task management background will give the segment data to the server according to the distribution strategy of the task. The server will get the segment information for execution. Finally, the conversion of task data to event data is completed.

[0105] For example, Figure 7 is a flowchart of another task conversion method according to an exemplary embodiment. Figure 7 As shown, when the business system produces task data, the task configuration center obtains the sub-table and sub-block data, determines whether the task needs to be executed immediately, creates the task data, writes the relevant data into the cache queue, and puts it into the task execution engine to wait for execution.

[0106] As an optional example, the method further includes:

[0107] Acquire second business data generated by multiple tasks executed at the current moment and first context information at a previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment;

[0108] Inputting the second service data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment;

[0109] The target configuration data is adjusted according to the second context operation information.

[0110] In an exemplary embodiment, the task strategy module refers to the task engine requiring strategy data during operation to make each machine run according to the established strategy (consistent hashing, sequential sharding according to the specified machine, and task allocation using a greedy algorithm). At the same time, the operation data collection system of each task is used to sort out the data in different dimensions. In order to avoid the problem of too many parameters caused by the complexity of the traditional Long Short-Term Memory (LSTM), the prediction system included in the task strategy uses a reset gate to replace the input gate and forget gate in the LSTM to obtain the second business data generated by multiple tasks executed at the current moment and the first context information at the previous moment, wherein the first context information is determined by the third business data generated by multiple tasks executed at the previous moment; the second business data and the first context information are input into the pre-trained neural network model to obtain the second context operation information at the current moment; and the target configuration data is adjusted according to the second context operation information. The recurrent neural network is realized by the Gated Recurrent Neural (GRU) unit.

[0111] Figure 8 is a neural network diagram of a task conversion method according to an exemplary embodiment. Figure 8 As shown, Figure 8 (a) is a schematic diagram of the GRU structure, where h is a memory unit, corresponding to the Constant Error Carousel (CEC) unit of LSTM. The signal transmission after the GRU forward process is expanded in time sequence is as follows Figure 8 (b) shows that the GRU contains only two gate structures: input gate z and reset gate r. The input gate z and reset gate r receive the same input: the input signal at the current moment and the context at the previous moment. The inputs of these two gate structures are defined by formula (1) and formula (2) respectively. t is the input signal at the current moment, and is the context at the previous moment.

[0112] z t =σ(W z x t +Uz x t-1 ) (1)

[0113] r t -σ(W r x t +U r h t-1 ) (2)

[0114] The hidden layer activation state of the GRU unit is defined by formula (3). ⊙ is a bitwise multiplication operation. U and W are fixed parameters.

[0115]

[0116] The final output of GRU is determined by the previous moment context, hidden layer activation, W, and reset activation, as shown in formula (4). The output is saved in memory unit h as the current moment context.

[0117]

[0118] By using two GRUs with output vectors of length 512 as the internal structure of the recurrent neural network. The initial parameters of the GRU memory unit are learned by back propagation. Through the recurrent neural network based on the GRU unit, the data collected by the data acquisition system is analyzed and predicted to obtain the trend of the running time of each task, and timely warnings are issued to carry out relevant expansion and start relevant strategies.

[0119] According to a third aspect of an embodiment of the present disclosure, there is provided a task conversion device, comprising: Fig. 9 FIG. 1 is a block diagram of a task conversion device according to an exemplary embodiment. Fig. 9 The device includes an acquisition module 902, a determination module 904 and an execution module 906.

[0120] The acquisition module 902 is configured to acquire business data generated by each business system;

[0121] The determination module 904 is configured to determine a target task to be executed according to the first business data when the first business data is detected, wherein the target task is a pre-configured task that is triggered by the first business data to start execution;

[0122] The execution module 906 is configured to execute the target task and convert the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0123] As an optional example, the device is used to determine the target task to be executed according to the first business data in the following manner:

[0124] Determine the type of the target task according to the first business data;

[0125] In the case where the type of the target task is an asynchronous task, the target task is determined to be

[0126] As an optional example, the device is used to determine the target task to be executed according to the first business data in the following manner:

[0127] Determine the type of the target task according to the first business data;

[0128] In the case that the type of the target task is a scheduled task, the target task is determined to be executed after the first business data is detected and a first preset time period has passed.

[0129] As an optional example, the device is further used for:

[0130] Before acquiring the business data generated by each business system, acquiring target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system;

[0131] The business data of each business system is written into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

[0132] As an optional example, the device is used to perform the target task in the following manner:

[0133] Acquire target business data from the task data center, wherein the target business data is business data required to perform the target task;

[0134] When the target business data is acquired, locking the target business data;

[0135] When the target business data is locked successfully, executing the target task;

[0136] In the case where the target business data fails to be locked, the target task is configured as a pending state to wait for a second preset time period before re-locking the target business data.

[0137] As an optional example, the device is used to convert the target task into a target event in the following manner:

[0138] When the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed;

[0139] In the event that the target task fails to be executed, determining a preset number of retries for the target task according to the target configuration data;

[0140] If the number of times the target task is currently executed is less than the preset number of retries, re-execute the target task;

[0141] When the number of times the target task is currently executed is greater than or equal to the preset number of retries, the execution of the target task is canceled and the target task is converted into the second event, wherein the second event is used to indicate that the execution of the target task has failed.

[0142] As an optional example, the device is used to perform the target task in the following manner:

[0143] Acquire target block information, wherein the target block information is used to determine a target thread for executing the target task;

[0144] The target task is executed on the target thread.

[0145] As an optional example, the device is further used for:

[0146] Acquire second business data generated by multiple tasks executed at the current moment and first context information at a previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment;

[0147] Inputting the second service data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment;

[0148] The target configuration data is adjusted according to the second context operation information.

[0149] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0150] According to another aspect of the embodiment of the present invention, an electronic device for implementing the conversion method of the above task is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server as an example. Fig.10 As shown, the electronic device includes a memory 1002 and a processor 1004. The memory 1002 stores a computer program, and the processor 1004 is configured to execute the steps in any of the above method embodiments through the computer program.

[0151] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0152] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0153] S1, obtain the business data generated by each business system;

[0154] S2, when the first business data is detected, determining a target task to be executed according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution;

[0155] S3, execute the target task and convert the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0156] Optionally, in this embodiment, the processor may also be configured to perform the following steps through a computer program:

[0157] S1, obtain the business data generated by each business system;

[0158] S2, when the first business data is detected, determining a target task to be executed according to the first business data, wherein the target task is a pre-configured task that is triggered by the first business data to start execution;

[0159] S3, execute the target task and convert the target task into a target event, wherein the target event is used to notify the execution status of the target task.

[0160] Alternatively, a person skilled in the art may understand that: Fig.10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig.10 The electronic device and the electronic equipment described above are not limited in structure. Fig.10 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.10 Different configurations are shown.

[0161] Among them, the memory 1002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the task conversion method and device in the embodiment of the present invention. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, realizing the above-mentioned task conversion method. The memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1002 may further include a memory remotely arranged relative to the processor 1004, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1002 can be specifically, but not limited to, used to store information such as historical user data. As an example, such as Fig.10 As shown, the memory 1002 may include but is not limited to the acquisition module 902, determination module 904 and execution module 906 in the task conversion device. In addition, it may also include but is not limited to other module units in the task conversion device, which will not be repeated in this example.

[0162] Optionally, the transmission device 1006 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0163] In addition, the electronic device further includes: a display 1008 for displaying the target service data; and a connection bus 1010 for connecting various module components in the electronic device.

[0164] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.

[0165] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, and the computer program / instruction implements the above-mentioned information transmission method when executed by a processor.

[0166] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0167] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A task conversion method, characterized in that: include: Obtain business data generated by each business system; In the case where the first service data is detected, determining a target task to be executed according to the first service data, wherein the target task is a pre-configured task that is triggered to start execution by the first service data; The target task is executed, and the target task is converted into a target event, wherein the target event is used to notify the execution status of the target task.

2. The method according to claim 1, characterized in that The determining the target task to be executed according to the first business data includes: Determine the type of the target task according to the first business data; In a case where the type of the target task is an asynchronous task, the target task is determined to be executed immediately when the first service data is detected.

3. The method according to claim 1, characterized in that The determining the target task to be executed according to the first business data includes: Determine the type of the target task according to the first business data; In the case that the type of the target task is a scheduled task, the target task is determined to be executed after the first business data is detected and a first preset time period has passed.

4. The method according to claim 1, characterized in that: Before obtaining the business data generated by each business system, the method further includes: Acquiring target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system; The business data of each business system is written into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

5. The method according to claim 4, characterized in that The executing of the target task comprises: Acquire target business data from the task data center, wherein the target business data is business data required to perform the target task; When the target business data is acquired, locking the target business data; When the target business data is locked successfully, executing the target task; In the case where the target business data fails to be locked, the target task is configured as a pending state to wait for a second preset time period before re-locking the target business data.

6. The method according to claim 5, characterized in that The converting the target task into a target event comprises: When the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed; In the event that the target task fails to be executed, determining a preset number of retries for the target task according to the target configuration data; If the number of times the target task is currently executed is less than the preset number of retries, re-execute the target task; When the number of times the target task is currently executed is greater than or equal to the preset number of retries, the execution of the target task is canceled and the target task is converted into a second event, wherein the second event is used to indicate that the execution of the target task has failed.

7. The method according to claim 4, characterized in that The executing of the target task comprises: Acquire target block information, wherein the target block information is used to determine a target thread for executing the target task; The target task is executed on the target thread.

8. The method according to claim 4, characterized in that The method further comprises: Acquire second business data generated by multiple tasks executed at the current moment and first context information at a previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment; Inputting the second service data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment; The target configuration data is adjusted according to the second context operation information.

9. A task conversion device, characterized in that: include: The acquisition module is used to obtain the business data generated by each business system; a determination module, configured to determine a target task to be executed according to the first business data when the first business data is detected, wherein the target task is a pre-configured task that is triggered to start execution by the first business data; The execution module is used to execute the target task and convert the target task into a target event, wherein the target event is used to notify the execution status of the target task.

10. The device according to claim 9, characterized in that The device is used to determine the target task to be executed according to the first business data in the following manner: Determine the type of the target task according to the first business data; In a case where the type of the target task is an asynchronous task, the target task is determined to be executed immediately when the first service data is detected.

11. The device according to claim 9, characterized in that The device is used to determine the target task to be executed according to the first business data in the following manner: Determine the type of the target task according to the first business data; In the case that the type of the target task is a scheduled task, the target task is determined to be executed after the first business data is detected and a first preset time period has passed.

12. The device according to claim 9, characterized in that The device is also used for: Before acquiring the business data generated by each business system, acquiring target configuration data, wherein the target configuration data includes execution parameters pre-configured for the business data generated by each business system; The business data of each business system is written into a task data center according to the execution parameters, wherein the task data center is used to store the business data of each business system.

13. The device according to claim 12, characterized in that The device is used to perform the target task in the following manner: Acquire target business data from the task data center, wherein the target business data is business data required to perform the target task; When the target business data is acquired, locking the target business data; When the target business data is locked successfully, executing the target task; In the case where the target business data fails to be locked, the target task is configured as a pending state to wait for a second preset time period before re-locking the target business data.

14. The device according to claim 13, characterized in that The device is used to convert the target task into a target event in the following manner: When the target task is being executed or has been completed, converting the target task into a first event, wherein the first event is used to indicate that the target task is successfully executed; In the event that the target task fails to be executed, determining a preset number of retries for the target task according to the target configuration data; If the number of times the target task is currently executed is less than the preset number of retries, re-execute the target task; When the number of times the target task is currently executed is greater than or equal to the preset number of retries, the execution of the target task is canceled and the target task is converted into a second event, wherein the second event is used to indicate that the execution of the target task has failed.

15. The device according to claim 12, characterized in that The device is used to perform the target task in the following manner: Acquire target block information, wherein the target block information is used to determine a target thread for executing the target task; The target task is executed on the target thread.

16. The device according to claim 12, characterized in that The device is also used for: Acquire second business data generated by multiple tasks executed at the current moment and first context information at a previous moment, wherein the first context information is determined by third business data generated by multiple tasks executed at the previous moment; Inputting the second service data and the first context information into a pre-trained neural network model to obtain the second context operation information at the current moment; The target configuration data is adjusted according to the second context operation information.

17. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the task conversion method as described in any one of claims 1 to 7.

18. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the task conversion method as described in any one of claims 1 to 7.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the conversion method of any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • A service data processing method and related equipment

    CN109408262A

  • Task management method and device, storage medium and electronic equipment

    CN112667386A