CN112905313A - Task processing method and device and electronic equipment - Google Patents

Task processing method and device and electronic equipment Download PDF

Info

Publication number
CN112905313A
CN112905313A CN202110080833.3A CN202110080833A CN112905313A CN 112905313 A CN112905313 A CN 112905313A CN 202110080833 A CN202110080833 A CN 202110080833A CN 112905313 A CN112905313 A CN 112905313A
Authority
CN
China
Prior art keywords
task
instruction
processing
operation instruction
type
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.)
Pending
Application number
CN202110080833.3A
Other languages
Chinese (zh)
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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202110080833.3A priority Critical patent/CN112905313A/en
Publication of CN112905313A publication Critical patent/CN112905313A/en
Pending legal-status Critical Current

Links

Images

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

Abstract

The application is applicable to the technical field of computers, and provides a task processing method, which comprises the following steps: acquiring a task instruction, wherein the task instruction comprises a task type and an operation instruction; determining a corresponding target task processing process according to the task type; calling a target task processing process to process the operation instruction to obtain a processing result; and calling a target task processing process to feed back a processing result. According to the method and the device, when the electronic equipment interacts with a plurality of other devices, the electronic equipment can call different processes to carry out interaction processing based on the task type of the received task instruction, and the compatibility of the electronic equipment is improved.

Description

