Business execution methods, equipment, media and products

By establishing a task relationship tree and clarifying task dependencies and priorities, the complexity of task collaborative execution between different business software is solved, and efficient and unified business execution is achieved.

CN119781977APending Publication Date: 2025-04-08KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411942397.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing technology is difficult to realize unified task arrangement and call between different business software, resulting in complex task dependencies and difficulty in effective collaborative execution.

Method used

By establishing a task relationship tree, clarify the dependencies and priorities between tasks, execute services in a tree structure when responding to business execution requests, and avoid targeted development of multi-task collaborative code.

Benefits of technology

It realizes multiple solutions that rely on business collaborative execution, simplify the task registration and execution process, avoid execution problems caused by task coupling, and improves the efficiency and consistency of business execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781977A_ABST
    Figure CN119781977A_ABST
Patent Text Reader

Abstract

The present disclosure provides a business execution method, device, medium and product. The method includes: in response to a business execution request, determining the business identifier carried by the business execution request and the execution time corresponding to the business execution request; determining the task relationship tree corresponding to the business execution request according to the business identifier and the execution time; the task relationship tree contains multiple tasks that have dependencies with other businesses; and executing the business according to the task priority and task dependency agreed in the task relationship tree. Add tasks that have dependencies with other businesses in each business to the task relationship tree, clearly declare the dependency between each task and other business modules when registering the task, and manage them uniformly by establishing a task relationship tree. In the process of executing tasks that depend on multiple businesses, execute the business according to the execution logic agreed in the task relationship tree. Avoid the problem of dependent tasks being unable to be executed due to the coupling of tasks that depend on multiple businesses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more particularly to a business execution method, device, medium, and product. Background Art

[0002] During the software development process, different business parties have their own business software. These business software are independent of each other when writing codes. However, during the use of business software, sometimes different business software needs to be used in conjunction with each other.

[0003] In order to meet the needs of mutual coordination between different business software, it is necessary to realize the mutual switching between different business software through underlying tasks. In the prior art, for example, a piece of code is developed to meet the needs of mutual calling between different business software. Even if the business code is developed separately, it is difficult to realize unified arrangement and calling of tasks in different business software. Therefore, a solution is needed to realize the collaborative execution of multiple dependent businesses. Summary of the invention

[0004] The present invention provides a service execution method, device, medium and product.

[0005] According to the first aspect of the present disclosure, a service execution method is provided. The method specifically comprises: in response to a service execution request, determining a service identifier carried in the service execution request and an execution time corresponding to the service execution request; determining a task relationship tree corresponding to the service execution request according to the service identifier and the execution time; wherein the task relationship tree includes multiple tasks having dependencies with other services; and executing the service according to the task priority and task dependency agreed in the task relationship tree.

[0006] Based on the above implementation, tasks with dependencies are not registered and declared in a certain business software, so that the dependencies between the tasks and multiple different business software can be declared when the tasks are registered, so as to meet the calling requirements of multiple different business execution tasks. These tasks are uniformly managed through the task management module, and a task relationship tree is established, in which the task dependencies and task priority order are reflected. After receiving the business execution request later, since the task nodes in the task relationship tree have clearly declared the dependencies between each task and other businesses, if it involves the collaboration of multiple businesses, it can be directly executed according to the agreement in the task relationship tree, without the need to develop targeted multi-task collaboration code.

[0007] According to at least one embodiment of the present disclosure, a method for establishing a task relationship tree includes: in response to registration requests for multiple tasks for a business, obtaining task parameters of multiple tasks; wherein the task parameters include: at least one of execution timing, task priority, task dependency, task details, task execution method and task description; and establishing a task relationship tree between multiple tasks based on the task parameters.

[0008] Based on the above implementation, when registering a task, a task relationship tree is established using the declared execution time, task priority, task dependency, task details, task execution method, and task description. The registered task is a basic common module unit to meet the calling requirements of different businesses.

[0009] According to at least one embodiment of the present disclosure, a task relationship tree between multiple tasks is established based on task parameters, including: obtaining the execution time, task priority, task dependency and task execution method contained in the task parameters; determining the root node of the task relationship tree according to the execution time; determining the sub-nodes of the task relationship tree containing multiple tasks according to the task execution method; determining the vertical arrangement order and horizontal arrangement order of the multiple sub-nodes in the task relationship tree according to the task priority and the task dependency; and establishing a tree structure relationship between the multiple tasks based on the vertical arrangement order and the horizontal arrangement order.

[0010] Based on the above implementation, after completing the registration of the task, a task relationship tree is further established according to the task parameters, task dependencies and task execution order, so that the subsequent execution of the task can be performed according to the order and dependency clearly agreed in the task relationship tree.

[0011] According to at least one embodiment of the present disclosure, the root node of the tree structure relationship is determined according to the execution timing, including: determining the root node for executing basic tasks according to the execution timing; wherein the basic tasks in the root node include: at least one of public monitoring, basic functional components and basic UI components.

[0012] According to at least one embodiment of the present disclosure, the task execution order includes: asynchronous execution and synchronous execution; determining the sub-nodes containing multiple tasks in the task relationship tree according to the task execution method, including: adding tasks with the same dependency and synchronous execution to the same sub-node; adding asynchronously executed tasks to different adjacent sub-nodes.

[0013] According to at least one embodiment of the present disclosure, before executing the business according to the task priority and task dependency agreed in the task relationship tree, it also includes: detecting whether the predecessor task that the current task depends on has been completed; if not, locking the current task.

[0014] Based on the above implementation, in the task relationship tree, a detection function is added to the tasks with dependency relationships, that is, the execution status of the currently dependent predecessor tasks is detected, so as to ensure that the tasks with dependency relationships can be executed correctly in sequence.

[0015] According to at least one embodiment of the present disclosure, the method further includes: if feedback information indicating that the preceding task is completed is received, unlocking the currently executed task and continuing to execute the current task.

[0016] Based on the above implementation, such a process can ensure that tasks are executed in the correct order, avoiding errors or inconsistent states caused by unfinished predecessor tasks.

[0017] According to a second aspect of the present disclosure, a service execution system is provided, the system comprising: Business modules include: business units developed by the business side; Public module, used to register public monitoring components, basic functional components, and basic UI components; The task management module is used to register the minimum task template related to the business unit and establish a task relationship tree using the minimum task template; wherein the task relationship tree contains task priorities and task dependencies; and after receiving the issued business execution request, execute the business according to the task priority and task dependency agreed in the task relationship tree.

[0018] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the method of the first aspect of any embodiment of the present disclosure.

[0019] According to a fourth aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and when the execution instructions are executed by a processor, the method of the first aspect of any embodiment of the present disclosure is implemented.

[0020] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method of the first aspect of any embodiment of the present disclosure is implemented.

[0021] In the scheme provided by the present disclosure, in response to a business execution request, the business identifier carried by the business execution request and the execution time corresponding to the business execution request are determined. According to the business identifier and the execution time, the task relationship tree corresponding to the business execution request is determined. Because when the task relationship tree is established, it is established based on the execution time, because different execution times have different underlying task relationships and underlying task execution orders when calling other dependent business software. Among them, the task relationship tree contains multiple tasks that have dependencies with other businesses; the business is executed according to the task priority and task dependency agreed in the task relationship tree. In the above manner, the tasks that have dependencies with other businesses in each business are added to the task relationship tree, and the dependencies between each task and other business modules are clearly stated when registering the task, and unified management is performed by establishing a task relationship tree. In the process of executing tasks that depend on multiple businesses, the business is executed according to the execution logic agreed in the task relationship tree. Avoid the problem that dependent tasks cannot be executed due to the coupling of tasks that depend on multiple businesses. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0023] Figure 1 This is a schematic diagram of the structure of the business execution system proposed in the present disclosure.

[0024] Figure 2 A flowchart of a business execution method provided by the present invention.

[0025] Figure 3 A flowchart of a method for establishing a task relationship tree provided in the present disclosure.

[0026] Figure 4 A schematic diagram of the structure of the task relationship tree provided by the present disclosure.

[0027] Figure 5 A schematic diagram of task management provided for an embodiment of the present disclosure.

