[go: up one dir, main page]

CN105072703B - The data transmission of Wifi-Direct network and processing method and system - Google Patents

The data transmission of Wifi-Direct network and processing method and system Download PDF

Info

Publication number
CN105072703B
CN105072703B CN201510427583.0A CN201510427583A CN105072703B CN 105072703 B CN105072703 B CN 105072703B CN 201510427583 A CN201510427583 A CN 201510427583A CN 105072703 B CN105072703 B CN 105072703B
Authority
CN
China
Prior art keywords
data
processing method
json
transmission
sending
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
CN201510427583.0A
Other languages
Chinese (zh)
Other versions
CN105072703A (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.)
Shanghai Moruan Communication Technology Co Ltd
Original Assignee
Shanghai Moruan Communication Technology Co Ltd
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 Shanghai Moruan Communication Technology Co Ltd filed Critical Shanghai Moruan Communication Technology Co Ltd
Priority to CN201510427583.0A priority Critical patent/CN105072703B/en
Publication of CN105072703A publication Critical patent/CN105072703A/en
Application granted granted Critical
Publication of CN105072703B publication Critical patent/CN105072703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a kind of transmission of the data of Wifi-Direct network and processing method and system, method to include:The first information is converted json data by data sending terminal, and the first information includes sending data and to the processing method for sending data;The data sending terminal sends the json data to data receiver;After the json data that the data receiver listens to that the data sending terminal is sent, the transmission data of the first information and the processing method to the transmission data in the json data are parsed.The present invention realizes the direct transmission of data using Wifi-Direct network and by http protocol, has the advantages that coding is convenient.

Description

