Instruction data transmission method, system and device and storage medium
By dividing the operation instructions of the printing device into short-time-consuming types and long-time-consuming types, and configuring the operation instructions of the target instruction type to send to the corresponding printing data transmission network, using the shared data channel to store and transmit operation instructions and execution results, the problems of low data transmission efficiency and channel blockage of traditional printing devices are solved, and the execution efficiency of printing tasks is improved.
Patent Information
- Application Number
- CN202411974601.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When traditional printing equipment executes printing tasks, it is necessary to call the operating system kernel to perform data extraction and transmission, resulting in low data transmission efficiency. Long and time-consuming operation instructions will cause shared channel blockage, reducing the execution efficiency of printing tasks.
By dividing operation instructions into short-time-consuming types and long-time-consuming types, and configuring to send each operation instruction of the target instruction type to the target printing data transmission network corresponding to the target instruction type, the operation instructions are stored in the first shared memory using the shared data channel, and the execution trigger instructions are sent to the instruction execution process in sequence according to the order of storage of the operation instructions, so that the instruction execution process extracts the operation instructions and the execution data set from the first shared memory through the shared data channel, and stores the instruction execution results in the second shared memory after execution.
The impact of long time-consuming operation instructions on short time-consuming operation instructions is avoided, the execution efficiency of operation instructions is improved, and while avoiding read and write conflicts, the need to store the instruction execution results and then execute the next operation instruction is reduced, thereby improving the execution efficiency of printing tasks.
Smart Images

