Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
Print control program provided by the present application can be applied in application environment as shown in Figure 1.Wherein, terminal 102
Control device 108 is collectively constituted with server 104 to control user's data content to be printed.Terminal 102 passes through network and clothes
Business device 104 connects, and terminal 102 is connect with printer 106, and user can be sent to server 104 to data by terminal 102
Print request, can be by terminal 102 to 106 transferring printing data of printer.Specifically, user passes through terminal 102 to service
Device 104 sends the print request to data, includes user identifier in the print request, after server 104 gets print request,
Understand according to the corresponding print right of the user identifier lookup field to be printed corresponding with the print right for including in print request,
And field to be printed is sent to terminal, terminal obtains the field to be printed, to generate data to be printed.Terminal 102 and printing
Machine 106 connects, and data to be printed are sent to printer 106, print out data to be printed by printer 106.
Wherein, terminal 102 can be, but not limited to be smart phone, tablet computer, portable wearable device and computer
It can realize that printer can with the server cluster of the either multiple servers compositions of independent server Deng, server 104
With but be not limited to thermal printer.
Fig. 2 is referred to, it illustrates a kind of print control programs, and the control device 108 being applied in Fig. 1 in this way is
Example is illustrated, comprising the following steps:
Step 202, the print request to data is received, print request includes user identifier.
Wherein, data refer to all kinds of printing contents being stored in advance in the server, can be sales bill, invoice, adopt
Buying order etc..User identifier can be networking account, mail address, IP information of user etc., and user identifier has uniqueness.Specifically
, terminal is that the corresponding user identifier of each user distributes corresponding print right in advance, which includes user institute energy
The data type and print field of printing.The print request is sent to service after receiving the print request of user's transmission by terminal
Device, server searches print right according to the user identifier for including in the print request received, and searches and print right pair
The data type and print field answered.
Step 204, corresponding print right is obtained according to user identifier.
Wherein, print right corresponds to the data content that user is available and prints.Specifically, the corresponding use of each user
Family mark is all previously provided with corresponding print right, and user can preview, editor's data in its corresponding print right.Clothes
Business device searches corresponding print right according to the user identifier for including in the print request received, and the print right is sent
To terminal, terminal obtains the print right, allows user preview, editor and print data in print right.As in advance
First be user setting print right be print sales bill in customer name, delivery product, product value, delivery quantity, when
Between field, terminal obtain server send print right after, then user can by terminal in its print right preview, compile
It collects and printing includes customer name, delivery product, product value, delivery quantity, the sales bill content of time field.
Step 206, field to be printed corresponding with print right is obtained, data to be printed are generated.
Wherein, field to be printed refers to all fields that terminal can obtain, corresponding with print right.Data to be printed
Refer to the printing content including field to be printed and corresponding type information that terminal is generated according to field to be printed, it is above-mentioned to beat
Official seal breath can be the specific print value of corresponding field to be printed.Specifically, each data type packet of storage in the server
Include multiple fields, server searches data type corresponding with print right and field to be printed according to print right, call and
The corresponding data acquisition system of the data type retains field to be printed corresponding with print right in the data acquisition system, and this is waited for
Print field is sent to terminal.Terminal obtains the field to be printed, and generates data to be printed according to the field to be printed.For example
In the print right of user preset data type be sales bill, sales bill include customer name, product value, gathering record,
Multiple fields such as gathering details, delivery quantity, delivery product, non-product expense, bar code, time, picture, set in advance for user
The corresponding field to be printed of the print right set is customer name, delivery product, product value, delivery quantity, time, then servicing
After device receives print request, the corresponding data acquisition system of sales bill is called, and corresponding to be printed according to user's print right
Field retains " customer name, delivery product, product value, delivery quantity, time " field in sales bill, and these are waited beating
Lettering section is sent to terminal, then terminal obtains these fields to be printed, and generates data to be printed according to these print fields.
Step 208, data to be printed are transmitted to printer.
Specifically, data to be printed to be transmitted to the printing having connected with terminal after terminal obtains above-mentioned data to be printed
Machine, by printer output content to be printed.
Above-mentioned print control program includes the user of user by obtaining the print request to data, in the print request
Mark, and distribute corresponding print field for each print right, so that user can only read in corresponding print right includes
Print field, the print field for not including in print right cannot be read, so as to hide what it cannot be obtained to user
Sensitive information improves the safety during stored data-printing.
In one embodiment, it as shown in figure 3, obtaining field to be printed corresponding with print right, generates to be printed
After number, further includes:
Step 302, data to be printed are shown.
Specifically, user can facilitate end by the terminal preview data to be printed after terminal generates data to be printed
The use of end subscriber.
Step 304, the setting of printing request for treating print data is received.
Wherein, setting of printing can include but is not limited to treat the field in print data carry out selection printing, printing
Number, font size size etc..Specifically, can receive the above-mentioned setting of printing sent by user after terminal generates data to be printed
Request, the data to be printed to be further arranged.In the present embodiment, in order to make user in the print right of oneself still
It so can control printing content, increase the setting of printing for treating print data, greatly meet user to data-printing control
The demand of system.If the print right of user is printing customer name, delivery product, product value, delivery quantity, time, user is obtained
After taking data to be printed, printing delivery product, product value and delivery quantity are merely desired to, is printed then user can issue terminal
Setting request, selection printing delivery product, product value, delivery quantity, terminal receive setting of printing request.
Step 306, according to the corresponding print field of setting of printing request, print data is generated.
Wherein, print field refers to that treating print field according to above-mentioned setting of printing request carries out treated field.It beats
Printing is printed according to the printing content including print field and corresponding type information that terminal is generated according to the print field is referred to
Information can be specific print value.Specifically, being asked after the setting of printing that terminal receives user's sending is requested according to setting of printing
The print field for including in asking combines field to be printed, that is, retains setting of printing in field to be printed and request the printing word for including
Section deletes other fields in addition to the print field.For example, user obtain field to be printed include customer name, delivery product,
Product value, delivery quantity, time, user to terminal send setting of printing request, request printing delivery product, product value,
Delivery quantity, terminal start to combine field to be printed, retain delivery product, product value, send after obtaining setting of printing request
Goods quantity print field deletes customer name, time field, to obtain print field, and generates print data.The present embodiment
In, setting of printing is carried out by treating print data, can satisfy terminal user to the different demands of printout content, conveniently
The use of terminal user.In the present embodiment, data to be printed are transmitted to printer, specifically includes to printer and transmits above-mentioned life
At print data.
In one embodiment, before transmitting data to be printed to printer, further includes: send bluetooth to printer and match
To request, to establish the bluetooth connection with printer.Specifically, terminal is connected with printer by Bluetooth pairing, by generation
Data to be printed pass through Bluetooth transmission to printer.
In one embodiment, before transmitting data to be printed to printer, further includes: obtain network where printer
The network information, the network information includes network identity;Network connecting request is sent according to network identity, network connecting request is used for
Indicate that network corresponding with network identity establishes connection.Specifically, network identity is with can be the IP of printer connected network
Location, the address Mac, network name etc..The network identity that terminal searching printer is connected, and network connecting request is sent, from
And the same network is connect with printer, data are transmitted to printer by establishing local area network with printer.In the present embodiment eventually
Data are transmitted by a variety of connection types with printer in end, use under different condition and occasion to facilitate user.
In one embodiment, as shown in figure 4, before receiving to the print request of data, further includes:
Step 402, the registration request of user is received, registration request includes user identifier and corresponding attribute.
Specifically, attribute may include but be not limited to the post of user, position hierarchy etc., for example the post of user is industry
Business person, purchasing agent, finance etc.;The position hierarchy of user is common office worker, manager, general manager etc..Each user in registration request
Mark all corresponds to corresponding attribute.
It step 404, is the corresponding print right of user corresponding with user identifier distribution according to attribute, print right includes
The print right of corresponding field to be printed.
Terminal each user identifier and corresponding attribute in registration request based on the received, and according to preset permission point
Distributing attribute in corresponding print right, such as preset authority distribution rule with rule for it is that the user of general manager possesses most
High permission, can print all data types and include all fields in data type, and the print right of chief inspector is to beat
All fields in print buying bill and sales bill, the print right of common sales force are the client printed in sales bill
Name, delivery product, product value, delivery quantity, time field.The registration request attribute information that terminal receives is if common pin
Personnel are sold, then it is customer name, delivery product, the product gold printed in sales bill that terminal, which is the print right of user distribution,
Volume, delivery quantity, time.In the present embodiment, by distributing corresponding print right for different attributes, it can control different hilllocks
The data that position, different position hierarchies can obtain, effectively protect the sensitive information in data, to improve data-printing
Safety.
In one embodiment, when the corresponding print right of a certain user identifier includes at least two data type, clothes
Being engaged in device can be according to the corresponding print right corresponding data type of lookup of user identifier in print request and each data type pair
The field to be printed answered, and above-mentioned data type and corresponding field to be printed are sent to terminal, terminal obtains print right
Interior at least two data type and the corresponding field to be printed of each data type.User then selects to need by setting of printing
The data type of printing and corresponding print field, terminal receives setting of printing request, with the number for needing to print according to user
Subsequent print job is completed according to the above method according to type and corresponding print field.
In one embodiment, it as shown in figure 5, obtaining field to be printed corresponding with print right, generates to be printed
Before data, further includes:
Step 205, corresponding data acquisition system is called according to print request, includes multiple fields in data acquisition system.
Wherein, data acquisition system includes all fields corresponding with data type.Specifically, server receives terminal transmission
Print request after, the user identifier for including according to the print request searches corresponding print right, is looked into according to the print right
Corresponding data type is looked for, and calls corresponding data acquisition system.It is in advance common sales force if user is common sales force
The print right of setting is printing sales bill, after server receives print request, can call and sell according to the print request
The corresponding data acquisition system of bill.
In the present embodiment, field to be printed corresponding with print right is obtained, data to be printed is generated, specifically includes root
The field in data acquisition system in addition to field to be printed is deleted according to field to be printed corresponding with print right, it is to be printed to generate
Data.Specifically, server searches print right according to the user identifier for including in print request, and looked into according to the print right
Look for corresponding data type and field to be printed.Server calls corresponding data acquisition system, the data set according to the data type
Closing includes all fields for including in the data type.Server deletes the data according to the corresponding field to be printed of print right
The field to be printed to obtain field to be printed, and is sent to end by other fields in set in addition to field to be printed
End, then terminal obtains the field to be printed, and generates data to be printed according to the field to be printed.
In one embodiment, before transmitting data to be printed to printer, further includes: data to be printed are carried out two
System circulation is changed.Specifically, terminal and printer generate connection, by the field of data to be printed and byte conversion at by 0 and 1 group
At binary stream, and the binary stream is transmitted to printer and is printed.
In one embodiment, above-mentioned print control program is further illustrated by a specific embodiment, such as Fig. 6 institute
Show, includes the following steps:
Step 601, user issues registration request.Registration request includes user identifier and the corresponding attribute of user.
Step 602, terminal is that user distributes print right according to user identifier and corresponding attribute, so that print right
It is consistent with user identifier.
Step 603, server obtains user identifier and corresponding print right, and wherein print right is corresponding word to be printed
The print right of section.
Step 604, terminal receives the print request that user sends.Print request is marked comprising user corresponding with print right
Know.
Step 605, server obtains print request.
Step 606, server searches printing right corresponding with user identifier according to the user identifier for including in print request
Limit, and data type corresponding with print right and field to be printed.
Step 607, server based on data type calls corresponding data acquisition system, deletes other in addition to field to be printed
Field.
Step 608, terminal obtains field to be printed.
Step 609, terminal generates data to be printed according to field to be printed.
Step 610, terminal shows data to be printed.
Step 611, terminal receives the setting of printing request that user treats print data.Wherein setting of printing request can be
Select printing portion data to be printed.
Step 612, terminal retains the print field in data to be printed according to setting of printing request print field,
Other fields in addition to print field are deleted, print data is generated.
Step 613, terminal is connect with printer.
Step 614, print data is converted into binary stream by terminal.
Step 615, terminal transmits binary stream to printer, then printer obtains the binary stream.
Step 616, printer output print data.
Above-mentioned print control program includes the user of user by obtaining the print request to data, in the print request
Corresponding print right is arranged to the corresponding user identifier of different user in advance in mark, and corresponding for the distribution of each print right
Print field cannot be read in print right so that user can only read the print field for including in corresponding print right
The print field for not including improves stored data-printing so as to hide its sensitive information that cannot be obtained to user
Safety in the process.
It should be understood that although each step in the flow chart of Fig. 2-6 is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-6
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively
It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately
It executes.
In one embodiment, as shown in fig. 7, providing a kind of print control unit 700, including receiving module 701, power
Limit obtains module 702, setting of printing module 703, print module 704, in which:
Receiving module 701 is used to receive the print request to data, and print request includes user identifier;Authority acquiring module
702 for obtaining corresponding print right according to user identifier;Setting of printing module 703 is corresponding with print right for obtaining
Field to be printed generates data to be printed;Print module 704, for transmitting data to be printed to printer.
It in one embodiment, further include display module, for showing data to be printed.
It in one embodiment, further include bluetooth communication, for sending Bluetooth pairing request to printer, to establish
With the bluetooth connection of printer.
It in one embodiment, further include network connecting module, for the network information of network where obtaining printer, net
Network information includes network identity;Network connecting request is sent according to network identity, network connecting request is used to indicate and network mark
Know corresponding network and establishes connection.
It in one embodiment, further include registration and authority distribution module, for receiving the registration request of user, registration is asked
It asks including user identifier and corresponding attribute;It is the corresponding printing right of user corresponding with user identifier distribution according to attribute
Limit, print right includes the print right of corresponding field to be printed.
It in one embodiment, further include editor module, for being deleted according to field to be printed corresponding with print right
Field in data acquisition system in addition to field to be printed, to generate data to be printed.
It in one embodiment, further include data conversion module, for data to be printed to be carried out binary stream conversion.
Specific about print control unit limits the restriction that may refer to above for print control program, herein not
It repeats again.Modules in above-mentioned print control unit can be realized fully or partially through software, hardware and combinations thereof.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure
Figure can be as shown in Figure 8.The computer equipment includes processor, the memory, network interface, display connected by system bus
Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited
Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey
Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating
The network interface of machine equipment is used to communicate with external terminal by network connection.When the computer program is executed by processor with
Realize a kind of print control program.The display screen of the computer equipment can be liquid crystal display or electric ink display screen,
The input unit of the computer equipment can be the touch layer covered on display screen, be also possible to be arranged on computer equipment shell
Key, trace ball or Trackpad, can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 8, only part relevant to application scheme is tied
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory
Computer program, the processor perform the steps of when executing computer program
The print request to data is received, print request includes user identifier;
Corresponding print right is obtained according to user identifier;
Field to be printed corresponding with print right is obtained, data to be printed are generated;
Data to be printed are transmitted to printer.
In one embodiment, obtain field to be printed corresponding with print right further includes after generating number to be printed
Show data to be printed;Receive the setting of printing request for treating print data;According to the corresponding printing of setting of printing request
Field generates print data.
In the present embodiment, data to be printed are transmitted to printer, specifically included to printer transferring printing data.
It in one embodiment, further include sending Bluetooth pairing to printer before transmitting data to be printed to printer
Request, to establish the bluetooth connection with printer.
It in one embodiment, further include obtaining network where printer before transmitting data to be printed to printer
The network information, the network information include network identity;Network connecting request is sent according to network identity, network connecting request is for referring to
Show that network corresponding with network identity establishes connection.
It in one embodiment, further include the note for receiving user before obtaining corresponding print right according to user identifier
Volume request, registration request includes user identifier and corresponding attribute;It is user corresponding with user identifier distribution according to attribute
Corresponding print right, print right include the print right of corresponding field to be printed.
In one embodiment, field to be printed corresponding with print right is obtained, is also wrapped before generating data to be printed
It includes: corresponding data acquisition system being called according to print request, includes multiple fields in data acquisition system.
In the present embodiment, field to be printed corresponding with print right is obtained, data to be printed is generated and specifically includes root
The field in data acquisition system in addition to field to be printed is deleted according to field to be printed corresponding with print right, it is to be printed to generate
Data.
In one embodiment, before transmitting data to be printed to printer, further include data to be printed are carried out two into
System circulation is changed.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of when being executed by processor
The print request to data is received, print request includes user identifier;
Corresponding print right is obtained according to user identifier;
Field to be printed corresponding with print right is obtained, data to be printed are generated;
Data to be printed are transmitted to printer.
In one embodiment, obtain field to be printed corresponding with print right further includes after generating number to be printed
Show data to be printed;Receive the setting of printing request for treating print data;According to the corresponding printing of setting of printing request
Field generates print data.In the present embodiment, data to be printed are transmitted to printer, are specifically included to printer transfer printing
Data.
It in one embodiment, further include sending Bluetooth pairing to printer before transmitting data to be printed to printer
Request, to establish the bluetooth connection with printer.
It in one embodiment, further include obtaining network where printer before transmitting data to be printed to printer
The network information, the network information include network identity;Network connecting request is sent according to network identity, network connecting request is for referring to
Show that network corresponding with network identity establishes connection.
It in one embodiment, further include the note for receiving user before obtaining corresponding print right according to user identifier
Volume request, registration request includes user identifier and corresponding attribute;It is user corresponding with user identifier distribution according to attribute
Corresponding print right, print right include the print right of corresponding field to be printed.
In one embodiment, field to be printed corresponding with print right is obtained also to wrap before generating data to be printed
It includes and corresponding data acquisition system is called according to print request, include multiple fields in data acquisition system.
In this example, field to be printed corresponding with print right is obtained, data to be printed is generated, specifically includes basis
Field to be printed corresponding with print right deletes the field in data acquisition system in addition to field to be printed, to generate number to be printed
According to.
In one embodiment, before transmitting data to be printed to printer, further include data to be printed are carried out two into
System circulation is changed.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein,
To any reference of memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
Above embodiments only express the several embodiments of the application, and the description thereof is more specific and detailed, but can not
Therefore it is construed as limiting the scope of the patent.It should be pointed out that for those of ordinary skill in the art,
Under the premise of not departing from the application design, various modifications and improvements can be made, these belong to the protection scope of the application.
Therefore, the scope of protection shall be subject to the appended claims for the application patent.