CN115713217A - Instruction processing method and device, storage medium and electronic equipment - Google Patents

Instruction processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115713217A
CN115713217A CN202211491719.0A CN202211491719A CN115713217A CN 115713217 A CN115713217 A CN 115713217A CN 202211491719 A CN202211491719 A CN 202211491719A CN 115713217 A CN115713217 A CN 115713217A
Authority
CN
China
Prior art keywords
instruction
queue
target
target queue
server
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
CN202211491719.0A
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.)
Caxa Technology Co Ltd
Original Assignee
Caxa 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 Caxa Technology Co Ltd filed Critical Caxa Technology Co Ltd
Priority to CN202211491719.0A priority Critical patent/CN115713217A/en
Publication of CN115713217A publication Critical patent/CN115713217A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Multi Processors (AREA)

Abstract

The invention discloses a method and a device for processing an instruction, a storage medium and electronic equipment. Wherein, the method comprises the following steps: if a first instruction is received when the process task is processed, judging whether the first instruction is a preset instruction or not, wherein the probability of instruction collision caused by the preset instruction is greater than a preset threshold value; adding the first instruction into the first target queue according to an instruction source of the first instruction under the condition that the first instruction is a preset instruction, wherein the instruction source is at least one of the following instructions: a client and a server; acquiring a second instruction in the first target queue, and adding the second instruction into a second target queue, wherein the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used for scheduling the second instruction; a second instruction in the second target queue is executed. The invention solves the technical problem that data confusion occurs when instructions are executed when different Web applications simultaneously send the instructions to the same flow in the prior art.

Description

