Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for updating a bill, which can update a bill template on the premise of not upgrading terminal device software, implement real-time replacement of the bill template, and trace a printed bill through a network.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of updating a menu, including: the equipment side acquires a service side single template or a service side single picture from the service side; and the equipment end updates the equipment end face single template by using the service end face single template or stores the face single picture.
Optionally, before the device side acquires the server-side single template from the server side, the method further includes: the equipment side acquires the version number of the single template of the service end face from the service side; the equipment terminal compares the version number of the service terminal surface single template with the stored version number of the equipment terminal surface single template; and if the version number of the single template of the service end face is different from the version number of the single template of the equipment end face, the equipment end sends a single template updating request to the service end to obtain the single template of the service end face.
Optionally, the method further comprises: the device side periodically obtains the version number of the single template of the service side from the service side, and/or after the device side receives a printing task, obtains the version number of the single template of the service side from the service side.
Optionally, the method further comprises: and after the server passes the authentication of the identifier of the equipment terminal, the equipment terminal acquires the service terminal surface single template or the surface single picture from the server.
Optionally, before the device side acquires the server-side single template from the server side, the method further includes: and the server side sends a single-panel updating notice to the equipment side.
Optionally, the method further comprises: and the equipment side acquires a service end face single template corresponding to the equipment side from the service side.
Optionally, the method further comprises: the equipment end uses the equipment end face single template or a surface single picture printing surface single acquired from the server end; the equipment side uploads the bill of dough to cloud storage; and the cloud storage generates an access link and/or a two-dimensional code of the menu.
Optionally, the method further comprises: the server receives the bill information; and generating the bill of surface picture according to the bill of surface information.
Optionally, the method further comprises: the service end compresses the single-sided picture; and the equipment side acquires the compressed menu picture from the server side.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an apparatus for updating a menu, including: the system comprises an equipment end and a server end, wherein the equipment end comprises an acquisition module used for acquiring a single template or a single picture of the server end from the server end; the equipment end further comprises an updating module, wherein the updating module is used for updating the equipment end face single template by the service end face single template or storing the face single picture.
Optionally, the obtaining module is further configured to obtain, from the server, a version number of the server-side single template; the equipment end also comprises a comparison module used for comparing the version number of the service end face single template with the stored version number of the equipment end face single template; the equipment end further comprises a first sending module, and the first sending module is used for sending a single panel updating request to the server end if the version number of the single panel of the service end is different from the version number of the single panel of the equipment end.
Optionally, the obtaining module is further configured to periodically obtain a version number of the single template of the service end from the service end, and/or obtain the version number of the single template of the service end from the service end after the device end receives a print job.
Optionally, the server further includes an authentication module, configured to authenticate an identifier of the device; the obtaining module is further used for obtaining the service end face single template or the face single picture from the service end after the authentication is passed.
Optionally, the server further includes a second sending module, configured to send a single-panel update notification to the device side.
Optionally, the obtaining module is further configured to obtain, from the server, a server-side single template corresponding to the device side.
Optionally, the apparatus further comprises a cloud storage device; the equipment end also comprises a printing module which is used for printing a surface sheet by using the equipment end surface single template or a surface sheet picture acquired from the server end; the uploading module is used for uploading the menu to the cloud storage equipment; the cloud storage device is further used for generating an access link and/or a two-dimensional code of the menu.
Optionally, the server further includes a receiving module, configured to receive the waybill information; and the generating module is used for generating the menu picture according to the menu information.
Optionally, the server further includes a compression module, configured to compress the facebook picture; the acquisition module is further used for acquiring the compressed menu picture from the server.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement any of a method of updating a menu.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program which, when executed by one or more processors, implements any one of the methods of updating a menu.
One embodiment of the above invention has the following advantages or benefits: because the technical means that the equipment side acquires the single template or the single picture of the service side from the service side is adopted, the technical problem that software needs to be upgraded when the single template of the service side is updated in the traditional method is solved, and the technical effects of updating the single template of the service side in real time and improving the efficiency are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main steps of a method for updating a menu according to an embodiment of the present invention, as shown in fig. 1:
step S101 represents that the device side acquires a service side single template or a single picture from the service side. The purpose of this step is to arrange the facebook template and the facebook picture at the server side for the device side to obtain. The equipment end can be equipment with a function of printing the facial tissues, such as a handheld facial tissue printer used by a courier; the server can be a server with networking function or the like. The service end bill template is a template which is stored in the service end and used for printing the bill, and the effective bill can be produced after the bill template and bill information (such as addressee information, sender information and the like) are combined. In one embodiment, the service-side single template may be in a text form, and is encapsulated in a compressed package, for example, the service-side single template is uploaded to the cloud storage service in a format of a zip (compressed package encapsulation format) file, when a terminal device (device side) performs printing, the service side provides an interface for acquiring the service-side single template for the terminal device, and the terminal device acquires the service-side single template to the terminal device through the interface in an inputstream file manner. When the single template of the service terminal is upgraded and changed, only the zip file of the template needs to be uploaded again, and the terminal equipment does not need to be upgraded. The menu picture refers to a menu with a picture format, such as jbig, jpg and the like, the menu picture can be stored in the cloud storage by taking a single number as an index, and when the terminal device needs to print the menu, the menu picture is inquired by calling the server interface from the cloud storage engine by taking the single number as a key. One embodiment of the invention is that the equipment end has a networking function, and directly accesses the server end through the internet to obtain a single template or a single picture of the server end; another embodiment of the present invention is that the device side may also indirectly obtain the service side single template or the service side single picture through other networking devices (such as only a mobile phone, etc.), that is, the service side single template or the service side single picture is obtained by the other networking devices first, and then forwarded to the device side through a wireless mode such as bluetooth or near field communication, or a wired transmission mode. Whether the service end face single template or the face single picture is stored in the service end, when the face single template is updated, only the service end face single template needs to be updated, and software upgrading is not needed to be carried out on the equipment end.
The method further comprises the following steps: the server receives the bill information; and generating the bill of surface picture according to the bill of surface information. Namely, after the service end receives the bill information, the bill image is generated according to the style of the bill image stored by the service end.
Before the device side acquires the service side single template from the service side, the method further includes: the equipment side acquires the version number of the single template of the service end face from the service side; the equipment terminal compares the version number of the service terminal surface single template with the stored version number of the equipment terminal surface single template; in an embodiment of the present invention, if the version number of the service end face single template is different from the version number of the device end face single template, the device end sends a single template update request to the service end to obtain the service end face single template. Another embodiment of the present invention is that if the version number of the service end face single template is the same as the version number of the equipment end face single template, the equipment end does not send a panel single template update request to the server.
One embodiment of the present invention is that the device side periodically obtains the version number of the service side single template from the server side, and/or after receiving a print job, the device side obtains the version number of the service side single template from the server side.
Before the device side acquires the service side single template from the service side, the method further includes: and the server side sends a single-panel updating notice to the equipment side. An embodiment of the present invention is that a server sends a single-mode board update notification to a device according to a device identifier (such as a terminal ID, a model, etc.) and a current version number, for example, the server stores record information shown in table 1:
TABLE 1
Terminal ID
|
Terminal equipment model
|
Current version number
|
Last update date
|
Client00001
|
Terminal A
|
V1.0
|
2018-2-5
|
Client00002
|
Terminal A
|
V1.1
|
2018-6-5
|
Client00003
|
Terminal A
|
V1.0
|
2018-2-6
|
Client00004
|
Terminal B
|
V1.0
|
2018-2-6
|
Client00005
|
Terminal B
|
V1.0
|
2018-2-5
|
Client00006
|
Terminal C
|
V1.1
|
2018-2-4
|
Client00007
|
Terminal D
|
V1.2
|
2018-6-5
|
Client00008
|
Terminal D
|
V1.1
|
2018-2-6 |
And the server side sends a single panel updating notice to different equipment sides respectively according to the setting, and if the current version number of the Client00001 is V1.0, the server side can send the single panel updating notice of the single panel V1.1 to the Client side. Another embodiment of the present invention is that, after the service end passes the authentication of the identifier of the device end, the device end obtains the service end face single template or the face single picture from the service end. If the server side verifies whether the terminal ID of the equipment side is included in the table 1, if so, the equipment side is the equipment side capable of updating the bill template.
An embodiment of the invention is that the method further comprises: and the equipment side acquires a service end face single template corresponding to the equipment side from the service side. For example, the server side stores the single templates of the different terminal device models (i.e., the device side) in different storage addresses respectively (as shown in table 2), and the device side accesses the corresponding storage address according to the terminal device model to obtain the corresponding single template of the server side.
TABLE 2
The method further comprises the following steps: the service end compresses the single-sided picture; and the equipment side acquires the compressed menu picture from the server side. In order to save system resources and improve data transmission speed, the face picture can be properly compressed to reduce the storage space occupied by the face single picture. For example, a picture may be compressed using a DCT (discrete cosine transform) discrete cosine transform compression algorithm, and in order to reduce the computational complexity of compression, the picture is coded using DCT to convert each pixel of the synthesized picture from RGB to YUV coordinate system. As shown in fig. 2, each pixel point may extract a matrix, and the DCT transform is performed on the pixel matrix to achieve the purpose of compressing the picture, thereby improving the transmission efficiency and the transmission speed.
Step S102 represents that the device side updates the device side single template with the service side single template or saves the side single picture. The single-sided picture may be stored in a cache of the device side or a storage disk of the device side.
One embodiment of the invention is that the equipment end uses the equipment end face single template or a surface single picture obtained from the server end to print a surface single; the equipment side uploads the bill of dough to cloud storage; and the cloud storage generates an access link and/or a two-dimensional code of the menu. Another embodiment of the invention is that the equipment side sends a printing completion notification to the server side, and the server side uploads the printed single-sided picture to the cloud storage.
The access link and the two-dimensional code can be used for tracing the bill, and when the bill needs to be printed or viewed again, the bill can be viewed on a computer through the access link or viewed at a mobile terminal through a mobile phone terminal. One embodiment of the invention adopts a bi-directional verification https link generation rule for safety, adds a signature verification mode to an access link for safety control and verification, and adopts an AES asymmetric encryption mode as a signature mode.
FIG. 3 is a preferred implementation of an embodiment of the invention, as shown in FIG. 3:
1. the equipment side accesses the server side to obtain a single template or a single picture of the server side;
2. the equipment side acquires a service end face single template or a single picture with a zip packaging format through an interface of the service side, wherein the single picture is compressed through DCT before being acquired;
3. and the equipment end updates the equipment end face single template by using the service end face single template or stores the face single picture.
4. The equipment side prints the surface sheet according to the updated surface sheet; or printing the menu according to the stored menu picture;
5. after the surface sheet is printed, storing the surface sheet or the surface sheet picture into cloud storage;
6. and the cloud storage generates an access link or a two-dimensional code of the bill of surface.
Fig. 4 is a schematic diagram of the main parts of an apparatus 400 for updating a bill of dough according to an embodiment of the present invention, as shown in fig. 4:
the apparatus 400 includes an equipment side 401 and a server side 402, where the equipment side 401 includes an obtaining module 4011 configured to obtain a single template or a single picture of a service side from the server side 402; the device side 401 further includes an updating module 4012, where the updating module 4012 is configured to update the device side single template with the service side single template or store the side single picture. The purpose is to set the facebook template and the facebook picture in the server 402 for the device 401 to obtain. The device end 401 may be a device with a function of printing a receipt, such as a handheld receipt printer used by a courier; the server 402 may be a server with networking capability, or the like. The service-side receipt template is a template stored in the service-side 402 and used for printing the receipt, and the receipt template and receipt information (such as recipient information and sender information) are combined to produce an effective receipt. In an embodiment, the service-side single template may be in a text form, and is encapsulated in a compressed package, for example, the service-side single template is uploaded to a cloud storage service in a format of a zip (compressed package encapsulation format) file, when the terminal device (device 401) performs printing, the service-side 402 provides an interface for acquiring the service-side single template for the terminal device, and the terminal device acquires the service-side single template to the terminal device through the interface in an inputstream file manner. When the single template of the service terminal is upgraded and changed, only the zip file of the template needs to be uploaded again, and the terminal equipment does not need to be upgraded. The menu picture refers to a menu with a picture format, such as jbig, jpg and the like, the menu picture can be stored in the cloud storage with the menu number as an index value, and when the terminal device needs to print the menu, the menu picture is inquired from the cloud storage engine with the menu number as an index by calling the interface of the server 402. One embodiment of the invention is that the device 401 has a networking function, and directly accesses the server 402 through the internet to obtain a single template or a single picture of the server; another embodiment of the present invention is that the device side 401 may also indirectly obtain the service side single template or the service side single picture through other networking devices (such as only a mobile phone, etc.), that is, the service side single template or the service side single picture is obtained by the other networking devices first, and then forwarded to the device side 401 through a wireless mode such as bluetooth or near field communication, or a wired transmission mode. Whether the service end face single template or the face single picture is stored in the service end 402, when the face single template is updated, only the service end face single template needs to be updated, and software upgrading on the equipment end is not needed.
The obtaining module 4011 is further configured to obtain, from the server 402, a version number of the server-side single template; the device side 401 further includes a comparing module, configured to compare the version number of the service end face single template with the version number of the stored device end face single template; the device side 401 may further include a sending module, configured to send a single panel update request to the server side 402 by the device side 401 if the version number of the single template of the service side is different from the version number of the single template of the device side.
The obtaining module 4011 is further configured to periodically obtain a version number of the service-side single template from the service-side 402, and/or obtain the version number of the service-side single template from the service-side 402 after the device-side 401 receives the print job.
The server 402 may further include an authentication module, configured to authenticate the identifier of the device 401; the obtaining module 4011 is further configured to obtain the service-side form template or the form picture from the service side 402 after the authentication is passed. If the terminal ID of the device side is verified to be included in table 1 by the authentication module, if so, it indicates that the device side is a device side capable of updating the facebook template.
The server 402 may further include a second sending module, configured to send a single-panel update notification to the device 401.
The apparatus 400 may also include a cloud storage device; the device side 401 further includes a printing module, configured to print a bill using the device end face bill template or a bill picture obtained from the server side; the uploading module is used for uploading the menu to the cloud storage equipment; the cloud storage device is further used for generating an access link and/or a two-dimensional code of the menu. Another embodiment of the present invention is that the device side 401 sends a print completion notification to the server side 402, and the server side 402 uploads the printed simplex image to the cloud storage. The access link and the two-dimensional code can be used for tracing the bill, and when the bill needs to be printed or viewed again, the bill can be viewed on a computer through the access link or viewed at a mobile terminal through a mobile phone terminal. One embodiment of the invention adopts a bi-directional verification https link generation rule for safety, adds a signature verification mode to an access link for safety control and verification, and adopts an AES asymmetric encryption mode as a signature mode.
The server 402 may further include a receiving module for receiving the receipt information; and the generating module is used for generating the menu picture according to the menu information.
The server 402 may further include a compression module for compressing the facebook picture; the acquisition module is further used for acquiring the compressed menu picture from the server. For example, a picture may be compressed using a DCT (discrete cosine transform) discrete cosine transform compression algorithm, and in order to reduce the computational complexity of compression, the picture is coded using DCT to convert each pixel of the synthesized picture from RGB to YUV coordinate system. As shown in fig. 2, each pixel point may extract a matrix, and the DCT transform is performed on the pixel matrix to achieve the purpose of compressing the picture, thereby improving the transmission efficiency and the transmission speed.
Fig. 5 illustrates an exemplary system architecture 500 of a method or apparatus for updating a menu to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. Various communication client applications, such as an online printing application, a cloud storage application, a web browser application, a search application, an instant messaging tool, and the like, may be installed on the terminal devices 501, 502, and 503.
The terminal devices 501, 502, 503 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and facebook printers, among others.
The server 505 may be a server that provides various services, such as a background management server that provides support for a user to print a page with a form browsed by the terminal devices 501, 502, 503. The background management server may analyze and otherwise process the received data such as the waybill information query request, and feed back the processing result (e.g., the target push information and the waybill information) to the terminal device.
It should be noted that the server in the method for updating a menu provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the server in the apparatus for updating a menu is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 6 is a block diagram illustrating a computer system 600 suitable for implementing a terminal device according to an embodiment of the invention. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that 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 section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, the processes described in the above step diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, the disclosed embodiments of the invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the step diagrams. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable media shown in the present invention include computer readable signal media or computer readable storage media, or any combination of the two. A computer readable storage medium includes, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, semiconductor system, apparatus, or device, or any combination of the foregoing. Computer-readable storage media specifically include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any combination of the foregoing. In the present invention, a computer readable storage medium includes any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device; a computer readable signal medium includes a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave, which may take many forms, including, but not limited to, electromagnetic signals, optical signals, or any combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF (radio frequency), etc., or any combination of the preceding.
The block diagrams or step diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention, may each represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or step diagrams, and combinations of blocks in the block diagrams or step diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described modules or units may also be provided in a processor, and may be described as: a processor includes an acquisition module and an update module. The names of these modules or units do not in some cases constitute a limitation on the modules or units themselves, and for example, the acquiring module may also be described as a "module for acquiring a service-side sheet template or sheet picture from the service side 402".
On the other hand, the embodiment of the present invention also provides a computer-readable medium, which may be included in the apparatus described in the above embodiment; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: the equipment side acquires a service side single template or a service side single picture from the service side; and the equipment end updates the equipment end face single template by using the service end face single template or stores the face single picture.
According to the technical scheme of the embodiment of the invention, the bill of surface template can be updated on the premise of not upgrading the terminal equipment software, the real-time replacement of the bill of surface template is realized, and the printed bill of surface can be traced through a network.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.