CN105589686B - Template-based information input and printing method and device under WinCE platform - Google Patents

Template-based information input and printing method and device under WinCE platform Download PDF

Info

Publication number
CN105589686B
CN105589686B CN201410648336.9A CN201410648336A CN105589686B CN 105589686 B CN105589686 B CN 105589686B CN 201410648336 A CN201410648336 A CN 201410648336A CN 105589686 B CN105589686 B CN 105589686B
Authority
CN
China
Prior art keywords
data
interface
printing
control
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410648336.9A
Other languages
Chinese (zh)
Other versions
CN105589686A (en
Inventor
赵轶民
王俊杰
武志鹏
贺正林
李毅
陈懿
胡金辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aisino Corp filed Critical Aisino Corp
Priority to CN201410648336.9A priority Critical patent/CN105589686B/en
Publication of CN105589686A publication Critical patent/CN105589686A/en
Application granted granted Critical
Publication of CN105589686B publication Critical patent/CN105589686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a template-based information input and printing method and device under a WinCE platform. The method comprises the following steps: generating interface template data according to a pre-stored interface template file, generating an entry interface according to the interface template data, and displaying the entry interface on a display screen of the WinCE platform; forming a data structure MAP according to the input information, wherein data units in the data structure MAP comprise keywords and values of the keywords, and storing the data structure MAP in a database; and converting the data structure MAP stored in the database into printing data based on the set ticket sample picture, and printing. The embodiment of the invention can meet the personalized requirements of users in the aspects of user data entry, data storage, data printing and the like, and the experience effect of the users is good. By adopting the general data structure MAP to transmit data among the modules, the problem that the program interfaces among different modules are modified due to the increase of parameters can be effectively avoided, and the working efficiency of the whole scheme is improved.

Description

Template-based information input and printing method and device under WinCE platform
Technical Field
The invention relates to the technical field of information processing, in particular to a template-based information input and printing method and device under a WinCE (Windows Embedded Compact, Microsoft Windows) platform.
Background
At present, embedded products are developed towards the color screen and touchable directions, and users are closer to PCs when using the embedded products. WinCE is an embedded and mobile computing platform of Microsoft corporation, which is an open and upgradable 32-bit embedded operating system and is an operating system of electronic equipment based on palm computers. The WinCE platform is an embedded product, is widely used in industrial production as an embedded device development platform due to its low power consumption and low requirement for hardware devices, and for example, can be used for manufacturing embedded invoicing devices.
In order to make the product closer to a PC in use feeling and make the use more comfortable for users, the product is required to follow the existing Windows operating system in input and use habits, and the WinCE platform is used as a brother product of Windows, and the use habits are similar to the indows on the PC. However, the screen, storage capacity and operation speed of the embedded product are far less than those of a PC, and users generally want to display a large amount of content on the limited screen of the WinCE platform, and the display content is different from user to user, and the database also stores the most useful data for the users as much as possible. Therefore, it is a problem to be solved urgently to develop an efficient information processing method for the WinCE platform.
Disclosure of Invention
The embodiment of the invention provides a template-based information input and printing method and device under a WinCE platform, which are used for improving the information processing efficiency of information input, printing and the like under the WinCE platform.
The invention provides the following scheme:
a template-based information input and printing method under a WinCE platform comprises the following steps:
generating interface template data according to a pre-stored interface template file, generating an entry interface according to the interface template data, and displaying the entry interface on a display screen of a WinCE platform;
receiving entry information of a user in the entry interface, forming a data structure MAP according to the entry information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and storing the data structure MAP in a database;
and converting the data structure MAP stored in the database into printing data based on the set ticket sample picture, and transmitting the printing data to a printer for printing.
The method further comprises the following steps:
storing various template files in a database, wherein the template files comprise an interface template file, a database template file and a printing template file, and the interface template file comprises: page size information, a page display form and control node information, wherein one interface template file comprises one or more pieces of control node information, each piece of control node information corresponds to one control, and the control node information comprises: the control identification, the generation of the control type, the control coordinate and width, the control default value and the CHECK character string CHECK field for parameter CHECK.
The method comprises the following steps of generating interface template data according to a pre-stored interface template file, generating an entry interface according to the interface template data, and displaying the entry interface on a display screen of a WinCE platform, wherein the method comprises the following steps:
after a user logs in a WinCE platform, reading an interface template file stored in the database, and generating interface template data according to the interface template file, wherein the interface template data comprises interface control information and interface input data;
and pushing the interface template data to a display screen under the WinCE platform, determining the display mode and the input mode of the input interface according to the interface template data, generating the input interface, and displaying the input interface on the display screen.
The method comprises the steps of receiving input information of a user in the input interface, forming a data structure MAP according to the input information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and storing the data structure MAP in a database, and comprises the following steps:
receiving input information of a user in the input interface, verifying the input information according to a verification rule defined in a CHECK character string CHECK field in an interface template file, and storing the input information passing verification as memory data;
extracting values, which are input by a user in each control and are contained in the memory data, acquiring control identification information according to an ID field in control node information in the interface template file, taking the control identification information as a keyword Key in a data unit in a data structure MAP, and taking the value, which is input by the user in the control, as the value of the keyword Key in the data unit;
and forming a plurality of data units according to the memory data and the interface template file, wherein each data unit corresponds to one control, forming a data structure MAP from all the data units, transmitting the data structure MAP to a database storage module, and storing the data structure MAP in a database in the database storage module.
The storing the data structure MAP in the database storage module includes:
setting a database template file to comprise keywords and data storage position coordinates, and after receiving the data structure MAP, a database storage module analyzes the data structure MAP and extracts each data unit in the data structure MAP;
setting the name of a data field in a data list in a database to be the same as the Key word Key in the data structure, wherein the value stored in the data field is the data storage position of the value of the Key word Key in the data structure, and storing the value of the Key word in the data structure on the storage address in the hard disk or on the actual data table.
The setting-based ticket sample picture converts a data structure MAP stored in the database into printing data, and transmits the printing data to a printer for printing, and the method comprises the following steps:
extracting a data field name in the data list as a keyword in one data unit in the MAP, using a value stored in a data field in the data list as a storage address, finding out the value stored in the storage address, using the value as the value of the keyword in the data unit, forming a plurality of data units according to the data list, forming all the data units into a data structure MAP, and transmitting the data structure MAP to a printing control module;
setting a printing control template comprising keywords, coordinates x, coordinates y, coordinate widths, seat heights and default display characters, analyzing the data structure MAP by the printing control module, inquiring the printing template file by the keywords contained in the data unit, and acquiring the default display characters of the control corresponding to the keywords by combining the values of the keywords;
the printing control module prints default display characters corresponding to each keyword and values of the keywords in a printed coordinate area according to coordinates specified in a printing template file to obtain basic images corresponding to each control, creates a blank image area, loads a ticket image, sequentially draws all the basic image areas on the ticket image to generate an invoice image, converts the invoice image into printing data, and sends the printing data to a printer for printing.
A template-based information input and printing device under a WinCE platform comprises: a database storage module, an interface control module and a printing control module,
the database storage module is used for storing an interface template file in advance and storing the data structure MAP transmitted by the interface control module in a database; when printing is needed, transmitting a data structure MAP stored in the database to a printing control module;
the interface control module is used for generating interface template data according to a pre-stored interface template file, generating an input interface according to the interface template data, and displaying the input interface on a display screen of the WinCE platform; receiving input information of a user in the input interface, forming a data structure MAP according to the input information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and transmitting the data structure MAP to a database storage module; storing in a database;
and the printing control module is used for converting the data structure MAP transmitted by the database storage module into printing data based on the set ticket image and printing the printing data.
The database storage module is specifically used for storing various template files in a database, wherein the template files comprise an interface template file, a database template file and a printing template file, and the interface template file comprises: page size information, a page display form and control node information, wherein one interface template file comprises one or more pieces of control node information, each piece of control node information corresponds to one control, and the control node information comprises: the control identification, the generation of the control type, the control coordinate and width, the control default value and the CHECK character string CHECK field for parameter CHECK.
The interface control module is specifically used for reading an interface template file stored in the database after a user logs in a WinCE platform, and generating interface template data according to the interface template file, wherein the interface template data comprises interface control information and interface input data;
and pushing the interface template data to a display screen under the WinCE platform, determining the display mode and the input mode of the input interface according to the interface template data, generating the input interface, and displaying the input interface on the display screen.
The interface control module is specifically used for receiving input information of a user in the input interface, verifying the input information according to a verification rule defined in a CHECK character string CHECK field in an interface template file, and storing the input information passing verification as memory data;
extracting values, which are input by a user in each control and are contained in the memory data, acquiring control identification information according to an ID field in control node information in the interface template file, taking the control identification information as a keyword Key in a data unit in a data structure MAP, and taking the value, which is input by the user in the control, as the value of the keyword Key in the data unit;
and forming a plurality of data units according to the memory data and the interface template file, wherein each data unit corresponds to one control, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a database storage module.
The database storage module is specifically used for setting a database template file comprising keywords and data storage position coordinates, receiving the data structure MAP, analyzing the data structure MAP and extracting each data unit in the data structure MAP; setting a data field name in a data list in a database to be the same as a Key word Key in the data structure, wherein a value stored in the data field is a data storage position of the value of the Key word Key in the data structure, and storing the value of the Key word in the data structure on a storage address in a hard disk or on an actual data table;
when printing is needed, extracting a data field name in the data list as a keyword in one data unit in the MAP, using a value stored in a data field in the data list as a storage address, finding a value stored in the storage address, using the value as a value of the keyword in the data unit, forming a plurality of data units according to the data list, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a printing control module.
The printing control module is specifically configured to set a printing control template including keywords, a coordinate x, a coordinate y, a coordinate width, a coordinate height and default display characters, and the printing control module analyzes the data structure MAP, queries the printing template file using the keywords included in the data unit, and obtains the default display characters of the control corresponding to the keywords by combining values of the keywords;
according to the specified coordinates in the printing template file, default display characters corresponding to each keyword and values of the keywords are printed in a printed coordinate area to obtain basic images corresponding to each control, a blank image area is created, a ticket image is loaded, all the basic image areas are drawn on the ticket image in sequence to generate an invoice image, the invoice image is converted into printing data, and the printing data is sent to a printer to be printed.
According to the technical scheme provided by the embodiment of the invention, the interface template file, the database template file and the printing template file are customized in advance according to the requirements of the user, different modules respectively utilize corresponding templates to process data, and the personalized requirements of the user can be met in the aspects of user data entry, data storage, data printing and the like. The embodiment of the invention has no requirement on the specific file format of the template, and the conversion work of the template file type can be completed only by modifying the analysis rule of the template file when the file formats are different, so the scheme of the embodiment of the invention is strong. The embodiment of the invention adopts the general data structure MAP to transmit data among the modules, can effectively avoid the problem that the program interfaces among different modules are modified due to the increase of parameters, can realize the seamless connection among different modules, and improves the working efficiency of the whole scheme.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a processing flow chart of a template-based information entry and printing method under a WinCE platform according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a text box display according to an embodiment of the present invention;
figure 3 is a flowchart of an invoice printing process according to an embodiment of the present invention,
fig. 4 is a diagram of a specific implementation structure of a template-based information entry and printing apparatus under a WinCE platform according to a second embodiment of the present invention, in which a database storage module 41, an interface control module 42, and a print control module 43 are shown.
Detailed Description
For the convenience of understanding the embodiments of the present invention, the following description will be further explained by taking several specific embodiments as examples in conjunction with the drawings, and the embodiments are not to be construed as limiting the embodiments of the present invention.
Example one
The embodiment of the invention designs an integral solution about three aspects of input interface, database storage and invoice printing, which is a universal dynamically configurable solution, and a user influences the interface, the database and the printing function by modifying a configuration file. The data can be effectively transmitted and stored in a series of data operations of user interface, database storage, typesetting and printing.
The embodiment provides a processing flow of a template-based information entry and printing method and device under a WinCE platform as shown in FIG. 1, which comprises the following processing steps:
and step S110, storing the interface template file, the database template file and the printing template file in a database.
In the information input and printing system based on the template under the WinCE platform, an interface control module, a database storage module and a printing control module are arranged according to the requirements of users, and data transmission is carried out among the modules through an agreed data structure.
According to the embodiment of the invention, various template files are stored in the database storage module according to various invoices of a user, wherein the template files comprise an interface template file, a database template file and a printing template file. The interface template file, the database template file and the printing template file are set according to the individual requirements of users, and different users can correspond to different interface template files, database template files and printing template files.
The template file body may be an ini file, a txt file, an xml (extensible Markup Language) file, and the like, and the embodiment of the present invention is described by taking an xml file as an example.
The interface template file comprises: page size information, page display form and a plurality of control node information. The page size information includes the size of the display page in units of pixels. The page display forms are divided into a text box display form and a table display form, and can be randomly selected according to needs, but only one style can be arranged in one interface. A schematic diagram of a text box display provided by this embodiment is shown in fig. 2.
The information stored in the data structure of the control node information may include: control identification, control type generation, control coordinate and width, control default values and CHECK (character string for parameter CHECK) fields. The control identification can not be empty, the control identification is the only identity identification for determining the filling content of the specific control, the control type determines the display type of the control, the control coordinate determines the display position of the control, when the coordinate exceeds the height of one screen, the multi-screen display is automatically converted, and the content of the corresponding page is displayed after page turning operation. The default values of the controls determine the content that is automatically filled in after the controls are displayed. The parameter check character string records relevant parameters required by the control, such as whether to allow null, check information of maximum and minimum values and the like, and is used for controlling the control to enter content. The function module is also used for the storage and printing functions, and different field data are used for different function modules.
The content and description of the control node information provided by the embodiment are as follows:
Figure BDA0000608482910000071
and one template file is provided with a plurality of control node information contents, and each control node information content corresponds to one control.
Step S120, after the user logs in the template-based information entry and printing system on the WinCE platform according to the embodiment of the present invention, the interface control module reads the interface template file stored in the database, and generates interface template data according to the interface template file, where the interface template data includes interface control information, interface entry data, and other contents.
The interface control module pushes the interface template data to a display screen under a WinCE platform, an input interface is generated according to the interface template data, information of the input interface comprises items controlled by an interface template file, and meanwhile, the interface template file also comprises information such as set control type, coordinates and parameters. This information determines how the final interface will look and how it will be entered.
Then, an entry interface is displayed on the display screen.
Step S130, the interface control module receives the input information of the user in the input interface, and verifies the input information according to a verification rule defined in a CHECK field in the interface template file, where the verification rule may be: cannot be empty, maximum length 52 characters, only numbers, etc.
And the interface control module stores the input information passing the verification as memory data.
Step S140, the interface control module forms a data structure MAP according to the stored data and transmits the data structure MAP to the database storage module.
The embodiment of the invention transmits data among an interface control module, a database storage module and a printing control module through an MAP (associated container), wherein the MAP is a data structure, the MAP comprises a plurality of data units, each data unit comprises two data, the first data is called a keyword and is represented by keys, each Key corresponds to a control, the keys in the MAP are not repeated, and the second data is called the value of the keyword.
The interface control module extracts values of the user input in each control contained in the memory data, acquires control identification information according to an ID field in control node information in the interface template file, uses the control identification information as a keyword in a data unit in MAP, and uses the value of the user input in the control as the value of the keyword in the data unit.
And the interface control module forms a plurality of data units according to the input information, each data unit corresponds to one control, all the data units form a data structure MAP, and the data structure MAP is transmitted to the database storage module.
Step S150, recording the key words and the coordinates of the data storage positions in the database template file, wherein the form of the database template file is as follows:
Figure BDA0000608482910000081
and the database storage module analyzes the data structure MAP after receiving the data structure MAP transmitted by the interface control module, extracts each data unit in the data structure MAP, and stores each data unit in a data list in the database according to the database template file.
In the data list in the database, the name of the data field is the same as the Key in the data structure, and the value stored in the data field is the data storage location of the value of the Key in the data structure, for example, if the value of the Key in the data structure is stored at a certain storage address in the hard disk or at the row and column of the actual data table, the value stored in the data field is at a certain storage address in the hard disk or at the row and column of the actual data table.
And step S160, after the database storage module stores the data, when the data needs to be printed, the database storage module transmits the data to the printing control module through the data structure MAP.
The database storage module extracts the data field name in the data list in the database as a keyword in a data unit in the MAP, uses the value stored in the data field in the data list as a storage address, finds the value stored in the storage address, and uses the value as the value of the keyword in the data unit.
And the database storage module forms a plurality of data units according to the data list, each data unit corresponds to one control, all the data units form a data structure MAP, and the data structure MAP is transmitted to the printing control module.
The content of the printing template file in the embodiment of the invention is as follows:
Figure BDA0000608482910000091
and the default display characters in the printing template file are flexibly set according to the control attributes and other contents in the control node information.
An invoice printing flowchart provided by an embodiment of the present invention is shown in fig. 3, and the specific processing procedure includes: and the printing control module analyzes the data structure MAP after receiving the data structure MAP transmitted by the database storage module, extracts each data unit in the data structure MAP, queries the printing template file by using keywords contained in the data units, and acquires default display characters of the control corresponding to the keywords by combining the values of the keywords, wherein the default display characters are pre-printed characters.
And the printing control module prints default display characters and key word values corresponding to each control (namely the key words) in the printed coordinate area according to the specified coordinates and alignment modes in the printing template file to obtain the basic images corresponding to each control respectively.
Then, a blank image area is created firstly, then a ticket image is loaded, so that a basic image for printing an invoice is created, then each item name and the coordinates of the item name in a printing template file are read, all the basic image areas are drawn on the ticket image in sequence, the character typesetting, line drawing and graphic drawing are realized, and then the invoice image is generated. And converting the drawn ticket sample picture into printing data, and sending the printing data to a printer to finish invoice printing.
Specifically, the method comprises the following steps: after the invoice image is generated, the invoice image is converted into dot matrix data according to the color value of each bit of the invoice image data, and in the data conversion process, offset, rotation and other operations are performed on the printing data according to the page attributes in the printing template file, if the printing data cannot be printed on one piece of invoice paper, the system can automatically page the printing data. And finally, the system sends the generated dot matrix data to a printer to finish invoice printing.
In a preferred embodiment of the present invention, after the database storage module stores the entry data, the database storage module generates sql statements according to the data field names and the data item storage locations specified in the database template file, and different sql statements may be generated according to different template contents. For example: the parameter MAP stores a pair of data of < FPDM,123456>, according to the key word of the FPDM, the value of "123456" is taken from the parameter MAP, and then a part of the sql statement is spliced: FPDM ═ 123456'. And traversing all the nodes in the template file, and then generating the finished sql statement.
In a preferred embodiment of the present invention, the interface control module is further responsible for generating each control, and when the ordinate exceeds the height of one screen, the height of one screen is gradually subtracted until the remaining height is within one screen height, and the control attribute is set to be hidden. Default values for the controls and partial property parameters are done in this module, such as maximum length limits, etc.
The interface control module also distinguishes screen numbers of the controls according to the generated control coordinates, and displays the corresponding controls according to the page numbers to be displayed. And hiding the control of the non-local screen and saving the information into the interface data. In the control, before the data is saved in the interface data, the CHECK item in the template CHECK item and the corresponding parameter type are used for checking. When the interface data is changed, such as after automatic calculation, and is to be displayed on the interface again, the display refreshing action is also completed through the module.
The interface control module can store the interface data content in the memory data area and can also synchronize the data in the memory to the interface data area, and the data synchronization direction is determined by the parameters when the module is called. In this control, before the data is saved in the memory data, the CHECK item and the corresponding parameter type in the template CHECK item are used for checking. When other functional modules want to operate the interface, the memory data is modified, then the module is called to reflect the data to the interface data, and finally the function of modifying the display interface is completed.
Example two
The embodiment provides a template-based information input and printing device under a WinCE platform, which is characterized by comprising: the specific implementation structure of the database storage module, the interface control module, and the print control module is shown in fig. 4, and may specifically include the following modules: a database storage module 41, an interface control module 42 and a print control module 43,
the database storage module 41 is configured to store an interface template file in advance, and store the data structure MAP transmitted by the interface control module in a database; when printing is needed, transmitting a data structure MAP stored in the database to a printing control module;
the interface control module 42 is configured to generate interface template data according to a pre-stored interface template file, generate an entry interface according to the interface template data, and display the entry interface on a display screen of the WinCE platform; receiving input information of a user in the input interface, forming a data structure MAP according to the input information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and transmitting the data structure MAP to a database storage module; storing in a database;
and the printing control module 43 is configured to convert the data structure MAP transmitted by the database storage module into printing data based on the set ticket image, and print the printing data.
Further, the database storage module 41 is specifically configured to store various template files in a database, where the template files include an interface template file, a database template file, and a printing template file, and the interface template file includes: page size information, a page display form and control node information, wherein one interface template file comprises one or more pieces of control node information, each piece of control node information corresponds to one control, and the control node information comprises: the control identification, the generation of the control type, the control coordinate and width, the control default value and the CHECK character string CHECK field for parameter CHECK.
Further, the interface control module 42 is specifically configured to, after a user logs in a WinCE platform, read an interface template file stored in the database, and generate interface template data according to the interface template file, where the interface template data includes interface control information and interface entry data;
and pushing the interface template data to a display screen under the WinCE platform, determining the display mode and the input mode of the input interface according to the interface template data, generating the input interface, and displaying the input interface on the display screen.
Further, the interface control module 42 is specifically configured to receive entry information of a user in the entry interface, verify the entry information according to a verification rule defined in a parameter CHECK character string CHECK field in an interface template file, and store the entry information that passes the verification as memory data;
extracting values, which are input by a user in each control and are contained in the memory data, acquiring control identification information according to an ID field in control node information in the interface template file, taking the control identification information as a keyword Key in a data unit in a data structure MAP, and taking the value, which is input by the user in the control, as the value of the keyword Key in the data unit;
and forming a plurality of data units according to the memory data and the interface template file, wherein each data unit corresponds to one control, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a database storage module.
Further, the database storage module 41 is specifically configured to set a database template file to include keywords and data storage location coordinates, and after receiving the data structure MAP, analyze the data structure MAP and extract each data unit included in the data structure MAP; setting a data field name in a data list in a database to be the same as a Key word Key in the data structure, wherein a value stored in the data field is a data storage position of the value of the Key word Key in the data structure, and storing the value of the Key word in the data structure on a storage address in a hard disk or on an actual data table;
when printing is needed, extracting a data field name in the data list as a keyword in one data unit in the MAP, using a value stored in a data field in the data list as a storage address, finding a value stored in the storage address, using the value as a value of the keyword in the data unit, forming a plurality of data units according to the data list, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a printing control module.
Further, the print control module 43 is specifically configured to set a print control template including keywords, a coordinate x, a coordinate y, a coordinate width, a coordinate height, and default display characters, and the print control module analyzes the data structure MAP, queries the print template file using the keywords included in the data unit, and obtains the default display characters of the control corresponding to the keywords by combining values of the keywords;
according to the specified coordinates in the printing template file, default display characters corresponding to each keyword and values of the keywords are printed in a printed coordinate area to obtain basic images corresponding to each control, a blank image area is created, a ticket image is loaded, all the basic image areas are drawn on the ticket image in sequence to generate an invoice image, the invoice image is converted into printing data, and the printing data is sent to a printer to be printed.
The specific process of using the device of the embodiment of the invention to perform template-based information entry and printing on a WinCE platform is similar to that of the method embodiment, and is not repeated here.
In summary, in the embodiment of the present invention, the interface template file, the database template file, and the print template file are pre-customized according to the requirements of the user, and different modules respectively process data by using corresponding templates, so that personalized requirements of the user can be met in the aspects of user data entry, data storage, data printing, and the like. The embodiment of the invention has no requirement on the specific file format of the template, and the conversion work of the template file type can be completed only by modifying the analysis rule of the template file when the file formats are different, so the scheme of the embodiment of the invention is strong. The embodiment of the invention adopts the general data structure MAP to transmit data among the modules, can effectively avoid the problem that the program interfaces among different modules are modified due to the increase of parameters, can realize the seamless connection among different modules, and improves the working efficiency of the whole scheme. The scheme of the embodiment of the invention effectively improves the information processing efficiency of information input, printing and the like under the WinCE platform.
The embodiment of the invention can effectively avoid the problem of modifying the program interface due to the increase of the parameters by adopting the data structure MAP form to transmit data, and can finish transmission at one time no matter the number of the parameters as long as the function interior operates according to the corresponding KEY value. Meanwhile, as for the new program and the old program, the old program does not use corresponding variables, and new variables can be ignored, so that the aim of seamless connection can be fulfilled, and the coupling between modules is greatly reduced.
The embodiment of the invention has strong expandability in checking the data input by the user, can achieve the function of expanding the checking items only by increasing the content of the CHECK field and then adding corresponding parameter checking processing in the interface display and access module, does not increase specific variables, and further improves the reusability and the expandability of the codes.
The data storage in the embodiment of the invention is controlled by the template, so that each stored data is valuable, and useless data does not exist. This ensures that the most efficient data is stored in a limited memory space. And a large number of possible fields are not required to be arranged in the database in advance, so that the field design work of the database is saved.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for apparatus or system embodiments, since they are substantially similar to method embodiments, they are described in relative terms, as long as they are described in partial descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A template-based information input and printing method under a WinCE platform is characterized by comprising the following steps:
generating interface template data according to a pre-stored interface template file, generating an entry interface according to the interface template data, and displaying the entry interface on a display screen of a WinCE platform, wherein the entry interface comprises a plurality of controls; all controls are distinguished by screen numbers according to generated control coordinates, corresponding controls are displayed according to the page numbers to be displayed, and controls which are not on the screen are hidden;
when the interface data changes and needs to be displayed on the interface again, finishing the display refreshing action;
receiving entry information of a user in the entry interface, forming a data structure MAP according to the entry information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and storing the data structure MAP in a database;
and when printing is needed, converting the data structure MAP stored in the database into printing data based on the set ticket sample picture, and transmitting the printing data to a printer for printing.
2. The method for template-based information entry and printing under a WinCE platform according to claim 1,
the method further comprises the following steps:
storing various template files in a database, wherein the template files comprise an interface template file, a database template file and a printing template file, and the interface template file comprises: page size information, a page display form and control node information, wherein one interface template file comprises one or more pieces of control node information, each piece of control node information corresponds to one control, and the control node information comprises: the control identification, the generation of the control type, the control coordinate and width, the control default value and the CHECK character string CHECK field for parameter CHECK.
3. The method for template-based information entry and printing under a WinCE platform according to claim 1,
the method comprises the following steps of generating interface template data according to a pre-stored interface template file, generating an entry interface according to the interface template data, and displaying the entry interface on a display screen of a WinCE platform, wherein the method comprises the following steps:
after a user logs in a WinCE platform, reading an interface template file stored in the database, and generating interface template data according to the interface template file, wherein the interface template data comprises interface control information and interface input data;
and pushing the interface template data to a display screen under the WinCE platform, determining the display mode and the input mode of the input interface according to the interface template data, generating the input interface, and displaying the input interface on the display screen.
4. The method for template-based information entry and printing under a WinCE platform according to claim 1,
the method comprises the steps of receiving input information of a user in the input interface, forming a data structure MAP according to the input information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and storing the data structure MAP in a database, and comprises the following steps:
receiving input information of a user in the input interface, verifying the input information according to a verification rule defined in a CHECK character string CHECK field in an interface template file, and storing the input information passing verification as memory data;
extracting values, which are input by a user in each control and are contained in the memory data, acquiring control identification information according to an ID field in control node information in the interface template file, taking the control identification information as a keyword Key in a data unit in a data structure MAP, and taking the value, which is input by the user in the control, as the value of the keyword Key in the data unit;
and forming a plurality of data units according to the memory data and the interface template file, wherein each data unit corresponds to one control, forming a data structure MAP from all the data units, transmitting the data structure MAP to a database storage module, and storing the data structure MAP in a database in the database storage module.
5. The method for template-based information entry and printing under a WinCE platform according to claim 4,
the storing the data structure MAP in the database storage module includes:
setting a database template file to comprise keywords and data storage position coordinates, and after receiving the data structure MAP, a database storage module analyzes the data structure MAP and extracts each data unit in the data structure MAP;
setting the name of a data field in a data list in a database to be the same as the Key word Key in the data structure, wherein the value stored in the data field is the data storage position of the value of the Key word Key in the data structure, and storing the value of the Key word in the data structure on the storage address in the hard disk or on the actual data table.
6. The method for template-based information entry and printing under a WinCE platform according to claim 5,
the setting-based ticket sample picture converts a data structure MAP stored in the database into printing data, and transmits the printing data to a printer for printing, and the method comprises the following steps:
extracting a data field name in the data list as a keyword in one data unit in the MAP, using a value stored in a data field in the data list as a storage address, finding out the value stored in the storage address, using the value as the value of the keyword in the data unit, forming a plurality of data units according to the data list, forming all the data units into a data structure MAP, and transmitting the data structure MAP to a printing control module;
setting a printing control template comprising keywords, coordinates x, coordinates y, coordinate widths, seat heights and default display characters, analyzing the data structure MAP by the printing control module, inquiring a printing template file by the keywords contained in the data unit, and acquiring the default display characters of the control corresponding to the keywords by combining the values of the keywords;
the printing control module prints default display characters corresponding to each keyword and values of the keywords in a printed coordinate area according to coordinates specified in a printing template file to obtain basic images corresponding to each control, creates a blank image area, loads a ticket image, sequentially draws all the basic image areas on the ticket image to generate an invoice image, converts the invoice image into printing data, and sends the printing data to a printer for printing.
7. The utility model provides an information input, printing apparatus based on template under winCE platform which characterized in that includes: a database storage module, an interface control module and a printing control module,
the database storage module is used for storing an interface template file in advance and storing the data structure MAP transmitted by the interface control module in a database; when printing is needed, transmitting a data structure MAP stored in the database to a printing control module;
the interface control module is used for generating interface template data according to a pre-stored interface template file, generating an input interface according to the interface template data, and displaying the input interface on a display screen of the WinCE platform; receiving input information of a user in the input interface, forming a data structure MAP according to the input information, wherein a data unit in the data structure MAP comprises a keyword and a value of the keyword, and transmitting the data structure MAP to a database storage module; storing in a database; and for generating a plurality of controls; all controls are distinguished by screen numbers according to generated control coordinates, corresponding controls are displayed according to the page numbers to be displayed, and controls which are not on the screen are hidden;
when the interface data changes and needs to be displayed on the interface again, finishing the display refreshing action;
and the printing control module is used for converting the data structure MAP transmitted by the database storage module into printing data based on a set ticket image when printing is required, and printing the printing data.
8. The device for information entry and printing based on the template under the WinCE platform according to claim 7, wherein:
the database storage module is specifically used for storing various template files in a database, wherein the template files comprise an interface template file, a database template file and a printing template file, and the interface template file comprises: page size information, a page display form and control node information, wherein one interface template file comprises one or more pieces of control node information, each piece of control node information corresponds to one control, and the control node information comprises: the control identification, the generation of the control type, the control coordinate and width, the control default value and the CHECK character string CHECK field for parameter CHECK.
9. The device for information entry and printing based on the template under the WinCE platform according to claim 8, wherein:
the interface control module is specifically used for reading an interface template file stored in the database after a user logs in a WinCE platform, and generating interface template data according to the interface template file, wherein the interface template data comprises interface control information and interface input data;
and pushing the interface template data to a display screen under the WinCE platform, determining the display mode and the input mode of the input interface according to the interface template data, generating the input interface, and displaying the input interface on the display screen.
10. The device for template-based information entry and printing under the WinCE platform according to claim 9, wherein:
the interface control module is specifically used for receiving input information of a user in the input interface, verifying the input information according to a verification rule defined in a CHECK character string CHECK field in an interface template file, and storing the input information passing verification as memory data;
extracting values, which are input by a user in each control and are contained in the memory data, acquiring control identification information according to an ID field in control node information in the interface template file, taking the control identification information as a keyword Key in a data unit in a data structure MAP, and taking the value, which is input by the user in the control, as the value of the keyword Key in the data unit;
and forming a plurality of data units according to the memory data and the interface template file, wherein each data unit corresponds to one control, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a database storage module.
11. The device for template-based information entry and printing under the WinCE platform according to claim 10, wherein:
the database storage module is specifically used for setting a database template file comprising keywords and data storage position coordinates, receiving the data structure MAP, analyzing the data structure MAP and extracting each data unit in the data structure MAP; setting a data field name in a data list in a database to be the same as a Key word Key in the data structure, wherein a value stored in the data field is a data storage position of the value of the Key word Key in the data structure, and storing the value of the Key word in the data structure on a storage address in a hard disk or on an actual data table;
when printing is needed, extracting a data field name in the data list as a keyword in one data unit in the MAP, using a value stored in a data field in the data list as a storage address, finding a value stored in the storage address, using the value as a value of the keyword in the data unit, forming a plurality of data units according to the data list, forming a data structure MAP from all the data units, and transmitting the data structure MAP to a printing control module.
12. The device for template-based information entry and printing under the WinCE platform according to claim 11, wherein:
the printing control module is specifically configured to set a printing control template including keywords, a coordinate x, a coordinate y, a coordinate width, a coordinate height and default display characters, and the printing control module analyzes the data structure MAP, queries the printing template file using the keywords included in the data unit, and obtains the default display characters of the control corresponding to the keywords by combining values of the keywords;
according to the specified coordinates in the printing template file, default display characters corresponding to each keyword and values of the keywords are printed in a printed coordinate area to obtain basic images corresponding to each control, a blank image area is created, a ticket image is loaded, all the basic image areas are drawn on the ticket image in sequence to generate an invoice image, the invoice image is converted into printing data, and the printing data is sent to a printer to be printed.
CN201410648336.9A 2014-11-14 2014-11-14 Template-based information input and printing method and device under WinCE platform Active CN105589686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410648336.9A CN105589686B (en) 2014-11-14 2014-11-14 Template-based information input and printing method and device under WinCE platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410648336.9A CN105589686B (en) 2014-11-14 2014-11-14 Template-based information input and printing method and device under WinCE platform

Publications (2)

Publication Number Publication Date
CN105589686A CN105589686A (en) 2016-05-18
CN105589686B true CN105589686B (en) 2021-03-02

Family

ID=55929296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410648336.9A Active CN105589686B (en) 2014-11-14 2014-11-14 Template-based information input and printing method and device under WinCE platform

Country Status (1)

Country Link
CN (1) CN105589686B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402729B (en) * 2016-05-20 2020-02-14 航天信息软件技术有限公司 Printing template construction method and template printing method
CN106569755B (en) * 2016-10-26 2020-06-05 深圳盒子信息科技有限公司 Printing method and printing device for mobile payment terminal
CN107239241A (en) * 2017-05-26 2017-10-10 泰康保险集团股份有限公司 For the method and device of document printing, electronic equipment, computer-readable medium
CN109902280A (en) * 2019-01-21 2019-06-18 新疆恒致达信息技术有限公司 Input method, device, computer equipment and the storage medium of student information
CN110210455B (en) * 2019-06-18 2022-03-01 石家庄捷弘科技有限公司 Printing content formatting extraction method
CN111340038B (en) * 2020-05-20 2020-08-21 四川新网银行股份有限公司 Disposable image data acquisition method for MOCK test
CN111782157B (en) * 2020-06-17 2024-04-09 上海乾臻信息科技有限公司 Express delivery face list printing management method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102074080A (en) * 2009-11-25 2011-05-25 航天信息股份有限公司 Customization and management method of visual management invoice template
CN102193922A (en) * 2010-03-04 2011-09-21 杭州华三通信技术有限公司 Method and device for accessing database
CN102479412A (en) * 2010-11-26 2012-05-30 航天信息股份有限公司 Processing method and system of network invoicing data as well as tax control device and handling server
CN102722899A (en) * 2012-05-28 2012-10-10 重庆大学 Positioning printing system for report
CN103164907A (en) * 2011-12-14 2013-06-19 航天信息股份有限公司 Bill analysis device and tax control system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2373076B (en) * 2001-08-06 2003-02-26 Software 2000 Ltd Apparatus and method for accessing resources
US7733509B2 (en) * 2001-09-26 2010-06-08 Infoprint Solutions Company, Llc Method and apparatus for printing XML directly using a formatting template
US20050160362A1 (en) * 2004-01-15 2005-07-21 Petar Obradovic Systems and methods for performing variable data printing
CN101504597A (en) * 2009-03-17 2009-08-12 北大方正集团有限公司 Page sequence number generating method and apparatus for layout template
TWI467128B (en) * 2009-07-03 2015-01-01 Koh Young Tech Inc Method for inspecting measurement object
CN104679453B (en) * 2013-12-03 2018-01-16 航天信息股份有限公司 The general-purpose system and method for a kind of Data Enter, storage and Typeset and Print

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102074080A (en) * 2009-11-25 2011-05-25 航天信息股份有限公司 Customization and management method of visual management invoice template
CN102193922A (en) * 2010-03-04 2011-09-21 杭州华三通信技术有限公司 Method and device for accessing database
CN102479412A (en) * 2010-11-26 2012-05-30 航天信息股份有限公司 Processing method and system of network invoicing data as well as tax control device and handling server
CN103164907A (en) * 2011-12-14 2013-06-19 航天信息股份有限公司 Bill analysis device and tax control system
CN102722899A (en) * 2012-05-28 2012-10-10 重庆大学 Positioning printing system for report

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Recognition of printed muti-font alphanumeric characters of multisize using 3/spl times/3 templates;Durk Won Park ET AL;《 Proceedings of Third International Conference on Signal Processing (ICSP"96)》;20020806;全文 *
win版纳税申报录入系统的开发与加密;莫非;《中国优秀博硕士学位论文全文数据库 (硕士) 信息科技辑》;20060715;第2006年卷(第4期);全文 *

Also Published As

Publication number Publication date
CN105589686A (en) 2016-05-18

Similar Documents

Publication Publication Date Title
CN105589686B (en) Template-based information input and printing method and device under WinCE platform
JP6507472B2 (en) Processing method, processing system and computer program
RU2316814C2 (en) Font selection method
CN102165393B (en) Editing 2D structures using natural input
US8325367B2 (en) System and method for a design with intent metadata
US20090319543A1 (en) Hierarchically presenting tabular data
US9619440B2 (en) Document conversion apparatus
CN103220443A (en) Wireless printing from a device outside the network
US20140368869A1 (en) Method of printing web page by using mobile terminal and mobile terminal for performing the method
US20150193387A1 (en) Cloud-based font service system
CN104679453B (en) The general-purpose system and method for a kind of Data Enter, storage and Typeset and Print
CN103620589A (en) Device, method, and program for displaying document file
US8386943B2 (en) Method for query based on layout information
US20200175101A1 (en) Systems and methods for generating social assets from electronic publications
JP2016162184A (en) Information processing system, information processing device, control method and computer program
US9886426B1 (en) Methods and apparatus for generating an efficient SVG file
TW201416884A (en) Font distribution system and method of font distribution
US20080049258A1 (en) Printing Digital Documents
US9946698B2 (en) Inserting text and graphics using hand markup
US20070180353A1 (en) Systems and methods for generating documents using multimedia data gathering tools
CN115114556A (en) Method and device for creating page
JP6687801B1 (en) Document display system, server device, information terminal device, document display method, and document display program
US20100188674A1 (en) Added image processing system, image processing apparatus, and added image getting-in method
US9075776B2 (en) Document processing apparatus, document processing method, and program
US10755034B2 (en) Information processing apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant