Task scheduling method, device and system
By implementing the task scheduling method on the client and using the adapter layer to be compatible with the interfaces of different task scheduling systems, the problem of large workload of programming interface code transformation during user migration is solved, the server load is reduced, and the flexibility and performance of task scheduling is improved. stability.
Patent Information
- Application Number
- CN202210450803.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-04-26
AI Technical Summary
When the existing task scheduling system migrates from one product to another, it requires a large amount of programming interface code transformation, and the server side has a large load, which has the problem of bloating.
By implementing the task scheduling method on the client, using the adapter layer to be compatible with the interfaces of different task scheduling systems, receiving the scheduling tasks sent by the server, and calling the second task interface through the first task interface to obtain the scheduling results and avoiding compatibility on the server side .
It reduces the workload, avoids the problem of excessive load on the task scheduling server, improves the flexibility of task scheduling, and makes the task scheduling system lighter and more stable in performance.
Smart Images

Figure CN114880139B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud platform technology, and in particular to a task scheduling method, device and system. Background Art
[0002] The task scheduling system generally consists of two parts: the server and the client. The client can provide a programming interface, and users can schedule tasks by implementing the programming interface.
[0003] There are many task scheduling system products, and each product has its own independent set of programming interfaces. If users want to migrate from one product to another, there is a technical problem of a large workload of code modification of the programming interface. Summary of the invention
[0004] The present disclosure provides a task scheduling method, device and system for reducing workload and avoiding the disadvantage of heavy load on the server side of task scheduling.
[0005] In a first aspect, an embodiment of the present disclosure provides a task scheduling method, the method being applied to a user device having a client installed thereon, the client communicating with a server via a first communication protocol, the method comprising:
[0006] Receiving a scheduling task sent by the server through the first communication protocol;
[0007] If the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol, calling the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task;
[0008] The first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol.
[0009] In one embodiment of the present disclosure, calling the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task includes:
[0010] calling an adapter corresponding to the second communication protocol, wherein the adapter includes the first task interface and the second task interface;
[0011] The second task interface is called based on the adapter to obtain a scheduling result corresponding to the scheduling task.
[0012] In one embodiment of the present disclosure, the adapter is a plug-in data package pre-installed for implementing the scheduling task.
[0013] In one embodiment of the present disclosure, if the scheduling result is obtained, the plug-in data packet is deleted from the client.
[0014] In one embodiment of the present disclosure, calling the second task interface based on the adapter to obtain a scheduling result corresponding to the scheduling task includes:
[0015] The first task interface is called from the adapter, and the second task interface is called through the first task interface to obtain a scheduling result corresponding to the scheduling task.
[0016] In one embodiment of the present disclosure, the scheduling task has a type attribute, and the type attribute is used to characterize the communication protocol applicable to the scheduling task.
[0017] In one embodiment of the present disclosure, after receiving the scheduling task sent by the server through the first communication protocol, the method further includes:
[0018] If the type attribute indicates that the communication protocol applicable to the scheduled task is the first communication protocol, the first task interface is called to obtain a scheduling result corresponding to the scheduled task.
[0019] In one embodiment of the present disclosure, calling the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task includes:
[0020] Calling the second task interface through the first task interface to obtain a call return value;
[0021] According to the first communication protocol and the second communication protocol, the call return value is converted into the scheduling result applicable to the first communication protocol.
[0022] In a second aspect, an embodiment of the present disclosure provides a task scheduling device, the device is applied to a user device having a client installed thereon, the client communicates with a server through a first communication protocol, and the device includes:
[0023] A receiving unit, configured to receive a scheduling task sent by the server via the first communication protocol;
[0024] A first calling unit, configured to call a second task interface through a first task interface to obtain a scheduling result corresponding to the scheduling task if the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol;
[0025] The first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol.
[0026] In one embodiment of the present disclosure, the first calling unit includes:
[0027] A first calling subunit, configured to call an adapter corresponding to the second communication protocol, wherein the adapter includes the first task interface and the second task interface;
[0028] The second calling subunit is used to call the second task interface based on the adapter to obtain a scheduling result corresponding to the scheduling task.
[0029] In one embodiment of the present disclosure, the adapter is a plug-in data package pre-installed for implementing the scheduling task.
[0030] In one embodiment of the present disclosure, if the scheduling result is obtained, the plug-in data packet is deleted from the client.
[0031] In one embodiment of the present disclosure, the second calling subunit includes:
[0032] A first calling module, used for calling the first task interface from the adapter;
[0033] The second calling module is used to call the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task.
[0034] In one embodiment of the present disclosure, the scheduling task has a type attribute, and the type attribute is used to characterize the communication protocol applicable to the scheduling task.
[0035] In one embodiment of the present disclosure, the device further includes:
[0036] The second calling unit is configured to call the first task interface to obtain a scheduling result corresponding to the scheduling task if the type attribute indicates that the communication protocol applicable to the scheduling task is the first communication protocol.
[0037] In one embodiment of the present disclosure, the first calling unit includes:
[0038] A third calling subunit is used to call the second task interface through the first task interface to obtain a call return value;
[0039] The conversion subunit is used to convert the call return value into the scheduling result applicable to the first communication protocol according to the first communication protocol and the second communication protocol.
[0040] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0041] at least one processor; and
[0042] a memory communicatively connected to at least one processor; wherein,
[0043] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the electronic device to execute the task scheduling method described in the first aspect of the present disclosure.
[0044] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the task scheduling method described in the first aspect of the present disclosure is implemented.
[0045] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the task scheduling method described in the first aspect when executed by a processor.
[0046] In a sixth aspect, an embodiment of the present disclosure provides a task scheduling system, the system comprising a server and a user device, the user device having a client installed thereon, the client communicating with the server via a first communication protocol, the user device comprising the task scheduling apparatus as described in the second aspect.
[0047] In one embodiment of the present disclosure, the client includes an adapter corresponding to the second communication protocol, the adapter includes the first task interface and the second task interface, and the adapter calls the second task interface to obtain a scheduling result corresponding to the scheduling task;
[0048] The adapter is a plug-in data package pre-installed for implementing the scheduling task; if the scheduling result is obtained, the plug-in data package is deleted from the client.
[0049] The present embodiment provides a task scheduling method, device and system, which is applied to a user device with a client installed, and the client communicates with the server through a first communication protocol. The method includes: receiving a scheduling task sent by the server through the first communication protocol, and if the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol, calling the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task, wherein the first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol. Compatibility with programming interfaces of different task scheduling systems is achieved through the client, thereby avoiding the disadvantage of "easy expansion" of the task scheduling system server. The task scheduling system server does not need to be changed, thereby improving the flexibility of task scheduling, making the task scheduling system more lightweight and having more stable performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0051] Figure 1 A schematic diagram of a task scheduling system according to an embodiment of the present disclosure;
[0052] Figure 2 A flowchart of a task scheduling method according to an embodiment of the present disclosure;
[0053] Figure 3 A flowchart of a task scheduling method according to another embodiment of the present disclosure;
[0054] Figure 4 A schematic diagram of a task scheduling system according to another embodiment of the present disclosure;
[0055] Figure 5 A schematic diagram of a task scheduling system according to another embodiment of the present disclosure;
[0056] Figure 6 A schematic diagram of a task scheduling device according to an embodiment of the present disclosure;
[0057] Figure 7 A schematic diagram of a task scheduling device according to another embodiment of the present disclosure;
[0058] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure.
[0059] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0061] The terms "first", "second", "third", 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 terms used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in sequences other than those illustrated or described herein.
[0062] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.
[0063] The task scheduling system generally consists of two parts: the server and the client. The server serves the client, and the service content includes providing resources to the client and saving client data. The client, or user end, refers to the program that provides local services to the client corresponding to the server. Except for some applications that only run locally, they are generally installed on ordinary client computers and need to cooperate with the server to run. Generally speaking, the client can include the computer used by the user (such as a browser), and the server is a server that can store web pages and database data.
[0064] In some embodiments, the compatibility solution for product programming interfaces of different task scheduling systems can be implemented based on the server, that is, the compatibility of product programming interfaces of different task scheduling systems can be implemented on the server. Figure 1 shown.
[0065] like Figure 1 As shown, the X-task scheduling system server includes: X-server (X-Server), A protocol conversion module and A communication framework. X business application includes X-client (X-Client) and X-task (Job) interface (implemented by business code). A business application includes A-client (A-Client) and A-task (Job) interface (implemented by business code).
[0066] Exemplarily, if the X-server needs to schedule the A-task interface, the X-server transmits the X-scheduling task to the A-protocol conversion module, wherein the communication protocol corresponding to the X-scheduling task is the X-communication protocol.
[0067] Correspondingly, the A-protocol conversion module converts the X-communication protocol into the A-communication protocol to obtain the A-scheduling task corresponding to the A-communication protocol. The A-protocol conversion module transmits the A-scheduling task to the A-communication framework.
[0068] The A communication framework transmits the A-scheduling task to the A-client. The A communication framework refers to the system framework for establishing communication between the A protocol conversion module and the A-client, that is, the A communication framework can establish a communication connection between the A protocol conversion module and the A-client, and complete the information transmission between the A protocol conversion module and the A-client, such as the transmission of the A-scheduling task.
[0069] like Figure 1 As shown, the A-client calls the A-task interface to obtain the A-task return value and transmits the scheduling status to the A communication framework (i.e., reporting the calling status), as shown in Figure 1 The "A-scheduling state" shown in . The A-scheduling state includes the A-task return value, and may also include heartbeat and progress information, etc. The A communication framework transmits the A-scheduling state to the A protocol conversion module.
[0070] Similarly, the protocol corresponding to the A-scheduling state is the A-communication protocol. The A-protocol conversion module converts the A-scheduling state into the X-scheduling state of the X-communication protocol and transmits the X-scheduling state to the X-server.
[0071] In other embodiments, Figure 1 As shown, if the X-server needs to schedule the X-scheduled task of the X-communication protocol, the X-server transmits the X-scheduled task to the X-client.
[0072] Correspondingly, such as Figure 1 As shown, the X-client calls the X-task interface to obtain the X-task return value and transmits the scheduling status to the X-server, such as Figure 1 Similarly, the X-scheduling status includes the X-task return value, and may also include heartbeat and progress information.
[0073] Among them, the communication between the X task scheduling system server and the X business application, and the communication between the X task scheduling system server and the A business application are remote communications. For example, the communication between the X-server and the X-client is remote communication. The communication between the A communication framework and the A-client is remote communication.
[0074] The components in the X task scheduling system server are called in-process. For example, the X-server and the A protocol conversion module are called in-process. The A protocol conversion module and the A communication framework are called in-process.
[0075] The components in the X business application are called in-process. For example, the X-client and the X task interface are called in-process. The components in the A business application are called in-process. For example, the A-client and the A task interface are called in-process.
[0076] Combination Figure 1 It can be seen that if the server needs to call a client with a different protocol from its own, compatibility processing can be performed on the server side, such as deploying a protocol conversion module and a communication framework corresponding to the client with a different protocol being called on the server side, such as the A protocol conversion module and A communication framework deployed on the server side of the X task scheduling system, so that the protocol corresponding to the server is converted into the communication protocol corresponding to the called client through the protocol conversion module, and the remote communication between the protocol conversion module and the called client side is completed through the communication framework applicable to the called client.
[0077] However, on the one hand, the task scheduling system has complex functions and many communication interfaces. It needs to support different communication protocols and corresponding communication frameworks for remote communication with each client. Moreover, the functions and data structures of different task scheduling systems are different, and it is very complicated to achieve compatibility on the server side. On the other hand, different task scheduling systems use different communication protocols. For example, some task scheduling systems use the Transmission Control Protocol (TCP) for communication, some task scheduling systems use the Hypertext Transfer Protocol (HTTP) for communication, and some task scheduling systems use message communication. Therefore, different task scheduling systems have different open ports, and different protocol conversion modules need to be deployed to support calls to different business applications. The more protocol conversion modules are deployed, the higher the server load.
[0078] In order to avoid the above-mentioned technical problems, the inventors of the present invention have obtained the inventive concept of the present invention through creative work: the task scheduling system generally includes a server and a client, the client provides a programming interface for the task, the business application relies on the client's software development kit (Software Development Kit, SDK), the business application includes two layers, the client and the business code (such as the task interface implemented based on the business code), and an adapter layer can be added between the client and the business code. The adapter layer includes one or more adapters to be compatible with different task scheduling system interfaces through different adapters.
[0079] The technical solution of the present disclosure is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0080] Figure 2 Flow chart of a task scheduling method according to an embodiment of the present disclosure. The method is applied to a user device having a client installed thereon. The client communicates with the server via a first communication protocol, such as Figure 2 As shown, the method includes:
[0081] S201: Receive a scheduling task sent by a server via a first communication protocol.
[0082] Exemplarily, the execution subject of this embodiment may be a user equipment with a client deployed thereon. This embodiment does not limit the user equipment. For example, the user equipment may be a fixed terminal or a mobile terminal.
[0083] The first communication protocol and the second communication protocol are relative concepts, referring to two different communication protocols, but should not be understood as specific limitations on the communication protocols.
[0084] Exemplarily, in combination with the above analysis, if the first communication protocol is the transmission control protocol, the second communication protocol may be the hypertext transfer protocol. Conversely, if the first communication protocol is the hypertext transfer protocol, the second communication protocol may be the transmission control protocol.
[0085] S202: If the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol, the second task interface is called through the first task interface to obtain a scheduling result corresponding to the scheduling task.
[0086] The first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol.
[0087] Similarly, the first task interface and the second task interface are relative concepts, referring to different task interfaces in two different business applications.
[0088] Exemplarily, in combination with the above analysis, if the first task interface is an X-task interface, the second task interface may be an A-task interface.
[0089] Correspondingly, if the first communication protocol is the X-task protocol and the second communication protocol is the A-task protocol, since the X-task protocol and the A-task protocol are different communication protocols, the A-task interface can be called through the X-task interface to obtain the scheduling result through the A-task interface.
[0090] Based on the above analysis, it can be seen that in some embodiments, compatibility with programming interfaces of different task scheduling systems can be achieved based on the task scheduling system server, and in this embodiment, compatibility with programming interfaces of different task scheduling systems can be achieved based on the client, and specifically, different task interfaces can be called in the same process based on the client, such as the first task interface can call the second task interface of the same process of the client.
[0091] Compared with achieving compatibility with programming interfaces of different task scheduling systems based on the task scheduling system server, this embodiment relatively avoids the disadvantage of "easy expansion" of the task scheduling system server. The task scheduling system server does not need to be changed, which improves the flexibility of task scheduling, making the task scheduling system more lightweight and more stable in performance.
[0092] Figure 3 Flow chart of a task scheduling method according to another embodiment of the present disclosure, the method is applied to a user device having a client installed thereon, the client communicating with the server via a first communication protocol, such as Figure 3 As shown, the method includes:
[0093] S301: Receive a scheduling task sent by a server via a first communication protocol.
[0094] It should be understood that in order to avoid cumbersome descriptions, the technical features of this embodiment that are the same as those in the above embodiments will not be described in detail in this embodiment.
[0095] For example, Figure 4 As shown, the X task scheduling system service end includes an X-server, the business application includes an X-client, the X-server sends an X-scheduling task (i.e., scheduling task) to the X-client, and the X-server and the X-client communicate based on the X communication protocol (i.e., the first communication protocol).
[0096] S302: If the communication protocol applicable to the scheduled task is a second communication protocol different from the first communication protocol, determine an adapter corresponding to the second communication protocol, wherein the adapter includes a first task interface and a second task interface.
[0097] Exemplarily, the adapter inherits the first task interface and the second task interface.
[0098] In combination with the above example, if the first communication protocol is X communication protocol, the second communication protocol is A communication protocol, the first task interface is X-task interface, and the second task interface is A-task interface, the adapter includes X-task interface and A-task interface.
[0099] S303: Calling the second task interface based on the adapter to obtain a scheduling result corresponding to the scheduling task.
[0100] Correspondingly, the call to the A-task interface can be completed through the adapter to obtain the scheduling result.
[0101] In this embodiment, the adapter can be developed independently, the amount of code is relatively small, the compatibility workload can be reduced, it is relatively simple and convenient, it will not cause intrusion to the server, and it does not need to rely on the task scheduling system, that is, the task scheduling system server does not need to make any changes, which can improve the stability of the task scheduling system. And the adapter can be in pluggable mode, so that when the task scheduling system is lightweight, it can be convenient for the task scheduling system to expand new plug-ins, that is, the extensibility of the task scheduling system can be improved.
[0102] The adapter being in pluggable mode can be understood as follows: the adapter is a plug-in data package pre-installed for implementing the scheduling task, and after the scheduling result is obtained, the plug-in data package is deleted from the client.
[0103] For example, the client can download and install the plug-in data package based on the user's download and installation operations. When receiving a scheduling task, the plug-in data package is run, that is, the adapter is called to call the second task interface through the first task interface to obtain the scheduling result corresponding to the scheduling task, that is, the scheduling task is completed. After completing the scheduling task, the client can delete the plug-in data package downloaded to the client based on the user's deletion operation, that is, delete the adapter.
[0104] It is worth noting that if the client needs to continue to implement the scheduling task, such as the client may receive the scheduling task sent by the server again through the first communication protocol, the client can first retain the plug-in data package, and if the client does not need to implement the scheduling task, the client can delete the plug-in data package. Similarly, the client can delete the plug-in data package based on the user's deletion operation.
[0105] In some embodiments, S303 may include: calling a first task interface from the adapter, and calling a second task interface through the first task interface to obtain a scheduling result corresponding to the scheduled task.
[0106] In combination with the above embodiment, since the adapter inherits the X-task interface and the A-task interface, the X-task interface can be called from the adapter first, and then the A-task interface can be called in the same process through the X-task interface to obtain the scheduling result.
[0107] For example, Figure 4 As shown, the business application also includes an adapter and an A-task interface. Among them, the X-client sends an X-scheduled task to the adapter, and the adapter first schedules the inherited X-task interface to call the A-task interface in the same process through the X-task interface to obtain the A-task return value.
[0108] The A-task return value is obtained through the adapter to obtain the X-task return value. For example, since the A-task interface is called by the X-task interface in the adapter, when the A-task interface returns the A-task return value, the X-task interface in the adapter can output the X-task return value based on the A-task return value, that is, Figure 4 As shown, the adapter can transmit the X-task return value to the X-client.
[0109] For example, the X-task interface can convert the A-task return value into the X-task return value according to the X-task protocol and the A-task protocol.
[0110] Correspondingly, the X-client transmits the X-task return value to the X-client based on remote communication. Figure 4 As shown, the X-client may return an X-scheduling status to the X-server, wherein the X-scheduling status includes an X-task return value.
[0111] In some embodiments, the scheduling task has a type attribute, and the type attribute is used to characterize the communication protocol applicable to the scheduling task.
[0112] Exemplarily, in combination with the above embodiment, if the scheduling task is an X-scheduling task, then the X-scheduling task has a type attribute, and the type attribute of the X-scheduling task indicates that the communication protocol applicable to the X-scheduling task is the X-communication protocol. For another example, if the scheduling task is an A-scheduling task, then the A-scheduling task has a type attribute, and the type attribute of the A-scheduling task indicates that the communication protocol applicable to the A-scheduling task is the A-communication protocol.
[0113] In some embodiments, the type attribute of the scheduling task can be determined by the content in the type field (type). For example, if type=A, the type attribute of the scheduling task indicates that the scheduling task is a scheduling task applicable to the A-communication protocol.
[0114] Accordingly, there can be multiple adapters to call different task interfaces through different adapters, such as calling A-task interface through X-adapter-A, calling B-task interface through X-adapter-B, and so on, which are not listed here one by one.
[0115] In some embodiments, the adapter to send the scheduling task can be determined based on the client. In combination with the above example, if the client is an X-client, the adapters include X-adapter-A and X-adapter-B. Then when the X-client receives the X-scheduling task, the type attribute of the X-scheduling task is obtained. If the type field of the X-scheduling task = A, it is determined that the type attribute of the X-scheduling task represents that the X-scheduling task is a scheduling task applicable to the A-communication protocol. The X-client selects X-adapter-A from X-adapter-A and X-adapter-B, and sends the X-scheduling task to X-adapter-A.
[0116] Correspondingly, X-adapter-A first schedules the X-task interface to schedule the A-task scheduling interface through the X-task interface to obtain the A-task return value, and the A-task return value outputs the X-task return value through the X-task interface in X-adapter-A. X-adapter-A transmits the X-task return value to the X-client.
[0117] That is to say, in this embodiment, corresponding adapters can be set according to the calling requirements of different task interfaces, so as to combine the adapter's calling of the task interface within the process, thereby achieving compatibility on the client side, avoiding the "bloatedness" of the server side caused by compatibility on the server side, and realizing a lightweight task scheduling system.
[0118] In other embodiments, the adapter may also determine the type attribute of the scheduled task to determine whether the task interface needs to be called through an in-process call according to the type attribute.
[0119] Exemplarily, in combination with the above embodiment, when the X-client receives the X-scheduling task, the X-scheduling task may be transmitted to the X-adapter-A and the X-adapter-B respectively.
[0120] Correspondingly, X-adapter-A and X-adapter-B respectively determine the type attribute of the X-scheduled task. If X-adapter-A determines that the type attribute of the X-scheduled task indicates that the X-scheduled task is a scheduled task applicable to the A-communication protocol, then X-adapter-A first schedules the X-task interface to schedule the A-task scheduling interface through the X-task interface to obtain the A-task return value, and the A-task return value outputs the X-task return value through the X-task interface in X-adapter-A. X-adapter-A transmits the X-task return value to the X-client.
[0121] Since X-adapter-B determines that the type attribute of the X-scheduled task represents that the X-scheduled task is a scheduled task applicable to the A-communication protocol, and X-adapter-B inherits the X-task interface and the B-task interface, X-adapter-B does not need to be called.
[0122] In other embodiments, Figure 5 As shown, the A-task scheduling system service end includes an A-server, and the business application includes an A-client and an A-task interface.
[0123] The A-server sends the A-scheduled task to the A-client, and the communication protocol corresponding to the A-scheduled task is the A-communication protocol. The A-client can transmit the A-scheduled task to the A-task interface to implement the scheduling of the A-task interface and obtain the A-task return value. The A-task interface transmits the A-task return value to the A-client, and the A-client transmits the A-scheduled state to the A-client. Among them, the A-scheduled state includes the A-task return value.
[0124] Figure 6 This is a schematic diagram of a task scheduling device according to an embodiment of the present disclosure, wherein the task scheduling device is applied to a user device having a client installed thereon, the client communicates with the server via a first communication protocol, and the task scheduling device 600 includes:
[0125] The receiving unit 601 is used to receive the scheduling task sent by the server through the first communication protocol.
[0126] The first calling unit 602 is used to call the second task interface through the first task interface to obtain the scheduling result corresponding to the scheduling task if the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol.
[0127] The first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol.
[0128] Figure 7 Schematic diagram of a task scheduling device according to another embodiment of the present disclosure, wherein the task scheduling device is applied to a user device having a client installed thereon, the client communicates with the server through a first communication protocol, and the task scheduling device 700 includes:
[0129] The receiving unit 701 is used to receive the scheduling task sent by the server through the first communication protocol.
[0130] The first calling unit 702 is used to call the second task interface through the first task interface to obtain the scheduling result corresponding to the scheduling task if the communication protocol applicable to the scheduling task is a second communication protocol different from the first communication protocol.
[0131] The first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol.
[0132] Combination Figure 7 It can be seen that, in some embodiments, the first calling unit 702 includes:
[0133] The first calling subunit 7021 is used to call an adapter corresponding to the second communication protocol, wherein the adapter includes the first task interface and the second task interface.
[0134] The second calling subunit 7022 is used to call the second task interface based on the adapter to obtain a scheduling result corresponding to the scheduling task.
[0135] In one embodiment of the present disclosure, the adapter is a plug-in data package pre-installed for implementing the scheduling task.
[0136] In one embodiment of the present disclosure, if the scheduling result is obtained, the plug-in data packet is deleted from the client.
[0137] In some embodiments, the second calling subunit 7022 includes:
[0138] The first calling module is used to call the first task interface from the adapter.
[0139] The second calling module is used to call the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task.
[0140] Combination Figure 7 It can be seen that, in some embodiments, the first calling unit 702 includes:
[0141] The third calling subunit 7023 is used to call the second task interface through the first task interface to obtain a call return value.
[0142] The conversion subunit 7024 is used to convert the call return value into the scheduling result applicable to the first communication protocol according to the first communication protocol and the second communication protocol.
[0143] In some embodiments, the scheduling task has a type attribute, and the type attribute is used to characterize the communication protocol applicable to the scheduling task.
[0144] The second calling unit 703 is configured to call the first task interface to obtain a scheduling result corresponding to the scheduling task if the type attribute indicates that the communication protocol applicable to the scheduling task is the first communication protocol.
[0145] According to another aspect of the embodiments of the present disclosure, the embodiments of the present disclosure also provide a task scheduling system, which includes a server and a user device, wherein the user device is installed with a client, the client communicates with the server via a first communication protocol, and the user device includes the task scheduling device as described in the second aspect.
[0146] In some embodiments, the client includes an adapter corresponding to the second communication protocol, the adapter includes the first task interface and the second task interface, and the adapter calls the second task interface to obtain a scheduling result corresponding to the scheduling task;
[0147] The adapter is a plug-in data package pre-installed for implementing the scheduling task; if the scheduling result is obtained, the plug-in data package is deleted from the client.
[0148] Figure 8 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present disclosure. Figure 8 As shown, the electronic device 800 of the embodiment of the present disclosure may include: at least one processor 801 ( Figure 8 Only one processor is shown); and a memory 802 in communication with at least one processor. The memory 802 stores instructions that can be executed by at least one processor 801, and the instructions are executed by at least one processor 801 so that the electronic device 800 can execute the technical solution in any of the aforementioned method embodiments.
[0149] Optionally, the memory 802 may be independent or integrated with the processor 801 .
[0150] When the memory 802 is a device independent of the processor 801 , the electronic device 800 further includes: a bus 803 for connecting the memory 802 and the processor 801 .
[0151] The electronic device provided by the embodiments of the present disclosure can execute the technical solution of any of the aforementioned method embodiments, and its implementation principles and technical effects are similar, which will not be repeated here.
[0152] The embodiments of the present disclosure further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the technical solution in any of the aforementioned method embodiments.
[0153] An embodiment of the present disclosure provides a computer program product, including a computer program, which implements the technical solution in any of the aforementioned method embodiments when executed by a processor.
[0154] The embodiment of the present disclosure further provides a chip, including: a processing module and a communication interface, wherein the processing module can execute the technical solution in the aforementioned method embodiment.
[0155] Furthermore, the chip also includes a storage module (such as a memory), the storage module is used to store instructions, the processing module is used to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module enables the processing module to execute the technical solution in the aforementioned method embodiment.
[0156] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0157] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0158] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present disclosure is not limited to only one bus or one type of bus.
[0159] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0160] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A task scheduling method, characterized in that: The method is applied to a user device having a client installed thereon, the client communicating with a server via a first communication protocol, and the method comprises: Receiving a scheduling task sent by the server through the first communication protocol; If the communication protocol applicable to the scheduled task is a second communication protocol different from the first communication protocol, an adapter corresponding to the second communication protocol is called, wherein the adapter includes a first task interface and a second task interface; the first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol; The second task interface is called through the first task interface to obtain a scheduling result corresponding to the scheduling task.
2. The method according to claim 1, characterized in that The adapter is a pre-installed plug-in data package for implementing the scheduling task.
3. The method according to claim 2, characterized in that If the scheduling result is obtained, the plug-in data packet is deleted from the client.
4. The method according to claim 1, characterized in that: Calling the second task interface through the first task interface to obtain a scheduling result corresponding to the scheduling task includes: The first task interface is called from the adapter, and the second task interface is called through the first task interface to obtain a scheduling result corresponding to the scheduling task.
5. The method according to any one of claims 1 to 4, characterized in that The scheduling task has a type attribute, and the type attribute is used to characterize the communication protocol applicable to the scheduling task.
6. A task scheduling device, characterized in that: The device is applied to a user equipment installed with a client, the client communicates with the server through a first communication protocol, and the device includes: A receiving unit, configured to receive a scheduling task sent by the server via the first communication protocol; A first calling unit is used to call an adapter corresponding to a second communication protocol if the communication protocol applicable to the scheduled task is a second communication protocol different from the first communication protocol, wherein the adapter includes a first task interface and a second task interface; the first task interface is a task interface corresponding to the first communication protocol, and the second task interface is a task interface corresponding to the second communication protocol; The second task interface is called through the first task interface to obtain a scheduling result corresponding to the scheduling task.
7. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to execute the task scheduling method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 5 is implemented.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 5 is implemented.
10. A task scheduling system, the system comprising a server and a user device, the user device having a client installed thereon, the client communicating with the server via a first communication protocol, the user device comprising the apparatus as claimed in claim 6.
11. The system according to claim 10, characterized in that The client includes an adapter corresponding to the second communication protocol, the adapter includes the first task interface and the second task interface, and the adapter calls the second task interface to obtain a scheduling result corresponding to the scheduling task; The adapter is a plug-in data package pre-installed for implementing the scheduling task; if the scheduling result is obtained, the plug-in data package is deleted from the client.
Citation Information
Patent Citations
Method and device for realizing adaptation of communication protocol of intelligent card
CN101706861A
A method and device for transmitting data
CN110290095A