Figure CN119902725A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printing device control technology, and in particular to a method, system, device and storage medium for transmitting instruction data. Background Art
[0002] In order to solve the problem of low data transmission efficiency caused by the need to call the operating system kernel to implement data extraction and transmission during the execution of printing tasks when traditional printing devices execute printing tasks, existing printing devices will configure shared memory for each thread executing the printing task, so that each thread can implement data extraction and transmission by directly accessing the shared memory, omitting the step of calling the operating system kernel and improving data transmission efficiency.
[0003] However, since each thread executing a print task in an existing printing device accesses the shared memory through a shared channel, and a print task usually includes multiple operation instructions, when an operation instruction requires too much data, the time consumption of the data extraction and transmission process of the operation instruction will increase, thereby causing the shared channel to be blocked, and then the subsequent operation instructions cannot be executed in time, reducing the execution efficiency of the print task. Therefore, how to improve the execution efficiency of the print task has become an urgent problem to be solved. Summary of the invention
[0004] In view of the above problems, the present application provides a command data transmission method, system, device and storage medium to achieve the purpose of improving the execution efficiency of printing tasks. The specific scheme is as follows:
[0005] The first aspect of the present application provides a method for transmitting instruction data, comprising:
[0006] Parsing the print task output by the instruction generation process, obtaining a plurality of operation instructions, and identifying the instruction type of each of the operation instructions, wherein the instruction type includes at least a short time-consuming type and a long time-consuming type;
[0007] Sending each operation instruction of a target instruction type to a target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, the target instruction type is any one of the short time-consuming type and the long time-consuming type, the target printing data transmission network includes a shared data channel, a first shared memory and a second shared memory, and the process of the instruction execution process using the target printing data transmission network to execute each operation instruction includes:
[0008] The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction;
[0009] When detecting that each instruction execution result is stored in the second shared memory, the shared data channel sends an extraction trigger instruction to the instruction generation process, so that the instruction generation process extracts each instruction execution result from the second shared memory through the shared data channel.
[0010] In a possible implementation, the shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, stores the instruction execution result in the second shared memory through the shared data channel, including:
[0011] The shared data channel adds each of the received operation instructions of the target instruction type to an operation instruction queue, identifies an instruction execution thread identifier in each of the operation instructions, and generates an execution trigger instruction for each of the operation instructions based on the instruction execution thread identifier;
[0012] According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process;
[0013] For each of the operation instructions: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel.
[0014] In a possible implementation, the shared data channel includes: an uplink channel and a downlink channel, the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, including:
[0015] The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain an execution result of the operation instruction;
[0016] The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downstream channel, and the bandwidth of the upstream channel is greater than the bandwidth of the downstream channel.
[0017] In a possible implementation, storing each of the operation instructions in the operation instruction queue to the first shared memory in sequence according to the storage order in which each of the operation instructions is added to the operation instruction queue, and sending the execution trigger instruction of the operation instruction to the target instruction execution thread in the instruction execution process when the operation instruction is exported from the operation queue, includes:
[0018] Determine an operation instruction first stored in the operation instruction queue as a current operation instruction;
[0019] storing the current operation instruction in the first shared memory, and detecting whether the execution data set corresponding to the current operation instruction exists in the first shared memory;
[0020] In the case where the execution data set corresponding to the current operation instruction exists, sending the execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and the execution data set corresponding to it from the first shared memory;
[0021] When it is detected that the current operation instruction and the corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction in the operation queue whose storage order is only later than the current operation instruction that has not been updated, and the operation steps of storing the current operation instruction in the first shared memory and detecting whether there is the execution data set corresponding to the current operation instruction in the first shared memory are performed.
[0022] The second aspect of the present application provides an instruction data transmission system, comprising: an instruction parsing module, an instruction management module and at least two target printing data transmission networks, wherein the target printing data transmission network comprises a shared data channel, a first shared memory and a second shared memory,
[0023] An instruction parsing module, used for parsing the printing task output by the instruction generation process, obtaining a plurality of operation instructions, and identifying the instruction type of each of the operation instructions, wherein the instruction type includes at least a short time-consuming type and a long time-consuming type;
[0024] The instruction management module is used to send each operation instruction of a target instruction type to a target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, the target instruction type is any one of the short time-consuming type and the long time-consuming type, and the target printing data transmission network is set to be:
[0025] The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction;
[0026] When detecting that each instruction execution result is stored in the second shared memory, the shared data channel sends an extraction trigger instruction to the instruction generation process, so that the instruction generation process extracts each instruction execution result from the second shared memory through the shared data channel.
[0027] In a possible implementation, the shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, stores the instruction execution result in the second shared memory through the shared data channel, which is specifically set as follows:
[0028] The shared data channel adds each of the received operation instructions of the target instruction type to an operation instruction queue, identifies an instruction execution thread identifier in each of the operation instructions, and generates an execution trigger instruction for each of the operation instructions based on the instruction execution thread identifier;
[0029] According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process;
[0030] For each of the operation instructions: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel.
[0031] In a possible implementation, the shared data channel includes: an uplink channel and a downlink channel; the target instruction execution thread, in response to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; when the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, it is set to:
[0032] The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain an execution result of the operation instruction;
[0033] The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downstream channel, and the bandwidth of the upstream channel is greater than the bandwidth of the downstream channel.
[0034] In a possible implementation, the shared data channel stores each of the operation instructions in the operation instruction queue to the first shared memory in sequence according to the storage order in which each of the operation instructions is added to the operation instruction queue, and when the operation instruction is exported from the operation queue, sends the execution trigger instruction of the operation instruction to the target instruction execution thread in the instruction execution process, and is set to:
[0035] Determine an operation instruction first stored in the operation instruction queue as a current operation instruction;
[0036] storing the current operation instruction in the first shared memory, and detecting whether the execution data set corresponding to the current operation instruction exists in the first shared memory;
[0037] In the case where the execution data set corresponding to the current operation instruction exists, sending the execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and the execution data set corresponding to it from the first shared memory;
[0038] When it is detected that the current operation instruction and the corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction in the operation queue whose storage order is only later than the current operation instruction that has not been updated, and the operation steps of storing the current operation instruction in the first shared memory and detecting whether there is the execution data set corresponding to the current operation instruction in the first shared memory are performed.
[0039] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0040] The memory is used to store computer programs;
[0041] The processor is used to execute the computer program so that the electronic device can implement the instruction data transmission method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0042] A fourth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use the instruction data transmission method of the above-mentioned first aspect or any implementation of the first aspect.
[0043] By means of the above technical scheme, the present application provides a method, system, device and storage medium for transmitting instruction data, by dividing the operation instruction into at least a short-time type and a long-time type, and configuring each operation instruction of the target instruction type to be sent to the target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, thereby avoiding the influence of the operation instruction of the long-time type on the operation instruction of the short-time type, and improving the execution efficiency of the operation instruction. In addition, by configuring the shared data channel to store each operation instruction in the first shared memory, and in accordance with the storage order of the operation instruction, the execution trigger instruction of each operation instruction is sent to the instruction execution process in sequence, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, the instruction execution result is stored in the second shared memory through the shared data channel, so that compared with the prior art, the present application avoids the read-write conflict while not needing to execute the next operation instruction when the instruction execution result of the current operation instruction is received, thereby improving the execution efficiency of the operation instruction. It can be seen that the present application improves the execution efficiency of the printing task. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0045] Figure 1 A flowchart of a command data transmission method provided by the present application;
[0046] Figure 2 A flowchart for identifying the instruction type of each operation instruction provided by the present application;
[0047] Figure 3 A schematic diagram of the structure of a printing task execution module of a printing device provided in this application;
[0048] Figure 4 A flowchart of an operation instruction for executing a short-time type provided by the present application;
[0049] Figure 5 A block diagram of a command data transmission system provided by the present application;
[0050] Figure 6 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0051] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0052] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0053] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0054] It should be noted that, in actual application scenarios, the present application improves the execution efficiency of printing tasks compared to the prior art. Specifically, since the prior art is only configured with one shared memory and one shared channel, when too much data is required for a certain operation instruction, the time consumption of the data extraction and transmission process of the operation instruction will increase, thereby causing channel blocking and long-term occupation of the shared memory, which in turn causes the subsequent operation instructions to fail to be executed in time, reducing the execution efficiency of the printing task. In addition, since the complete execution process of an operation instruction includes the extraction, execution and feedback of the instruction execution result of the operation instruction, and since there is only one shared memory, in order to avoid read-write conflicts, the prior art requires that the instruction execution process can only extract the next operation instruction and the corresponding execution data from the shared memory after the instruction execution result of the current operation instruction is stored in the shared memory. It can be seen that the prior art reduces the execution efficiency of printing tasks. The present application divides the operation instructions into at least short-time consuming type and long-time consuming type, and configures each operation instruction of the target instruction type to be sent to the target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, thereby avoiding the influence of the operation instruction of the long-time consuming type on the operation instruction of the short-time consuming type, and improving the execution efficiency of the operation instruction. In addition, by configuring the shared data channel to store each operation instruction in the first shared memory, and in accordance with the storage order of the operation instruction, the execution trigger instruction of each operation instruction is sent to the instruction execution process in sequence, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, the instruction execution result is stored in the second shared memory through the shared data channel, so that compared with the prior art, the present application avoids the read-write conflict while not needing to execute the next operation instruction when the instruction execution result of the current operation instruction is received, thereby improving the execution efficiency of the operation instruction. It can be seen that the present application improves the execution efficiency of the printing task.
[0055] The first aspect of the present application provides a method for transmitting instruction data, such as Figure 1 As shown, the instruction data transmission method includes:
[0056] S101, parsing the print task output by the instruction generation process, obtaining multiple operation instructions, and identifying the instruction type of each operation instruction, where the instruction type includes at least a short time-consuming type and a long time-consuming type.
[0057] It should be noted that in actual application scenarios, when executing the above Figure 1Before the instruction data transmission method shown, each target printing data transmission network needs to be initialized and configured, and the content of the above initialization configuration at least includes: configuring the shared data channel bandwidth, allocating storage resources to the first shared memory and the second shared memory, and constructing the communication interface between the instruction generation process and the instruction execution process and the target printing data transmission network.
[0058] It should be noted that, in actual application scenarios, the above instruction generation process may be a process in a printing device for generating a corresponding printing task in response to a client operation. The above instruction generation process may include multiple instruction generation threads.
[0059] It should be noted that in actual application scenarios, the above Figure 1 There are many ways to implement step S101, and one example is provided here: Figure 2 As shown, it is a flow chart for identifying the instruction type of each operation instruction, and the specific operation steps are as follows: step A1 to step A3.
[0060] Step A1, reading the instruction configuration file of the printing task output by the instruction generation process, and triggering step A2.
[0061] Step A2, using a preset segmentation script to parse the command configuration file according to a preset command set, to obtain each operation command in the printing task, and triggering step A3.
[0062] The preset command set may be a data set constructed based on a printer command set. There may be multiple printer command sets, including but not limited to: an ESC command set, a PCL command set, a PostScript command set, a CPCL command set, and the like.
[0063] Step A3: according to the instruction identifier of each operation instruction, search the preset instruction type mapping relationship table for the instruction type corresponding to the instruction identifier.
[0064] In a possible implementation, the preset instruction type mapping relationship table is a data table for storing the mapping relationship between instruction identifiers and instruction types. The mapping relationship can be determined based on the execution time of each operation instruction in the actual application scenario. For example, for operation instructions such as starting printing, stopping printing, adjusting job order, deleting jobs, uploading jobs, and querying printing status, since there is no need to load too much data, the single execution time of the above operation instructions is short, so the instruction type of the above operation instruction can be determined as a short-time type. For operation instructions that require a large amount of data, such as reading and writing nozzle voltage, loading materials, and obtaining material lists, their instruction types can be determined as long-time types.
[0065] It should be noted that in actual application scenarios, the above instruction types can be further refined based on the execution time of each operation instruction, and for the refined instruction types, it is only necessary to configure the corresponding target printing data transmission network for them. This application does not make too many restrictions and redundant descriptions on the specific content of the above instruction types.
[0066] S102, sending each operation instruction of the target instruction type to the target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, the target instruction type is any one of a short-time type and a long-time type, the target printing data transmission network includes a shared data channel, a first shared memory and a second shared memory, and the process of the instruction execution process using the target printing data transmission network to execute each operation instruction includes:
[0067] The shared data channel stores each operation instruction in the first shared memory, and sends the execution trigger instruction of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction;
[0068] It should be noted that in actual application scenarios, due to the difference in the amount of data required for the execution of different operation instructions, different types of operation instructions have different execution times. Therefore, the present application configures each operation instruction of the target instruction type to be sent to the target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, thereby avoiding the influence of the long-time operation instruction on the short-time operation instruction, improving the execution efficiency of the operation instruction, and further improving the execution efficiency of the printing task.
[0069] It should be noted that in actual application scenarios, the storage space size of the above-mentioned first shared memory and the second shared memory, as well as the bandwidth of the above-mentioned shared data channel, can be set according to the average data volume of the operation instructions and instruction execution results in the actual application scenarios. This application does not make too many restrictions or elaborate on this.
[0070] It should be noted that, in actual application scenarios, the present application stores each operation instruction in the first shared memory by configuring a shared data channel, and sends the execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that compared with the prior art, the present application does not need to execute the next operation instruction after receiving the instruction execution result of the current operation instruction, thereby improving the execution efficiency of the operation instruction. When the shared data channel detects that the execution result of each instruction is stored in the second shared memory, the extraction trigger instruction is sent to the instruction generation process, so that the instruction generation process extracts the execution result of each instruction from the second shared memory through the shared data channel.
[0071] It should be noted that in actual application scenarios, the present application configures a first shared memory to store operation instructions and their corresponding execution data sets, and configures a second shared memory to store instruction execution results, thereby avoiding the risk of read-write conflicts caused by simultaneous read and write operations on a shared memory data.
[0072] The present application divides the operation instructions into at least short-time consuming type and long-time consuming type, and configures each operation instruction of the target instruction type to be sent to the target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, thereby avoiding the influence of the operation instruction of the long-time consuming type on the operation instruction of the short-time consuming type, and improving the execution efficiency of the operation instruction. In addition, by configuring a shared data channel to store each operation instruction in the first shared memory, and in accordance with the storage order of the operation instruction, the execution trigger instruction of each operation instruction is sent to the instruction execution process in sequence, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, the instruction execution result is stored in the second shared memory through the shared data channel, so that compared with the prior art, the present application avoids the read-write conflict while not needing to execute the next operation instruction when the instruction execution result of the current operation instruction is received, thereby improving the execution efficiency of the operation instruction. It can be seen that the present application improves the execution efficiency of the printing task.
[0073] In a possible implementation, a shared data channel stores each operation instruction in a first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, stores the instruction execution result in a second shared memory through the shared data channel, including:
[0074] The shared data channel adds each operation instruction of the received target instruction type to the operation instruction queue, identifies the instruction execution thread identifier in each operation instruction, and generates an execution trigger instruction for each operation instruction based on each instruction execution thread identifier;
[0075] According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process;
[0076] For each operation instruction: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel.
[0077] It should be noted that, in actual application scenarios, the above-mentioned shared data channel may be a communication thread for executing data transmission.
[0078] It should be noted that, in actual application scenarios, sending each operation instruction of the target instruction type to the shared data channel can be implemented by using the data sending function (such as SendData) integrated in the instruction generation process. The above-mentioned target instruction execution thread responds to the execution trigger instruction of the operation instruction and can be implemented by the data receiving function (RcvData) configured in the instruction execution process.
[0079] In a possible implementation, the shared data channel includes: an uplink channel and a downlink channel, the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, including:
[0080] The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction;
[0081] The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downlink channel, and the bandwidth of the uplink channel is greater than the bandwidth of the downlink channel.
[0082] It should be noted that in actual application scenarios, the present application further subdivides the shared data channel into an uplink channel and a downlink channel through configuration, thereby avoiding channel blockage and data interference caused by the simultaneous transmission of data extracted from the first shared memory and data stored in the second shared memory in the shared data channel, so as to improve the execution accuracy and efficiency of operation instructions.
[0083] In order to facilitate the understanding of the above-mentioned target printing data transmission network, a possible implementation of the present application is specifically described here:
[0084] like Figure 3 The figure is a schematic diagram of the structure of a print task execution module of a printing device, including: an instruction generation process, two target print data transmission networks (a first print data transmission network and a second print data transmission network) and an instruction execution process. Among them, the first print data transmission network includes a first shared data channel, a first shared memory and a second shared memory, and the second print data transmission network includes a second shared data channel, a third shared memory and a fourth shared memory.
[0085] In a possible implementation, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence according to the storage order of each operation instruction in the operation instruction queue, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process, including:
[0086] Determine an operation instruction first stored in the operation instruction queue as the current operation instruction;
[0087] The current operation instruction is stored in the first shared memory, and the execution data set corresponding to the current operation instruction is detected in the first shared memory;
[0088] If there is an execution data set corresponding to the current operation instruction, sending an execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and its corresponding execution data set from the first shared memory;
[0089] When it is detected that the current operation instruction and its corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction whose storage order in the operation queue is only later than the current operation instruction that has not been updated, and the current operation instruction is stored in the first shared memory, and the operation steps of detecting whether there is an execution data set corresponding to the current operation instruction in the first shared memory are executed.
[0090] It should be noted that, in an actual application scenario, in order to facilitate the understanding of the complete execution process of an operation instruction, a possible implementation of the present application is specifically described here: Figure 4 As shown in FIG. 1 , it is a flowchart for executing a short-time operation instruction. The specific operation steps are as follows:
[0091] In step S401, the shared data channel determines an operation instruction first stored in the operation queue as the current operation instruction, and triggers step S402.
[0092] Step S402: The shared data channel stores the current operation instruction in the first shared memory, and determines whether there is an execution data set corresponding to the current operation instruction in the first shared memory. If yes, step S403 is triggered. If no, step S404 is triggered.
[0093] Step S403: The shared data channel sends an execution trigger instruction including the target instruction execution thread identifier to the instruction process, and triggers step S405.
[0094] Step S404: The shared data channel sends a trigger instruction for constructing a data set to the first shared memory, and triggers step S402.
[0095] In a possible implementation, the above-mentioned data set construction trigger instruction is an instruction for triggering the first shared memory to summarize the data required for executing the current operation instruction and construct the above-mentioned execution data set.
[0096] Step S405, the shared data channel monitors whether the target instruction execution thread has completed the extraction of the current operation instruction and its corresponding execution data set. If so, steps S406 and S407 are triggered. If not, step S405 is triggered.
[0097] Step S406: The shared data channel updates the current operation instruction to an operation instruction in the operation queue whose storage sequence is only later than the current operation instruction that has not been updated, and triggers step S402.
[0098] Step S407, the shared data channel monitors whether the target instruction execution thread has completed writing the instruction execution result including the instruction identifier of the current operation instruction to the second shared memory. If so, step S408 is triggered, and if not, step S407 is triggered.
[0099] Step S408: The shared data channel sends an extraction trigger instruction with the instruction identifier of the current operation instruction to the instruction generation process, and triggers step S409.
[0100] Step S409, the shared data channel monitors whether the instruction generation process has completed the extraction operation of the instruction execution result with the instruction identifier of the current operation instruction. If so, step S407 is triggered, if not, step S409 is triggered.
[0101] The second aspect of the present application provides a command data transmission system, such as Figure 5 As shown, the instruction data transmission system includes: an instruction parsing module 501, an instruction management module 502 and at least two target printing data transmission networks 503, the target printing data transmission network includes a shared data channel, a first shared memory and a second shared memory,
[0102] The instruction parsing module 501 is used to parse the print task output by the instruction generation process, obtain multiple operation instructions, and identify the instruction type of each operation instruction, where the instruction type includes at least a short time-consuming type and a long time-consuming type;
[0103] The instruction management module 502 is used to send each operation instruction of the target instruction type to the target printing data transmission network 503 corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction. The target instruction type is any one of the short-time type and the long-time type. The target printing data transmission network is set to:
[0104] The shared data channel stores each operation instruction in the first shared memory, and sends the execution trigger instruction of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction;
[0105] When the shared data channel detects that the execution results of each instruction are stored in the second shared memory, the shared data channel sends an extraction trigger instruction to the instruction generation process, so that the instruction generation process extracts the execution results of each instruction from the second shared memory through the shared data channel.
[0106] In a possible implementation, the shared data channel stores each operation instruction in the first shared memory, and sends the execution trigger instruction of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and after executing the operation instruction, stores the instruction execution result in the second shared memory through the shared data channel, which is specifically set as follows:
[0107] The shared data channel adds each operation instruction of the received target instruction type to the operation instruction queue, identifies the instruction execution thread identifier in each operation instruction, and generates an execution trigger instruction for each operation instruction based on each instruction execution thread identifier;
[0108] According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process;
[0109] For each operation instruction: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel.
[0110] In a possible implementation, the shared data channel includes: an uplink channel and a downlink channel. The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; when the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, it is set to:
[0111] The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction;
[0112] The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downlink channel, and the bandwidth of the uplink channel is greater than the bandwidth of the downlink channel.
[0113] In a possible implementation, the shared data channel stores each operation instruction in the operation instruction queue to the first shared memory in sequence according to the storage order of each operation instruction in the operation instruction queue, and when the operation instruction is exported from the operation queue, sends the execution trigger instruction of the operation instruction to the target instruction execution thread in the instruction execution process, and is set to:
[0114] Determine an operation instruction first stored in the operation instruction queue as the current operation instruction;
[0115] The current operation instruction is stored in the first shared memory, and the execution data set corresponding to the current operation instruction is detected in the first shared memory;
[0116] If there is an execution data set corresponding to the current operation instruction, sending an execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and its corresponding execution data set from the first shared memory;
[0117] When it is detected that the current operation instruction and its corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction whose storage order in the operation queue is only later than the current operation instruction that has not been updated, and the current operation instruction is stored in the first shared memory, and the operation steps of detecting whether there is an execution data set corresponding to the current operation instruction in the first shared memory are executed.
[0118] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0119] The memory is used to store computer programs;
[0120] The processor is used to execute a computer program so that the electronic device can implement the instruction data transmission method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0121] The structural diagram of the electronic device provided in the third aspect of the present application is as follows Figure 6 The electronic devices in the embodiments of the present application may include but are not limited to fixed terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, and the like. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0122] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0123] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0124] A fourth aspect of the present application provides a computer storage medium, the storage medium carrying one or more computer programs, which, when executed by an electronic device, can enable the electronic device to transmit instruction data according to the first aspect or any implementation of the first aspect.
[0125] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0126] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0127] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0128] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for transmitting instruction data, characterized in that: include: Parsing the print task output by the instruction generation process, obtaining a plurality of operation instructions, and identifying the instruction type of each of the operation instructions, wherein the instruction type includes at least a short time-consuming type and a long time-consuming type; Sending each operation instruction of a target instruction type to a target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, the target instruction type is any one of the short time-consuming type and the long time-consuming type, the target printing data transmission network includes a shared data channel, a first shared memory and a second shared memory, and the process of the instruction execution process using the target printing data transmission network to execute each operation instruction includes: The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction; When detecting that each instruction execution result is stored in the second shared memory, the shared data channel sends an extraction trigger instruction to the instruction generation process, so that the instruction generation process extracts each instruction execution result from the second shared memory through the shared data channel.
2. The instruction data transmission method according to claim 1, characterized in that: The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction, including: The shared data channel adds each of the received operation instructions of the target instruction type to an operation instruction queue, identifies an instruction execution thread identifier in each of the operation instructions, and generates an execution trigger instruction for each of the operation instructions based on the instruction execution thread identifier; According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process; For each of the operation instructions: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel.
3. The instruction data transmission method according to claim 2, characterized in that: The shared data channel includes: an uplink channel and a downlink channel, the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction; the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, including: The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain an execution result of the operation instruction; The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downstream channel, and the bandwidth of the upstream channel is greater than the bandwidth of the downstream channel.
4. The instruction data transmission method according to claim 2, characterized in that: The method further comprises: storing each of the operation instructions in the operation instruction queue in the first shared memory in sequence according to the storage order in which each of the operation instructions is added to the operation instruction queue, and sending the execution trigger instruction of the operation instruction to the target instruction execution thread in the instruction execution process when the operation instruction is exported from the operation queue, including: Determine an operation instruction first stored in the operation instruction queue as a current operation instruction; storing the current operation instruction in the first shared memory, and detecting whether the execution data set corresponding to the current operation instruction exists in the first shared memory; In the case where the execution data set corresponding to the current operation instruction exists, sending the execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and the execution data set corresponding to it from the first shared memory; When it is detected that the current operation instruction and the corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction in the operation queue whose storage order is only later than the current operation instruction that has not been updated, and the operation steps of storing the current operation instruction in the first shared memory and detecting whether there is the execution data set corresponding to the current operation instruction in the first shared memory are performed.
5. A command data transmission system, characterized in that: include: An instruction parsing module, an instruction management module and at least two target printing data transmission networks, wherein the target printing data transmission network includes a shared data channel, a first shared memory and a second shared memory, An instruction parsing module, used for parsing the printing task output by the instruction generation process, obtaining a plurality of operation instructions, and identifying the instruction type of each of the operation instructions, wherein the instruction type includes at least a short time-consuming type and a long time-consuming type; The instruction management module is used to send each operation instruction of a target instruction type to a target printing data transmission network corresponding to the target instruction type, so that the instruction execution process uses the target printing data transmission network to execute each operation instruction, the target instruction type is any one of the short time-consuming type and the long time-consuming type, and the target printing data transmission network is set to be: The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result in the second shared memory through the shared data channel after executing the operation instruction; When the shared data channel detects that each instruction execution result is stored in the second shared memory, the shared data channel sends an extraction trigger instruction to the instruction generation process, so that the instruction generation process extracts each instruction execution result from the second shared memory through the shared data channel.
6. The instruction data transmission system according to claim 5, characterized in that: The shared data channel stores each of the operation instructions in the first shared memory, and sends execution trigger instructions of each operation instruction to the instruction execution process in sequence according to the storage order of the operation instructions, so that the instruction execution process extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and stores the instruction execution result to the second shared memory through the shared data channel after executing the operation instruction. The specific setting is: The shared data channel adds each of the received operation instructions of the target instruction type to an operation instruction queue, identifies an instruction execution thread identifier in each of the operation instructions, and generates an execution trigger instruction for each of the operation instructions based on the instruction execution thread identifier; According to the storage order of each operation instruction in the operation instruction queue, each operation instruction in the operation instruction queue is stored in the first shared memory in sequence, and when the operation instruction is exported from the operation queue, the execution trigger instruction of the operation instruction is sent to the target instruction execution thread in the instruction execution process; For each of the operation instructions: the target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain an execution result of the operation instruction; The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the shared data channel.
7. The instruction data transmission system according to claim 6, characterized in that: The shared data channel includes: an uplink channel and a downlink channel. The target instruction execution thread, in response to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the shared data channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain the execution result of the operation instruction. When the target instruction execution thread stores the execution result of the operation instruction to the second shared memory through the shared data channel, it is set as: The target instruction execution thread responds to the execution trigger instruction of the operation instruction, extracts the operation instruction and the execution data set corresponding to the operation instruction from the first shared memory through the uplink channel, and executes the operation instruction based on the execution data set of the operation instruction to obtain an execution result of the operation instruction; The target instruction execution thread stores the execution result of the operation instruction in the second shared memory through the downstream channel, and the bandwidth of the upstream channel is greater than the bandwidth of the downstream channel.
8. The instruction data transmission system according to claim 6, characterized in that: The shared data channel is set to: store each of the operation instructions in the operation instruction queue to the first shared memory in sequence according to the storage order in which each of the operation instructions is added to the operation instruction queue, and send the execution trigger instruction of the operation instruction to the target instruction execution thread in the instruction execution process when the operation instruction is exported from the operation queue: Determine an operation instruction first stored in the operation instruction queue as a current operation instruction; storing the current operation instruction in the first shared memory, and detecting whether the execution data set corresponding to the current operation instruction exists in the first shared memory; In the case where the execution data set corresponding to the current operation instruction exists, sending the execution trigger instruction of the operation instruction to the target instruction execution thread, so that the target instruction execution thread extracts the current operation instruction and the execution data set corresponding to it from the first shared memory; When it is detected that the current operation instruction and the corresponding execution data set have been extracted, the current operation instruction is updated to an operation instruction in the operation queue whose storage order is only later than the current operation instruction that has not been updated, and the operation steps of storing the current operation instruction in the first shared memory and detecting whether there is the execution data set corresponding to the current operation instruction in the first shared memory are performed.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the instruction data transmission method as described in any one of claims 1 to 4.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the instruction data transmission method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Task request processing method and device, and user equipment
CN106899649A
Resource allocation method and device, electronic equipment and storage medium
CN111190739A
Instruction processing method, instruction processing device and storage medium
CN113900712A
Message Queue Protocol for Sequential Execution of Related Task Routines in Many Task Computing
US20230138344A1
Data processing method and apparatus, device, storage medium, and program product
US20240289208A1