[0028] Figure 6 A schematic diagram of the execution timing provided by the present disclosure.

[0029] Figure 7 The present invention is a block diagram showing the structure of a service execution device according to an embodiment of the present invention.

[0030] Figure 8 The present invention is a block diagram showing the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0032] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] In existing solutions, many business softwares, while meeting the corresponding business needs of users, in some cases, also require multiple other different business softwares to work together to complete a certain task of the user. For example, if a user wants to forward the content in one software to another business software, it is necessary to switch the front and back ends of the two business softwares. However, this kind of task call across business softwares will have obvious task dependencies. In order to support the dependency and call requirements between different business softwares, it is usually necessary to develop a special code to establish the dependency between the two business softwares for switching calls between different tasks, as well as the management of the task execution order. This targeted code development method will increase the workload of developers, and cannot meet the call requirements of other business softwares.

[0034] For the convenience of description and to make the technical solutions of the specific implementation methods of the present disclosure easier to understand, before describing the business execution method implemented by the present disclosure, the technical terms involved in the specific implementation methods of the present disclosure are explained as follows.

[0035] Harmony: A distributed operating system independently developed by Huawei that has cross-device and cross-platform capabilities.

[0036] Task: Each task can be understood as a function that implements a single function. This function can be a function that needs to call other tasks to implement functions, or a function that can run or execute independently.

[0037] Dependency: refers to the logical connection between tasks, which determines that the tasks must be performed in a specific order. Dependencies can be direct (such as one task can only start another task after it is completed) or indirect (such as multiple tasks can only start another task after they are completed). Dependencies are usually based on factors such as input-output relationships between tasks, resource requirements, and time constraints.

[0038] Execution sequence: refers to the order in which tasks are actually performed. This order is usually determined based on the dependencies between tasks, but may also be affected by other factors such as resource availability, priority, urgency, etc. The execution sequence is an important part of the project management plan, which ensures that the project can proceed according to the predetermined goals and schedule.

[0039] Figure 1 The overall structure diagram of a business execution system provided by the present disclosure is shown in FIG. Figure 1 The system shown includes: a business module 11, including: a business unit developed by a business party. A public module 12, used to register a public monitoring component, a basic functional component, and a basic UI component. And a task management module 13, used to register a minimum task template related to a business unit, and to establish a task relationship tree using the minimum task template; wherein the task relationship tree includes task priorities and task dependencies; and after receiving a business execution request, executing the business according to the task priorities and task dependencies agreed in the task relationship tree.

[0040] In the business module 11, business software developed by different business parties are included, such as second-hand trading software, commodity management software, business opportunity management software, customer source management software, etc. These different business software are independent of each other, but in the application process, the tasks in the software may also need to rely on other business software to be implemented. For this reason, in the system proposed in this application, each task with a dependency relationship is registered together with the public module as a general task template. That is, when there is a call demand across business software, the registered general task can be directly called like a public module, without the need for cumbersome code development.

[0041] In the common module 12, various common components are registered, such as common monitoring components, basic function components, basic UI components, etc. These basic common components are the basic components required by various business software, and can be handed over to the task management module for unified management.

[0042] The task management module 13 is used to uniformly manage tasks with multiple dependencies. Specifically, when the business party develops business software, it will register multiple tasks that have dependencies with other business software. In addition to declaring basic parameters, it also declares task parameters specific to the task, such as the dependency between the task and other businesses, so that subsequent execution can be smoothly executed according to the declared dependency.

[0043] At the time of registration, the task parameters of each task are obtained, including: at least one of execution time, task priority, task execution order, task dependency, task details and task description. Among them, the execution time mentioned here can be a business cold start, the homepage startup of the business software (that is, when the first frame appears), the foreground switching of the business software to the background, and the business software switching from the background to the foreground (that is, hot start), business software login, business software logout, and business software killing. At different business execution times, the dependency and call relationship between tasks are different. The task management module 13 establishes a task relationship tree according to the task parameters. In the task relationship tree, each task node is established according to the dependency relationship, execution method, etc. between each task.

[0044] During subsequent execution, you can directly call each task with dependencies, without having to develop corresponding task calling code for a specific business.

[0045] like Figure 2 A flowchart of a business execution method provided by the present disclosure. Figure 2 As can be seen in , the business execution method specifically includes the following steps.

[0046] Step 201: In response to a service execution request, determine a service identifier carried in the service execution request and an execution time corresponding to the service execution request.

[0047] A business execution request is a request issued by business software when executing a task. During the execution of business software, multiple underlying tasks are usually required to cooperate with each other. This task is a function that can achieve a certain function.

[0048] The execution timing mentioned here refers to the execution timing of various tasks in the business software. In the disclosed solution, the main focus is on the execution timing of the collaborative work between different businesses, the execution timing of the business software startup and exit, etc.

[0049] In actual applications, after receiving the service execution request from the service developer, the service identifier carried in the service execution request and the execution timing corresponding to the service execution request will be further extracted.

[0050] The business identifier mentioned here can be understood as the unique name identifier corresponding to a certain business software. For example, the business identifier of the product management software is abc1, the business identifier of the business opportunity management software is bcd1, and so on.

[0051] Step 202: Determine a task relationship tree corresponding to the service execution request according to the service identifier and the execution timing; wherein the task relationship tree includes a plurality of tasks having dependency relationships with other services.

[0052] It should be noted that when establishing a task relationship tree, a corresponding task relationship tree is established for each business execution time. Because the task execution order is different at different execution times, the corresponding task relationship tree is also different. The task relationship tree contains a root node, multiple child nodes and leaf nodes, and each node is a task node. Each task node contains one or more tasks.

[0053] The connection relationship and arrangement order between each task node in the task relationship tree represent the execution order and dependency relationship of the tasks.

[0054] Step 203: Execute the business according to the task priorities and task dependencies agreed upon in the task relationship tree.

[0055] As mentioned above, during execution, it is executed according to the task relationship tree. In the task relationship tree, the task priority is sorted from left to right and from top to bottom. That is, when executing a task, the root node is executed first, and then the child node is executed, and the priority of the root node is higher than that of the child node. When executing horizontally, the task in the left node is executed first, and then the task in the right node is executed, that is, the priority of the left node is higher than that of the right node. Of course, in the disclosed solution, it is sorted in order of priority from left to right and from top to bottom, but it does not constitute a limitation compared to the technical solution of the present application. In actual applications, users can sort the priority order of each node in the relationship tree as needed.

[0056] In the disclosed solution, tasks with dependencies are not registered and declared in a certain business software, so that the dependencies between the tasks and multiple different business software can be declared when the tasks are registered, meeting the calling requirements of multiple different business execution tasks. These tasks are uniformly managed through the task management module, and a task relationship tree is established, in which the task dependencies and task priority order are reflected. After receiving the business execution request later, since the task nodes in the task relationship tree have clearly declared the dependencies between each task and other businesses, if it involves the collaboration of multiple businesses, it can be directly executed according to the agreement in the task relationship tree, without the need to develop targeted multi-task collaboration code.

[0057] In one or more embodiments of the present disclosure, a method for establishing a task relationship tree includes: in response to registration requests for multiple tasks for a business, obtaining task parameters of multiple tasks; wherein the task parameters include: at least one of execution timing, task priority, task dependency, task details, task execution method and task description; and establishing a task relationship tree between multiple tasks based on the task parameters.

[0058] The task priority here refers to the order in which tasks are executed. For example, after the first task is executed, should the second task or the third task be executed first? For example, tasks can be prioritized, including high priority, default priority, and low priority. The task dependency here refers to the logical connection between tasks, which determines that the tasks must be performed in a specific order.

[0059] The dependency mentioned here can be direct (e.g. one task can only start another task after it is completed) or indirect (e.g. multiple tasks can only start another task after they are completed). Dependencies are usually based on factors such as input-output relationships, resource requirements, and time constraints between tasks. The task details mentioned here refer to the specific function code of the task. Each task here is a function that can achieve a certain function. For example, it can be a function to extract personal information, a function to authenticate user identity, a function to quickly forward product information, etc.