Task processing method and device and electronic equipment
Technical Field
The application belongs to the technical field of computers, and particularly relates to a task processing method and device and electronic equipment.
Background
Electronic devices, such as vehicle-mounted terminal devices, often have situations that require data interaction with multiple other devices. That is, in the related art, the electronic device needs to be compatible with a plurality of other devices at the same time.
Disclosure of Invention
The embodiment of the application provides a task processing method and device and electronic equipment.
In a first aspect, an embodiment of the present application provides a task processing method, where the method includes:
acquiring a task instruction, wherein the task instruction comprises a task type and an operation instruction;
determining a corresponding target task processing process according to the task type;
calling a target task processing process to process the operation instruction to obtain a processing result;
and calling a target task processing process to feed back a processing result.
Further, the task type comprises a function task and/or a terminal maintenance task;
determining a corresponding target task processing process according to the task type, specifically comprising:
if the task type is a functional task, determining that the first process is a target task processing process;
if the task type is a terminal maintenance task, determining that a second process is a target task processing process;
and if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
Further, invoking a target task processing process to process the operation instruction specifically includes:
when the task type is a functional task, calling a first process to process an operation instruction;
when the task type is a terminal maintenance task, calling a second process to process an operation instruction;
when the task type comprises a function task and a terminal maintenance task, calling a first process to process the task type into an operation instruction of the function task; and calling a second process to process the task type into an operation instruction of the terminal maintenance task.
Further, when the task type includes a terminal maintenance task, invoking a target task processing process to process the operation instruction, specifically including:
calling a second process to receive an operation instruction;
sending a communication instruction adaptive to the operation instruction to the first process, wherein the communication instruction is used for controlling the first process to enter a matching state of executing the operation instruction in cooperation with the second process;
and calling a second process to execute the operation instruction according to the feedback information that the first process enters the matching state.
Further, sending a communication instruction adapted to the operation instruction to the first process specifically includes:
and writing the communication instruction into the message queue so as to transmit the communication instruction to the first process through the message queue.
Further, when the operation instruction includes an upgrade operation, the cooperation state is a state of stopping processing the current task; and when the operation instruction does not comprise the upgrading operation, the coordination state is the state of processing the current task in parallel.
In a second aspect, an embodiment of the present application provides a task processing device, including:
the instruction acquisition unit is used for acquiring task instructions, and the task instructions comprise task types and operation instructions;
the process determining unit is used for determining a corresponding target task processing process according to the task type;
the instruction processing unit is used for calling a target task processing process to process the operation instruction to obtain a processing result;
and the result feedback unit is used for calling the target task processing process to feed back the processing result.
Further, the task type comprises a function task and/or a terminal maintenance task;
a process determining unit, specifically configured to:
if the task type is a functional task, determining that the first process is a target task processing process;
if the task type is a terminal maintenance task, determining that a second process is a target task processing process;
and if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
Further, when the task type includes a terminal maintenance task, invoking a target task processing process to process the operation instruction, specifically including:
calling a second process to receive an operation instruction;
sending a communication instruction adaptive to the operation instruction to the first process, wherein the communication instruction is used for controlling the first process to enter a matching state of executing the operation instruction in cooperation with the second process;
and calling a second process to execute the operation instruction according to the feedback information that the first process enters the matching state.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the task processing method when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the task processing method.
In a fifth aspect, the present application provides a computer program product, which when run on an electronic device, causes the electronic device to execute the task processing method of any one of the above first aspects.
Compared with the related technology, the embodiment of the application has the beneficial effects that: when the electronic equipment interacts with a plurality of other equipment, the electronic equipment can call different processes to carry out interaction processing based on the task type of the received task instruction, and the compatibility of the electronic equipment is improved.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system architecture diagram of a task processing method application provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a task processing method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a task processing method according to another embodiment of the present application;
FIG. 4 is a schematic illustration of the type of communication instructions provided by an embodiment of the present application;
FIG. 5 is a timing diagram illustrating a task processing method according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a task processing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In order to explain the technical means of the present application, the following examples are given below.
Referring to fig. 1, a system architecture diagram of a task processing method application provided in an embodiment of the present application is shown.
As shown in fig. 1, the system architecture may include a vehicle 101, an in-vehicle terminal apparatus 102, and a vehicle management server 103 and a target server 104. The vehicle-mounted terminal 102 is usually disposed On the vehicle 101, and the vehicle 101 and the vehicle-mounted terminal 102 usually implement a communicative connection through a communication interface On the vehicle, such as an On Board Diagnostics (OBD) interface, so as to implement interaction of data and/or signaling. A plurality of processes, such as a first process 1021 and a second process 1022, may run on the vehicle-mounted terminal apparatus 102.
The vehicle 101 may be various vehicles. Such as unmanned vehicles, cars, trucks, etc. It is noted that the vehicle 101 may also be a variety of other vehicles. Such as an aircraft, a ship.
The in-vehicle terminal apparatus 102 may be an electronic apparatus for collecting vehicle data. The in-vehicle terminal apparatus 102 may transmit the collected vehicle data of the vehicle 101 to the vehicle management server 103. The in-vehicle terminal apparatus 102 can interact with the vehicle management server 103 and the target server 104. During interaction, the vehicle-mounted terminal device 102 may obtain a task instruction, where the task instruction includes a task type and an operation instruction; determining a corresponding target task processing process according to the task type; calling a target task processing process to process the operation instruction to obtain a processing result; and calling a target task processing process to feed back a processing result.
The vehicle management server 103 is generally a server for managing vehicles, and for example, the vehicle management server may perform scheduling management on the vehicles based on vehicle data collected by the in-vehicle terminal device. In practice, the vehicle management server and the in-vehicle terminal device may be implemented as the same object.
The target server 104 is generally a server for managing and maintaining the in-vehicle terminal device.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
Referring to fig. 2, a schematic flowchart of a task processing method provided in an embodiment of the present application is shown, where the task processing method shown in fig. 2 includes:
step 201, acquiring a task instruction, where the task instruction includes a task type and an operation instruction.
In the present embodiment, the execution subject of the task processing method is typically an electronic device (for example, the in-vehicle terminal device 102 shown in fig. 1). The execution main body can receive task instructions sent by other devices connected in communication through a network.
Wherein the task type is typically the type of task that needs to be performed. In practice, the task type may include, but is not limited to, at least one of: the type of the function task, the type of the terminal maintenance task, etc. The type of functional task is typically used to instruct the execution body to perform the primary function. Taking the vehicle-mounted terminal device as an example, if the main function of the vehicle-mounted terminal device is to collect vehicle data. Then, at this time, when the vehicle-mounted terminal device is taken as the execution subject of the method, the type of the functional task may instruct the vehicle-mounted terminal device to execute the collection of the vehicle data. The type of terminal maintenance task is typically used to instruct the execution master to perform the maintenance function.
The operation instruction is generally an instruction for controlling the execution subject to execute an operation. In practice, the operation instruction may be an instruction for controlling the execution main body to execute an operation corresponding to the main function, or may be an instruction for controlling the execution main body to execute an operation corresponding to the maintenance function. In practice, the operation instructions generally correspond to the task type. For example, if the task type is a type of a functional task, the operation instruction may be an instruction for controlling the execution main body to execute an operation corresponding to the main function. If the task type is a terminal maintenance task type, the operation instruction may be an instruction for controlling the execution main body to execute an operation corresponding to the maintenance function.
Here, for convenience of description, the operation corresponding to the maintenance function may be referred to as a maintenance operation. In practice, maintenance operations may include, but are not limited to: operations to wake up the device, operations to upgrade an application, operations to upgrade device controller software, operations to send device parameters, operations to set device parameters, operations to send device log data, and the like.
Wherein the operation of waking up the device is typically an operation of waking up the electronic device. As an example, the operation of waking up the device may be: and assigning the value of the state parameter of the electronic equipment to a first preset value. The first preset value is used for indicating that the electronic equipment is in a working state. The electronic device status parameter may be a preset parameter for indicating an operating status of the electronic device. The first preset value may be a preset value. The operation of upgrading an application generally refers to an operation of upgrading an application installed in an electronic device. The operation of upgrading the controller software of the device generally refers to an operation of upgrading the software of the controller of the electronic device. The operation of sending the device parameter generally refers to an operation of sending a value of the parameter of the electronic device to the target server. The operation of setting the device parameters generally refers to an operation of assigning values to the parameters of the electronic device. The operation of sending the device log data is generally an operation of sending the log data of the electronic device to a target server. It should be noted that the embodiment does not limit the specific implementation form of the operations.
Step 202, determining a corresponding target task processing process according to the task type.
The target task processing process is generally a process for processing an operation instruction. In practice, there may typically be multiple processes in the execution body. Here, each process in the execution body may be associated with a task type in advance. In this way, the execution main body can determine the target task processing process directly based on the task type. In practical applications, multiple processes in the execution main body are usually implemented in the same application.
Optionally, the task type includes a function task and/or a terminal maintenance task. At this time, determining a corresponding target task processing process according to the task type specifically includes: and if the task type is the functional task, determining that the first process is a target task processing process. And if the task type is the terminal maintenance task, determining that the second process is a target task processing process. And if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
Here, when the task type is a type of a functional task, the execution subject may determine the first process as a target task processing process. When the task type is a type of a terminal maintenance task, the execution subject may determine the second process as a target task processing process. When the task type includes both the type of the function task and the type of the terminal maintenance task, the execution main body may determine the first process and the second process as the target task processing process at the same time.
In practice, the first process may be a process for implementing the main functions of the electronic device. The second process may be a process for implementing a maintenance function of the electronic device. The implementation mode can realize that proper processes are called to process the operation instructions. Compared with the mode that all tasks are realized by the same process, the realization mode can reduce the task amount processed by a single process and is beneficial to improving the interaction efficiency between the electronic equipment and other equipment.
Step 203, calling a target task processing process to process the operation instruction to obtain a processing result.
In this embodiment, when the target task processing process is determined, the execution main body may directly invoke the target task processing process to process the operation instruction, so as to obtain a processing result.
Optionally, the invoking the target task processing process to process the operation instruction specifically includes: and when the task type is a functional task, calling a first process to process the operation instruction. And when the task type is the terminal maintenance task, calling a second process to process the operation instruction. And when the task types comprise a function task and a terminal maintenance task, calling a first process to process the operation instruction of the task type as the function task, and calling a second process to process the operation instruction of the task type as the terminal maintenance task.
Here, when the task type is a type of a functional task, the execution main body may call the first process to process the operation instruction. And when the task type is the type of the terminal maintenance task, the execution main body can call a second process to process the operation instruction. When the task type includes both the type of the function task and the type of the terminal maintenance task, the execution main body may call an operation instruction corresponding to the first process processing task type as the type of the function task, and call an operation instruction corresponding to the second process processing task type as the type of the terminal maintenance task. The implementation mode can realize that proper processes are called to process the operation instructions. Compared with the mode that all tasks are realized by the same process, the realization mode can reduce the task amount processed by a single process and is beneficial to further improving the interaction efficiency between the electronic equipment and other equipment.
And step 204, calling a target task processing process to feed back a processing result.
In this embodiment, the executing entity may implement the feedback of the processing result obtained in step 203 to other devices connected in communication by calling the target task processing process, and in practice, the processing result is usually fed back to the sender of the task instruction. For example, if the task instruction is received from device a, the sender of the task instruction is device a.
The method provided by the embodiment can realize that when the electronic equipment interacts with a plurality of other equipment, the electronic equipment can call different processes to perform interactive processing based on the task type of the received task instruction, which is beneficial to improving the compatibility of the electronic equipment.
Referring to fig. 3, which is a flowchart illustrating a task processing method provided in an embodiment of the present application, as shown in fig. 3, when a task type includes a terminal maintenance task, the foregoing call target task processing process processing operation instruction may be implemented by following steps 301 and 303.
Step 301, calling a second process to receive an operation instruction.
Here, when the task type includes a terminal maintenance task, the operation instruction is generally an instruction for controlling the second process to perform a maintenance operation.
In practice, maintenance operations may include, but are not limited to: operations to wake up the device, operations to upgrade an application, operations to upgrade device controller software, operations to send device parameters, operations to set device parameters, operations to send device log data, and the like.
Wherein the operation of waking up the device is typically an operation of waking up the electronic device. As an example, the operation of waking up the device may be: and assigning the value of the state parameter of the electronic equipment to a first preset value. The first preset value is used for indicating that the electronic equipment is in a working state. The electronic device status parameter may be a preset parameter for indicating an operating status of the electronic device. The first preset value may be a preset value. The operation of upgrading an application generally refers to an operation of upgrading an application installed in an electronic device. The operation of upgrading the controller software of the device generally refers to an operation of upgrading the software of the controller of the electronic device. The operation of sending the device parameter generally refers to an operation of sending a value of the parameter of the electronic device to the target server. The operation of setting the device parameters generally refers to an operation of assigning values to the parameters of the electronic device. The operation of sending the device log data is generally an operation of sending the log data of the electronic device to a target server. It should be noted that the embodiment does not limit the specific implementation form of the operations.
In the present embodiment, the execution subject of the task processing method is typically an electronic device (for example, the in-vehicle terminal device 102 shown in fig. 1). The execution main body may call the second process to receive an operation instruction for controlling the second process to perform the maintenance operation.
Step 302, sending a communication instruction adapted to the operation instruction to the first process, where the communication instruction is used to control the first process to enter a coordination state in which the first process coordinates with the second process to execute the operation instruction.
The communication instruction is generally an instruction for controlling the first process to enter a coordination state in which the first process coordinates the second process to perform the maintenance operation. The orchestrated state is typically a state in which maintenance operations are performed in orchestration with the second process.
Optionally, when the operation instruction includes an upgrade operation, the coordination state is a state in which processing of the current task is stopped. And when the operation instruction does not comprise the upgrading operation, the coordination state is the state of processing the current task in parallel. As an example, if the maintenance operation is: and (5) upgrading the operation of the application. The coordination state may be: a state of stopping collecting data and stopping sending data. As another example, if the maintenance operation is: the operation of the device controller software is upgraded. The coordination state may be: and processing the state of the current task in parallel. As another example, if the maintenance operation is: operation of transmitting device parameters. The coordination state may be: and processing the state of the current task in parallel.
In practice, the communication instructions are generally of different types for different maintenance operations. Fig. 4 is a schematic diagram of types of communication commands provided in an embodiment of the present application. As shown in fig. 4, different types of communication instructions can be implemented by assigning different values to the parameters. If the value of the parameter is 0x00, the type of the communication command is to wake up the device. At this time, the first process enters a coordination state in which the second process is coordinated to execute the operation of waking up the device when receiving the communication instruction.
In this embodiment, the executing entity may send the communication instruction to the first process by using a technology in the prior art or a technology in future development. Thus, the first process may enter the orchestrated state based on the communication instruction.
In practice, the execution subject may send the communication instruction adapted to the maintenance operation to the first process by: and writing the communication instruction into the message queue so as to transmit the communication instruction to the first process through the message queue.
The message queue is usually a preset message queue. A message queue is typically a container that holds messages during their transmission. The role of the message queue is to guarantee reliable delivery of messages. When a message sender sends a message to a message receiver via a message queue, if the message receiver is temporarily unavailable, the message queue will typically hold the message until it can be successfully delivered.
Here, the execution subject may write the communication instruction into a message queue, so as to transfer the communication instruction of the second process to the first process through the message queue. Which helps to ensure reliable transmission of messages between two processes. In addition, since the message queue can save the message when the message recipient is temporarily unavailable. Therefore, the communication instruction is transmitted to the first process through the message queue, so that the communication instruction can be transmitted to the first process under the condition that the first process is not busy, and the data processing efficiency of the first process for processing own business is guaranteed.
In practical applications, the second process may be a process for interacting with the target server to implement maintenance on the electronic device. The first process may be a process for interacting with a vehicle management server to effect management of the vehicle. The first and second processes may typically be implemented in the same application on the in-vehicle terminal device. The second process transmits the communication instruction to the first process through the message queue, and interaction efficiency of interaction between the first process and the vehicle management server can be guaranteed when the second process interacts with the first process.
It should be noted that, due to the program processing logic of the vehicle management server, the program processing logic is different from that of the target server, and the data processing protocol followed by the vehicle management server is also generally different from that followed by the target server. Two mutually independent processes are adopted in the same application to interact with the target server and the vehicle management server respectively, so that the vehicle management and the vehicle-mounted terminal equipment management can be realized, the complexity of the application program is reduced, the development difficulty is reduced, and the development cost of the application program can be saved.
Step 303, according to the feedback information that the first process has entered the coordination state, a second process is called to execute the operation instruction.
The feedback information is generally information indicating that the first process has entered the coordination state.
In this embodiment, after receiving feedback information sent by the first process for the communication instruction, the execution main body may start to execute the maintenance operation by calling the second process to execute the operation instruction, so as to implement maintenance on the electronic device. In practice, after the second process performs the maintenance operation, the second process usually sends the operation result of performing the maintenance operation to the target server. Therefore, the target server can timely and accurately know the condition of the electronic equipment. The operation result generally includes a result of successful operation and a result of failed operation.
According to the method provided by the embodiment, the independent process for maintaining the electronic equipment is preset in the electronic equipment, the process is interacted with the target server to maintain the electronic equipment where the process is located, and the electronic equipment can be maintained. It should be noted that, the electronic device is maintained in time, the problems of the electronic device can be found in time, and the problems of the electronic device can be cleared in time. Compared with the prior art that after the electronic equipment breaks down, the electronic equipment troubleshooting method and the electronic equipment troubleshooting system find out the workers to disassemble and maintain on site, efficiency of troubleshooting of the electronic equipment can be improved, and manpower and material resources are saved.
With continuing reference to fig. 5, fig. 5 is a timing diagram of a task processing method provided by an embodiment of the present application. The specific implementation flow of the task processing method provided by the application can include the following steps:
step 501, the vehicle-mounted terminal equipment is started.
Here, it is general that the in-vehicle terminal device is started at the same time when the vehicle is started, for example, when the vehicle is ignited. When the vehicle-mounted terminal equipment is started, the first process and the second process are started simultaneously.
Step 502, the first process collects vehicle data and sends the collected vehicle data to a vehicle management server.
In step 503, the second process sends a heartbeat packet to the target server.
In step 504, the target server sends an operation instruction to the second process.
Here, the operation instruction is generally an instruction for controlling the second process to perform a maintenance operation. Maintenance operations may include, but are not limited to: waking up the device, upgrading the application, upgrading the device controller software, sending device parameters, setting device parameters, and sending device log data.
Step 505, the second process sends a communication instruction to the first process.
Here, the communication instruction is generally an instruction for controlling the second process to enter the coordination state. The coordination state is a state in which maintenance operation is performed in coordination with the first process. In practice, a first process sends communication instructions to a second process, typically through a message queue.
Step 506, the first process sends feedback information to the second process for the communication instruction.
Here, the feedback information is generally information for indicating that the second process has entered the coordination state.
In step 507, the second process executes the maintenance operation after receiving the feedback information sent by the first process. The vehicle-mounted terminal equipment can be managed and maintained.
In step 508, the second process sends the operation result of the maintenance operation to the target server.
In practice, after the second process performs the maintenance operation, the second process usually sends the operation result of performing the maintenance operation to the target server. Therefore, the target server can timely and accurately acquire the maintenance condition of the vehicle-mounted terminal equipment. The operation results typically include results of successful operations and results of failed operations.
Further referring to fig. 6, corresponding to the task processing method of the foregoing embodiment, fig. 6 is a block diagram of a task processing device 600 provided in the embodiment of the present application, and for convenience of description, only the parts related to the embodiment of the present application are shown.
Referring to fig. 6, the apparatus includes:
an instruction obtaining unit 601, configured to obtain a task instruction, where the task instruction includes a task type and an operation instruction;
a process determining unit 602, configured to determine a corresponding target task processing process according to a task type;
the instruction processing unit 603 is configured to invoke a target task processing process to process the operation instruction, so as to obtain a processing result;
and a result feedback unit 604, configured to invoke the target task processing process to feed back the processing result.
In some embodiments, the task types include function tasks and/or terminal maintenance tasks; the process determining unit 602 is specifically configured to:
if the task type is a functional task, determining that the first process is a target task processing process;
if the task type is a terminal maintenance task, determining that a second process is a target task processing process;
and if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
In some embodiments, when the task type includes a terminal maintenance task, invoking a target task processing process to process the operation instruction specifically includes:
calling a second process to receive an operation instruction;
sending a communication instruction adaptive to the operation instruction to the first process, wherein the communication instruction is used for controlling the first process to enter a matching state of executing the operation instruction in cooperation with the second process;
and calling a second process to execute the operation instruction according to the feedback information that the first process enters the matching state.
The device provided by the embodiment can realize that when the electronic device interacts with a plurality of other devices, the electronic device can call different processes to perform interaction processing based on the task type of the received task instruction, which is beneficial to improving the compatibility of the electronic device.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Referring to fig. 7 further, fig. 7 is a schematic structural diagram of an electronic device 700 according to an embodiment of the present disclosure. As shown in fig. 7, the electronic apparatus 700 of this embodiment includes: at least one processor 701 (only one processor is shown in fig. 7), a memory 702, and a computer program 703, such as a task processing program, stored in the memory 702 and executable on the at least one processor 701. The steps in any of the various method embodiments described above are implemented when the computer program 703 is executed by the processor 701. The steps in the embodiments of the respective task processing methods described above are implemented when the processor 701 executes the computer program 703. The processor 701, when executing the computer program 703, implements the functions of each module/unit in each device embodiment described above, such as the functions of the units 601 to 604 shown in fig. 6.
Illustratively, the computer program 703 may be partitioned into one or more modules/units, which are stored in the memory 702 and executed by the processor 701 to accomplish the present application. One or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 703 in the electronic device 700. For example, the computer program 703 may be divided into an instruction obtaining unit, a process determining unit, an instruction processing unit, and a result feedback unit, and specific functions of each unit are described in the foregoing embodiments, and are not described herein again.
The electronic device 700 may be a computing electronic device such as a server, a desktop computer, a tablet computer, a cloud server, and a mobile terminal. The electronic device 700 may include, but is not limited to, a processor 701, a memory 702. Those skilled in the art will appreciate that fig. 7 is merely an example of an electronic device 700 and does not constitute a limitation of electronic device 700 and may include more or fewer components than shown, or combine certain components, or different components, e.g., the electronic device may also include input output electronics, network access electronics, a bus, etc.
The Processor 701 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 702 may be an internal storage unit of the electronic device 700, such as a hard disk or a memory of the electronic device 700. The memory 702 may also be an external storage electronic device of the electronic device 700, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the electronic device 700. Further, the memory 702 may also include both internal and external storage electronics of the electronic device 700. The memory 702 is used to store computer programs and other programs and data required by the electronic device. The memory 702 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/electronic device and method may be implemented in other ways. For example, the above-described apparatus/electronic device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the embodiments described above may be implemented by a computer program, which is stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for processing a task, the method comprising:
acquiring a task instruction, wherein the task instruction comprises a task type and an operation instruction;
determining a corresponding target task processing process according to the task type;
calling the target task processing process to process the operation instruction to obtain a processing result;
and calling the target task processing process to feed back the processing result.
2. The method of claim 1, wherein the task type comprises a function task and/or a terminal maintenance task;
the determining a corresponding target task processing process according to the task type specifically includes:
if the task type is a functional task, determining that a first process is a target task processing process;
if the task type is a terminal maintenance task, determining that a second process is a target task processing process;
and if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
3. The method according to claim 2, wherein the invoking the target task processing process to process the operation instruction specifically includes:
when the task type is a functional task, calling the first process to process the operation instruction;
when the task type is a terminal maintenance task, calling the second process to process the operation instruction;
when the task type comprises a function task and a terminal maintenance task, calling the first process to process the task type into an operation instruction of the function task; and calling the second process processing task type as an operation instruction of a terminal maintenance task.
4. The method according to claim 2, wherein when the task type includes a terminal maintenance task, the invoking the target task processing process to process the operation instruction specifically includes:
calling the second process to receive the operation instruction;
sending a communication instruction adapted to the operation instruction to the first process, wherein the communication instruction is used for controlling the first process to enter a matching state in which the first process is matched with the second process to execute the operation instruction;
and calling the second process to execute the operation instruction according to the feedback information that the first process enters the cooperation state.
5. The method according to claim 4, wherein the sending the communication instruction adapted to the operation instruction to the first process specifically includes:
writing the communication instruction into a message queue to transmit the communication instruction to the first process through the message queue.
6. The method according to claim 4 or 5, wherein when the operation instruction includes an upgrade operation, the cooperation state is a state in which processing of a current task is stopped; and when the operation instruction does not comprise the upgrading operation, the coordination state is the state of parallel processing of the current task.
7. A task processing apparatus, characterized in that the apparatus comprises:
the instruction acquisition unit is used for acquiring a task instruction, and the task instruction comprises a task type and an operation instruction;
the process determining unit is used for determining a corresponding target task processing process according to the task type;
the instruction processing unit is used for calling the target task processing progress to process the operation instruction to obtain a processing result;
and the result feedback unit is used for calling the target task processing process to feed back the processing result.
8. The apparatus of claim 7, wherein the task type comprises a function task and/or a terminal maintenance task;
the process determining unit is specifically configured to:
if the task type is a functional task, determining that a first process is a target task processing process;
if the task type is a terminal maintenance task, determining that a second process is a target task processing process;
and if the task type comprises a function task and a terminal maintenance task, determining that the first process and the second process are target task processing processes.
9. The apparatus according to claim 8, wherein when the task type includes a terminal maintenance task, the invoking the target task processing process to process the operation instruction specifically includes:
calling the second process to receive the operation instruction;
sending a communication instruction adapted to the operation instruction to the first process, wherein the communication instruction is used for controlling the first process to enter a matching state in which the first process is matched with the second process to execute the operation instruction;
and calling the second process to execute the operation instruction according to the feedback information that the first process enters the cooperation state.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 6 when executing the computer program.
CN202110080833.3A 2021-01-21 2021-01-21 Task processing method and device and electronic equipment Pending CN112905313A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110080833.3A CN112905313A (en) 2021-01-21 2021-01-21 Task processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110080833.3A CN112905313A (en) 2021-01-21 2021-01-21 Task processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112905313A true CN112905313A (en) 2021-06-04