The data transmission of Wifi-Direct network and processing method and system
Technical field
The present invention relates to a kind of transmission of data and processing method and system, in particular to a kind of to be not necessarily to intermediary transfer just The data transmission and processing method and system of data can directly be transmitted.
Background technique
In the wireless network, it when needing data interaction between two equipment, needs through wireless router, access point etc. Transfer, i.e. a transmitting terminal first send data to wireless router, then are sent to receiving end by wireless router, this will lead to number According to (equipment such as wireless router need to be added) at high cost of transmission, transmission speed is slow and time-consuming the defects of.
Moreover, transmitting terminal is when sending data, usually packs the data to form data type and then sent again The form data, this will lead to coding trouble;And when transmitting terminal is intended to wish that the processing method that receiving end is made is sent to reception When end, needs for the processing method to be placed on and sent in url (uniform resource locator).It follows that transmitting terminal will need to send out The data sent are sent to receiving end in a manner of form data, processing method is placed in url is sent to receiving end, i.e., transmitting terminal will Different data are transmitted to receiving end in different ways, further result in coding trouble.Receiving end is receiving transmitting terminal hair After the data sent, start log-on data processing set, this mode just registered after data that receives also causes coding inconvenient.
Summary of the invention
The technical problem to be solved by the present invention is to need to overcome when transmitting terminal sends data to receiving end in the prior art The transfer of the equipment such as wireless router, and the defect that data transfer mode is pretty troublesome are wanted, a kind of Wifi-Direct network is provided The data of (equipment in wireless network is allowed to be not necessarily to be connected with each other by wireless router) are transmitted and processing method and are System.
The present invention is to solve above-mentioned technical problem by following technical proposals:
The present invention provides the data transmission and processing method of a kind of Wifi-Direct network, it is characterized in that, including it is following Step:
The first information is converted json (data interchange format that json is a kind of lightweight) data, institute by data sending terminal Stating the first information includes sending data and to the processing method for sending data;
The data sending terminal sends the json data to data receiver;
After the json data that the data receiver listens to that the data sending terminal is sent, the json is parsed The transmission data of the first information and the processing method to the transmission data in data.
In the present solution, data sending terminal will need all data for sending to send with json data type, keep away Exempt from that different data are sent to the drawback for leading to coding trouble in different ways as the prior art.
Preferably, further including:
The data receiver dynamic registration data processing set, data processing before receiving the json data Set includes multiple data processing methods, and the data processing for setting one in the data processing method to default is arranged Method;
The data receiver parses in the json data transmission data of the first information and to the transmission data Processing method after, will to it is described send data processing method be matched with the data processing set, if successful match It then executes to the processing method for sending data, otherwise executes the data processing method of the default.
Preferably, data processing set described in dynamic registration (is directly made using Flyweight Pattern if registered With the new registration not registered) it realizes, Flyweight Pattern is the prior art, is just repeated no more to the principle of Flyweight Pattern here.
Preferably, the communication protocol of the data sending terminal and the data receiver is Http agreement (Hyper text transfer Agreement), the data sending terminal is client, and the data receiver is server end.
The present invention also provides a kind of data of Wifi-Direct network transmission and processing system, including data sending terminal and Data receiver, it is characterized in that, the data sending terminal includes conversion unit and transmission unit, and the conversion unit is used for will The first information is converted into json data, and the first information includes sending data and to the processing method for sending data;
The transmission unit is for sending the json data to the data receiver;
The data receiver includes monitoring unit and resolution unit, and the resolution unit is used to supervise in the monitoring unit After hearing the json data that the transmission unit is sent, transmission data of the first information and right are parsed in the json data The processing method for sending data.
Preferably, the data receiver further includes registering setting unit, matching unit, the first execution unit and second to hold Row unit;
The registration setting unit is used for the dynamic registration data processing set before receiving the json data, the number Include multiple data processing methods according to processing set, and the number for setting one in the data processing method to default is set According to processing method;
The matching unit is for parsing in the json data transmission data of the first information and to the transmission number According to processing method after, will to it is described send data processing method be matched with the data processing set, if match at Function then calls first execution unit to execute to the processing method for sending data, otherwise calls second execution unit Execute the data processing method of the default.
Preferably, data processing set described in dynamic registration is realized using Flyweight Pattern.
Preferably, the communication protocol of the data sending terminal and the data receiver is Http agreement, the data hair Sending end is client, and the data receiver is server end.
On the basis of common knowledge of the art, above-mentioned each optimum condition, can any combination to get each preferable reality of the present invention Example.
The positive effect of the present invention is that:
The present invention passes through the transmission of the immediate data of Wifi-Direct network implementations data sending terminal and data receiver, nothing Other intermediary interim datas are needed, cost has been saved;And data sending terminal will need all data sent with json Data type carries out being sent to data receiver, has the advantages that coding is convenient;What furthermore the present invention used is receiving json Just have using Flyweight Pattern dynamic registration is good in such a way that before data and save memory, facilitates coding, scalability by force excellent Point.
Detailed description of the invention
Fig. 1 is the flow chart of the data transmission and processing method of the embodiment of the present invention 1.
Fig. 2 is the structural block diagram of the data transmission and processing system of the embodiment of the present invention 1.
Fig. 3 is the structural block diagram of the data transmission and processing system of the embodiment of the present invention 2.
Fig. 4 is the flow chart of the data transmission and processing method of the embodiment of the present invention 3.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Embodiment 1
As shown in Figure 1, passing through the present embodiment provides a kind of transmission of the data of Wifi-Direct network and processing method Wifi-Direct network carries out the immediate data transmission of data sending terminal and data receiver, without other intermediarys for example without Line router interim data, saves cost.The data transmission and processing method include the following steps:
The first information is converted json data by step 101, data sending terminal, the first information include send data and To the processing method for sending data;
Step 102, the data sending terminal send the json data to data receiver;
Step 103, after the json data that the data receiver listens to that the data sending terminal is sent, parse The transmission data of the first information and the processing method to the transmission data in the json data.
In the present embodiment, data sending terminal will need all data sent to send with json data type, Avoid the drawback that different data are sent in different ways as the prior art and lead to coding trouble.The skill of this field Art personnel according to common knowledge it is found that in the prior art data receiver to data sending terminal send data when be with json data Type is sent, and data sending terminal to data receiver send data when do not sent with json data type, and The present invention breaks conventional design, so that data sending terminal is also sent out when sending data to data receiver with json data type It send, and this sending method coding is very convenient.
As shown in Fig. 2, the present embodiment also provides the data transmission and processing system of a kind of Wifi-Direct network, including Data sending terminal 1 and data receiver 2, the data sending terminal 1 include conversion unit 11 and transmission unit 12, and the conversion is single For member 11 for converting json data for the first information, the first information includes sending data and to the place for sending data Reason method;
The transmission unit 12 is for sending the json data to the data receiver;
The data receiver 2 includes monitoring unit 21 and resolution unit 22, and the resolution unit 22 is used in the prison After listening unit 21 to listen to the json data that the transmission unit 12 is sent, the first information in the json data is parsed Send data and to the processing method for sending data.
Embodiment 2
Data transmission provided in this embodiment and processing method include the institute of the data transmission and processing method in embodiment 1 There is operation, in addition to this, the present embodiment is executed when not hearing the json data that data sending terminal is sent continues monitoring Operation, and the present embodiment is further comprising the steps of after the step 104 of embodiment 1:The data receiver parses institute State the transmission data of the first information in json data and to the processing method for sending data after, data will be sent to described Processing method is matched with the data processing set, if including to described in successful match, that is, data processing set The processing method for sending data is then executed to the processing method for sending data, if it is the data processing set that it fails to match In without containing then executing the data processing method of the default to the processing method for sending data.
Moreover, just having used Flyweight Pattern dynamic registration to get well data before receiving json data in the present embodiment Processing set, the data processing set includes multiple data processing methods, and is arranged appointing in the data processing method Meaning one is set as the data processing method of default, this to have the function for saving memory by the way of Flyweight Pattern dynamic registration Energy;Again due to being dynamic registration data processing set, so be between each data processing set it is independent, this is for number For transmitting terminal, it is only necessary to which data processing method is set in json data, so that coding is more convenient.In addition, Dynamic registration data processing set will not influence the program circuit that data receiver is currently running originally, and more it is not necessary to modify data The original code in receiving end has stronger scalability.Therefore the data that receive compared with the existing technology just instantiate later Data processing method, this programme have the advantages that save memory, facilitate coding, scalability strong.
The present embodiment also provides the data transmission and processing system of a kind of Wifi-Direct network comprising data are sent End and data receiver.Wherein, the data sending terminal institute in function and embodiment 1 that the data sending terminal of the present embodiment has The function having is identical, the function that functional module included by the data receiver of the present embodiment and each functional module have Not only include the function that all functional modules and each functional module included by the data receiver in embodiment 1 have, also wraps Following each functional module is included, referring specifically to Fig. 3:
The data receiver further includes registering setting unit 23, matching unit 24, the first execution unit 25 and second to hold Row unit 26.
The registration setting unit 23 is used to use Flyweight Pattern dynamic registration data before receiving the json data Processing set, the data processing set includes multiple data processing methods, and is arranged one in the data processing method A data processing method for being set as default;
The matching unit 24 is for parsing in the json data transmission data of the first information and to the transmission After the processing method of data, the processing method for sending data will be matched with the data processing set, if matching It is successful then first execution unit 25 is called to execute to the processing method for sending data, otherwise call described second to execute Unit 26 executes the data processing method of the default.
Embodiment 3
Data transmission provided in this embodiment and processing method and system include the data transmission and processing method of embodiment 2 And all the elements of system, and the communication protocol of data sending terminal and data receiver is Http agreement in the present embodiment, is pressed According to the requirement of Http agreement, data sending terminal is designed as client in the present embodiment, and data receiver is designed as servicing Device end.
In the present embodiment, data transmission and processing method utilize JAVA (object oriented program language) exploitation language Speech realizes that specifically client is HttpClient, server end HttpServer, and data processing collection is combined into Map < Uri, Servlet > is arranged before transmitting the data by HttpClient and HttpServer, wherein Map is the most common aggregate type One of, for storage element to (referred to as key and value), wherein each key is mapped to a value;Uri is uniform resource identifier; Servlet is the small routine run on server end.
As shown in figure 4, data transmission and processing method include the following steps:
The first information is converted json data by step 201, client HttpClient, and the first information includes sending Data (including data Data and data type Type) and to it is described send data processing method Action, the processing method Action is exactly the specific processing method name in the java class of Servlet;
Step 202, client HttpClient send Http and request to server end HttpServer, wrap in Http request Include the json data;
Step 203, server end HttpServer after system start-up and receive the request that HttpClient is sent Any moment before uses Flyweight Pattern dynamic registration data processing set Map < Uri, Servlet >, the data processing Set Map < Uri, Servlet > include multiple data processing method Action, and by one in those data processing methods It is set as the data processing method of default, each data processing method Action all has corresponding Servlet;
Step 204, server end HttpServer monitor the Http request that HttpClient is sent, if receiving described Json data then parse the transmission data Data and Type of the first information in the json data and to the transmission data Otherwise processing method Action continues to monitor;
It is in step 205, server end HttpServer inquiry data processing set Map < Uri, the Servlet > It is no that there is the processing method Action, the corresponding Servlet of processing method Action is executed if having, and otherwise executes institute State the corresponding Servlet of data processing method Action of default.
To sum up, the present invention is passed by the immediate data of Wifi-Direct network implementations data sending terminal and data receiver It is defeated, other intermediary interim datas are not necessarily to, cost has been saved;And data sending terminal will need all data for sending with Json data type carries out being sent to data receiver, has the advantages that coding is convenient;What furthermore the present invention used is receiving Just have in such a way that Flyweight Pattern dynamic registration is good before json data and save memory, facilitates coding, scalability is strong The advantages of.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back Under the premise of from the principle and substance of the present invention, many changes and modifications may be made, but these are changed Protection scope of the present invention is each fallen with modification.

