CN115080205B - Task execution method, device, electronic equipment and readable storage medium - Google Patents

Task execution method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115080205B
CN115080205B CN202210592634.5A CN202210592634A CN115080205B CN 115080205 B CN115080205 B CN 115080205B CN 202210592634 A CN202210592634 A CN 202210592634A CN 115080205 B CN115080205 B CN 115080205B
Authority
CN
China
Prior art keywords
task
token
target
task execution
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210592634.5A
Other languages
Chinese (zh)
Other versions
CN115080205A (en
Inventor
穆亚昆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210592634.5A priority Critical patent/CN115080205B/en
Publication of CN115080205A publication Critical patent/CN115080205A/en
Application granted granted Critical
Publication of CN115080205B publication Critical patent/CN115080205B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a task execution method, a task execution device, electronic equipment and a readable storage medium, and relates to the technical field of artificial intelligence such as cloud services and big data. The method comprises the following steps: acquiring task information to be executed; determining a task execution end according to the task information to be executed; generating a target token corresponding to the task execution end, and sending the target token to the task execution end; and sending target task information to the target task execution end, wherein the target task information comprises a target token, and the target task information is used for executing a task corresponding to the target task information by the task execution end. The method and the device improve the safety and accuracy of task execution.

Description

Task execution method, device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to the technical field of data processing, in particular to the technical field of artificial intelligence such as cloud service, big data and the like. And more particularly, to a task execution method, apparatus, electronic device, and readable storage medium.
Background
In the related art, communication is performed between a scheduling end and different execution ends in a task scheduling framework through a fixed token (token); the fixed token stored in the execution end has leakage risk, so that the safety of the dispatching end when communicating with different execution ends is reduced.
Disclosure of Invention
According to a first aspect of the present disclosure, there is provided a task execution method applied to a task scheduling end, including: acquiring task information to be executed; determining a task execution end according to the task information to be executed; generating a target token corresponding to the task execution end, and sending the target token to the task execution end; and sending target task information to the task execution end so as to be used for the task execution end to execute a task corresponding to the target task information, wherein the target task information comprises the target token.
According to a second aspect of the present disclosure, there is provided a task execution method, applied to a task execution end, including: receiving target task information sent by a task scheduling end, wherein the target task information comprises a second designated token; and executing the task corresponding to the target task information under the condition that the second designated token is determined to be consistent with the target token, wherein the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task executing end.
According to a third aspect of the present disclosure, there is provided a task execution device applied to a task scheduling end, including: the acquisition unit is used for acquiring task information to be executed; the determining unit is used for determining a task executing end according to the task information to be executed; the generating unit is used for generating a target token corresponding to the task execution end and sending the target token to the task execution end; the first sending unit is used for sending target task information to the task execution end so as to be used for the task execution end to execute a task corresponding to the target task information, wherein the target task information comprises the target token.
According to a fourth aspect of the present disclosure, there is provided a task execution device applied to a task execution end, including: the second receiving unit is used for receiving target task information sent by the task scheduling end, wherein the target task information comprises a second designated token; and the execution unit is used for executing the task corresponding to the target task information under the condition that the second designated token is determined to be consistent with the target token, wherein the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task execution end.
According to a fifth aspect of the present disclosure, there is provided a task execution system, including a task scheduling end and a task execution end; the task scheduling end is used for executing the task execution method provided in the first aspect of the disclosure, and the task execution end is used for executing the task execution method provided in the second aspect of the disclosure.
According to a sixth aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
According to a seventh aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method as described above.
According to an eighth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method as described above.
According to the technical scheme, the communication between the task scheduling end and the task execution end is realized through the target token which is generated by the task scheduling end and corresponds to the task execution end, and because different task execution ends correspond to different target tokens, the problem that a single token used by different task execution ends can generate safety risks when being leaked can be effectively avoided, the communication safety between the task execution end and the task execution end is greatly improved, and further the safety and the accuracy of task execution are improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing a task execution method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure. As shown in fig. 1, the task execution method of the present embodiment is applied to a task scheduling end, and may be a server or a terminal, and specifically includes the following steps:
S101, acquiring task information to be executed;
s102, determining a task execution end according to the task information to be executed;
s103, generating a target token corresponding to the task execution end, and sending the target token to the task execution end;
s104, sending target task information to the task execution end so as to be used for the task execution end to execute a task corresponding to the target task information, wherein the target task information comprises the target token.
The execution main body of the task execution method in the embodiment is a task scheduling end, the task scheduling end uses the generated target token corresponding to the task execution end to achieve the purpose of sending target task information to the task execution end, and because different task execution ends correspond to different target tokens, the problem that a single token used by different task execution ends can generate safety risks when being leaked can be effectively avoided, communication safety between the task scheduling end and the task execution end is greatly improved, and further safety and accuracy of task execution are improved.
The task scheduling end and the task executing end of the embodiment are located in the same task scheduling frame, and the task scheduling end and the task executing end located in the same task frame can be deployed in different network environments; the task scheduling end in the task scheduling framework is used for distributing the acquired task information to be executed to the determined one or more task execution ends; and the one or more task execution ends are used for executing tasks according to the target task information distributed by the task scheduling end.
When the task scheduling end of the embodiment obtains the task information to be executed in the execution S101, the task information input by the input end may be used as the task information to be executed, or the task information obtained from the task center at regular time may be used as the task information to be executed.
When executing S101 to obtain task information to be executed, the task scheduling end of this embodiment may adopt the following alternative implementation manners: receiving a task request, wherein the task request comprises a request token and task information, and a task scheduling end can receive the task request sent by an input end; under the condition that the request token is consistent with the preset request token, the task information obtained by analyzing the task request is used as the task information to be executed; the preset request token at the task scheduling end in this embodiment is unique.
That is, the task scheduling end of the embodiment checks the task request according to the request token, so that task information contained in the task request is obtained as task information to be executed only when the task request is determined to pass the check, the problem that the task scheduling end distributes the task information with safety risk to the task execution end is avoided, and therefore the safety of task execution is improved.
When executing S101, the task scheduling end of the embodiment may return, if it is determined that the request token is inconsistent with the preset request token, a prompt message to the input end sending the task request, where the prompt message is used to prompt that the input end fails to check due to a token error, so that the task corresponding to the task request cannot be executed.
After the task scheduling end of the embodiment obtains the task information to be executed in the execution step S101, the task scheduling end of the embodiment determines a task execution end according to the task information to be executed in the execution step S102; the number of task execution ends determined by the task scheduling end executing S102 in this embodiment may be one or more.
When the task scheduling end of the embodiment determines the task execution end according to the task information to be executed in the execution S102, the optional implementation manner may be: determining the number of execution ends required for task execution according to the task information to be executed and the attribute information of the execution ends, wherein the attribute information of the execution ends in the embodiment can be machine configuration information of the execution ends; and selecting the execution ends corresponding to the determined number of the execution ends as task execution ends.
For example, if the task scheduling end of the present embodiment performs the pressure test of 1000 users, and if it is determined that each execution end can only perform the pressure test of 200 users according to the attribute information (e.g., the machine configuration information) of the execution end, the task scheduling end of the present embodiment performs S102 to determine that the number of execution ends required for task execution is 5, and then selects 5 execution ends as task execution ends.
When executing S102 to select the execution ends corresponding to the determined number of execution ends, the task scheduling end of this embodiment may randomly select the execution ends corresponding to the determined number of execution ends, or may select, according to the load condition of the execution ends at the current moment, the execution ends corresponding to the determined number of execution ends, where the load condition meets the task execution requirement.
After the task scheduling end in this embodiment determines the task execution end according to the task information to be executed in the execution S102, the task scheduling end may further determine target task information corresponding to each task execution end, where the target task information is task information corresponding to a task executed by each task execution end, for example, task information corresponding to a pressure test of 200 users.
After the task scheduling end of the present embodiment determines the task execution end in S102, S103 generates a target token corresponding to the task execution end, and sends the target token to the task execution end.
When executing S103 to generate a target token corresponding to the task execution end, the task scheduling end of this embodiment may adopt the following alternative implementation manners: sending a notification message to a task execution end, wherein the notification message is used for notifying the task execution end to execute a task; receiving response information sent by a task execution terminal aiming at the notification message, wherein the response information comprises a registration token; generating a target token corresponding to the task execution end when the registration token is determined to be consistent with the preset registration token; the preset registration token at the task scheduling end in this embodiment is unique.
That is, when the task scheduling end communicates with the task execution end, the task scheduling end of the embodiment may involve two types of tokens, namely the registration token and the target token, and compared with the task scheduling end and different task execution ends in the related art, the communication security between the task scheduling end and the task execution end can be greatly improved by only communicating with one fixed token.
In addition, when executing S103 to generate the target token corresponding to the task execution end, the task scheduling end of the present embodiment may directly send the generated target token to the task execution end, without sending the notification message and receiving the response message.
The task execution end of this embodiment executes S103 a notification message sent to the determined task execution end, and is configured to send a response message to the task scheduling end after the task execution end receives the notification message, so as to generate the target token.
When executing S103 to send a notification message to the task execution end, the task scheduling end of the embodiment may obtain address information of the task execution end according to attribute information of the task execution end, for example, a machine IP address, and then send the notification message to the task execution end through the obtained address information.
After executing S103 to send the notification message to the task execution end, the task scheduling end of this embodiment receives a response message sent by the task execution end, where the response message includes the registration token.
That is, the task scheduling end of the embodiment selects the task execution end as the task execution end to execute the task by sending the notification message to the task execution end, and receives the response message sent by the task execution end, so that after the comparison between the registration token and the preset registration token is completed, the target token is regenerated, and the accuracy of generating the target token can be improved.
When executing S103 to generate a target token corresponding to the task execution end, the task scheduling end of this embodiment may adopt the following alternative implementation manners: generating a random token; taking the generated random token as a target token corresponding to the task execution end; in addition, the task scheduling end of the embodiment may also record a correspondence between the target token and the task execution end.
That is, the task scheduling end of the embodiment will randomly generate a token when executing the task, and the token is used as a target token corresponding to the task executing end, so that the security of the target token is improved, and different task executing ends correspond to different target tokens, and even if the target token of one task executing end leaks, the security of the task executing ends of other task executing ends is not affected.
When executing S103 to record the correspondence between the target token and the task execution end, the task execution end and the corresponding target token thereof may be recorded in a preset registry; the preset registry contains the corresponding relation between the attribute information (such as the IP address, ID and other identification information of the target execution server) of the task execution end and the target token.
It can be understood that if there are multiple task execution ends that complete the comparison between the registration token and the preset registration token, the task scheduling end in this embodiment generates a target token corresponding to each task execution end and sends different target tokens to different task execution ends when executing S103.
After executing S103 to generate a target token corresponding to the task execution end, the task scheduling end of the embodiment sends the generated target token to the task execution end, so that the task execution end checks the target task information received next time according to the target token received this time.
After the task scheduling end of the embodiment sends the target token to the task execution end in the step S103, the step S104 sends target task information to the task execution end for the task execution end to execute the task corresponding to the target task information, where the target task information includes the target token corresponding to the task execution end.
When executing S104 to send the target task information to the task execution end, the task scheduling end of the embodiment may first acquire the target task information corresponding to the task execution end, then add the target token corresponding to the task execution end to the acquired target task information, and further send the target task information including the target token to the task execution end.
When the task scheduling end of the embodiment obtains the target task information corresponding to the task execution end in the execution S104, the task information corresponding to the attribute information of the target task execution end (for example, the machine configuration information of the task execution end) in the task information to be executed may be used as the target task information, for example, the task information for performing the pressure test corresponding to 200 users in the task information to be executed for performing the pressure test corresponding to 1000 users may be used as the target task information; the target task information may be all of the task information to be executed, or may be a part of the task information to be executed.
After executing S104 to send the target task information to the task execution end, the task scheduling end of the present embodiment may further include the following: receiving task execution information sent by a task execution end, wherein the task execution information comprises a task execution result and a first appointed token; and under the condition that the first designated token is consistent with the target token, analyzing the task execution information to obtain a task execution result.
That is, after receiving the task execution information sent by the task execution end, the task scheduling end performs verification of the task execution information according to the first designated token included in the task execution information and the target token corresponding to the task execution end, so that after determining that the task execution information passes the verification, the task execution information is analyzed to obtain a task execution result therein, thereby avoiding obtaining a task execution result with safety risk, and further improving the safety of task execution.
After the task scheduling end obtains the task execution result, the task execution result may also be sent to an input end that sends a task request to the task scheduling end, so as to display the task execution result at the input end.
Fig. 2 is a schematic diagram according to a second embodiment of the present disclosure. As shown in fig. 2, the task execution method of the present embodiment is applied to a task execution end, which may be a server or a terminal, and specifically includes the following steps:
s201, receiving target task information sent by a task scheduling end, wherein the target task information comprises a second designated token;
s202, executing a task corresponding to the target task information under the condition that the second designated token is determined to be consistent with a target token, wherein the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task executing end.
The execution main body of the task execution method in the embodiment is a task execution end, the task execution end uses the target token generated by the task scheduling end to realize the purpose of checking and executing the target task information sent by the task scheduling end, and because different task execution ends correspond to different target tokens, the problem that a single token used can generate safety risks when leakage occurs can be effectively avoided, the communication safety between the task scheduling end and the task execution end is greatly improved, and the safety and the accuracy of task execution are further improved.
The task execution end of this embodiment also receives the target token sent in advance by the task scheduling end before executing S201 to receive the target task information sent by the task scheduling end.
Before executing S201, the task execution end of this embodiment may adopt an alternative implementation manner when receiving the target token sent in advance by the task scheduling end: receiving a notification message sent by a task scheduling end, wherein the notification message is used for notifying a task execution end to execute a task by the task scheduling end; aiming at the notification message, sending a response message to the task scheduling end, wherein the response message comprises a registration token; and receiving a target token sent by the task scheduling end, wherein the target token is generated under the condition that the registration token is consistent with a preset registration token.
That is, the task execution end in this embodiment can receive the target token sent by the task scheduling end after receiving the notification message sent by the task scheduling end and sending the response message to the task scheduling end, and the task execution end sends the response message added with the registration token to the task scheduling end, so that the response message with security risk received by the task scheduling end can be avoided, and the communication security between the task execution end and the task scheduling end is improved.
The target token received by the task execution end before executing S201 in the present embodiment may also be directly sent to the task execution end by the task scheduling end after determining the task execution end.
Before executing S201, the task execution end of the embodiment may first acquire a registration token when sending response information to the task scheduling end, then add the acquired registration token to the response information, and then send the response information including the registration token to the task scheduling end, so as to be used for the task scheduling end to check and generate a target token.
After receiving the target token sent by the task scheduling end, the task execution end of the embodiment may set the target token as a communication token of the machine, so as to use the target token to communicate with the task scheduling end.
It can be understood that, after the target token is stored by the task execution end in this embodiment, if it is determined that the task execution information is sent to the task scheduling end, the target token may be destroyed, so as to avoid affecting the next task execution.
After executing S201 the target task information sent by the task scheduling end, the task execution end of the present embodiment executes S202 the task corresponding to the target task information when determining that the second instruction token is consistent with the target token.
That is, the task execution end of the embodiment performs verification of the target task information according to the token received twice, and executes the task corresponding to the target task information after determining that the target task information passes the verification, thereby avoiding executing the task information with safety risk, and further improving the safety and accuracy of task execution.
In addition, if the task execution end in this embodiment determines that the second designated token is inconsistent with the target token when executing S202, the task scheduling end may be prompted with information to prompt the task execution end that the verification fails due to the error of the token, so that the task corresponding to the target task information cannot be executed.
The task execution end of the embodiment may further include the following after executing the task corresponding to the execution target task information in S202: acquiring a task execution result of target task information; and sending the task execution information comprising the task execution result and the target token to a task scheduling end.
That is, when the task execution end of the embodiment sends the task execution result to the task scheduling end, the stored target token is sent to the task scheduling end together, so that the task scheduling end performs verification according to the token, thereby improving the safety and accuracy of the task execution result received by the task scheduling end.
Fig. 3 is a schematic diagram according to a third embodiment of the present disclosure. Fig. 3 shows a flow chart of interaction among the input end, the task scheduling end and the task execution end in this embodiment: the input end sends a task request to the task scheduling end; after the task scheduling end passes the verification, acquiring task information to be executed according to a task request, and determining a task executing end; the task scheduling end sends a notification message to the task execution end; after receiving the notification message, the task execution end sends a response message to the task scheduling end; after the task scheduling end checks the response message and determines that the response message passes, a target token is sent to the task execution end; the target task execution end stores the target token; the task scheduling end sends target task information to the task executing end; the task execution end verifies the target task information and executes the target task information after the target task information passes the verification; the task execution end sends task execution information to the task scheduling end; and after the task scheduling end checks the task execution information and determines that the task execution information passes, sending a task execution result in the task execution information to the input end.
Fig. 4 is a schematic diagram according to a fourth embodiment of the present disclosure. As shown in fig. 4, the task execution device 400 of the present embodiment is applied to a task scheduling end, and includes:
an acquiring unit 401, configured to acquire task information to be executed;
a determining unit 402, configured to determine a task execution end according to the task information to be executed;
the generating unit 403 is configured to generate a target token corresponding to the task execution end, and send the target token to the task execution end;
the first sending unit 404 is configured to send target task information to the task execution end, so that the task execution end executes a task corresponding to the target task information, where the target task information includes the target token.
When acquiring task information to be executed, the acquiring unit 401 may use the task information input by the input end as the task information to be executed, or may use the task information acquired from the task center at regular time as the task information to be executed.
When acquiring the task information to be executed, the acquiring unit 401 may adopt the following alternative implementation manners: receiving a task request, wherein the task request comprises a request token and task information; under the condition that the request token is consistent with the preset request token, the task information obtained by analyzing the task request is used as the task information to be executed; the preset request token at the task scheduling end in this embodiment is unique.
That is, the acquiring unit 401 checks the task request according to the request token, so that only if the task request is determined to pass the check, the task information included in the task request is acquired as the task information to be executed, thereby avoiding the problem that the task scheduling end distributes the task information with the security risk to the task execution end, and improving the security of task execution.
If the obtaining unit 401 determines that the request token is inconsistent with the preset request token, it may return a prompt message to the input end sending the task request, where the prompt message is used to prompt that the input end fails to check due to the error of the token, so that the task corresponding to the task request cannot be executed.
After the task scheduling end of the present embodiment acquires the task information to be executed by the acquiring unit 401, the determining unit 402 determines the task execution end according to the task information to be executed; the number of task execution ends determined by the determining unit 402 may be one or more.
When determining the task execution end according to the task information to be executed, the determining unit 402 may adopt the following alternative implementation manners: determining the number of task execution ends required by task execution according to the task information to be executed and the attribute information of the execution ends; and selecting the execution ends corresponding to the determined number of the task execution ends as task execution ends.
When selecting the execution ends corresponding to the determined number of execution ends, the determining unit 402 may randomly select the execution ends corresponding to the determined number of execution ends, or may select the execution ends corresponding to the determined number of execution ends according to the load condition of the execution ends at the current moment, where the load condition meets the task execution requirement.
The determining unit 402 may determine, after determining task execution ends according to the task information to be executed, target task information corresponding to each task execution end, where the target task information is task information corresponding to a task executed by each target task execution end.
After the task scheduling end of the present embodiment determines the task execution end by the determining unit 402, the generating unit 403 generates a target token corresponding to the task execution end, and sends the target token to the task execution end.
The generating unit 403 may adopt the following alternative implementation manners when generating the target token corresponding to the task execution end: sending a notification message to a task execution end, wherein the notification message is used for notifying the task execution end to execute a task; receiving response information sent by a task execution terminal aiming at the notification message, wherein the response information comprises a registration token; generating a target token corresponding to the task execution end when the registration token is determined to be consistent with the preset registration token; the preset registration token at the task scheduling end in this embodiment is unique.
In addition, after the determining unit 402 determines the task execution end, the generating unit 403 may directly generate the target token corresponding to the task execution end, and then send the target token to the task execution end, without sending the notification message and receiving the response message.
When sending the notification message to the task execution end, the generating unit 403 may obtain the address information of the task execution end according to the attribute information of the task execution end, and then send the notification message to the task execution end according to the obtained address information.
The generating unit 403 receives a response message sent by the task execution end after sending the notification message to the task execution end, where the response message includes the registration token.
That is, the generating unit 403 selects the notification execution end as the task execution end by sending the notification message to the task execution end, and receives the response message sent by the task execution end, so that after the comparison between the registration token and the preset registration token is completed, the target token is generated, and the accuracy of generating the target token can be improved.
The generating unit 403 may adopt the following alternative implementation manners when generating the target token corresponding to the task execution end: generating a random token; taking the generated random token as a target token corresponding to the task execution end; the generating unit 403 may also record the correspondence between the target token and the task execution end.
The generating unit 403 may record the corresponding relation between the target token and the task execution end in a preset registry, where the task execution end and the corresponding target token are recorded; the preset registry contains the corresponding relation between the attribute information of the task execution end and the target token.
It may be understood that, if there are multiple task execution ends that complete the comparison between the registration token and the preset registration token, the generating unit 403 may generate the target tokens corresponding to each task execution end, and send different target tokens to different task execution ends.
After generating the target token corresponding to the task execution end, the generating unit 403 sends the generated target token to the task execution end, so that the task execution end checks the target task information received next time according to the target token received this time.
After the generating unit 403 sends the target token to the task execution end, the task scheduling end of the present embodiment sends target task information to the task execution end by the first sending unit 404, so that the task execution end executes a task corresponding to the target task information, where the target task information includes the target token corresponding to the target execution server.
When sending the target task information to the task execution end, the first sending unit 404 may first obtain the target task information corresponding to the task execution end, then add the target token corresponding to the task execution end to the obtained target task information, and then send the target task information including the target token to the task execution end.
When the first sending unit 404 obtains the target task information corresponding to the task execution end, the task information corresponding to the attribute information of the task execution end in the task information to be executed may be used as the target task information; the target task information may be all of the task information to be executed, or may be a part of the task information to be executed.
The task execution device 400 applied to the task scheduling end of the present embodiment may further include a third receiving unit 405, configured to execute the following: receiving task execution information sent by a task execution end, wherein the task execution information comprises a task execution result and a first appointed token; and under the condition that the first designated token is consistent with the target token, analyzing the task execution information to obtain a task execution result.
That is, after receiving the task execution information sent by the task execution end, the third receiving unit 405 performs verification of the task execution information according to the first designated token included in the task execution information and the target token corresponding to the task execution end, so that after determining that the task execution information passes the verification, the task execution information is parsed to obtain a task execution result, thereby avoiding obtaining a task execution result with a security risk, and further improving the security of task execution.
The third receiving unit 405 may further send the task execution result to an input end that sends a task request to the task scheduling end after obtaining the task execution result in the task execution information, so as to display the task execution result at the input end.
Fig. 5 is a schematic diagram according to a fifth embodiment of the present disclosure. As shown in fig. 5, the task execution device 500 of the present embodiment is applied to a task execution end, and includes:
a second receiving unit 501, configured to receive target task information sent by a task scheduling end, where the target task information includes a second instruction token;
and the execution unit 502 is configured to execute a task corresponding to the target task information when it is determined that the second specified token is consistent with a target token, where the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task execution end.
The second receiving unit 501 may also receive the target token sent in advance by the task scheduling end before receiving the target task information sent by the task scheduling end.
The task execution device 500 of the present embodiment may further include a first receiving unit 503, configured to execute the following: receiving a notification message sent by a task scheduling end, wherein the notification message is used for notifying a task execution end to execute a task by the task scheduling end; aiming at the notification message, sending a response message to the task scheduling end, wherein the response message comprises a registration token; and receiving a target token sent by the task scheduling end, wherein the target token is generated under the condition that the registration token is consistent with a preset registration token.
That is, the first receiving unit 503 can receive the target token sent by the task scheduling end after receiving the notification message sent by the task scheduling end and sending the response message to the task scheduling end, and the task execution end sends the response message added with the registration token to the task scheduling end, so that the response message with security risk received by the task scheduling end can be avoided, and the communication security between the task scheduling end and the task execution end is improved.
The target token received by the second receiving unit 501 before receiving the target task information may be sent by the task scheduling end directly to the task execution end after determining the task execution end.
The first receiving unit 503 may first acquire the registration token when transmitting the response message to the task scheduling end, and then add the acquired registration token to the response message, thereby transmitting the response message including the registration token to the task scheduling end for the task scheduling end to check and generate the target token.
The second receiving unit 501 or the first receiving unit 503 may further use the target token as a communication token of the machine after receiving the target token, so as to use the target token to communicate with the scheduling server.
It can be understood that after the target token is stored, if it is determined that the task execution information is sent to the task scheduling end, the target token can be destroyed, so that the next task execution is prevented from being affected.
After the task execution end of the present embodiment receives the target task information sent by the task scheduling end by the second receiving unit 501, the execution unit 502 executes the task corresponding to the target task information if it is determined that the second instruction token is identical to the target token.
That is, the execution unit 502 performs verification of the target task information according to the target tokens received twice, and executes the task corresponding to the target task information after determining that the target task information passes the verification, thereby avoiding execution of the task information with security risk, and improving security and accuracy of task execution.
In addition, if the execution unit 502 determines that the second designated token is inconsistent with the target token, a prompt message may be sent to the task scheduling end, so as to prompt the task scheduling end that the verification fails due to the error of the token, and thus the target task information cannot be executed.
The task execution device 500 applied to the task execution end of the present embodiment may further include a second sending unit 504, configured to execute the following: acquiring a task execution result of target task information; and sending the task execution information comprising the task execution result and the target token to a task scheduling end.
That is, when the second sending unit 504 sends the task execution result to the task scheduling end, the stored target token is sent to the task scheduling end together, so that the task scheduling end performs verification according to the target token, thereby improving the security and accuracy of the task execution result received by the task scheduling end.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
As shown in fig. 6, is a block diagram of an electronic device of a task execution method according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM602, and RAM603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, such as a task execution method. For example, in some embodiments, the task execution method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608.
In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the task performing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the task execution method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable task performing device such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram block or blocks to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a presentation device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for presenting information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (19)

1. A task execution method is applied to a task scheduling end and comprises the following steps:
acquiring task information to be executed;
determining a task execution end according to the task information to be executed;
generating a target token corresponding to the task execution end, and sending the target token to the task execution end;
the method comprises the steps that target task information is sent to a task execution end, the target task information comprises a second designated token, and the second designated token is used for executing a task corresponding to the target task information when the task execution end determines that the second designated token is consistent with a target token sent by a task scheduling end in advance;
wherein, the generating the target token corresponding to the task execution end includes:
generating a random token;
and taking the random token as a target token corresponding to the task execution end.
2. The method of claim 1, wherein the obtaining task information to be performed comprises:
receiving a task request, wherein the task request comprises a request token and task information;
and under the condition that the request token is consistent with a preset request token, the task information obtained by analyzing the task request is used as the task information to be executed.
3. The method of claim 1, wherein the determining, according to the task information to be performed, a task execution end includes:
determining the number of execution ends required by task execution according to the task information to be executed and the attribute information of the execution ends;
and selecting the execution ends corresponding to the number of the execution ends as the task execution ends.
4. The method of claim 1, wherein the generating the target token corresponding to the task execution end comprises:
sending a notification message to the task execution end, wherein the notification message is used for notifying the task execution end to execute a task;
receiving a response message sent by the task execution terminal aiming at the notification message, wherein the response message comprises a registration token;
and generating a target token corresponding to the task execution end when the registration token is determined to be consistent with the preset registration token.
5. The method of any one of claims 1-4, further comprising,
receiving task execution information sent by the task execution end, wherein the task execution information comprises a task execution result and a first appointed token;
and under the condition that the first appointed token is determined to be consistent with the target token, analyzing the task execution information to obtain a task execution result.
6. A task execution method is applied to a task execution end and comprises the following steps:
receiving target task information sent by a task scheduling end, wherein the target task information comprises a second designated token;
executing a task corresponding to the target task information under the condition that the second designated token is determined to be consistent with a target token, wherein the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task executing end;
wherein the task scheduling end performs the method of any one of the preceding claims 1-5.
7. The method of claim 6, further comprising,
receiving a notification message sent by the task scheduling end, wherein the notification message is used for notifying the task execution end to execute a task;
for the notification message, sending a response message to the task scheduling end, wherein the response message comprises a registration token;
and receiving a target token sent by the task scheduling end, wherein the target token is generated under the condition that the registration token is consistent with a preset registration token.
8. The method of any one of claims 6-7, further comprising,
acquiring a task execution result of the target task information;
And sending the task execution information comprising the task execution result and the target token to the task scheduling end.
9. A task execution device is applied to a task scheduling end and comprises:
the acquisition unit is used for acquiring task information to be executed;
the determining unit is used for determining a task executing end according to the task information to be executed;
the generating unit is used for generating a target token corresponding to the task execution end and sending the target token to the task execution end;
the first sending unit is used for sending target task information to the task execution end, wherein the target task information comprises a second designated token, and the second designated token is used for executing a task corresponding to the target task information when the task execution end determines that the target task information is consistent with a target token sent in advance by the task scheduling end;
the generating unit specifically executes when generating a target token corresponding to the task execution end:
generating a random token;
and taking the random token as a target token corresponding to the task execution end.
10. The apparatus according to claim 9, wherein the acquiring unit, when acquiring the task information to be executed, specifically performs:
Receiving a task request, wherein the task request comprises a request token and task information;
and under the condition that the request token is consistent with a preset request token, the task information obtained by analyzing the task request is used as the task information to be executed.
11. The apparatus according to claim 9, wherein the determining unit, when determining the task execution end according to the task information to be executed, specifically performs:
determining the number of execution ends required by task execution according to the task information to be executed and the attribute information of the execution ends;
and selecting the execution ends corresponding to the number of the execution ends as the task execution ends.
12. The apparatus according to claim 9, wherein the generating unit, when generating the target token corresponding to the task execution end, specifically performs:
sending a notification message to the task execution end, wherein the notification message is used for notifying the task execution end to execute a task;
receiving a response message sent by the task execution terminal aiming at the notification message, wherein the response message comprises a registration token;
and generating a target token corresponding to the task execution end when the registration token is determined to be consistent with the preset registration token.
13. The apparatus according to any of claims 9-12, further comprising a third receiving unit to perform:
receiving task execution information sent by the task execution end, wherein the task execution information comprises a task execution result and a first appointed token;
and under the condition that the first appointed token is determined to be consistent with the target token, analyzing the task execution information to obtain a task execution result.
14. A task execution device is applied to a task execution end and comprises:
the second receiving unit is used for receiving target task information sent by the task scheduling end, wherein the target task information comprises a second designated token;
the execution unit is used for executing the task corresponding to the target task information under the condition that the second designated token is determined to be consistent with the target token, wherein the target token is a token sent in advance by the task scheduling end, and the target token corresponds to the task execution end;
wherein the task scheduling end comprises the device of any one of claims 9-13.
15. The apparatus of claim 14, further comprising a first receiving unit to perform:
receiving a notification message sent by the task scheduling end, wherein the notification message is used for notifying the task execution end to execute a task;
For the notification message, sending a response message to the task scheduling end, wherein the response message comprises a registration token;
and receiving a target token sent by the task scheduling end, wherein the target token is generated under the condition that the registration token is consistent with a preset registration token.
16. The apparatus according to any of claims 14-15, further comprising a second transmitting unit to perform:
acquiring a task execution result of the target task information;
and sending the task execution information comprising the task execution result and the target token to the task scheduling end.
17. A task execution system comprises a task scheduling end and a task execution end:
the task scheduling end is configured to perform the method according to any one of claims 1 to 5, and the task performing end is configured to perform the method according to any one of claims 6 to 8.
18. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
19. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8.
CN202210592634.5A 2022-05-27 2022-05-27 Task execution method, device, electronic equipment and readable storage medium Active CN115080205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210592634.5A CN115080205B (en) 2022-05-27 2022-05-27 Task execution method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210592634.5A CN115080205B (en) 2022-05-27 2022-05-27 Task execution method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN115080205A CN115080205A (en) 2022-09-20
CN115080205B true CN115080205B (en) 2023-07-25

Family

ID=83248781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210592634.5A Active CN115080205B (en) 2022-05-27 2022-05-27 Task execution method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115080205B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256721A (en) * 2017-11-16 2018-07-06 中国平安财产保险股份有限公司 A kind of method for scheduling task, terminal device and medium
CN111831420A (en) * 2020-07-20 2020-10-27 北京百度网讯科技有限公司 Method and device for task scheduling, electronic equipment and computer-readable storage medium
CN113485820A (en) * 2021-08-03 2021-10-08 北京百度网讯科技有限公司 Task scheduling system and implementation method, device and medium thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014167679A (en) * 2013-02-28 2014-09-11 Ricoh Co Ltd Job execution control system, job execution system, job execution control method and program
US11201738B2 (en) * 2019-05-02 2021-12-14 Shopify Inc. Systems and methods for associating a user with a task executed in a computing system
CN111880919B (en) * 2020-07-29 2024-04-02 平安国际融资租赁有限公司 Data scheduling method, system and computer equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256721A (en) * 2017-11-16 2018-07-06 中国平安财产保险股份有限公司 A kind of method for scheduling task, terminal device and medium
CN111831420A (en) * 2020-07-20 2020-10-27 北京百度网讯科技有限公司 Method and device for task scheduling, electronic equipment and computer-readable storage medium
CN113485820A (en) * 2021-08-03 2021-10-08 北京百度网讯科技有限公司 Task scheduling system and implementation method, device and medium thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Data token heuristic scheduling of the Kalman algorithm onto a message-passing multiprocessor system;V.Vaidehi 等;《Control Engineering Practice》;第1691-1703页 *
关于计算机通信中的传输控制技术研究;彭澎;《电脑知识与技术》;第49-50页 *

Also Published As

Publication number Publication date
CN115080205A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN113766487B (en) Cloud mobile phone information acquisition method, device, equipment and medium
WO2023115836A1 (en) Method and apparatus for controlling distributed operation system, and device, medium and program product
CN113377381B (en) Distribution method and device of small program package, electronic equipment and medium
CN113037489B (en) Data processing method, device, equipment and storage medium
CN114186206A (en) Login method and device based on small program, electronic equipment and storage medium
CN115080205B (en) Task execution method, device, electronic equipment and readable storage medium
CN114374703B (en) Cloud mobile phone information acquisition method, device, equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN114371863A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN106878369B (en) Service processing method and device
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN114610511A (en) Input verification method and device, electronic equipment and storage medium
CN113220282B (en) Development processing method, device and storage medium for applet
CN116506165A (en) Cloud mobile phone identification method and device, electronic equipment and readable storage medium
CN116232638A (en) Access request processing method and device, electronic equipment and readable storage medium
CN115150310A (en) Request generation method, processing method, device, electronic equipment and storage medium
CN116382787A (en) Method and device for loading animation in page, electronic equipment and readable storage medium
CN116541224A (en) Performance test method, device, electronic equipment and readable storage medium
CN115309717A (en) Database loading method, device, equipment, medium and computer program product
CN117076168A (en) SDK processing method, device, equipment and storage medium
CN116088868A (en) Project application method, device, equipment and program product
CN116846796A (en) Server testing method, device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant