CN107577504A - A kind of wireless sensor network programming method based on Restful frameworks - Google Patents

A kind of wireless sensor network programming method based on Restful frameworks Download PDF

Info

Publication number
CN107577504A
CN107577504A CN201710617534.2A CN201710617534A CN107577504A CN 107577504 A CN107577504 A CN 107577504A CN 201710617534 A CN201710617534 A CN 201710617534A CN 107577504 A CN107577504 A CN 107577504A
Authority
CN
China
Prior art keywords
programming
task
request
token
restful
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
Application number
CN201710617534.2A
Other languages
Chinese (zh)
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.)
Henan University
Original Assignee
Henan University
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 Henan University filed Critical Henan University
Priority to CN201710617534.2A priority Critical patent/CN107577504A/en
Publication of CN107577504A publication Critical patent/CN107577504A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of wireless sensor network programming method based on Restful frameworks, pass through the WEB server based on RESTful frameworks, user can directly log in client by webpage, client is packaged into the request of data of JSON forms by calling the PUT methods under RESTful frameworks to send, server end connects some sensors by USB programmings line, USB interface original state is all set to disable, the respective nodes that server opens the corresponding interface control respective sensor according to request complete corresponding operating, and USB interface recovers disabled status after completing programming program, until by demand being next time to be then turned on, it enormously simplify the operating process of user, improve the efficiency of programming.

Description