Claims (6)

1. a kind of data of Wifi-Direct network are transmitted and processing method, which is characterized in that include the following steps:
The first information is converted json data by data sending terminal, and the first information includes sending data and to the transmission number According to processing method;
The data sending terminal sends the json data to data receiver;
After the json data that the data receiver listens to that the data sending terminal is sent, the json data are parsed The transmission data of the middle first information and to it is described send data processing method;
The data receiver dynamic registration data processing set, data processing set before receiving the json data Including multiple data processing methods, and the data processing side for setting one in the data processing method to default is set Method;
The data receiver parses the transmission data of the first information and the place to the transmission data in the json data After reason method, the processing method for sending data will be matched with the data processing set, held if successful match Otherwise row executes the data processing method of the default to the processing method for sending data.
2. the data of Wifi-Direct network as described in claim 1 are transmitted and processing method, which is characterized in that dynamic is infused The volume data processing set is realized using Flyweight Pattern.
3. the data of Wifi-Direct network as described in claim 1 are transmitted and processing method, which is characterized in that the number It is Http agreement according to the communication protocol of transmitting terminal and the data receiver, the data sending terminal is client, the data Receiving end is server end.
4. a kind of data of Wifi-Direct network are transmitted and processing system, including data sending terminal and data receiver, special Sign is that the data sending terminal includes conversion unit and transmission unit, and the conversion unit is for converting the first information to Json data, the first information include sending data and to the processing method for sending data;
The transmission unit is for sending the json data to the data receiver;
The data receiver includes monitoring unit and resolution unit, and the resolution unit in the monitoring unit for listening to After the json data that the transmission unit is sent, the transmission data of the first information are parsed in the json data and to described Send the processing method of data;
The data receiver further includes registration setting unit, matching unit, the first execution unit and the second execution unit;
The registration setting unit is used for the dynamic registration data processing set before receiving the json data, at the data Reason set includes multiple data processing methods, and is arranged at the data for setting one in the data processing method to default Reason method;
The matching unit is used to parse transmissions data of the first information in the json data and to the transmission data After processing method, the processing method for sending data will be matched with the data processing set, if successful match It calls first execution unit to execute to the processing method for sending data, second execution unit is otherwise called to execute The data processing method of the default.
5. data transmission as claimed in claim 4 and processing system, which is characterized in that data processing set described in dynamic registration It is realized using Flyweight Pattern.
6. data transmission as claimed in claim 4 and processing system, which is characterized in that the data sending terminal and the data The communication protocol of receiving end is Http agreement, and the data sending terminal is client, and the data receiver is server end.
CN201510427583.0A 2015-07-20 2015-07-20 The data transmission of Wifi-Direct network and processing method and system Active CN105072703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510427583.0A CN105072703B (en) 2015-07-20 2015-07-20 The data transmission of Wifi-Direct network and processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510427583.0A CN105072703B (en) 2015-07-20 2015-07-20 The data transmission of Wifi-Direct network and processing method and system