[0060] The task execution mode mentioned here includes asynchronous execution mode and synchronous execution mode. In the task relationship tree, when two tasks are synchronously executed, they are placed in the same task node, and when two tasks are asynchronously executed, they are placed in different task nodes. The task description mentioned here can be understood as the monitoring and feedback of task execution, for example, monitoring whether the previously executed function with dependency relationship is completed, and feeding back the execution completion result to the task management module.

[0061] These task parameters will be clearly stated during registration so that a task relationship tree can be established based on the task parameters. The specific process of establishing the task relationship tree will be described in the following embodiments. For details, please refer to the following embodiments, and will not be repeated here.

[0062] Through the above method, when registering a task, a task relationship tree is established using the declared execution time, task priority, task dependency, task details, task execution method, and task description. The registered task is a basic common module unit to meet the calling requirements of different businesses.

[0063] In one or more embodiments of the present application, a task relationship tree between multiple tasks is established based on task parameters. Figure 3 The following is a flow chart of the method for establishing a task relationship tree provided by the present disclosure. Figure 3As can be seen in , the method specifically includes the following steps: Step 301: Obtain the execution time, task priority, task dependency and task execution mode contained in the task parameters. Step 302: Determine the root node of the task relationship tree according to the execution time. Step 303: Determine the subnode containing multiple tasks in the task relationship tree according to the task execution mode. Step 304: Determine the vertical arrangement order and horizontal arrangement order of multiple subnodes in the task relationship tree according to the task priority and task dependency. Step 305: Establish a tree structure relationship between multiple tasks based on the vertical arrangement order and the horizontal arrangement order. Among them, step 302 determines the root node of the tree structure relationship according to the execution time, including step 3021: Determine the root node for executing the basic task according to the execution time; wherein the basic task in the root node includes: at least one of public monitoring, basic functional components and basic UI components. It should be noted that the task execution order includes: asynchronous execution and synchronous execution. Step 303 determines the subnodes containing multiple tasks in the task relationship tree according to the task execution mode, including: Step 3031: adding tasks with the same dependency and executed synchronously to the same subnode. Step 3032: adding tasks executed asynchronously to different adjacent subnodes.

[0064] like Figure 4 The structure diagram of the task relationship tree provided by the present disclosure. Figure 4 As can be seen in the figure, only the three-layer node relationship is schematically shown here. Assume that the task relationship tree is a task relationship tree with a business identifier of abc1, and the corresponding execution time is switching from the foreground to the background. Among them, T0 represents the root node, T1.1 and T1.2 represent the child nodes connected to the root node. T2.1, T2.2, T2.3 and T2.4 represent leaf nodes.

[0065] Among them, the root node in the task relationship tree is determined based on the execution timing, and the tasks in the root node are public basic tasks, such as basic functional components, basic UI components, public monitoring, public tracking points, etc. When determining the root node of the task relationship tree, it is determined according to the execution timing of the business. For example, when the execution timing is the foreground and background switching, the corresponding task in the root node is public task 1; when the execution timing is login, the corresponding task in the root node is public task 2. After determining the root node, the child nodes connected to the root node will be further determined. The child nodes connected to the root node contain tasks that execute different business directions.

[0066] The basic functional components mentioned here may be, for example, user authentication functional components, login functional components, etc. The basic UI components mentioned here may be, for example, UI components of the login interface, UI components of user registration, etc.

[0067] The public monitoring component mentioned here refers to the component used to monitor the execution status of each task, for example, monitoring whether a task is completed. If it is completed, the next task will be executed according to the agreed dependency and execution method in the task relationship tree.

[0068] The public tracking points mentioned here can be understood as inserting specific codes (tracking code) into applications or websites to collect user operation behaviors and data. These codes can capture and send events (such as clicks, scrolls, searches, etc.) and attributes (such as time, location, device, etc.) to the data platform. Tracking data is mainly used to analyze user behavior, monitor application performance, improve product functions, etc.

[0069] There are two types of task execution: synchronous execution and asynchronous execution. Synchronous execution refers to the simultaneous execution of two or more tasks, and there is no dependency between these synchronously executed tasks. Multiple synchronously executed tasks will be placed in the same task node in the task relationship tree. From the perspective of dependency, multiple different tasks in the same task node have the same dependency because the task node is connected to the same task node.

[0070] Multiple tasks executed asynchronously are placed in different task nodes, which can be two different task nodes horizontally parallel or two different task nodes executed one after the other (the upper and lower task nodes in the task relationship tree). Two or more tasks executed asynchronously may have the same dependency or different dependency.

[0071] After determining the inclusion relationship between each task and the task node, the vertical arrangement order and horizontal arrangement order of multiple sub-nodes in the task relationship tree are further determined according to the task priority and task dependency relationship. Figure 4 As can be seen in the figure, the root node T0 and the child nodes T1.1 and T1.2 are arranged vertically, and the child nodes T1.1 and T1.2 are arranged horizontally. When arranging the task nodes in the task relationship tree, the high priority ones are arranged in the left task nodes, the low priority ones are arranged in the right nodes, the dependent nodes are arranged in the upper task nodes close to the root node, and the dependent nodes are arranged in the subsequent task nodes far away from the root node.

[0072] It should be noted that Figure 4 The task relationship tree shown is only an example. In actual applications, the number of layers of the task relationship tree may be more than 3 layers, and there may be more layers. Similarly, the number of task nodes may also be multiple.

[0073] Based on the above embodiment, after completing the registration of the task, a task relationship tree is further established according to the task parameters, task dependencies and task execution order, so that the subsequent tasks can be executed according to the order and dependencies clearly agreed in the task relationship tree.

[0074] In one or more embodiments of the present application, before executing the business according to the task priority and task dependency agreed in the task relationship tree, it also includes: detecting whether the predecessor task that the current task depends on has been completed; if not, locking the current task.

[0075] During the execution of tasks, some tasks have dependencies. During the execution process, the next dependent task can only be executed after the dependent task is completed. Therefore, it is necessary to detect the dependent predecessor task. Specifically, in order to ensure the order and dependency of task execution, the following steps can be taken to detect whether the predecessor task of the current task has been completed, and decide whether to lock the current task based on this: In the task relationship tree, each task and the dependencies between tasks are clearly defined. Each task is marked with which predecessor tasks it depends on. Before trying to execute the current task, the system needs to traverse all predecessor tasks of the task and check their status. For example, these statuses usually include "not started", "in progress" and "completed". For each predecessor task, if its status is not "completed", it means that the prerequisite of the current task is not met. If any predecessor task is found to be unfinished, the system should immediately implement a lock operation on the current task. This can be achieved by setting a status flag (such as "waiting for the predecessor task to complete") to prevent the task from continuing to execute.

[0076] By the above method, in the task relationship tree, a detection function is added to the tasks with dependency relationships, that is, the execution status of the current dependent predecessor tasks is detected, so as to ensure that the tasks with dependency relationships can be executed correctly in order.

[0077] In one or more embodiments of the present application, the method further includes: if feedback information indicating that the preceding task is completed is received, unlocking the currently executed task and continuing to execute the current task.

[0078] Based on the above, if the predecessor task has not been completed, the locked task can choose to wait for the predecessor task to complete, or learn the change of the predecessor task status through some notification mechanism (such as event monitoring or callback). Once all predecessor tasks become "completed", the system should unlock the current task. After the current task is unlocked, the system can recheck the status of the predecessor task (in case the status changes during the waiting period), and then safely execute the current task.

[0079] This process ensures that tasks are executed in the correct order, avoiding errors or inconsistent states caused by unfinished predecessor tasks.

[0080] For ease of understanding, the process of executing a business using a task management module will be described below through a specific embodiment. Figure 5 A schematic diagram of task management provided by an embodiment of the present disclosure. Figure 5 As can be seen in the figure, during software development, task parameters are registered during the task registration phase. For example, the task parameters to be registered include execution time, task priority, execution mode, task dependency, task details and task description. These tasks can be stored in a specified storage location, for example, in a blank project in harmony. They can also be stored together with common basic components to facilitate unified management by the task management module. The tasks here are tasks that have dependencies with other businesses. During the execution of business, these registered tasks can be directly called. Since these tasks are not registered in a certain business software, calling tasks is simpler and more convenient.

[0081] After completing the task registration, a task relationship tree may be further established based on the task parameters. It should be noted that when establishing the task relationship tree, different task relationship trees are established for different execution times and different businesses.

[0082] like Figure 6 A schematic diagram of the execution timing provided by the present disclosure. Figure 6 As can be seen, according to the timeline established according to the business life cycle, the execution timings are cold start, starting the home page of the business software, entering the background from the foreground, entering the foreground from the background, logging into the software, exiting the software, and killing the business software (that is, shutting down the business software).

[0083] Among them, task node T0 is the root node, and other child nodes or leaf nodes are directly or indirectly connected to the root node according to the task parameters. Each node here can have one or more tasks. When there are multiple tasks, multiple tasks in the same node are executed synchronously.

[0084] During the task execution process, the tasks will be executed according to the dependencies and execution order agreed in the task relationship tree. Considering that there may be certain dependencies between different tasks when multiple tasks are executed, in order to ensure that the tasks can be executed correctly and smoothly, it is necessary to detect the dependencies, for example, to detect whether the dependent tasks have been completed. If the execution is completed, the subsequent tasks will continue to be executed. If the execution is not completed, the current task will be locked. Wait for the dependent tasks to be completed before continuing to execute the current task.

[0085] When using harmony's Har file (dynamic library file) to implement the above solution, all apps on the harmony side can rely on it, that is, each app can register tasks that have dependencies with other apps to allow dependencies with other tasks. In other words, when registering, directly declare the dependencies between these tasks and other tasks in the public module, and conduct your own business through dynamically registered tasks. Of course, in addition to the business party's own tasks, other public modules, such as public monitoring components, reporting capability components, public capability components, and public UI components are registered as general tasks as minimum task templates.

[0086] After using the disclosed solution, the business side's own business code is completely written in its own lib module. Any tasks that rely on other business modules or public events are registered and declared using the disclosed solution, and a task relationship tree is established, and then executed according to the task relationship tree. This realizes the decoupling of business module codes, and at the same time meets the functional coupling requirements of each business module and the interdependence requirements of task execution.

[0087] Based on any of the above implementations, the present disclosure also provides a service execution device.

[0088] Figure 7 The present invention is a block diagram showing the structure of a service execution device according to an embodiment of the present invention.

[0089] like Figure 7 As shown, the service execution device includes: a first determination module 71, which is used to determine the service identifier carried in the service execution request and the execution time corresponding to the service execution request in response to the service execution request.

[0090] The second determining module 72 is used to determine the task relationship tree corresponding to the business execution request according to the business identifier and the execution timing; wherein the task relationship tree includes multiple tasks that have dependency relationships with other businesses.

[0091] The execution module 73 is used to execute the business according to the task priorities and task dependencies agreed in the task relationship tree.

[0092] It also includes an establishment module 74, which is used to obtain task parameters of multiple tasks in response to registration requests for multiple tasks for business; wherein the task parameters include: execution time, task priority, task dependency, task details, task execution method and at least one of task description; and establish a task relationship tree between the multiple tasks based on the task parameters.

[0093] Optionally, the establishment module 74 is also used to obtain the execution time, the task priority, the task dependency and the task execution method contained in the task parameters; determine the root node of the task relationship tree according to the execution time; determine the child nodes of the task relationship tree containing multiple tasks according to the task execution method; determine the vertical arrangement order and the horizontal arrangement order of the multiple child nodes in the task relationship tree according to the task priority and the task dependency; and establish a tree structure relationship between the multiple tasks based on the vertical arrangement order and the horizontal arrangement order.

[0094] The establishment module 74 is also used to determine the root node for executing the basic task according to the execution timing; wherein the basic task in the root node includes at least one of: public monitoring, basic functional components and basic UI components.

[0095] Optionally, the task execution sequence includes: asynchronous execution and synchronous execution. The establishment module 74 is further used to add the synchronously executed tasks having the same dependency to the same child node; and to add the asynchronously executed tasks to different adjacent child nodes.