A kind of wireless sensor network programming method based on Restful frameworks
Technical field
The present invention relates to technical field of the computer network, more particularly to a kind of wireless senser based on Restful frameworks Network programming method.
Background technology
At present, in wireless sensor network development, more and more applications are produced to actual life, its development is very fast, It is by one group of microsensor node to introduce lower wireless sensor network (Wireless Sensor Networks, WSN) first The wireless network formed in an ad-hoc fashion, the purpose is to collaboratively perceive, gather and handle in the covering geographic area of networking to feel Know the information of object, and be distributed to observer.Each sensor in wireless sensor network has one or more nodes, passes Sensor node is typically a miniature embedded system.Each node monitors the sensing range object of oneself, and monitoring is specific Behavior, each node must burned respective type obtain .hex files and start gathered data to trigger node, the number that will be collected According to nearest client is sent to, the convergence stage is subsequently entered, is analyzed and is handled from the data collected close to node, Then result is sent to base station as needed, base station sends final result to the terminal of user, allows users to know it Data message interested.
RESTful frameworks
REST full name are Representational State Transfer, and Chinese means declarative state transfer, what it referred to It is one group of framework constraints and principle, if a framework meets REST constraints and principle, just it is referred to as we RESTful frameworks.HTTP is example uniquely related to REST at present, so our REST described herein are also to pass through The REST that HTTP is realized.
REST full name are the transfers of declarative state, and it is exactly resource to state refer to.Allow a resource can be identified, it is necessary to There is individual unique mark, this unique mark is exactly URI (Uniform Resource Identifier) in Web.URI both may be used To regard the address of resource as, the title of resource can also be regarded as.If some information do not use URI to represent, it Cannot a resource at last, can only be resource some information.URI design should follow addressability principle, With self descriptiveness, it is necessary to give association instinctively in form.
RESTFul frameworks should follow unified interface principle, and unified interface contains one group of limited predefined operation, All it is the access that resource is carried out by using identical interface no matter which type of resource.Interface should use the HTTP of standard Method such as GET, PUT, POST and DELETE, and follow the semanteme of these methods.
JSON
JSON (JavaScript Object Notation) is a kind of data interchange format of lightweight.It is based on JavaScript(Standard ECMA-262 3rd Edition - December 1999)A subset.JSON is used The text formatting of language is totally independent of, but also using the custom similar to C language family(Including C, C++, C#, Java, JavaScript, Perl, Python etc.).These characteristics make JSON turn into preferable data interchange language.It is easy to people Read and write, while be also easy to machine parsing and generation (network transfer speeds are fast).
Token
Token authentication generally use dynamic-password technique.So-called dynamic-password technique is changing to traditional static password technology Enter, user will possess the Token that some things such as system is issued, and the numeral on Token is continually changing, and be taken with certification Business device is synchronous, therefore it is also constantly to change that user, which signs in the password of system,(I.e. so-called " one-time pad ").
Dynamic-password technique has two kinds of synchronization scenarios:Time synchronized, event synchronization.
1. time synchronized refers to that Token uses a seed of the time as dynamic password, server end by using Time is as password caused by a seed certification Token.
2. event synchronization refers to when Token produces dynamic password every time using current counting as a seed, produce every time After completing dynamic password, the counting can be incremented by automatically.Server end is equally using number as seed when verifying.
Token also preserves identical seed in token with the external world without any data communication, service end, same to use With identical AES in token, identical encryption data is drawn, then obtains identical random cipher and is verified.Token Random cipher must be bound with the account of client etc., just can provide whether password matches.When service end does certification, same password Only allow verification once.
Hex files
Hex full name(Intel HEX)File is made up of the text for meeting Intel HEX file formats line by line ASCII text file.In Intel HEX files, a HEX is included per a line and is recorded.These records are by corresponding machine language The hexadecimal code of code and/or constant data numeral composition.Intel HEX files be generally used for transmission will be stored in ROM or Program and data in person EPROM.Most of EPROM programmers or simulator use Intel HEX files.Existing programming is big It is the programming using tunneling data mostly, there is larger limitation to regional space, and how net is carried out by wireless senser Network programming data, and it is the direction that the present invention studies to reduce the flow of user in operation.
The content of the invention
, can be with it is an object of the invention to provide a kind of wireless sensor network programming method based on Restful frameworks Simplify the operating process of user.
The technical solution adopted by the present invention is:
A kind of wireless sensor network programming method based on Restful frameworks, comprises the following steps:
A:The WEB server based on RESTful frameworks is established, user can log in the WEB based on RESTful frameworks by webpage Server, and be that the WEB servers of RESTful frameworks connects several sensors by USB programming lines, and by USB programmings USB interface original state corresponding to line is set to disable;
B:As user by webpage to the WEB server transmission logging request based on RESTful frameworks, based on RESTful frameworks WEB server end receive logging request after, a Token can be generated algorithmically by simultaneously according to user name and password and current time Client is returned to, Token is used for the authentication token of subsequent session, wireless to ensure for follow-up data interaction The safety of sensor network data;
C:After logging in successfully, the request of data for being encapsulated as JSON forms is sent to and is based on by calling PUT methods by client The WEB server of RESTful frameworks, following parameter is included in request of data:User IP, base station IDs, node ID, HEX files, TOKEN tokens;
D:Based on the WEB server end of RESTful frameworks by request of the concurrent receipt from client, will ask by reception Sequencing is put into several FIFO annular task memory, is then performed successively in the way of first in first out;
E:WEB server based on RESTful frameworks takes out being currently needed for performing of the task, and parsing is encapsulated as the number of JSON forms According to asking and compile it as autoexec, described autoexec is programming program;
F:WEB server based on RESTful frameworks enables corresponding USB interface according to request, and programming program is passed through into USB programmings Line is sent to base station;
G:Base station is by the burned node corresponding with the client logged in of the programming routine data received;It is then based on RESTful framves The WEB server of structure detects whether current programming task is completed, if completing, returns to client corresponding information, and close USB USB interface corresponding to programming line;Then next task is performed, is sequentially completed all programming tasks.
The URI parameters of PUT method calls are as follows in step C:
http://ip/put/:userIP/:senserID/:nodeId/:code/:token
Ip is server ip address, and userIP is IP address, and senserID refers to sensor ID, and nodeID is node ID, Code is hex file contents, and token is authentication token;
The request of data form for being encapsulated as JSON forms is as follows:
{"userIP":"192.168.0.1",
"senserID":"2",
"nodeId":"1",
"code":" :06000000025FF302999B70 ……",
"token":"0001000200……"
}。
In step C, described data operation request includes following parameter:UserIP, boxID, nodeID, hex, token; Wherein userIP returns to client task end of operation information for follow-up server end, hex refer to it is compiled can File is performed, file is made up of the hexadecimal code numeral of some corresponding machine language codes and/or constant data.
In the step D, executive mode is TDMA modes, specifically:
Time is divided into periodic frame (Frame), each frame is sub-partitioned into several time slots, in satisfaction timing and synchronously Under conditions of, the task that server can perform in each time slot in circle queue respectively is disturbed without mixed, so that task is rapid Be performed, one by one, and each task uses the timeslice of themselves.
In described step E, generate autoexec the step of be:
E1:Corresponding USB device is found according to the base station IDs of the request of data after parsing, is prepared for execution programming below;
E2:The IEEE addresses of corresponding node are found using base station IDs, namely node ID;
E3:By corresponding to the write-in of hex file contents in file, and obtain the path of this document;
E4:Then complete errorlevel is combined into according to hex file paths and IEEE addresses, errorlevel is write into suffix In entitled .bat autoexec.
Server detects current programming task whether complete be by detection procedure SmartRFProConsole.exe whether Realization is withdrawn, is concretely comprised the following steps:
Process is built, performs errorlevel;
SmartRFProgConsole.exe is called to perform programming program;
It whether there is SmartRFProgConsole.exe in detection local process, if in the presence of, then detect whether this process exits, Represent that current task programming is completed if exiting.
The present invention can directly log in client by the WEB server based on RESTful frameworks, user by webpage, Client is packaged into the request of data of JSON forms by calling the PUT methods under RESTful frameworks to send, and server end leads to Cross USB programmings line and connect some sensors, USB interface original state is all set to disable, and server is opened corresponding according to request The respective nodes of Interface Controller respective sensor complete corresponding operating, and complete USB interface recovery disabled status after programming program, Until by demand being next time to be then turned on, the operating process of user is enormously simplify, improves the efficiency of programming.
Brief description of the drawings
Fig. 1 is the wireless sensor network topology figure provided in an embodiment of the present invention based on RESTFul frameworks;
Fig. 2 is wireless sensor network programming program timing diagram provided in an embodiment of the present invention;
Fig. 3 is the detail flowchart of wireless sensor network programming program provided in an embodiment of the present invention;
Fig. 4 is FIFO task memories provided in an embodiment of the present invention;
Fig. 5 is cycle detection flow chart provided in an embodiment of the present invention.
Embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with Figure of description, it will be appreciated that described herein Preferred embodiment is merely to illustrate and explain the present invention, and is not intended to limit the present invention.And in the case where not conflicting, this Shen Please in embodiment and embodiment in feature can be mutually combined.
As shown in figure 1, the wireless sensor network topology figure provided in an embodiment of the present invention based on RESTFul frameworks, such as Figure, the WEB server based on restful frameworks connect some biosensor assay casees, USB interface initial shape by USB programmings line State is set to disable, and the corresponding interface is then turned on when task needs, and is recovered disabled status after completing programming program, is needed until next time Seeking Truth is then turned on.Some users log in client by webpage, and data operation request is sent to server.Specific present invention bag Include following steps:
A:The WEB server based on RESTful frameworks is established, user can log in the WEB based on RESTful frameworks by webpage Server, and be that the WEB servers of RESTful frameworks connects several sensors by USB programming lines, and by USB programmings USB interface original state corresponding to line is set to disable;
B:As user by webpage to the WEB server transmission logging request based on RESTful frameworks, based on RESTful frameworks WEB server end receive logging request after, a Token can be generated algorithmically by simultaneously according to user name and password and current time Client is returned to, Token is used for the authentication token of subsequent session, wireless to ensure for follow-up data interaction The safety of sensor network data;
C:After logging in successfully, the request of data for being encapsulated as JSON forms is sent to and is based on by calling PUT methods by client The WEB server of RESTful frameworks, following parameter is included in request of data:User IP, base station IDs, node ID, HEX files, TOKEN tokens;The URI parameters of PUT method calls are as follows in step C:
http://ip/put/:userIP/:senserID/:nodeId/:code/:token
Ip is server ip address, and userIP is IP address, and senserID refers to sensor ID, and nodeID is node ID, Code is hex file contents, and token is authentication token.
The request of data form for being encapsulated as JSON forms is as follows:
{"userIP":"192.168.0.1",
"senserID":"2",
"nodeId":"1",
"code":" :06000000025FF302999B70 ……",
"token":"0001000200……"
}
In step C, described data operation request includes following parameter:
UserIP, represents the IP address of user, and userIP returns to client task end of operation for follow-up server end Information;
BoxID, the numbering of chamber is represented, a chamber that is to say the aggregation node SINK nodes of a wireless sense network;
NodeID, represent the mark of a specific sensor node;
Hex, programming file is indicated, its filename is ended up with .HEX, because existing sensor network chip is with TI CC2530 cores Based on piece, its programming file consolidation is HEX forms, and hex refers to compiled executable file, and file is by some corresponding machines The hexadecimal code of language code and/or constant data numeral composition;
token;The wherein token of authentication;
D:Based on the WEB server end of RESTful frameworks by request of the concurrent receipt from client, will ask by reception Sequencing is put into several FIFO annular task memory, is then performed successively in the way of first in first out;It is described In step D, executive mode is TDMA modes, specifically:
Time is divided into periodic frame (Frame), each frame is sub-partitioned into several time slots, in satisfaction timing and synchronously Under conditions of, the task that server can perform in each time slot in circle queue respectively is disturbed without mixed, so that task is rapid Be performed, one by one, and each task uses the timeslice of themselves.
Annular task memory is divided into task queue region and dummy section, and server end is received from visitor by concurrent fashion The task requests at family end, task is put into several FIFO annular task memory successively according to sequential, task according to TDMA modes perform successively, and execution sequence is polling mode, take out task in each FIFO annular task memory successively, Programming task is performed, current task has been performed and has performed again next, performing for task into team after rounds of inquiries have been performed, Task is taken out in first FIFO annular task memory again and performs poll again.
E:WEB server based on RESTful frameworks takes out being currently needed for performing of the task, and parsing is encapsulated as JSON forms Request of data, and the autoexec performed automatically in operating system is generated as, such as .Bat files in windows platform Or Powershell files, Shell scripts in Linux, its act on be by a series of console instructions pack one it is automatic Change configuration processor, that is, generate autoexec;In described step E, generate autoexec the step of be:
E1:Corresponding USB device is found according to the base station IDs of the request of data after parsing, is prepared for execution programming below;
E2:Using node ID, NodeID is that is to say, finds the IEEE addresses of corresponding node;
E3:By in file corresponding to the write-in of hex file contents(Described respective file is the .Bat texts of the generation in E steps Part), and obtain the path of this document;
E4:Then complete errorlevel is combined into according to hex file paths and IEEE addresses, such as:start E:\403\ SmartRFProgConsole.exe SEPF="E:\403\testSendFile3\3.hex" WI(F=0,I= Ff.ff.ff.ff.00.16.00.09), wherein start refers to opening application program.E:\403\ SmartRFProgConsole.exe is Program path.S refers to target, by chip system programming to node.E refers to erasing Original program on node.P refers to the new program of programming.F refers to the path for wanting programming program.IEEE MAC when WI refers to programming program Address writes chip.F refers to the flash memory size of occupancy, unit KB.I refers to IEEE MAC address.Batch processing is ordered In the entitled .bat of order write-in suffix autoexec.
F:WEB server based on RESTful frameworks is according to the type of request, including is the types such as Get, put, update Operation, enables corresponding USB interface, programming program is sent into base station by USB programming lines;
G:Base station is by the burned node corresponding with the client logged in of the programming routine data received;It is then based on RESTful framves The WEB server of structure detects whether current programming task is completed, if completing, returns to client corresponding information, and close USB USB interface corresponding to programming line;Then next task is performed, is sequentially completed all programming tasks.Server is examined in step G Survey current programming task and whether complete to be whether to withdraw realization by detection procedure SmartRFProConsole.exe, have Body step is:
Process is built, performs errorlevel;
SmartRFProgConsole.exe is called to perform programming program;
It whether there is SmartRFProgConsole.exe in detection local process, if in the presence of, then detect whether this process exits, Represent that current task programming is completed if exiting.
The present invention proposes a kind of mode for being based under RESTful frameworks, program burn writing being realized in wireless sensor network, Which provides a kind of WEB server based on RESTful frameworks, and server end connects some sensors by USB programmings line, USB interface original state is all set to disable, and server opens the corresponding section of the corresponding interface control respective sensor according to request Point completes corresponding operating.USB interface recovers disabled status after completing programming program, until by demand being next time to be then turned on.With Family sends logging request by webpage to server, and server returns to one authentication token of client, for subsequently number According to interaction, to ensure the safety of wireless sensor network data;Client call PUT methods, will be encapsulated as JSON forms Request of data be sent to server, include following parameter in request of data:User IP, base station IDs, node ID, HEX files, TOKEN tokens;Task is put into several FIFO annular task memory successively according to sequential respectively, task is according to TDMA Mode performs successively, and execution sequence is polling mode, takes out task in each FIFO annular task memory successively, performs Programming task, perform current task and performed again next, having performed for task into team after rounds of inquiries have been performed, then from Task is taken out in first FIFO annular task memory and performs poll again;Server takes out current task, and analysis request is simultaneously It is compiled as autoexec;Server enables corresponding USB interface according to request, and programming program is sent to by USB programming lines Base station;Base station is by the burned respective nodes of program;Whether server detection programming task is completed, if completing, returns to client Corresponding information, then perform next task.It is illustrated below with specific example:
Fig. 2 is wireless sensor network programming program timing diagram provided in an embodiment of the present invention, specifically includes following steps:
S201:Client sends logging request.
In embodiments of the present invention, logging request should include parameter:User name, password
S202:Server end returns to one authentication token Token of client.
In embodiments of the present invention, server end receives logging request, is calculated according to user name and password and current time Method generates a Token and returns to client, and Token is used for the authentication token of subsequent session.
S203:Client sends data operation request.
In embodiments of the present invention, client is by calling PUT methods to send operation requests, wherein data to server end Operation requests can be encapsulated as JSON forms in order to which server end translates identification before sending, and data operation request includes following Parameter:UserIP, boxID, nodeID, hex, token.Wherein userIP returns to client for follow-up server end and appointed Business end of operation information, hex refer to compiled executable file, and file is by some corresponding machine language codes and/or constant The hexadecimal code numeral composition of data.
The URI parameters of wherein PUT method calls are as follows:
http://ip/put/:userIP/:senserID/:nodeId/:code/:token
Ip is server ip address, and userIP is IP address, and senserID refers to sensor ID, and nodeID is node ID, Code is hex file contents, and token is authentication token.
The request of data form for being encapsulated as JSON forms is as follows:
{"userIP":"192.168.0.1",
"senserID":"2",
"nodeId":"1",
"code":" :06000000025FF302999B70 ……",
"token":"0001000200……"
}
S204:The request received is put into annular task queue by server end.
In embodiments of the present invention, server end by concurrent fashion receive the request task from client, according to when Task is put into several FIFO annular task memory by sequence successively, and task performs successively according to TDMA modes, is performed suitable Sequence is polling mode.
S205:Server end takes out current task and performed.
In embodiments of the present invention, server end takes out current task, and the request of data for being encapsulated as JSON forms is parsed And errorlevel is compiled as, by enabling corresponding USB interface, programming program is sent to the base station of corresponding chamber.
S206:Sensor programming program.
In embodiments of the present invention, base station according to order to respective nodes programming program.
S207:Whether server end detection current task is finished.
In embodiments of the present invention, server end meeting cycle detection whether there is process SmartRF ProConsole.exe, if being not present, then it represents that tasks carrying finishes;If in the presence of, then it represents that task is also in commission.
S208:Server end returns to client corresponding information.
In embodiments of the present invention, when server end detects that process SmartRFProConsole.exe is exited, then return The information finished to relative client tasks carrying.
Fig. 3 be wireless sensor network programming program provided in an embodiment of the present invention detail flowchart, specifically include with Lower step:
S301:Client sends logging request.
In embodiments of the present invention, logging request should include parameter:User name, password
S302:Received server-side returns to one Token for being used for authentication of client to logging request.
In embodiments of the present invention, server end receives logging request, is calculated according to user name and password and current time Method generates a Token and returns to client, and Token is used for the authentication token of subsequent session.
S303:Client sends data operation request.
In embodiments of the present invention, client is by calling PUT methods to send operation requests, wherein data to server end Operation requests can be encapsulated as JSON forms in order to which server end translates identification before sending, and data operation request includes following Parameter:UserIP, boxID, nodeID, hex, token.Wherein userIP returns to client for follow-up server end and appointed Business end of operation information, hex refer to compiled executable file, and file is by some corresponding machine language codes and/or constant The hexadecimal code numeral composition of data.
The URI parameters of wherein PUT method calls are as follows:
http://ip/put/:userIP/:senserID/:nodeId/:code/:token
Ip is server ip address, and userIP is IP address, and senserID refers to sensor ID, and nodeID is node ID, Code is hex file contents, and token is authentication token.
The request of data form for being encapsulated as JSON forms is as follows:
{"userIP":"192.168.0.1",
"senserID":"2",
"nodeId":"1",
"code":" :06000000025FF302999B70 ……",
"token":"0001000200……"
}
S304:The request received is put into annular task queue by server end.
In embodiments of the present invention, server end receives the request from client by concurrent fashion, by request by suitable Sequence is put into several FIFO annular task memory, according to performing successively, such as Fig. 4 FIFO task memories:
Annular task memory is divided into task queue region and dummy section, and server end is received by concurrent fashion and comes from client Task requests, task is put into several FIFO annular task memory successively according to sequential, task is according to TDMA side Formula performs successively, and execution sequence is polling mode, takes out task in each FIFO annular task memory successively, performs burning Writing task, perform current task and performed again next, performing for task into team after rounds of inquiries have been performed, then from Task is taken out in one FIFO annular task memory and performs poll again.
TDMA modes refer to is divided into periodic frame (Frame) the time, and each frame is sub-partitioned into several time slots, Under conditions of meeting timing and synchronization, the task that server can perform in each time slot in circle queue respectively is disturbed without mixed. Task is rapidly performed, and one by one, each task uses the timeslice of themselves.
S305:Server end takes out current task and processed.
In embodiments of the present invention, server end takes out current task, and the request of data for being encapsulated as JSON forms is carried out Parsing, corresponding USB device is found according to the base station IDs of the request of data after parsing, is prepared for execution programming below;Profit The IEEE addresses of corresponding node are found with node ID;By corresponding to the write-in of hex file contents in file, and obtain the road of this document Footpath;Then complete errorlevel is combined into according to hex file paths and IEEE addresses, such as:start E:\403\ SmartRFProgConsole.exe S EP F="E:\403\testSendFile3\3.hex" WI(F=0,I= Ff.ff.ff.ff.00.16.00.09), errorlevel is write in the entitled .bat of suffix autoexec.
S306:Server end enables corresponding USB interface, and programming program is sent to base station.
In embodiments of the present invention, server end connects some sensors, USB interface original state by USB programmings line It is all set to disable, the respective nodes that the corresponding interface control respective sensor is then turned on according to request complete corresponding operating.Complete USB interface recovers disabled status after programming program, until by demand being next time to be then turned on.Here server end opens according to order With corresponding USB interface, and programming program is sent to by corresponding base station by USB programmings line.
S307:Base station is by the burned corresponding node of program.
In embodiments of the present invention, base station is corresponding node programming program according to order.
S308:Server cycle detection current task whether complete by programming.If programming is completed, step S310 is carried out, it is no Then carry out step S309.
In embodiments of the present invention, server cycle detection current task whether complete by programming.Such as Fig. 5 cycle detection flows Figure, is comprised the following steps that:
S501:Establishment process, perform errorlevel.Command forms are as follows:start E:\403\ SmartRFProgConsole.exe S EP F="E:\403\testSendFile3\3.hex" WI(F=0,I= ff.ff.ff.ff.00.16.00.09).Wherein start refers to opening application program.E:\403\ SmartRFProgConsole.exe is Program path.S refers to target, by chip system programming to node.E refers to erasing Original program on node.P refers to the new program of programming.F refers to the path for wanting programming program.IEEE MAC when WI refers to programming program Address writes chip.F refers to the flash memory size of occupancy, unit KB.I refers to IEEE MAC address.
S502:SmartRFProgConsole.exe is called to perform programming program.
S503:It whether there is SmartRFProgConsole.exe in detection local process, if in the presence of, then detect this process Whether exit, represent that current task programming is completed if exiting.
S504:Corresponding USB interface is disabled, client programming is returned to and finishes.
Cycle detection finishes.
S309:If detecting, current task does not have programming completion, continues cycling through detection, until detecting that programming is completed, then Carry out step S310.
S310:Server end disables current USB interface, returns to the information that client executing finishes.
S311:Server end performs next task, and circulation carries out step S305 to step S311.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (6)

  1. A kind of 1. wireless sensor network programming method based on Restful frameworks, it is characterised in that:Comprise the following steps:
    A:The WEB server based on RESTful frameworks is established, user can log in the WEB based on RESTful frameworks by webpage Server, and be that the WEB servers of RESTful frameworks connects several sensors by USB programming lines, and by USB programmings USB interface original state corresponding to line is set to disable;
    B:As user by webpage to the WEB server transmission logging request based on RESTful frameworks, based on RESTful frameworks WEB server end receive logging request after, a Token can be generated algorithmically by simultaneously according to user name and password and current time Client is returned to, Token is used for the authentication token of subsequent session, wireless to ensure for follow-up data interaction The safety of sensor network data;
    C:After logging in successfully, the request of data for being encapsulated as JSON forms is sent to and is based on by calling PUT methods by client The WEB server of RESTful frameworks, following parameter is included in request of data:User IP, base station IDs, node ID, HEX files, TOKEN tokens;
    D:Based on the WEB server end of RESTful frameworks by request of the concurrent receipt from client, will ask by reception Sequencing is put into several FIFO annular task memory, is then performed successively in the way of first in first out;
    E:WEB server based on RESTful frameworks takes out being currently needed for performing of the task, and parsing is encapsulated as the number of JSON forms According to asking and compile it as autoexec, described autoexec is programming program;
    F:WEB server based on RESTful frameworks enables corresponding USB interface according to request, and programming program is passed through into USB programmings Line is sent to base station;
    G:Base station is by the burned node corresponding with the client logged in of the programming routine data received;It is then based on RESTful framves The WEB server of structure detects whether current programming task is completed, if completing, returns to client corresponding information, and close USB USB interface corresponding to programming line;Then next task is performed, is sequentially completed all programming tasks.
  2. 2. the wireless sensor network programming method based on Restful frameworks as claimed in claim 1, it is characterised in that step The URI parameters of PUT method calls are as follows in rapid C:
    http://ip/put/:userIP/:senserID/:nodeId/:code/:token
    Ip is server ip address, and userIP is IP address, and senserID refers to sensor ID, and nodeID is node ID, Code is hex file contents, and token is authentication token;
    The request of data form for being encapsulated as JSON forms is as follows:
    {"userIP":"192.168.0.1",
    "senserID":"2",
    "nodeId":"1",
    "code":" :06000000025FF302999B70 ……",
    "token":"0001000200……"
    }。
  3. 3. the wireless sensor network programming method based on Restful frameworks as claimed in claim 2, it is characterised in that step In rapid C, described data operation request includes following parameter:UserIP, boxID, nodeID, hex, token;Wherein userIP Client task end of operation information is returned to for follow-up server end, hex refers to compiled executable file, text Part is made up of the hexadecimal code numeral of some corresponding machine language codes and/or constant data.
  4. 4. the wireless sensor network programming method based on Restful frameworks as claimed in claim 3, it is characterised in that institute State in step D, executive mode is TDMA modes, specifically:
    Time is divided into periodic frame (Frame), each frame is sub-partitioned into several time slots, in satisfaction timing and synchronously Under conditions of, the task that server can perform in each time slot in circle queue respectively is disturbed without mixed, so that task is rapid Be performed, one by one, and each task uses the timeslice of themselves.
  5. 5. the wireless sensor network programming method based on Restful frameworks as claimed in claim 4, it is characterised in that
    In described step E, generate autoexec the step of be:
    E1:Corresponding USB device is found according to the base station IDs of the request of data after parsing, is prepared for execution programming below;
    E2:The IEEE addresses of corresponding node are found using base station IDs, namely node ID;
    E3:By corresponding to the write-in of hex file contents in file, and obtain the path of this document;
    E4:Then complete errorlevel is combined into according to hex file paths and IEEE addresses, errorlevel is write into suffix In entitled .bat autoexec.
  6. 6. the wireless sensor network programming method based on Restful frameworks as claimed in claim 5, it is characterised in that clothes Business device detects whether current programming task is completed to be whether to withdraw realization by detection procedure SmartRFProConsole.exe , concretely comprise the following steps:
    Process is built, performs errorlevel;
    SmartRFProgConsole.exe is called to perform programming program;
    It whether there is SmartRFProgConsole.exe in detection local process, if in the presence of, then detect whether this process exits, Represent that current task programming is completed if exiting.
CN201710617534.2A 2017-07-26 2017-07-26 A kind of wireless sensor network programming method based on Restful frameworks Pending CN107577504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710617534.2A CN107577504A (en) 2017-07-26 2017-07-26 A kind of wireless sensor network programming method based on Restful frameworks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710617534.2A CN107577504A (en) 2017-07-26 2017-07-26 A kind of wireless sensor network programming method based on Restful frameworks

Publications (1)

Publication Number Publication Date
CN107577504A true CN107577504A (en) 2018-01-12

Family

ID=61034200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710617534.2A Pending CN107577504A (en) 2017-07-26 2017-07-26 A kind of wireless sensor network programming method based on Restful frameworks

Country Status (1)

Country Link
CN (1) CN107577504A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109462595A (en) * 2018-11-29 2019-03-12 甘肃万维信息科技有限责任公司 Data-interface secure exchange method based on RestFul

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2408892A (en) * 2003-12-03 2005-06-08 Emmanuel Davis Wireless sensor network
CN102364445A (en) * 2011-10-24 2012-02-29 上海理工大学 Automatic program burning system and method for wireless sensor network testing platform
CN105007597A (en) * 2015-08-31 2015-10-28 河南大学 Node packaging and accessing method of wireless sensor networks based on Restful configuration
CN105516980A (en) * 2015-12-17 2016-04-20 河南大学 Token authentication method for wireless sensor network based on Restful architecture
CN106603527A (en) * 2016-12-13 2017-04-26 天津春荣合陞科技发展有限公司 Sensor overall planning method based on Internet of things

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2408892A (en) * 2003-12-03 2005-06-08 Emmanuel Davis Wireless sensor network
CN102364445A (en) * 2011-10-24 2012-02-29 上海理工大学 Automatic program burning system and method for wireless sensor network testing platform
CN105007597A (en) * 2015-08-31 2015-10-28 河南大学 Node packaging and accessing method of wireless sensor networks based on Restful configuration
CN105516980A (en) * 2015-12-17 2016-04-20 河南大学 Token authentication method for wireless sensor network based on Restful architecture
CN106603527A (en) * 2016-12-13 2017-04-26 天津春荣合陞科技发展有限公司 Sensor overall planning method based on Internet of things

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘信新,邵明凯: "无线传感器网络操作系统TinyOS研究", 《计算机与数字工程》 *
刘龙: "大规模无线传感器网络平台的自动烧录方法", 《计算机研究与发展》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109462595A (en) * 2018-11-29 2019-03-12 甘肃万维信息科技有限责任公司 Data-interface secure exchange method based on RestFul

Similar Documents

Publication Publication Date Title
CN104735066B (en) A kind of single-point logging method of object web page application, device and system
CN104468531B (en) The authorization method of sensitive data, device and system
CN103905447B (en) Service link selects control method and equipment
CN105187392B (en) Mobile terminal from malicious software detecting method and its system based on Network Access Point
CN101316219B (en) Virtual network connection apparatus, system, method for controlling connection of a virtual network
CN104519050B (en) Login method and login system
CN102737019A (en) Machine behavior determining method, webpage browser and webpage server
CN111049946B (en) Portal authentication method, portal authentication system, electronic equipment and storage medium
CN111643907A (en) Game login method and device, storage medium and electronic equipment
CN104125485B (en) A kind of user profile shared method, equipment and system
CN108616360A (en) User identity verification, register method and device
CN107071723A (en) With sharing user profile close to device
CN110210212A (en) A kind of data processing method, device and relevant device
CN106357609A (en) User creation method and system, public network server and private cloud equipment
CN103647775B (en) Method and apparatus for registration in webpage
JP2018500834A (en) Method and apparatus for deploying services in a virtualized network
CN109996219A (en) A kind of Internet of Things method for authenticating, the network equipment and terminal
CN108399333A (en) System and method for the anti-virus scan for executing webpage
CN110730236B (en) Business pushing method and device based on artificial intelligence and electronic equipment
CN111125039B (en) Method and device for generating operation log
WO2022111169A1 (en) User identity identification method, computing device and computer storage medium
CN108959401B (en) Information propagation monitoring and analyzing method, system, server and storage medium
CN107577504A (en) A kind of wireless sensor network programming method based on Restful frameworks
CN113709743A (en) Zigbee network-based equipment network access method and system
Dimitriou et al. Sensenet: a wireless sensor network testbed

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180112