Background technology
Software serves promptly that (Software-as-a-service SaaS) is based on the software application pattern that the Internet provides software service.Software is that the service provider is that information-based needed all-network infrastructure and software, hardware running platform are built by enterprise; And be responsible for the enforcement in all early stages, a series of services such as maintenance in later stage; Just as opening just ability water of water tap; Software service is leased from SaaS provider according to actual needs by enterprise.The SaaS platform of current main-stream is generally based on Web, and the user need pass through browser (Internet Browser) visit.But the application in the browser is access hardware directly, and the SaaS system of the retail business that therefore realizes based on Web can not directly visit POS printer, bar code scanner, go out equipment such as cash box.
The form of traditional P OS system generally is a client application, and it can be directly and the POS devices communicating.
In order to make scripts in web pages can have access to POS equipment, common solution is for browser plug-in unit to be installed, and plug-in unit provides calling interface to page script, ordinary circumstance, and plug-in unit has the authority of browser process, can have access to equipment.The different browsers product that a shortcoming of this method is a different editions all needs different plug-in units, develops and safeguard more complicated.Another defective is that still the neither one module has the authority of safeguarding POS equipment; If each browser plug-in all has this authority to conflict; If all there is not this authority will make that a little less than the robustness of POS system, perhaps extra needs independently program are safeguarded POS equipment.
Summary of the invention
The object of the present invention is to provide a kind of can be through the system of web access point-of-sale terminal equipment, solve Web and use with POS devices communicating (comprising unidirectional and two-way) and safeguard the problem of POS equipment, overcome the shortcoming and defect that exists in the prior art.
To achieve these goals, technical scheme of the present invention is: a kind of can it is characterized in that through the system of web access point-of-sale terminal equipment:
The Web client modules is used for to the Web application visit POS being provided equipment interface on the one hand, is used to the function that provides the request-reply module to send request and accept to reply on the other hand; Can be to write with the Web script; The communication protocol of using is http protocol or TCP Socket agreement, when using http protocol, uses the JSONP technology; When using Transmission Control Protocol, browser has the WebSocket assembly of supporting HTML5;
The request-reply module is used for realizing that with the Web client modules communication is connected, and accepts the request instruction that the Web client modules sends, and realizes replying;
Order maincenter module, this module are embedded in the request-reply module or are independent of the request-reply module, the order that the responder module that is used to accept request transmits, and the specific modules of distributing is come fill order, and execution result is returned to the request-reply module;
The POS equipment configuration module can supply inquiry and revise the POS configuration of devices, is used for the data command that fill order maincenter module is sent;
POS device access module is used to support the read-write operation to POS equipment, is used for the data command that fill order maincenter module is sent, and is provided with 1+N POS device access module in the native system, to different POS equipment, different POS device access modules is arranged;
Described request responder module, order maincenter module, POS equipment configuration module are formed server end.
The invention discloses and a kind ofly can design a SaaS service platform that is suitable for being directed to retail business, solved the problem of Web application access POS equipment through the system of web access point-of-sale terminal equipment, and the problem of POS configuration of devices and maintenance.
Embodiment
With reference to the accompanying drawings, the present invention is further described.
The present invention be a kind of can be through the system of web access point-of-sale terminal equipment, as shown in fig. 1 it is characterized in that:
Web client modules 1 is used for to the Web application visit POS being provided equipment interface on the one hand, is used to the function that provides request-reply module 2 to send request and accept to reply on the other hand; Can be to write with the Web script; The communication protocol of using is http protocol or TCP Socket agreement, when using http protocol, uses the JSONP technology; When using Transmission Control Protocol, browser has the WebSocket assembly of supporting HTML5;
Request-reply module 2 is used for realizing that with Web client modules 1 communication is connected, and accepts the request instruction that Web client modules 1 sends, and realizes replying;
Order maincenter module 3, this module are embedded in the request-reply module 2 or are independent of request-reply module 2, the order that the responder module that is used to accept request transmits, and the specific modules of distributing is come fill order, and execution result is returned to request-reply module 2;
POS equipment configuration module 4 can supply inquiry and revise the POS configuration of devices, is used for the data command that fill order maincenter module 3 is sent;
POS device access module 5; Be used to support read-write operation, be used for the data command that fill order maincenter module 3 is sent, be provided with 1+N POS device access module 5 in the native system POS equipment; To different POS equipment; Different POS device access modules 5 is arranged,, different device access modules is arranged to different POS equipment.Such as: to the POS printer, a POS printer browsing module can be arranged, be specifically designed to and transmit data to printer; To the POS barcode scanner, a POS bar code scanner access modules can be arranged, can read scanning information;
Described request responder module 2, order maincenter module 3, POS equipment configuration module 4 are formed server end 6.
In the specific implementation, said Web client modules 1 is http protocol or TCP Socket agreement with the communication protocol that server end 6 uses, and when using http protocol, in order to solve cross-domain problem, use the JSONP technology; Use Transmission Control Protocol to need browser to support the WebSocket assembly of HTML5; In order to make server end in time data passes to be arrived the Web client, a connection may be safeguarded in two ends, and server end is not done this connection and returned response; Up to there being data need be delivered to the Web client; Just with data back, the Web client receives that connecting the such connection of redispatching when replying continues to wait for the data that possibly need reception, handles the data that this is received simultaneously.
In the specific implementation, said Web client modules 1 request of sending: I, the state of inquiring about certain POS equipment and detailed configuration to request-reply module 2; II, read the data (need this equipment support output) of certain POS equipment; III, to certain POS equipment sending data, the request-reply module may be returned the response of POS equipment to data; IV, revise certain POS configuration of devices, request-reply module 2 will ask arrangement to be called to order maincenter module 3 after filtering.
In the specific implementation; The order that responder module 2 transmits that accepts request of said order maincenter module 3; The specific modules of distributing is come fill order; And execution result is returned to request-reply module 2, and wherein: ⅰ, the state of inquiring about certain POS equipment and detailed configuration, the order of revising certain POS configuration of devices are given POS equipment configuration module 4 and are handled; ⅱ, read certain POS equipment data, give POS device access module 5 to the order of certain POS equipment sending data.
In the specific implementation, said POS equipment configuration module 4 provides inquiry and revises the function of POS configuration of devices, and configuration information possibly exist in the operating system, like registration table, configuration file, also can obtain through calling POS device access module.
Above content is to combine concrete preferred implementation to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to above-mentioned these explanations.For the those of ordinary skill of technical field under the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.