Method and device for processing orders
The method and device optimize order processing by synchronizing or asynchronous printing and voice playback based on order quantity, addressing inefficiencies in printers handling multiple orders.
Patent Information
- Application Number
- CN201911146704.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-21
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2039-11-21
AI Technical Summary
Printers that can print and voice-play orders face inefficiencies, particularly when multiple orders are pending, leading to delayed processing and user dissatisfaction.
A method and device that synchronously or asynchronously process orders based on a quantity threshold, allowing simultaneous printing and voice playback for fewer orders and asynchronous processing for many orders to enhance efficiency.
Improves order processing efficiency by ensuring timely notification of users, even with numerous orders, by optimizing the synchronization of printing and voice playback.
Smart Images

Figure CN110908619B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and device for processing orders. Background Art
[0002] Currently, some printers can not only print documents, but also play the documents by voice. For example, when a printer prints takeout orders, it performs two tasks at the same time: printing orders and playing orders by voice. Usually, the time required to print an order is less than the time required to play an order by voice. If the current order is printed but the voice playback of the current order has not yet ended, the printer needs to cache the data of the next order and wait for the voice playback of the current order to end before printing and playing the next order.
[0003] When there are many orders, users (eg, takeaway merchants) often need to print orders urgently. However, the printing efficiency of printers in the prior art is low and cannot meet the needs of users. Summary of the invention
[0004] The present application provides a method and device for processing orders, which can improve order processing efficiency and meet user needs.
[0005] In a first aspect, a method for processing an order is provided, comprising: obtaining the number of orders to be processed, the orders to be processed including a target order; printing the target order according to the number and voice playing the target order, wherein when the number is less than or equal to a quantity threshold, printing the target order and voice playing the target order are performed synchronously; or, when the number is greater than the quantity threshold, printing the target order and voice playing the target order are performed asynchronously.
[0006] When the number of pending orders is less than or equal to the quantity threshold, it means that there are few pending orders, and the target orders can be printed and voice played synchronously to provide a better experience for users. When the number of pending orders is greater than the quantity threshold, it means that there are many pending orders, and the printer can asynchronously print the target orders and voice play the target orders to quickly notify users of pending orders and improve user efficiency.
[0007] In a second aspect, a device for processing an order is provided, which is used to execute the method in the first aspect. Specifically, the device includes a functional module for executing the method in the first aspect.
[0008] In a third aspect, a terminal device with a printing function and a voice playing function is provided, the terminal device comprising a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect.
[0009] In a fourth aspect, a chip is provided for executing the method in the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip is used to execute the method in the first aspect.
[0010] In a fifth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method in the first aspect.
[0011] In a sixth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a printing system suitable for the present application;
[0013] Figure 2 is a schematic diagram of a method for processing an order provided by the present application;
[0014] Figure 3 is a schematic diagram of another method for processing orders provided by the present application;
[0015] Figure 4 is a schematic diagram of a device for processing orders provided by the present application;
[0016] Figure 5 It is a schematic diagram of an order processing device provided by the present application. DETAILED DESCRIPTION
[0017] Below, the technical solution provided by this application will be described in detail with reference to the accompanying drawings.
[0018] Figure 1 The printing system 100 is suitable for the present application. The printing system 100 includes a cloud 110 and a printer 120 .
[0019] The cloud 110 is, for example, a server, on which a software platform is installed, which can collect and process data, and can also send the processing results of the data to the printer 120. For example, the cloud 110 receives takeout order data sent by a user, and the takeout order data corresponds to the merchant A, then the cloud 110 can send the takeout order data to the terminal device of the merchant A, and the terminal device is, for example, the printer 120. The printer 120 can print and play the takeout order data by voice, so that the merchant A can perform corresponding processing based on the takeout order data.
[0020] The printer 120 may include a voice playback module, which may be an audio decoder and an audio device integrated in the printer 120. Optionally, the voice playback module may also be a playback device connected to the printer 120, wherein the printer 120 and the playback device may be connected via a wired connection such as a universal serial bus (USB), or via a wireless connection such as Bluetooth. The present application does not limit the specific form of the voice playback by the printer 120.
[0021] Figure 1 The printing system 100 shown is only an example of a printing system applicable to the present application, and the printing system applicable to the present application is not limited thereto. For example, the cloud 110 can also send the takeaway order data to the printer 120 through the computer of the merchant A. The present application does not limit the way in which the printer 120 obtains the takeaway order data.
[0022] After the printer obtains the pending order, it can Figure 2 The method shown performs the operation. Figure 2 As shown, the method 200 includes:
[0023] S210, obtaining the number of pending orders, where the pending orders include target orders.
[0024] After the printer obtains the pending orders, it can count the number of pending orders to facilitate subsequent processing. The target order is any order in the pending orders.
[0025] S220, printing the target order and voice playing the target order according to the quantity, wherein when the quantity is less than or equal to the quantity threshold, printing the target order and voice playing the target order are executed synchronously; or, when the quantity is greater than the quantity threshold, printing the target order and voice playing the target order are executed asynchronously.
[0026] When the number of pending orders is less than or equal to the quantity threshold, it means that there are few pending orders, and the target orders can be printed and voice played synchronously to provide a better experience for users. When the number of pending orders is greater than the quantity threshold, it means that there are many pending orders, and the printer can asynchronously print the target orders and voice play the target orders to quickly notify users of pending orders and improve user efficiency.
[0027] The quantity threshold can be a fixed value or a value that changes based on preset conditions. For example, if the pending orders are takeout orders, the lunch period is usually a period with more takeout orders. The quantity threshold can be set to a smaller value during the lunch period to avoid order backlogs. In the afternoon period, there are fewer takeout orders. The quantity threshold can be set to a larger value during the afternoon period, and the printing target order and the voice playback target order can be executed simultaneously to provide users with a better experience.
[0028] Figure 3 A schematic diagram showing another method for processing an order provided by the present application is shown.
[0029] In this method, the printer working thread monitors the cloud server backend database to obtain the number of pending orders.
[0030] When it is determined that the order quantity is small, the printing target order and the voice playback target order are executed synchronously, that is, after the printing task and the voice playback task of the current order are completed, the processing task of the next order to be processed is executed.
[0031] When it is determined that the order quantity is large, the printing target order and the voice playback target order are executed asynchronously, that is, after the printing task of the current order is completed, there is no need to wait for the completion of the voice playback task of the previous order, and the printing task of the next pending order is directly executed.
[0032] In the process of asynchronously executing printing the target order and voice playing the target order, the printer worker thread can add the target order to the printing task queue, and then print the target order in the printing task queue. The printer worker thread can also add the target order to the voice playing task queue, and play the target order in the voice playing task queue.
[0033] When playing a target order in a voice playing task queue, the text data corresponding to the target order may be first converted into voice data, and then the voice data may be played through the player.
[0034] The text data is, for example, a txt file, and the voice data is, for example, a wav file. The present application does not limit the specific forms of the text data and the voice data.
[0035] In the process of converting text data into voice data, the printer working thread may first add the text data to a text to speech (TTS) linked list, and then convert the text data into voice data using the TTS linked list.
[0036] During the process of playing the voice data, the printer working thread can add the voice data to the play linked list, and when it is the voice data's turn, the voice data is taken out of the play linked list and sent to the player for playing.
[0037] The text data in the TTS linked list and the voice data in the play linked list may also be referred to as nodes.
[0038] Optionally, after adding the voice data to the play list, the printer working thread may delete the text data in the TTS list to reduce the cache; after the voice data is played, the printer working thread may delete the voice data in the play list to reduce the cache.
[0039] The above describes in detail an example of a method for processing an order provided by the present application. It is understandable that, in order to implement the above functions, the device for processing an order includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0040] The present application can divide the functional units of the device for processing orders according to the above method example. For example, each function can be divided into each functional unit, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0041] Figure 4 4 is a schematic diagram of a device for processing an order provided by the present application. The device 400 includes an input unit 410 and a processing unit 420, and the processing unit 420 can control the input unit 410 to execute the acquisition step.
[0042] The input unit 410 is used to: obtain the number of pending orders, where the pending orders include target orders;
[0043] The processing unit 420 is used to: print the target order according to the quantity and voice play the target order, wherein when the quantity is less than or equal to the quantity threshold, printing the target order and voice playing the target order are executed synchronously; or, when the quantity is greater than the quantity threshold, printing the target order and voice playing the target order are executed asynchronously.
[0044] Optionally, the processing unit 420 is specifically used to: add the target order to a printing task queue; print the target order in the printing task queue; add the target order to a voice playing task queue; and play the target order in the voice playing task queue.
[0045] Optionally, the processing unit 420 is specifically used to: convert text data corresponding to the target order into voice data; and play the voice data through a player.
[0046] Optionally, the processing unit 420 is specifically configured to: add the text data to a TTS linked list; and convert the text data in the TTS linked list into the voice data.
[0047] Optionally, the processing unit 420 is specifically used to: add the voice data to a play list; and play the voice data in the play list.
[0048] Optionally, the processing unit 420 is further configured to: delete the text data in the TTS linked list.
[0049] Optionally, the processing unit is further used to: after the voice data is played, delete the voice data in the play linked list.
[0050] The specific process of the method for processing orders executed by the device 400 and the beneficial effects produced can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0051] Figure 5 A schematic diagram of the structure of an order processing device provided by the present application is shown. Figure 5 The dotted line in the figure indicates that the unit or the module is optional. The device 500 can be used to implement the method described in the above method embodiment. The device 500 can be a terminal device, a server or a chip.
[0052] The device 500 includes one or more processors 501, which can support the device 500 to implement Figure 2 or Figure 3 The method in the corresponding method embodiment. The processor 501 can be a general-purpose processor. For example, the processor 501 can be a CPU. The CPU can be used to control the device 500, execute the software program, and process the data of the software program. The device 500 can also include a communication unit 505 to implement the input (reception) and output (transmission) of signals.
[0053] For example, the device 500 may be a chip, the communication unit 505 may be an input and / or output circuit of the chip, or the communication unit 505 may be a communication interface of the chip, and the chip may be a component of a terminal device, a server, or other electronic devices.
[0054] For another example, the device 500 may be a terminal device or a server, and the communication unit 505 may be a transceiver of the terminal device or the server, or the communication unit 505 may be a transceiver circuit of the terminal device or the server.
[0055] The device 500 may include one or more memories 502, on which a program 504 is stored. The program 504 can be executed by the processor 501 to generate instructions 503, so that the processor 501 performs the method described in the above method embodiment according to the instructions 503. Optionally, data can also be stored in the memory 502. Optionally, the processor 501 can also read the data stored in the memory 502, and the data can be stored at the same storage address as the program 504, or the data can be stored at a different storage address from the program 504.
[0056] The processor 501 and the memory 502 may be provided separately or integrated together, for example, integrated on a single board of a server or a system on chip (SOC) of a terminal device.
[0057] The device 500 may further include an antenna 506. The communication unit 505 is used to implement the transceiver function of the device 500 through the antenna 506.
[0058] The specific manner in which the processor 501 executes the method for processing an order can refer to the relevant description in the method embodiment.
[0059] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in the processor 501. The processor 501 can be a CPU, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.
[0060] The present application also provides a computer program product, which, when executed by the processor 501, implements the method described in any method embodiment of the present application.
[0061] The computer program product may be stored in the memory 502 , for example, a program 504 , which is finally converted into an executable target file that can be executed by the processor 501 after preprocessing, compiling, assembling, and linking.
[0062] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0063] The computer-readable storage medium is, for example, a memory 502. The memory 502 may be a volatile memory or a nonvolatile memory, or the memory 502 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0064] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.
[0065] In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
[0066] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0067] In addition, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0068] In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.
Claims
1. A method for processing an order, characterized in that: include: Obtaining the number of pending orders, where the pending orders are takeout orders, and the pending orders include target orders; Print the target order according to the quantity and play the target order by voice, wherein: When the quantity is less than or equal to the quantity threshold, printing the target order and voice playing the target order are executed simultaneously; or, When the quantity is greater than the quantity threshold, the target order is printed and the target order is played by voice asynchronously; wherein the printing of the target order and the voice playing of the target order are performed asynchronously as follows: after the printing task of the current order is completed, the printing task of the next order to be processed is directly performed without waiting for the voice playing task of the previous order to be completed; The asynchronous execution of printing the target order and voice playing the target order includes: Adding the target order to a print task queue; Printing the target order in the print task queue; Add the target order to the voice playing task queue; Play the target order in the voice playing task queue.
2. The method according to claim 1, characterized in that The playing of the target order in the voice playing task queue includes: Converting text data corresponding to the target order into voice data; The voice data is played through a player.
3. The method according to claim 2, characterized in that The converting the text data corresponding to the target order into voice data includes: Add the text data to the text-to-speech TTS linked list; The text data in the TTS linked list is converted into the voice data.
4. The method according to claim 3, characterized in that: The playing of the voice data by a player includes: Add the voice data to the playback link list; Play the voice data in the play list.
5. The method according to claim 4, characterized in that Also includes: Delete the text data in the TTS linked list.
6. The method according to claim 4 or 5, characterized in that: Also includes: After the voice data is played, the voice data in the play linked list is deleted.
7. A device for processing orders, characterized in that: It includes input unit and processing unit. The input unit is used to: obtain the number of pending orders, the pending orders are takeaway orders, and the pending orders include target orders; The processing unit is used to: print the target order according to the quantity and play the target order by voice, wherein: When the quantity is less than or equal to the quantity threshold, printing the target order and voice playing the target order are executed simultaneously; or, When the quantity is greater than the quantity threshold, the target order is printed and the target order is played by voice asynchronously; wherein the printing of the target order and the voice playing of the target order are performed asynchronously as follows: after the printing task of the current order is completed, the printing task of the next order to be processed is directly performed without waiting for the voice playing task of the previous order to be completed; The processing unit is specifically used for: Adding the target order to a print task queue; Printing the target order in the print task queue; Add the target order to the voice playing task queue; Play the target order in the voice playing task queue.
8. The device according to claim 7, characterized in that The processing unit is specifically used for: Converting text data corresponding to the target order into voice data; The voice data is played through a player.
9. The device according to claim 8, characterized in that The processing unit is specifically used for: Add the text data to the text-to-speech TTS linked list; The text data in the TTS linked list is converted into the voice data.
10. The device according to claim 9, characterized in that The processing unit is specifically used for: Add the voice data to the playback link list; Play the voice data in the play list.
11. The device according to claim 10, characterized in that The processing unit is also used for: Delete the text data in the TTS linked list.
12. The device according to claim 10 or 11, characterized in that The processing unit is also used for: After the voice data is played, the voice data in the play linked list is deleted.
13. A terminal device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 6.
14. A chip, characterized in that: It comprises: a processor, used to call and run a computer program from a memory, so that a device equipped with the chip executes: a method as claimed in any one of claims 1 to 6.
15. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute: the method according to any one of claims 1 to 6.