Publications (2)

Publication Number Publication Date
CN105072703A CN105072703A (en) 2015-11-18
CN105072703B true CN105072703B (en) 2018-11-27

Family

ID=54501941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510427583.0A Active CN105072703B (en) 2015-07-20 2015-07-20 The data transmission of Wifi-Direct network and processing method and system

Country Status (1)

Country Link
CN (1) CN105072703B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272337A (en) * 2007-12-27 2008-09-24 华为技术有限公司 Business data processing method and business data processing system
CN101854371A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Method and device for invoking and processing JavaScript objects
CN102158482A (en) * 2011-03-10 2011-08-17 易程(苏州)软件股份有限公司 JSON (JavaScript Object Notation) data protocol based passenger transport information communication method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272337A (en) * 2007-12-27 2008-09-24 华为技术有限公司 Business data processing method and business data processing system
CN101854371A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Method and device for invoking and processing JavaScript objects
CN102158482A (en) * 2011-03-10 2011-08-17 易程(苏州)软件股份有限公司 JSON (JavaScript Object Notation) data protocol based passenger transport information communication method and system

Also Published As

Publication number Publication date
CN105072703A (en) 2015-11-18

Similar Documents

Publication Publication Date Title
CN109391500B (en) A configuration management method, device and device
CN105721473B (en) A kind of method and system of WEB terminal far call optimization
CN109889454A (en) A message push device and method for microservice architecture
CN102546794B (en) Method for directly communicating browser client with back-end server as well as gateway and communication system
CN103152378B (en) A kind of transmission method of network data, system and client
CN110300050A (en) Information push method, device, computer equipment and storage medium
CN105357283B (en) Long connection establishing method of intelligent wearable equipment, server and terminal
CN103997539B (en) Radar running status collection dissemination system and its method based on web services
JP5940216B2 (en) Socket management method with bearer independent protocol
CN102938788B (en) The processing method of event and device
CN103685381B (en) Method, system and device for downloading webpage resources
US20150207598A1 (en) Data distribution method and device
CN101183946A (en) Method and system of obtaining resource listing of download file
CN105100158A (en) Message pushing and obtaining methods and apparatuses
CN111884938B (en) Router information acquisition method and device
CN107368334B (en) Business plug-in interaction system and method
CN113438233A (en) Method for mutual conversion between protocols
CN105072703B (en) The data transmission of Wifi-Direct network and processing method and system
CN105263169A (en) WLAN equipment management frame transmission speed adjusting method and system, WLAN equipment
CN108924773B (en) Message processing method and device
US9992767B2 (en) Data transmission method and device
US20190318036A1 (en) Topic Based Publish and Parametric Subscribe Pattern
US20120254728A1 (en) Content acquiring method and client terminal
JP2019071573A (en) APPARATUS, METHOD AND PROGRAM FOR TRANSMITTING AND RECEIVING DATA TO AND FROM IoT DEVICE
CN103428280A (en) Mobile terminal based mobile service data acquisition method and system

Legal Events

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