Instruction processing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of information management, and in particular, to a method and an apparatus for processing an instruction, a storage medium, and an electronic device.
Background
In the management information system, because the browser Web application and the service application for processing the flow task are both run in a distributed manner, when different Web applications submit different instructions on one flow, for example: two people simultaneously operate a task, where one person wants to submit through the task and the other person wants to return to the task, at which time the requests of the two people may be sent to different service applications and processed simultaneously, which may eventually lead to a wrong result for one person or, in severe cases, to a confusion of data for the two people.
Fig. 1 is a flowchart of an optional document initiation auditing process in the related art, as shown in fig. 1, in S101, an auditing process is first initiated for a document, and when an node is audited in S102, different people issue "audit pass" and "audit fail" instructions at the same time, that is, S103 and S104, which may cause data confusion;
in addition, at any active node of the auditing process, someone simultaneously issues an instruction of S105 to suspend the process, which may also cause data confusion.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an instruction processing method, an instruction processing device, a storage medium and electronic equipment, which are used for at least solving the technical problem that data confusion occurs when instructions are executed when different Web applications simultaneously send the instructions to the same flow in the related art.
According to an aspect of the embodiments of the present invention, there is provided an instruction processing method, including: if a first instruction is received when a flow task is processed, judging whether the first instruction is a preset instruction or not, wherein the probability of instruction conflict caused by the preset instruction is larger than a preset threshold value; adding the first instruction to a first target queue according to an instruction source of the first instruction under the condition that the first instruction is a preset instruction, wherein the instruction source is at least one of the following: a client and a server; acquiring a second instruction in the first target queue, and adding the second instruction into a second target queue, wherein the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used for scheduling the second instruction; executing the second instruction in the second target queue.
Further, the first target queue includes at least: the client side waiting queue and the server side waiting queue add the first instruction to a first target queue according to the instruction source of the first instruction, and the method comprises the following steps: adding the first instruction to the client wait queue if the instruction source of the first instruction is the client; and adding the first instruction into the server waiting queue under the condition that the instruction source of the first instruction is the server.
Further, obtaining the second instruction in the first target queue includes: according to the instruction type of each instruction in the first target queue and the flow identification corresponding to each instruction, judging whether instruction conflict exists between each instruction and other instructions being processed under the flow task to which the instruction belongs, and obtaining a target judgment result, wherein the instruction type at least comprises one of the following instructions: an active type instruction, a flow type instruction; extracting an executable instruction in the first target queue at the current time according to the target judgment result; and taking the executable instruction in the first target queue as the second instruction.
Further, adding the second instruction to a second target queue, comprising: judging whether the waiting queue of the client is empty or not; adding the second instruction in the client wait queue to the second target queue if the client wait queue is not empty; and adding the second instruction in the server waiting queue to the second target queue under the condition that the client waiting queue is empty.
Further, the instruction processing method further includes: judging whether the waiting time of the server side waiting queue exceeds a preset time length or not; and adding a second instruction in the server side waiting queue to the second target queue under the condition that the waiting time of the server side waiting queue exceeds the preset time length.
Further, executing the second instruction in the second target queue includes: selecting a target server, and sending the instructions in the second target queue to the target server; executing, by the target server, the instructions in the second target queue.
Further, the queue length of the second target queue is a preset length, and the preset length is determined by the thread number of a processor executing the processing method of the instruction.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for processing an instruction, including: the processing unit is used for judging whether a first instruction is a preset instruction or not if the first instruction is received when a flow task is processed, wherein the probability of instruction collision caused by the preset instruction is larger than a preset threshold value; a first processing unit, configured to add the first instruction to a first target queue according to an instruction source of the first instruction when the first instruction is a preset instruction, where the instruction source is at least one of: a client and a server; a second processing unit, configured to obtain a second instruction in the first target queue, and add the second instruction to a second target queue, where the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used to schedule the second instruction; an execution unit to execute the second instruction in the second target queue.
Further, the first target queue includes at least: the client side waits for the queue, and the server side waits for the queue, and the first processing unit includes: a first adding subunit, configured to add the first instruction to the client wait queue if an instruction source of the first instruction is the client; and the second adding subunit is used for adding the first instruction to the waiting queue of the server under the condition that the instruction source of the first instruction is the server.
Further, the second processing unit includes: a first determining subunit, configured to determine, according to an instruction type of each instruction in the first target queue and a flow identifier corresponding to each instruction, whether there is an instruction conflict between each instruction and another instruction being processed in a flow task to which the instruction belongs, to obtain a target determination result, where the instruction type at least includes one of: an active type instruction, a flow type instruction; the extraction subunit is used for extracting the executable instruction in the first target queue at the current time according to the target judgment result; and the processing subunit is used for taking the executable instruction in the first target queue as the second instruction.
Further, the second processing unit further includes: the second judgment subunit is used for judging whether the client side waiting queue is empty or not; a third adding subunit, configured to add the second instruction in the client wait queue to the second target queue when the client wait queue is not empty; a fourth adding subunit, configured to add the second instruction in the server wait queue to the second target queue when the client wait queue is empty.
Further, the instruction processing method further includes: the third judging subunit is configured to judge whether the waiting time of the server side waiting queue exceeds a preset time length; and the fifth adding subunit is configured to add the second instruction in the server side wait queue to the second target queue when the wait time of the server side wait queue exceeds the preset time duration.
Further, the execution unit includes: the sending subunit is configured to select a target server, and send the instruction in the second target queue to the target server; and the execution subunit is used for executing the instructions in the second target queue through the target server.
Further, the queue length of the second target queue is a preset length, and the preset length is determined by the thread number of a processor executing the processing method of the instruction.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform a processing method of any of the above instructions via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is executed to control an apparatus in which the computer-readable storage medium is located to execute a processing method of any one of the instructions.
In the invention, if a first instruction is received when a flow task is processed, whether the first instruction is a preset instruction is judged, wherein the probability of instruction conflict caused by the preset instruction is greater than a preset threshold value; adding the first instruction into a first target queue according to an instruction source of the first instruction under the condition that the first instruction is a preset instruction, wherein the instruction source is at least one of the following: a client and a server; acquiring a second instruction in the first target queue, and adding the second instruction into a second target queue, wherein the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used for scheduling the second instruction; a second instruction in the second target queue is executed. And the technical problem that data confusion occurs when instructions are executed when different Web applications simultaneously send the instructions to the same flow in the related technology is solved. In the invention, an executable second instruction is selected from a first target queue and added into a second target queue for execution by adding an instruction which causes the probability of instruction conflict to be greater than a preset threshold value into the first target queue. The method achieves the aim of avoiding the occurrence of instruction conflict during the execution of the flow task, thereby realizing the technical effect of reducing the probability of data confusion of the management information system for processing the flow task.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative document initiation review process in the related art;
FIG. 2 is a flow diagram of an alternative method of processing instructions according to an embodiment of the invention;
FIG. 3 is a schematic diagram of business logic for the optional handling of instruction conflicts in accordance with an embodiment of the present invention;
FIG. 4 is a flow diagram of an alternative wait queue scheduling process according to an embodiment of the present invention;
FIG. 5 is a flow diagram of an alternative instruction scheduling process according to an embodiment of the present invention;
FIG. 6 is an architecture diagram illustrating an alternative management information system for handling instruction conflicts, according to an embodiment of the present invention;
FIG. 7 is a flow diagram of an alternative instruction processing apparatus according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, some terms or nouns related to the present invention will be explained below.
A management information system: PDM (product data management system), PLM (product lifecycle management system), drawing document, MES (manufacturing information management system for manufacturing enterprise workshop execution layer), process data management, ERP (enterprise resource planning management system), OA (office automation management system), which are referred to herein as systems for short.
The process comprises the following steps: the workflow management method is a workflow management mode supported by a system, one process comprises a plurality of activities, and a user can give instructions for the process or the activities to the process.
Moving: refers to a basic element of the process, which can be a sub-process or a single work item node.
Work items: an atomic activity corresponds to a single atomic operation in a process.
Instruction conflict: under the condition of multi-service operation, instructions issued to the same flow or certain activity of the flow are distributed and executed, and if some instructions are executed at the same time, object data in a system related to the flow can be confused.
The invention will now be further illustrated with reference to the following examples.
Example one
In accordance with an embodiment of the present invention, there is provided a method embodiment of an alternative method of processing instructions, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than presented herein.
FIG. 2 is a flow chart of an alternative method of processing instructions according to an embodiment of the present invention, as shown in FIG. 2, the method including the steps of:
step S201, if the first instruction is received during processing the flow task, determining whether the first instruction is a preset instruction, where a probability of instruction collision caused by the preset instruction is greater than a preset threshold.
The flow task may be a flow task in the management information system, the first instruction may be a flow instruction or an activity instruction initiated by a client of the management information system, or may also be a flow instruction or an activity instruction initiated by a server of the management information system, the instruction initiated by the server may be an instruction periodically generated by the server, the preset instruction is an instruction that may cause instruction collision when the flow task is processed, and a probability that the preset instruction causes instruction collision is greater than a preset threshold.
Step S202, when the first instruction is a preset instruction, adding the first instruction to the first target queue according to an instruction source of the first instruction, where the instruction source is at least one of: client side and server side.
The instruction source may be a server or a client, that is, the first instruction may be a request instruction initiated from the client or a request instruction generated from the server, and in this embodiment, the request instruction manually sent from the client may be simply referred to as a "client instruction", and the request instruction periodically generated from the server may be simply referred to as a "server instruction".
The target queue may be a server waiting queue or a client waiting queue, where the server waiting queue is used to temporarily store the instruction from the server, and the client waiting queue is used to temporarily store the instruction from the client.
Step S203, acquiring a second instruction in the first target queue, and adding the second instruction to a second target queue, where the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used to perform scheduling processing on the second instruction.
The second instruction is an executable instruction of the first target queue at the current time, that is, the second instruction does not cause an instruction conflict when being executed at the current time. The second instruction may be fetched from the first target queue and added to the second target queue by determining whether each instruction in the first target queue causes an instruction conflict when executed at the current time.
The second target queue may be a dispatch queue for dispatching the instructions, and is configured to dispatch the executable instructions to the workflow server, and execute the executable instructions in the second target queue through the workflow server.
Step S204, executing a second instruction in the second target queue.
In this embodiment, the executable instructions in the second target queue may be executed by the workflow server by dispatching the executable instructions in the second target queue to the workflow server. And selecting one of the workflow servers to execute the executable instructions in the second target queue, and after the instructions are executed, triggering the scheduler function of the first target queue to continue to add the executable second instructions in the first target queue to the second target queue.
Through the above steps, in this embodiment, an executable second instruction is selected from the first target queue and added to the second target queue for execution by adding an instruction causing the instruction collision probability to be greater than a preset threshold to the first target queue. The method achieves the purpose of avoiding the occurrence of instruction conflict during the execution of the flow task, thereby achieving the technical effect of reducing the probability of data disorder when the management information system for processing the flow task sends instructions to the same flow at the same time, and further solving the technical problem that the data disorder occurs during the execution of the instructions when different Web applications send the instructions to the same flow in the related art.
Fig. 3 is a schematic diagram of a service logic for optional instruction conflict processing according to an embodiment of the present invention, and as shown in fig. 3, the following describes the above steps schematically with reference to fig. 3:
s301: the scheduling service receives requests of the client and requests generated by the service regularly.
S302: it is determined whether the incoming request is a flow instruction that would result in a conflict.
S303: the current instruction is an instruction that is a conflict and is added to the wait queue.
S304: the current instruction is an instruction which can not conflict, and is directly distributed and executed.
S305: the scheduler selects from the wait queue instructions that no longer cause a conflict and can be executed to dispatch execution.
S306: one of the workflow services is randomly selected, and the flow instruction is sent to be executed.
S307: and after the execution is finished, returning the execution result to the client for display.
S308: after the execution of one instruction is finished, the scheduler function of the waiting queue is triggered.
Optionally, the first target queue at least includes: the client side waiting queue and the server side waiting queue add the first instruction to the first target queue according to the instruction source of the first instruction, and the method comprises the following steps: adding the first instruction to a client waiting queue under the condition that the instruction source of the first instruction is the client; and adding the first instruction into a waiting queue of the server side under the condition that the instruction source of the first instruction is the server side.
Because the instruction sent by the client needs to return execution information, which may be success information or failure information, the requirement on timeliness is high, and the timeliness requirement of the server instruction (the instruction source is the instruction of the server) is low, so that the two types of instructions need to be stored separately, and when the instruction is scheduled, the client instruction (the instruction source is the instruction of the client) can be preferentially selected to be dispatched and executed, that is, the client instruction is preferentially added to the second target queue.
Fig. 4 is a flow diagram of an alternative process for scheduling a wait queue according to an embodiment of the present invention, as shown in fig. 4,
s401: whether the instructions are the flow instructions causing the conflict is judged through isConflicting (a preset judgment mode), and the preset judgment mode can judge the probability that the instructions may cause the instructions through a preset instruction conflict probability library.
S402: the current instruction is an instruction which does not conflict, and is directly distributed for execution.
S403: whether the current instruction is a client instruction is judged through the source (instruction source).
S404: the current instruction is a client instruction, added to the client queue clientcmdque.
S405: the current instruction is a server instruction and is added to a server queue serverCmdQueue.
S406: after adding an instruction to the waiting queue (corresponding to the first target queue), triggering a scheduling function to schedule the instructions in the waiting queue.
The first instructions are respectively added into different waiting queues according to different instruction sources, namely the client waiting queue and the server waiting queue, so that the instructions from different sources are separately scheduled, and the technical effect of improving the instruction execution efficiency of the information management system is realized.
Optionally, the obtaining the second instruction in the first target queue includes: according to the instruction type of each instruction in the first target queue and the flow identification corresponding to each instruction, judging whether instruction conflict exists between each instruction and other instructions being processed under the flow task to which the instruction belongs, and obtaining a target judgment result, wherein the instruction type at least comprises one of the following instructions: an active type instruction, a flow type instruction; extracting an executable instruction at the current time in the first target queue according to the target judgment result; and taking the executable instruction in the first target queue as a second instruction.
In this embodiment, the type of each instruction in the wait queue and the execution status of other instructions under the process task may be obtained through cmdType (instruction type, which may be an active instruction or a flow instruction) and process id (identification of the flow to which the instruction belongs), whether there is an instruction conflict between each instruction in the first target queue and other instructions under the process task is determined, and then all executable instructions in the first target queue are collected to obtain the second instruction.
Optionally, adding the second instruction to the second target queue includes: judging whether the waiting queue of the client is empty or not; adding a second instruction in the client waiting queue to a second target queue under the condition that the client waiting queue is not empty; and adding a second instruction in the waiting queue of the server to a second target queue under the condition that the waiting queue of the client is empty.
Because the instruction sent by the client needs to return execution information, namely success or failure information, the requirement on timeliness is high, the requirement on timeliness of the instruction of the server is low, and when the instruction is scheduled, the instruction of the client is preferentially selected to be dispatched and executed, namely, the scheduling processing is preferentially carried out on the waiting queue of the client.
In this embodiment, it may be determined whether the client wait queue is empty, and when the client wait queue is not empty, the type of each instruction in the client wait queue and the execution status of other instructions in the process may be obtained through cmdType and process id, and after the determination, all executable instructions (i.e., the second instruction) are collected and added to the second target queue (i.e., the dispatch queue). The client waits for the queue to be empty and may select an executable from the server wait queue servercmdquee to add to the second target queue (i.e., the dispatch queue).
It should be noted that before the second instruction is added to the second target queue, it may also be determined whether the second target queue is full, and in the case that the second target queue is full, it may be waited for that the second target queue is idle, and after the second target queue is idle, the second instruction may be added to the second target queue.
Fig. 5 is a flowchart of an alternative instruction scheduling process according to an embodiment of the present invention.
As in fig. 5, S501: and judging whether the client side waiting queue clientCmdQueue is empty or not.
S502: and the client side waits for the queue not to be empty, acquires the types of all instructions in the waiting queue (a first target queue) and the execution conditions of other instructions in the process through cmdType and processID, collects all executable instructions after judgment, and adds the executable instructions into a dispatching queue (a second target queue).
S503: and the client side waits for the queue to be empty, selects an executable instruction from the server side waiting queue sercmdquee and adds the executable instruction into a dispatching queue (a second target queue).
In this embodiment, when the client wait queue is not empty, the executable instructions in the client wait queue are preferentially executed, so that the technical effect of improving the efficiency of receiving the instruction execution result by the client is achieved.
Optionally, the instruction processing method further includes: judging whether the waiting time of the waiting queue of the server exceeds a preset time length or not; and adding a second instruction in the server side waiting queue into a second target queue under the condition that the waiting time of the server side waiting queue exceeds the preset time length.
In order to avoid the situation that the executable instructions in the client waiting queue are continuously added to the second target queue, when the server waits for execution, the server starves, and after the server waiting queue waits for a certain time, the second instructions in the server waiting queue can be added to the second target queue under the situation that the waiting time of the server waiting queue exceeds a preset time length.
For example, as in fig. 5, S504: and after the server side orders to wait for a certain time, the server side automatically distributes the instructions to prevent starvation.
S505: and judging whether the dispatch queue is full or not and whether the dispatch queue is idle or not.
S506: the dispatch queue is full and waits to be idle.
S507: and the dispatching queue is free and is added to the dispatching queue.
Judging whether the waiting time of the server side waiting queue exceeds a preset time length or not; and when the waiting time of the server side waiting queue exceeds the preset time length, adding the second instruction in the server side waiting queue into a second target queue, so that the condition that the instruction in the server side waiting queue cannot be executed all the time is avoided, and the technical effect of improving the stability of instruction processing and execution is realized.
Optionally, executing the second instruction in the second target queue includes: selecting a target server, and sending the instructions in the second target queue to the target server; executing, by the target server, the instructions in the second target queue.
In this embodiment, the head node of the dispatch queue (corresponding to the second target queue) instructs to select a workflow server (corresponding to the target server) for execution.
As in fig. 5, S508: and selecting the workflow server to send an instruction for execution.
S509, after the instruction execution is completed, the scheduling is triggered again, and the dispatch queue is updated.
S510, after the instruction execution is finished, the corresponding dispatch queue node is cleared, the space is released, and the waiting instruction is added into the queue.
By selecting the target server and executing the instructions in the second target queue, the technical effect of reducing the probability of instruction conflict is achieved.
Optionally, the queue length of the second target queue is a preset length, and the preset length is determined by a thread number of a processor executing the processing method of the instruction.
The queue length of the second target queue is a preset length, that is, the second target queue may be a fixed-length queue, and the number of processor threads is usually selected as the queue length, and when the queue is full, a new instruction cannot be added to enter, so that the maximum concurrent number of actual instruction execution is limited, and the technical effect of ensuring stable operation of the management information system for executing the flow task is achieved.
Fig. 6 is an architecture diagram of an alternative management information system for processing instruction conflicts according to an embodiment of the present invention, and as shown in fig. 6, the management information system may be composed of a client and a server, where the client may include a plurality of client applications, and the server may include a process scheduling service (scheduling service for short) and a plurality of workflow services.
Example two
The embodiment provides an optional instruction processing device, and each implementation unit in the processing device corresponds to an implementation step of one embodiment.
Fig. 7 is a flowchart of an alternative instruction processing apparatus according to an embodiment of the present invention, as shown in fig. 7, the processing apparatus includes: a determination unit 71, a first processing unit 72, a second processing unit 73, and an execution unit 74.
Specifically, the determining unit 71 is configured to determine whether the first instruction is a preset instruction if the first instruction is received during processing of the flow task, where a probability that the preset instruction causes an instruction conflict is greater than a preset threshold;
the first processing unit 72 is configured to add the first instruction to the first target queue according to an instruction source of the first instruction when the first instruction is a predetermined instruction, where the instruction source is at least one of: a client and a server;
a second processing unit 73, configured to obtain a second instruction in the first target queue, and add the second instruction to a second target queue, where the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used to perform scheduling processing on the second instruction;
an execution unit 74 is configured to execute the second instruction in the second target queue.
In the apparatus for processing an instruction provided in the second embodiment of the present application, when the determining unit 71 is used to process a flow task, if a first instruction is received, it is determined whether the first instruction is a preset instruction, where a probability of instruction collision caused by the preset instruction is greater than a preset threshold, and the first processing unit 72 is used to add the first instruction to the first target queue according to an instruction source of the first instruction when the first instruction is the preset instruction, where the instruction source is at least one of: the client and the server obtain, through the second processing unit 73, a second instruction in the first target queue, and add the second instruction to the second target queue, where the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used to schedule the second instruction, and the second instruction in the second target queue is obtained through the execution unit 74. And the technical problem that data confusion occurs when instructions are executed when different Web applications simultaneously send the instructions to the same flow in the related technology is solved. In the invention, an executable second instruction is selected from the first target queue and added into the second target queue for execution by adding the instruction which causes the probability of instruction conflict to be larger than a preset threshold value into the first target queue. The method achieves the aim of avoiding the occurrence of instruction conflict during the execution of the flow task, thereby realizing the technical effect of reducing the probability of data confusion of the management information system for processing the flow task.
Optionally, in the apparatus for processing an instruction provided in the second embodiment of the present application, the first target queue at least includes: the client wait queue and the server wait queue, the first processing unit 72 includes: the first adding subunit is used for adding the first instruction to the client waiting queue under the condition that the instruction source of the first instruction is the client; and the second adding subunit is used for adding the first instruction into the waiting queue of the server under the condition that the instruction source of the first instruction is the server.
Optionally, in the instruction processing apparatus provided in the second embodiment of the present application, the second processing unit 73 includes: the first judging subunit is configured to, according to an instruction type of each instruction in the first target queue and a flow identifier corresponding to each instruction, judge whether there is an instruction conflict between each instruction and another instruction being processed in a flow task to which the instruction belongs, and obtain a target judgment result, where the instruction type at least includes one of: active type instructions, flow type instructions; the extraction subunit is used for extracting the executable instruction at the current time in the first target queue according to the target judgment result; and the processing subunit is used for taking the executable instruction in the first target queue as a second instruction.
Optionally, in the instruction processing apparatus provided in the second embodiment of the present application, the second processing unit 73 further includes: the second judgment subunit is used for judging whether the waiting queue of the client is empty or not; the third adding subunit is used for adding the second instruction in the client waiting queue to the second target queue under the condition that the client waiting queue is not empty; and the fourth adding subunit is used for adding the second instruction in the server waiting queue to the second target queue under the condition that the client waiting queue is empty.
Optionally, in the apparatus for processing an instruction provided in the second embodiment of the present application, the method for processing an instruction further includes: the third judgment subunit is used for judging whether the waiting time of the server side waiting queue exceeds the preset time length or not; and the fifth adding subunit is configured to add the second instruction in the server wait queue to the second target queue when the wait time of the server wait queue exceeds the preset time duration.
Optionally, in the instruction processing apparatus provided in the second embodiment of the present application, the execution unit 74 includes: the sending subunit is used for selecting a target server and sending the instructions in the second target queue to the target server; and the execution subunit is used for executing the instructions in the second target queue through the target server.
Optionally, the queue length of the second target queue is a preset length, and the preset length is determined by a thread number of a processor executing the instruction processing method.
The above-mentioned instruction processing device may further include a processor and a memory, the above-mentioned judging unit 71, the first processing unit 72, the second processing unit 73, the executing unit 74, and the like are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement the corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more than one instruction, and selects a second executable instruction from the first target queue to be added into the second target queue for execution by adding the instruction causing the instruction conflict probability to be larger than a preset threshold value into the first target queue through adjusting the kernel parameters. The method achieves the purpose of avoiding the occurrence of instruction conflict when the flow task is executed, thereby realizing the technical effect of reducing the probability of data disorder of the management information system for processing the flow task.
The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the processing method of any of the instructions described above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is further provided a computer-readable storage medium, where a computer program is stored, and when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the method for processing the instruction of any one of the foregoing descriptions.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple 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 coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The 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 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 invention 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 may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and amendments can be made without departing from the principle of the present invention, and these modifications and amendments should also be considered as the protection scope of the present invention.