[0096] The establishment module 74 is also used to detect whether the predecessor task that the current task depends on has been completed; if it has not been completed, the current task is locked.

[0097] The establishing module 74 is further configured to unlock the currently executed task and continue to execute the current task if feedback information indicating that the predecessor task is completed is received.

[0098] In response to a business execution request, determine the business identifier carried by the business execution request and the execution time corresponding to the business execution request. According to the business identifier and the execution time, determine the task relationship tree corresponding to the business execution request. Because when the task relationship tree is established, it is established based on the execution time, because different execution times have different underlying task relationships and underlying task execution orders when calling other dependent business software. Among them, the task relationship tree contains multiple tasks that have dependencies with other businesses; execute the business according to the task priority and task dependency agreed in the task relationship tree. In the above manner, add the tasks that have dependencies with other businesses in each business to the task relationship tree, and clearly declare the dependencies between each task and other business modules when registering the task, and manage them uniformly by establishing a task relationship tree. In the process of executing tasks that depend on multiple businesses, execute the business according to the execution logic agreed in the task relationship tree. Avoid the problem that dependent tasks cannot be executed due to the coupling of tasks that depend on multiple businesses.

[0099] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0100] The execution subject of the service execution method in the specific implementation manner of the present disclosure may be an electronic device such as a server (including a local server or a cloud server).

[0101] Therefore, based on any one of the above embodiments, the present disclosure further provides an electronic device, which can execute the service execution method of any one of the above embodiments of the present disclosure.

[0102] Figure 8 It is a schematic block diagram of the structure of an electronic device 1000 according to an embodiment of the present disclosure.

[0103] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0104] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.

[0105] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0106] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.

[0107] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0108] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0109] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0112] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

[0113] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0114] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A service execution method, characterized in that: The method comprises: In response to the service execution request, determining a service identifier carried in the service execution request and an execution timing corresponding to the service execution request; Determine, according to the service identifier and the execution timing, a task relationship tree corresponding to the service execution request; wherein the task relationship tree includes a plurality of tasks having dependency relationships with other services; The business is executed according to the task priorities and task dependencies agreed upon in the task relationship tree.

2. The method according to claim 1, characterized in that The task relationship tree is established in the following manner: In response to a registration request for a plurality of tasks for a service, obtaining task parameters of the plurality of tasks; wherein the task parameters include: at least one of execution timing, task priority, task dependency, task details, task execution mode, and task description; A task relationship tree between the multiple tasks is established based on the task parameters.

3. The method according to claim 2, characterized in that The step of establishing a task relationship tree between the plurality of tasks based on the task parameters includes: Obtaining the execution timing, the task priority, the task dependency and the task execution mode included in the task parameters; Determining the root node of the task relationship tree according to the execution timing; Determine, according to the task execution mode, a sub-node containing multiple tasks in the task relationship tree; Determining a vertical arrangement order and a horizontal arrangement order of a plurality of sub-nodes in the task relationship tree according to the task priority and the task dependency relationship; Based on the vertical arrangement order and the horizontal arrangement order, a tree structure relationship between the multiple tasks is established.

4. The method according to claim 3, characterized in that: The step of determining the root node of the tree structure relationship according to the execution timing includes: According to the execution timing, a root node for executing basic tasks is determined; wherein the basic tasks in the root node include: at least one of public monitoring, basic functional components and basic UI components.

5. The method according to claim 3, characterized in that: The task execution sequence includes: asynchronous execution and synchronous execution; The determining, according to the task execution mode, sub-nodes containing multiple tasks in the task relationship tree comprises: Adding tasks with the same dependency and executed synchronously to the same child node; The asynchronously executed tasks are added to different adjacent child nodes.

6. The method according to claim 1, characterized in that Before executing the business according to the task priorities and task dependencies agreed upon in the task relationship tree, the method further includes: Check whether the predecessor task that the current task depends on has been completed; If the execution is not completed, the current task is locked.

7. The method according to claim 6, characterized in that Also includes: If feedback information indicating that the predecessor task is completed is received, the currently executed task is unlocked and the execution of the current task continues.

8. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory, so that the processor executes the method according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

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