Family

ID=76117896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110080833.3A Pending CN112905313A (en) 2021-01-21 2021-01-21 Task processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112905313A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114070896A (en) * 2021-10-29 2022-02-18 深圳市优必选科技股份有限公司 Communication interface, electronic device and device management method
CN116450324A (en) * 2023-06-20 2023-07-18 北京超星未来科技有限公司 Task processing method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104246693A (en) * 2012-04-20 2014-12-24 飞思卡尔半导体公司 Information processing device and method for protecting data in a call stack
US9798584B1 (en) * 2015-09-29 2017-10-24 EMC IP Holding Company LLC Methods and apparatus for IO sizing based task throttling
US20180077237A1 (en) * 2015-03-25 2018-03-15 Alibaba Group Holding Limited Method, apparatus, and system for providing remote terminal assistance to electronic devices using an intermediary server
US20180131756A1 (en) * 2016-11-10 2018-05-10 Trilliant Networks, Inc. Method and system for affinity load balancing
CN108132835A (en) * 2017-12-29 2018-06-08 五八有限公司 Task requests processing method, device and system based on multi-process
CN109710416A (en) * 2019-01-11 2019-05-03 银清科技(北京)有限公司 Resource regulating method and device
CN110601880A (en) * 2019-09-02 2019-12-20 平安科技(深圳)有限公司 Cloud platform, service processing method, command interface and computer equipment
WO2020093214A1 (en) * 2018-11-05 2020-05-14 深圳市欢太科技有限公司 Application program login method, application program login device and mobile terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104246693A (en) * 2012-04-20 2014-12-24 飞思卡尔半导体公司 Information processing device and method for protecting data in a call stack
US20180077237A1 (en) * 2015-03-25 2018-03-15 Alibaba Group Holding Limited Method, apparatus, and system for providing remote terminal assistance to electronic devices using an intermediary server
US9798584B1 (en) * 2015-09-29 2017-10-24 EMC IP Holding Company LLC Methods and apparatus for IO sizing based task throttling
US20180131756A1 (en) * 2016-11-10 2018-05-10 Trilliant Networks, Inc. Method and system for affinity load balancing
CN108132835A (en) * 2017-12-29 2018-06-08 五八有限公司 Task requests processing method, device and system based on multi-process
WO2020093214A1 (en) * 2018-11-05 2020-05-14 深圳市欢太科技有限公司 Application program login method, application program login device and mobile terminal
CN109710416A (en) * 2019-01-11 2019-05-03 银清科技(北京)有限公司 Resource regulating method and device
CN110601880A (en) * 2019-09-02 2019-12-20 平安科技(深圳)有限公司 Cloud platform, service processing method, command interface and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114070896A (en) * 2021-10-29 2022-02-18 深圳市优必选科技股份有限公司 Communication interface, electronic device and device management method
CN114070896B (en) * 2021-10-29 2023-12-15 深圳市优必选科技股份有限公司 Communication interface, electronic device and device management method
CN116450324A (en) * 2023-06-20 2023-07-18 北京超星未来科技有限公司 Task processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112905313A (en) Task processing method and device and electronic equipment
CN110611707B (en) Task scheduling method and device
CN112199266B (en) Log transmission method and system for vehicle-mounted machine system, vehicle and storage medium
CN112788074A (en) Data transmitting method, processing method, receiving method and equipment and storage medium
CN108958174B (en) Multi-class device control method and system
CN110874232A (en) Virtual machine component upgrading method, equipment and computer readable storage medium
CN114201197A (en) Firmware upgrading method and device, electronic equipment and readable storage medium
CN112860290A (en) Vehicle upgrading method, device and system, terminal equipment and storage medium
CN111526049A (en) Operation and maintenance system, operation and maintenance method, electronic device and storage medium
CN114064091A (en) OTA (over the air) upgrade control method and device, electronic equipment and automatic driving vehicle
CN113791792B (en) Method, device and storage medium for acquiring application call information
CN115016805A (en) Vehicle system upgrading method, device, system, equipment and medium
CN112804301B (en) Method and device for determining equipment state, gateway and storage medium
CN113821017A (en) Working machine control method and system and working machine
CN116166582A (en) Data reading and writing method, system, equipment and storage medium
CN110634230B (en) Method for information interaction between application program of vending machine and hardware equipment
CN112615835B (en) Charging pile multi-communication protocol support method and storage medium
CN112346766A (en) Dynamic deployment method and system of vehicle-mounted application software
CN102339027A (en) Network asynchronous callback-based distributed upper computer control method and device for programmable logic controller (PLC) equipment
CN105549911A (en) Data transmission method and apparatus for NVRAM
CN112685082A (en) Task execution method and device, computer readable storage medium and vehicle-mounted terminal
US20220121597A1 (en) Data processing device, data processing method, and program
CN110816435A (en) Method and device for remotely controlling vehicle
CN115632904A (en) Unmanned aerial vehicle communication method, system and storage medium
CN112565041B (en) Hardware information configuration method, device and medium of FF field bus system

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