CN105635137A - Method and apparatus for obtaining charge information - Google Patents
Method and apparatus for obtaining charge information Download PDFInfo
- Publication number
- CN105635137A CN105635137A CN201511003555.2A CN201511003555A CN105635137A CN 105635137 A CN105635137 A CN 105635137A CN 201511003555 A CN201511003555 A CN 201511003555A CN 105635137 A CN105635137 A CN 105635137A
- Authority
- CN
- China
- Prior art keywords
- websocket
- user equipment
- server
- charge information
- connects
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention provides a method and apparatus for obtaining charge information. The method for obtaining the charge information comprises the following steps: user equipment establishing network socket websocket connection with a server; and the user equipment receiving and displaying the charge information pushed by the server through the websocket connection. According to the invention, it is unnecessary to wait for the user equipment to initiate a query request, and the real-time performance is higher.
Description
Technical field
The present invention relates to technical field of new energy, particularly relate to a kind of implementation method and the device that obtain charge information.
Background technology
Day by day serious petroleum and gas resources is deficient makes new-energy automobile popularization extremely urgent with air environmental pollution. Along with going deep into of new-energy automobile development, more and more users brings into use new-energy automobile, and in new-energy automobile process of charging, user needs to obtain process of charging information and expense.
In prior art, the dynamic information in process of charging is obtained by the clients poll request server of the mobile terminal of user, a large amount of concurrent requests can be caused like this, very big pressure can be caused to server, owing to the frequency interval of clients poll can delay in generation information.
Summary of the invention
The present invention provides a kind of implementation method and the device that obtain charge information, to overcome message delay in prior art, and due to a large amount of concurrent requests, can cause the problem of very big pressure to server.
First aspect, the present invention provides a kind of implementation method obtaining charge information, comprising:
User equipment is set up and is connected with the web socket websocket of server;
User equipment reception server connects the charge information pushed by described websocket, and shows.
Second aspect, the present invention provides a kind of implementation method obtaining charge information, comprising:
Described server obtains charge information corresponding to described user equipment;
Described server determines that the websocket corresponding with described user equipment connects, and is connected by described websocket and push described charge information to described user equipment.
The third aspect, the present invention provides a kind of user equipment, comprising:
Set up module, it is connected for setting up the web socket websocket with server;
Receiver module, connects the charge information pushed for reception server by described websocket;
Display module, for showing described charge information.
Fourth aspect, the present invention provides a kind of server, comprising:
Acquisition module, for obtaining charge information corresponding to described user equipment;
Determination module, for determining that the websocket corresponding with described user equipment connects;
Sending module, pushes described charge information for being connected by described websocket to described user equipment.
The present invention obtains implementation method and the device of charge information, set up by user equipment and it is connected with the web socket websocket of server, reception server connects the charge information pushed by described websocket, and show, namely connect by websocket after server gets charge information and it is pushed to user equipment, thus it is shown to user, without the need to waiting that inquiry request initiated by user equipment, real-time is higher, and avoid due to a large amount of concurrent requests in prior art, the problem of very big pressure can be caused to server.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, it is briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet that the present invention obtains implementation method one embodiment of charge information;
Fig. 2 is the schematic flow sheet that the present invention obtains another embodiment of implementation method of charge information;
Fig. 3 is the structural representation of user equipment one embodiment of the present invention;
Fig. 4 is the structural representation of server one embodiment of the present invention.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments. Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the schematic flow sheet that the present invention obtains implementation method one embodiment of charge information. As shown in Figure 1, the method for the present embodiment, comprising:
Step 101, user equipment are set up and are connected with the web socket websocket of server;
Step 102, user equipment reception server connect the charge information pushed by described websocket, and show.
Specifically, it is possible to realize the two-way communication between user equipment and server by websocket protocol, user equipment such as, can arrange client terminal, for obtaining charge information with server communication. User equipment can be set up described websocket according to websocket interface and connect, and the corresponding relation that the mark setting up user equipment is connected with described websocket, this corresponding relation can be left in buffer memory server, buffer memory server can be an independent server, and multiple server shares a buffer memory server.
Server is after the charge information getting described user equipment, the corresponding relation that server is connected with described websocket according to the mark of described user equipment, the described websocket corresponding with described user equipment is found to connect, and connected by described websocket and push charge information to user equipment, user equipment shows to user after receiving charge information.
Wherein, in actual applications, described charge information, comprising: length, charge capacity or charging expense during charging.
In the embodiment of the present invention, connected the two-way communication achieving between user equipment and server by websocket.
The present embodiment obtains the implementation method of charge information, set up by user equipment and it is connected with the web socket websocket of server, reception server connects the charge information pushed by described websocket, and show, namely connect by websocket after server gets charge information and it is pushed to user equipment, thus it is shown to user, without the need to waiting that inquiry request initiated by user equipment, real-time is higher, and avoid due to a large amount of concurrent requests in prior art, the problem of very big pressure can be caused to server.
On the basis of above-described embodiment, further, in actual applications, step 101, it is possible to realize in the following way:
User equipment, by calling websocket interface, is set up and is connected with the described websocket of server.
Specifically, described user equipment utilizes internet (Web) browser, accesses HTML (HyperTextMarkupLanguage the is called for short HTML) page specified in advance; By described html page, call websocket interface, connect to set up described websocket.
Further, user equipment is set up after being connected with the web socket websocket of server, also comprises:
User equipment listens to described websocket and connects disconnection, then obtain the network state of described user equipment;
If network state is normal, then again sets up and it is connected with the websocket of described server, until successful with the websocket connection establishment of described server.
Specifically, user equipment is set up after being connected with the websocket of server, user equipment can be monitored this websocket always and connect, and connects after disconnected event when listening to websocket, represents to be connected with the websocket of server and disconnects, now obtain the network state that this user equipment is current, if network state is normal, then again sets up and it is connected with the websocket of described server, until being successfully established, if cannot be successfully established in the time of presetting, then show current network abnormal.
Fig. 2 is the schematic flow sheet that the present invention obtains implementation method one embodiment of charge information. As shown in Figure 2, the method for the present embodiment, comprising:
Step 201, described server obtain charge information corresponding to described user equipment;
Step 202, described server determine that the websocket corresponding with described user equipment connects, and are connected by described websocket and push described charge information to described user equipment.
Wherein, in actual applications, described server also comprises before determining that the websocket corresponding with described user equipment connects:
Described server stores the corresponding relation that the mark of described user equipment is connected with described websocket;
Specifically, it is possible to realize the two-way communication between user equipment and server by websocket protocol, user equipment such as, can arrange client terminal, for obtaining charge information with server communication. User equipment can be set up described websocket according to websocket interface and connect, and the corresponding relation that the mark setting up user equipment is connected with described websocket, this corresponding relation can be left in buffer memory server, buffer memory server can be an independent server, and multiple server shares a buffer memory server.
Wherein, described server determines that the websocket corresponding with described user equipment connects, and comprising:
According to described corresponding relation, described server determines that the websocket corresponding with described user equipment connects.
Concrete, server is after the charge information getting described user equipment, the corresponding relation that server is connected with described websocket according to the mark of described user equipment, the described websocket corresponding with described user equipment is found to connect, and connected by described websocket and push charge information to user equipment, user equipment shows to user after receiving charge information.
Wherein, in actual applications, described charge information, comprising: length, charge capacity or charging expense during charging.
Further, described method, also comprises:
If again setting up after the websocket with described server is connected at described user equipment, corresponding relation described in described whois lookup, if the mark of described user equipment exists, then the described websocket in described corresponding relation is connected and replace as current websocket connects.
Specifically, user equipment is set up after being connected with the websocket of server, user equipment can be monitored this websocket always and connect, after listening to websocket connection disconnected event, represent to be connected with the websocket of server and disconnect, now obtain the network state that this user equipment is current, if network state is normal, then again set up and it is connected with the websocket of described server, until being successfully established, after being successfully established, the corresponding relation that the mark of the user equipment that whois lookup stores is connected with websocket, if the mark of described user equipment exists, then the described websocket in described corresponding relation is connected and replace as current websocket connects.
Fig. 3 is the structural representation of user equipment one embodiment of the present invention. As shown in Figure 3, the user equipment of the present embodiment, comprising: set up module 301, receiver module 302 and display module 303;
Set up module 301, it is connected for setting up the web socket websocket with server;
Receiver module 302, connects the charge information pushed for reception server by described websocket;
Display module 303, for showing described charge information.
Can selection of land, set up module 301, specifically for:
By calling websocket interface, set up and it is connected with the described websocket of server.
Can selection of land, also comprise:
Acquisition module, after listening to described websocket connection disconnection, obtains the network state of described user equipment;
If the network state that acquisition module obtains is normal, then set up module 301, it is connected with the websocket of described server for again setting up, until successful with the websocket connection establishment of described server.
Can selection of land, described charge information, comprising:
Length, charge capacity or charging expense during charging.
It should be noted that, for the embodiment of user equipment, owing to it is substantially corresponding to the embodiment of the method for user equipment side, so relevant part illustrates see the part of the embodiment of the method for user equipment side.
Fig. 4 is the structural representation of server one embodiment of the present invention. As shown in Figure 4, the server of the present embodiment, comprising: acquisition module 401, determination module 402 and sending module 403;
Acquisition module 401, for obtaining charge information corresponding to described user equipment;
Determination module 402, for determining that the websocket corresponding with described user equipment connects;
Sending module 403, pushes described charge information for being connected by described websocket to described user equipment.
Can selection of land, also comprise:
Memory module, the corresponding relation being connected with described websocket for storing the mark of described user equipment;
Described determination module 402, specifically for:
Determine that the websocket corresponding with described user equipment connects according to described corresponding relation.
Can selection of land, it is determined that module 402, also for:
If again setting up after the websocket with described server is connected at described user equipment, search described corresponding relation, if the mark of described user equipment exists, then the described websocket in described corresponding relation is connected and replace as current websocket connects.
Can selection of land, described charge information, comprising:
Length, charge capacity or charging expense during charging.
It should be noted that, for the embodiment of server, owing to it is substantially corresponding to the embodiment of the method for server side, so relevant part illustrates see the part of the embodiment of the method for user equipment side.
One of ordinary skill in the art will appreciate that: all or part of step realizing aforesaid method embodiment can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising aforesaid method embodiment; And aforesaid storage media comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate the technical scheme of the present invention, it is not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, it will be understood by those within the art that: the technical scheme described in foregoing embodiments still can be modified by it, or wherein some or all of technology feature is carried out equivalent replacement; And these amendments or replacement, do not make the scope of the essence disengaging various embodiments of the present invention technical scheme of appropriate technical solution.
Claims (10)
1. one kind obtains the implementation method of charge information, it is characterised in that, comprising:
User equipment is set up and is connected with the web socket websocket of server;
User equipment reception server connects the charge information pushed by described websocket, and shows.
2. method according to claim 1, it is characterised in that, described user equipment is set up and is connected with the web socket websocket of server, comprising:
User equipment, by calling websocket interface, is set up and is connected with the described websocket of server.
3. method according to claim 2, it is characterised in that, described user equipment is set up after being connected with the web socket websocket of server, also comprises:
User equipment listens to described websocket and connects disconnection, then obtain the network state of described user equipment;
If network state is normal, then again sets up and it is connected with the websocket of described server, until successful with the websocket connection establishment of described server.
4. method according to the arbitrary item of claim 1-3, it is characterised in that, described charge information, comprising:
Length, charge capacity or charging expense during charging.
5. one kind obtains the implementation method of process of charging information, it is characterised in that, comprising:
Described server obtains charge information corresponding to described user equipment;
Described server determines that the websocket corresponding with described user equipment connects, and is connected by described websocket and push described charge information to described user equipment.
6. method according to claim 5, it is characterised in that, described server also comprises before determining that the websocket corresponding with described user equipment connects:
Described server stores the corresponding relation that the mark of described user equipment is connected with described websocket;
Described server determines that the websocket corresponding with described user equipment connects, and comprising:
According to described corresponding relation, described server determines that the websocket corresponding with described user equipment connects.
7. method according to claim 6, it is characterised in that, also comprise:
If again setting up after the websocket with described server is connected at described user equipment, corresponding relation described in described whois lookup, if the mark of described user equipment exists, then the described websocket in described corresponding relation is connected and replace as current websocket connects.
8. method according to the arbitrary item of claim 5-7, it is characterised in that, described charge information, comprising:
Length, charge capacity or charging expense during charging.
9. a user equipment, it is characterised in that, comprising:
Set up module, it is connected for setting up the web socket websocket with server;
Receiver module, connects the charge information pushed for reception server by described websocket;
Display module, for showing described charge information.
10. a server, it is characterised in that, comprising:
Acquisition module, for obtaining charge information corresponding to described user equipment;
Determination module, for determining that the websocket corresponding with described user equipment connects;
Sending module, pushes described charge information for being connected by described websocket to described user equipment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511003555.2A CN105635137A (en) | 2015-12-28 | 2015-12-28 | Method and apparatus for obtaining charge information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511003555.2A CN105635137A (en) | 2015-12-28 | 2015-12-28 | Method and apparatus for obtaining charge information |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105635137A true CN105635137A (en) | 2016-06-01 |
Family
ID=56049627
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511003555.2A Pending CN105635137A (en) | 2015-12-28 | 2015-12-28 | Method and apparatus for obtaining charge information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105635137A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108449403A (en) * | 2018-03-13 | 2018-08-24 | 万帮充电设备有限公司 | A kind of charge control method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103001822A (en) * | 2012-08-29 | 2013-03-27 | 五八同城信息技术有限公司 | Network anomaly handling method and device |
CN104010039A (en) * | 2014-06-05 | 2014-08-27 | 北京航空航天大学 | Multi-radar remote monitoring system and method based on WebSocket |
US8897952B1 (en) * | 2011-05-20 | 2014-11-25 | Brian Palmer | Vehicle diagnostic communications system and application |
CN104618425A (en) * | 2014-12-17 | 2015-05-13 | 浙江工商大学 | Real-time data monitoring method and system |
CN104617630A (en) * | 2015-02-14 | 2015-05-13 | 戴国峰 | Unattended electric vehicle charging power station |
CN104980898A (en) * | 2014-04-04 | 2015-10-14 | 中兴通讯股份有限公司 | Information pushing method, system and equipment |
-
2015
- 2015-12-28 CN CN201511003555.2A patent/CN105635137A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8897952B1 (en) * | 2011-05-20 | 2014-11-25 | Brian Palmer | Vehicle diagnostic communications system and application |
CN103001822A (en) * | 2012-08-29 | 2013-03-27 | 五八同城信息技术有限公司 | Network anomaly handling method and device |
CN104980898A (en) * | 2014-04-04 | 2015-10-14 | 中兴通讯股份有限公司 | Information pushing method, system and equipment |
CN104010039A (en) * | 2014-06-05 | 2014-08-27 | 北京航空航天大学 | Multi-radar remote monitoring system and method based on WebSocket |
CN104618425A (en) * | 2014-12-17 | 2015-05-13 | 浙江工商大学 | Real-time data monitoring method and system |
CN104617630A (en) * | 2015-02-14 | 2015-05-13 | 戴国峰 | Unattended electric vehicle charging power station |
Non-Patent Citations (1)
Title |
---|
张立生 等: "基于三层架构的移动协同应用平台的研究", 《河北省科学院学报》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108449403A (en) * | 2018-03-13 | 2018-08-24 | 万帮充电设备有限公司 | A kind of charge control method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102651861B (en) | Download method for mobile terminal, mobile terminal and proxy download server | |
CN104519036B (en) | A kind of method and device for sending business request information | |
EP4243559A3 (en) | Method for establishing a connection, radio access network element device and computer storage medium | |
CN103220351A (en) | Mobile terminal, file transmission method and system thereof and network system | |
CN103209089A (en) | Method for obtaining heart beat period, terminal and server | |
CN103068070A (en) | Negotiation method, mobile terminal, base station and communication system of protocol version | |
CN107182098B (en) | Method and equipment for realizing switching of user equipment between wireless access points | |
CN105635180A (en) | Message pushing method and device | |
CN104486379B (en) | A kind of parameter updating method and relevant device, system | |
CN105245612A (en) | File transmission method and system of terminal | |
CN104462033A (en) | Method and device for realizing editing operation among devices | |
CN104468852A (en) | Method, device and system for client to select IP link address | |
CN102118831A (en) | Wireless access method and device | |
CN102571820A (en) | Method used for transmitting data, compression server and terminal | |
CN105827740A (en) | Method, equipment and system for contact person information backup | |
CN102891858A (en) | Method and system for network data transmission and proxy server | |
CN103929453A (en) | Processing method, device and system for data uploading | |
WO2015172497A1 (en) | Message pushing and acquisition methods and devices, and computer readable storage medium | |
CN104469394A (en) | Video resource acquiring method, background server, video client and system | |
CN101808160B (en) | File processing method applied on mobile terminal and mobile terminal | |
CN103220331B (en) | The a large amount of picture approach of a kind of transmission and mobile intelligent terminal | |
CN104426863A (en) | Page request method, page request device, transit server and terminal | |
CN105635137A (en) | Method and apparatus for obtaining charge information | |
CN103929720A (en) | Method and system for information push and information sending end | |
CN103729440A (en) | Method and device for having access to website |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160601 |