Claims (10)

1. A method for processing instructions, comprising:
if a first instruction is received when a flow task is processed, judging whether the first instruction is a preset instruction or not, wherein the probability of instruction collision caused by the preset instruction is greater than a preset threshold value;
adding the first instruction into a first target queue according to an instruction source of the first instruction under the condition that the first instruction is a preset instruction, wherein the instruction source is at least one of the following: a client and a server;
acquiring a second instruction in the first target queue, and adding the second instruction into a second target queue, wherein the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used for scheduling the second instruction;
executing the second instruction in the second target queue.
2. The processing method according to claim 1, wherein the first target queue comprises at least: the client side waiting queue and the server side waiting queue add the first instruction to a first target queue according to the instruction source of the first instruction, and the method comprises the following steps:
if the instruction source of the first instruction is the client, adding the first instruction to the client waiting queue;
and adding the first instruction into the server waiting queue under the condition that the instruction source of the first instruction is the server.
3. The processing method of claim 1, wherein fetching the second instruction in the first target queue comprises:
according to the instruction type of each instruction in the first target queue and the flow identification corresponding to each instruction, judging whether instruction conflict exists between each instruction and other instructions being processed under the flow task to which the instruction belongs, and obtaining a target judgment result, wherein the instruction type at least comprises one of the following instructions: active type instructions, flow type instructions;
extracting an executable instruction in the first target queue at the current time according to the target judgment result;
and taking the executable instruction in the first target queue as the second instruction.
4. The processing method of claim 2, wherein adding the second instruction to a second target queue comprises:
judging whether the client side waiting queue is empty or not;
adding the second instruction in the client wait queue to the second target queue if the client wait queue is not empty;
and adding the second instruction in the server waiting queue to the second target queue under the condition that the client waiting queue is empty.
5. The process of claim 4, further comprising:
judging whether the waiting time of the server side waiting queue exceeds a preset time length or not;
and adding a second instruction in the server side waiting queue to the second target queue under the condition that the waiting time of the server side waiting queue exceeds the preset time length.
6. The processing method of claim 1, wherein executing the second instruction in the second target queue comprises:
selecting a target server, and sending the instructions in the second target queue to the target server;
executing, by the target server, the instructions in the second target queue.
7. The processing method according to any one of claims 1 to 6, wherein the queue length of the second target queue is a preset length determined by a thread number of a processor that executes the processing method of the instruction.
8. An apparatus for processing instructions, comprising:
the processing unit is used for processing a flow task, and if a first instruction is received, judging whether the first instruction is a preset instruction or not, wherein the probability of instruction collision caused by the preset instruction is greater than a preset threshold value;
a first processing unit, configured to add the first instruction to a first target queue according to an instruction source of the first instruction when the first instruction is a preset instruction, where the instruction source is at least one of: a client and a server;
the second processing unit is used for acquiring a second instruction in the first target queue and adding the second instruction into a second target queue, wherein the second instruction is an executable instruction of the first target queue at the current time, and the second target queue is used for scheduling the second instruction;
an execution unit to execute the second instruction in the second target queue.
9. A computer-readable storage medium, in which a computer program is stored, wherein when the computer program runs, an apparatus in which the computer-readable storage medium is located is controlled to execute the processing method of the instruction of any one of claims 1 to 7.
10. An electronic device comprising one or more processors and memory storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of processing instructions of any of claims 1-7.
CN202211491719.0A 2022-11-25 2022-11-25 Instruction processing method and device, storage medium and electronic equipment Pending CN115713217A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211491719.0A CN115713217A (en) 2022-11-25 2022-11-25 Instruction processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211491719.0A CN115713217A (en) 2022-11-25 2022-11-25 Instruction processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115713217A true CN115713217A (en) 2023-02-24

Family

ID=85234842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211491719.0A Pending CN115713217A (en) 2022-11-25 2022-11-25 Instruction processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115713217A (en)

Similar Documents

Publication Publication Date Title
CN106802826B (en) Service processing method and device based on thread pool
US7559062B2 (en) Intelligent scheduler for multi-level exhaustive scheduling
CN111338791A (en) Method, device and equipment for scheduling cluster queue resources and storage medium
CN107515781B (en) Deterministic task scheduling and load balancing system based on multiple processors
CN102469033A (en) Message subscription system and message sending method
US20130318533A1 (en) Methods and systems for presenting and assigning tasks
CN110928655A (en) Task processing method and device
CN105306277A (en) Message scheduling method and message scheduling device for message queues
CN110611707B (en) Task scheduling method and device
CN111427675B (en) Data processing method and device and computer readable storage medium
CN110716800B (en) Task scheduling method and device, storage medium and electronic equipment
JPWO2007072544A1 (en) Information processing apparatus, computer, resource allocation method, and resource allocation program
CN109873910A (en) Processing method, device and the storage medium of session request
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
JP4834622B2 (en) Business process operation management system, method, process operation management apparatus and program thereof
CN106547566B (en) Communications service process pool management method and system
CN111210340A (en) Automatic task processing method and device, server and storage medium
CN113326150A (en) Online small-batch message processing method and device
CN113032125A (en) Job scheduling method, device, computer system and computer-readable storage medium
CN115713217A (en) Instruction processing method and device, storage medium and electronic equipment
CN108521524B (en) Agent collaborative task management method and device, computer equipment and storage medium
CN111835809A (en) Work order message distribution method, work order message distribution device, server and storage medium
CN116089033A (en) Task scheduling method based on multistage heterogeneous dynamic queue
CN111767125B (en) Task execution method, device, electronic equipment and storage medium
CN114443325A (en) Asynchronous retry method and system for interface call exception

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