A kind of sync server formula wireless router data transmission method and system
Technical field
The present invention relates to wireless router technical field, specially a kind of sync server formula wireless router data transfer
Method and system.
Background technology
With network Development, the role that wireless router is served as in a network is also more and more important, and people are also more and more
Use wireless router as the gateway routing device of family online.Router (Router) is also known as gateway device
(Gateway), for connecting multiple logically separate networks.So-called logical network is to represent a single network or one
Individual subnet.When data are transferred to another subnet from a subnet, it can be completed by the routing function of router.Therefore,
Router has the function of judging the network address and selection IP paths.It can set up and flexibly connect in Multi net voting Interconnection Environment
Connect, various subnets can be connected with entirely different packet and media access method.Router only receives source station or other roads
By the information of device, belong to a kind of InterWorking Equipment of Internet.
People are often by the use of wireless routing as the bridge for being wiredly connected to wireless connection in life, using mobile phone when
Wait, wireless router is only merely that the wireless signal of handle machine is converted into wire signal and is sent to Internet (cable network),
Or the wire signal that Internet transmission comes is converted into wireless signal is sent to mobile phone.In actual application, we make
When with wireless routing from remote server renewal APP or with wechat foradownloaded video, the bottle of network speed is often met
Neck, causes to download or updates slow.
In the prior art, detail router can provide the user store function, such as hard disk is carried on the router having;Have
Router carry cloud function.Such as Application No. 201320073719.9, a kind of entitled " route with store function
Set on a kind of router with store function disclosed in the Chinese utility model patent of device ", including router, described router
There is antenna, router bottom is provided with network hard disc, and network hard disc bottom is provided with battery, and battery is connected with router, electric power storage
Pond is also connected with network hard disc, and network hard disc is connected by data wire with router.For another example Application No. 201220242628.9,
The Chinese utility model patent of entitled router of internet behavior data storage " a kind of support " is disclosed on a kind of support
The router of net behavioral data storage, including the router in network, described router is connected on power supply, described
Router be provided with storage module;Described router includes central processing unit and the friendship being connected respectively with central processing unit
Control unit, memory cell and Ethernet control unit are changed, described storage module is connected on central processing unit.
Generally, user can be gone up after transmitting file to router, and when needing by modes such as mobile phone A PP from route
The file of upload is downloaded in device.But storage file data in the router without limitation, it can not effectively improve data
The efficiency of transmission.
The content of the invention
A kind of the problem of present invention exists for prior art, it is proposed that sync server formula wireless router data transfer
Method and system, will can specifically transmit that data are temporary to wait suitable opportunity again in the router by wireless router
It is transmitted, network blockage, the slow phenomenon of data transfer can be avoided the occurrence of.
The technical solution adopted for the present invention to solve the technical problems is:A kind of sync server formula wireless router data
Transmission method, comprises the following steps,
(1) an application detecting chained list is set up to the application in terminal device by wireless router, and according to the application
Detect chained list and distribute a corresponding memory space to each application;
(2) data to be transmitted are detected by wireless router, when data are to pass through wireless router by terminal device
When being sent to network, by the data judging to be transmitted to be sent data, when data are to pass through wireless router by network
When being sent to terminal device, by the data judging to be transmitted to be received data;
(3) when the data to be transmitted is to be sent data, certain threshold will be met by detecting chained list according to the application
The data that to be sent of value are temporarily stored in corresponding memory space, and wait network response with by being sent in memory space
Data are transferred to network;
When the data to be transmitted is to be received data, certain threshold value will be met by detecting chained list according to the application
To be received data to be temporarily stored in corresponding memory space, and wait terminal device response with by being received in memory space
Data are transferred to terminal device.
Preferably, the step (1) specifically includes, and when terminal device is connected with wireless router, wireless router
First mounted application in detecting terminal device, an application detecting chained list is set up according to mounted application, and according to described
Using detecting chained list a corresponding memory cell is distributed on the memory of wireless router to each application.
Preferably, in the step (3), when a certain application of terminal device needs to send out to network by wireless router
When sending data, wireless router can first detect respective application to be sent the size of data and to be sent between the wait of data
Every when the size to be sent data is more than the first storage threshold value and to be sent the wait interval of data more than the first interval threshold
During value, wireless router can will be sent data according to application detecting chained list and move to the corresponding memory space of respective application, and
Record respective application to be carried out the destination address of data transmission, when network begins to respond to be sent data, wireless routing
Data in memory space are transferred to destination address by device;
Wherein, the first storage threshold value to be sent the storage size of data for storage;First interval threshold is is wanted
Send the transmission data amount check that data also need to wait before being transmitted.
Preferably, in the step (3), when network needs to send out to a certain application of terminal device by wireless router
When sending data, wireless router first detects the size to be received data, to be received the wait interval of data, and to be connect
The correspondence application of data is received, when the size to be received data is more than the second storage threshold value and to be received the wait interval of data
During more than the second interval threshold, wireless router will be received data according to application detecting chained list, and to move to respective application corresponding
Memory space, when terminal device begins to respond to be received data, the data in memory space are transferred to by wireless router
Corresponding application;
Wherein, the second storage threshold value to be received the storage size of data for storage;Second interval threshold is is wanted
Receive the transmission data amount check that data also need to wait before being transmitted.
Preferably, giving application distribution memory space to specifically include in the step (1), by total storage of wireless router
Space equivalence is divided into some storage space blocks and is stored in storage pool;When terminal device newly-increased one is applied, from storage pool
A storage space block is randomly selected as the basic memory space of newly-increased application;When terminal device, which deletes one, to be applied, it will delete
Except the basic memory space of application is placed back in storage pool as storage space block;When the storage of the transmission data of a certain application
When value is more than the basic memory space of respective application, at least one is randomly choosed from storage pool according to the storage value of transmission data
Storage space block merges to form temporary memory space with basic memory space successively, again by merging after the completion of data transfer
Storage space block is separated and placed back in storage pool with basic memory space.
A kind of sync server formula wireless router data transmission system, including,
Using detecting chained list generation module, detectd for setting up an application to the application in terminal device by wireless router
Surveyor's chain table;
Memory allocation module, it is empty to the corresponding storage of each application distribution one for detecting chained list according to the application
Between;
Data detection module, for detecting the data to be transmitted, when data are to pass through wireless router by terminal device
When being sent to network, by the data judging to be transmitted to be sent data, when data are to pass through wireless router by network
When being sent to terminal device, by the data judging to be transmitted to be received data;
Data processing module, for when the data to be transmitted is to be sent data, chain to be detected according to the application
The data that to be sent for meeting certain threshold value are temporarily stored in corresponding memory space by table, and wait network response empty that will store
Between in the data that to be sent be transferred to network;When the data to be transmitted is to be received data, detectd according to the application
The data that to be received for meeting certain threshold value are temporarily stored in corresponding memory space by surveyor's chain table, and wait terminal device response with
The data that to be received in memory space are transferred to terminal device.
Preferably, the application detecting chained list generation module includes applying detecting unit and chained list generation unit, it is described
Using detecting unit, for the Apply Names in detecting real-time terminal device and number is applied;
The chained list generation unit, chained list end is added to for the erection sequence according to application successively by newly-increased application
End, and deleted application is deleted from original chained list, with real-time update chained list.
Preferably, the memory allocation module includes the equal subdivision of memory space, basic memory allocation list
Member, and temporary memory space formation unit;
The equal subdivision of memory space, for total memory space equivalence of wireless router to be divided into some memory spaces
Block is simultaneously stored in storage pool;
The basic storage space allocation unit, for when terminal device newly-increased one is applied, being selected at random from storage pool
Take a storage space block as the basic memory space of newly-increased application, when terminal device, which deletes one, to be applied, application will have been deleted
Basic memory space placed back in as storage space block in storage pool;
The temporary memory space formation unit, the storage value for the transmission data when a certain application is more than respective application
Basic memory space when, according to transmission data storage value at least one storage space block is randomly choosed from storage pool successively
Merge with basic memory space to form temporary memory space, again by the storage space block and base of merging after the completion of data transfer
Plinth memory space is separated and placed back in storage pool.
Preferably, the data processing module includes the first storage threshold setting unit, the setting of the first interval threshold is single
Member, sends data message acquiring unit, sends data comparing unit, and send data processing unit;
The transmission data message acquiring unit, for obtain to be sent the sizes of data with to be sent data etc.
Wait to be spaced;
The transmission data comparing unit, for the size for being sent data to be compared with the first storage threshold value, by institute
The wait interval for sending data is compared with the first interval threshold, when to be sent data size be more than first storage threshold value and
When the wait interval to be sent data is more than the first interval threshold, start the transmission data processing unit;
The transmission data processing unit, for moving to respective application pair by be sent data according to application detecting chained list
The memory space answered, and the destination address that respective application to be carried out data transmission is recorded, when network begins to respond to be sent
During data, the data in memory space are transferred to destination address by wireless router.
Preferably, the data processing module also includes the second storage threshold setting unit, the setting of the second interval threshold
Unit, receives data message acquiring unit, receives data comparing unit, and receive data processing unit;
The reception data message acquiring unit, for obtain to be received the sizes of data with to be received data etc.
Wait to be spaced;
The reception data comparing unit, for the size for being received data to be compared with the second storage threshold value, by institute
The wait interval for receiving data is compared with the second interval threshold, when to be received data size be more than second storage threshold value and
When the wait interval to be received data is more than the second interval threshold, start the reception data processing unit;
The reception data processing unit, for moving to respective application pair by be received data according to application detecting chained list
The memory space answered, when terminal device begins to respond to be received data, wireless router passes the data in memory space
It is defeated by corresponding application.
The beneficial effects of the invention are as follows, it can assist in user and Large Volume Data sent by terminal device external network,
The larger data for needing to send first are sent into storage and arrive wireless router, then from wireless router on suitable opportunity to outside
Send, it is to avoid network blockage, the slow phenomenon of data transfer occur.It can assist in user and Large Copacity number received by terminal device
According to by wireless router the data that are obtained from remote server being needed first to deposit, treat that user needs remote server
On these data when, can directly be obtained from wireless router, save network download time, and avoid network blockage.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of sync server formula wireless router data transmission method;
Fig. 2 is a kind of structural representation of sync server formula wireless router data transmission system.
Embodiment
The following is specific embodiment of the invention and with reference to accompanying drawing, technical scheme is further described,
But the present invention is not limited to these embodiments.
As shown in figure 1, a kind of sync server formula wireless router data transmission method, comprises the following steps, (1) passes through
Wireless router sets up an application detecting chained list to the application in terminal device, and according to described
Using detecting chained list a corresponding memory space is distributed to each application.
It is made up of using detecting chained list the title applied, Apply Names is arranged in order by the erection sequence of application, when newly-increased
One when applying, application detecting chained list the new title for installing application of table tail increase to update using detecting chained list, work as deletion
One when applying, will delete in original application detecting chained list and deleted using corresponding Apply Names to update using detecting
Chained list, makes to be constantly in last state using detecting chained list.
When terminal device is connected with wireless router, wireless router first detects mounted application in terminal device,
One application detecting chained list is set up according to mounted application, and storage of the chained list in wireless router is detected according to the application
On device a corresponding memory space is distributed to each application.
Specifically included to application distribution memory space, it is empty that total memory space equivalence of wireless router is divided into some storages
Between block and be stored in storage pool, the value of total memory space is fixed, and the optimal number of storage space block is application number
Twice, if the number of storage space block is very little, underaction distribution, if the number of storage space block is too many, is stored
The storage value of space block can be less than normal, is unfavorable for data storage, and other storage space blocks can cannot get effective reason, causes storage
The waste in space.Often updated once using detecting chained list, the memory space of application will be redistributed accordingly.
When terminal device newly-increased one is applied, a storage space block is randomly selected from storage pool as the base of newly-increased application
Plinth memory space, the basic memory space and related application correspondence.When terminal device, which deletes one, to be applied, application will be deleted
Basic memory space placed back in as storage space block in storage pool;When the storage value of the transmission data of a certain application is more than
During the basic memory space of respective application, at least one storage is randomly choosed from storage pool according to the storage value of transmission data empty
Between block merge successively with basic memory space to form temporary memory space, with store correlation transmission data, work as data transfer
After the completion of the storage space block of merging is separated and placed back in storage pool with basic memory space again.The memory allocation
Method can effectively utilize the memory space of router, it is to avoid the insufficient memory for certain applications occur is used and other part
The memory space of application is constantly in the phenomenon of blank state.
(2) data to be transmitted are detected by wireless router, when data are to pass through wireless router by terminal device
When being sent to network, by the data judging to be transmitted to be sent data, when data are to pass through wireless router by network
When being sent to terminal device, by the data judging to be transmitted to be received data.
(3) when the data to be transmitted is to be sent data, certain threshold will be met by detecting chained list according to the application
The data that to be sent of value are temporarily stored in corresponding memory space, and wait network response with by being sent in memory space
Data are transferred to network.
When a certain application of terminal device needs to send data to network by wireless router, wireless router can be first
Detecting respective application to be sent the size of data and to be sent the wait interval of data, when the size to be sent data
When threshold value is stored more than first and the wait interval of data is sent more than the first interval threshold, wireless router meeting basis should
Data will be sent with detecting chained list and move to the corresponding memory space of respective application, and record respective application to be carried out data
The destination address of transmission, when network begins to respond to be sent data, wireless router is by the data transfer in memory space
To destination address.Wherein, the first storage threshold value to be sent the storage size of data for storage;First interval threshold is institute
Send the transmission data amount check that data also need to wait before being transmitted.
The embodiment one of data is sent, if the first storage threshold value is 500KB, the first interval threshold is 5.When terminal device
When needing the data to external server transmission 600KB using 1, if the transmission order of the data is from the number currently transmitted
According to transmission intercal be 5, although the size to be sent data is more than first and stores threshold value, but the wait to be sent data
When interval is equal to the first interval threshold, therefore, the data are directly transmitted, and need not be stored temporarily in the memory space of router
In.
The embodiment two of data is sent, if the first storage threshold value is 500KB, the first interval threshold is 5.When terminal device
When needing the data to external server transmission 300KB using 2, if the transmission order of the data is from the number currently transmitted
According to transmission intercal be 5, be less than the first storage threshold value by be sent the size of data, and to be sent between the wait of data
When equal to the first interval threshold, therefore, the data are directly transmitted, and need not be stored temporarily in the memory space of router
In.
The embodiment three of data is sent, if the first storage threshold value is 500KB, the first interval threshold is 5.When terminal device
When needing the data to external server transmission 600KB using 3, if the transmission order of the data is from the number currently transmitted
According to transmission intercal be 6, be more than the first storage threshold value by be sent the size of data, and to be sent between the wait of data
When more than the first interval threshold, therefore, the data are first stored temporarily in the memory space of the corresponding respective application 3 of router
In, and the record data destination address to be sent, when external server responds the data, then transmit this data to phase
The destination address answered.If the storage value of storage space block is 700KB, the data storage to be sent directly is being applied 3
In corresponding basic memory space.If the storage value of storage space block is 550KB, need basic memory space and one first
One temporary memory space of individual memory space merged block formation to be sent data to store, and after data are sent completely, will
Storage space block is separated with basic memory space.
When the data to be transmitted is to be received data, certain threshold value will be met by detecting chained list according to the application
To be received data to be temporarily stored in corresponding memory space, and wait terminal device response with by being received in memory space
Data are transferred to terminal device.
When network needs to send data to a certain application of terminal device by wireless router, wireless router is first detectd
Survey to be received the sizes of data, to be received the wait interval of data, and to be received correspondingly applying for data, when wanting
When the size for receiving data is more than the second storage threshold value and to be received the wait interval of data more than the second interval threshold, wirelessly
Router will be received data according to application detecting chained list and move to the corresponding memory space of respective application, when terminal device starts
When response to be received data, the data in memory space are transferred to corresponding application by wireless router.Wherein, the second storage
Threshold value to be received the storage size of data for storage;Second interval threshold is also needed before being transmitted to be received data
The transmission data amount check to be waited.
The embodiment one of data is received, if the second storage threshold value is 500KB, the second interval threshold is 5.Work as external server
When needing the application 4 to terminal device to send 600KB data, if the reception order of the data is from the number currently transmitted
According to transmission intercal be 3, although the size to be received data is more than second and stores threshold value, but the wait to be received data
When interval is less than the second interval threshold, therefore, the data are directly received, and need not be stored temporarily in the memory space of router
In.
The embodiment two of data is sent, if the second storage threshold value is 500KB, the second interval threshold is 5.Work as external server
When needing the application 5 to terminal device to send 300KB data, if the reception order of the data is from the number currently transmitted
According to transmission intercal be 5, be less than the second storage threshold value by be received the size of data, and to be received between the wait of data
When equal to the second interval threshold, therefore, the data are directly received, and need not be stored temporarily in the memory space of router
In.
The embodiment three of data is sent, if the second storage threshold value is 500KB, the second interval threshold is 5.Work as external server
When needing the application 6 to terminal device to send 1300KB data, if the reception order of the data is from currently transmitting
The transmission intercal of data is 6, is more than the second storage threshold value by be received the size of data, and to be received the wait of data
When interval is more than the second interval threshold, therefore, the data are first stored temporarily in the memory space of the corresponding respective application 6 of router
In, receive the data when application 6 responds the data, then by application 6.If the storage value of storage space block is
1400KB, then directly by the data storage to be received in 6 corresponding basic memory spaces of application.If storage space block
Storage value is 550KB, then needs basic memory space and two memory space merged block one temporary memory spaces of formation first
Data are received to store, and after the completion of data receiver, storage space block is separated with basic memory space.
As shown in Fig. 2 a kind of sync server formula wireless router data transmission system, including,
Using detecting chained list generation module, detectd for setting up an application to the application in terminal device by wireless router
Surveyor's chain table.The application detecting chained list generation module includes applying detecting unit and chained list generation unit.The application detecting is single
Member, for the Apply Names in detecting real-time terminal device and applies number.The chained list generation unit, for according to application
Newly-increased application is added to chained list end by erection sequence successively, and deleted application is deleted from original chained list, with
Real-time update chained list.
Memory allocation module, it is empty to the corresponding storage of each application distribution one for detecting chained list according to the application
Between.It is empty that the memory allocation module includes the equal subdivision of memory space, basic storage space allocation unit, and interim storage
Between form unit.
The equal subdivision of memory space, for total memory space equivalence of wireless router to be divided into some memory spaces
Block is simultaneously stored in storage pool.The basic storage space allocation unit, for when terminal device newly-increased one is applied, from storage
A storage space block is randomly selected in pond as the basic memory space of newly-increased application, will when terminal device, which deletes one, to be applied
The basic memory space for having deleted application is placed back in storage pool as storage space block.The temporary memory space forms list
Member, when the storage value for the transmission data when a certain application is more than the basic memory space of respective application, according to transmission data
Storage value at least one storage space block randomly choosed from storage pool merge interim to be formed with basic memory space successively
Memory space, the storage space block of merging is separated and place back in storage with basic memory space again after the completion of data transfer
Chi Zhong.
Data detection module, for detecting the data to be transmitted, when data are to pass through wireless router by terminal device
When being sent to network, by the data judging to be transmitted to be sent data, when data are to pass through wireless router by network
When being sent to terminal device, by the data judging to be transmitted to be received data.
Data processing module, for when the data to be transmitted is to be sent data, chain to be detected according to the application
The data that to be sent for meeting certain threshold value are temporarily stored in corresponding memory space by table, and wait network response empty that will store
Between in the data that to be sent be transferred to network;When the data to be transmitted is to be received data, detectd according to the application
The data that to be received for meeting certain threshold value are temporarily stored in corresponding memory space by surveyor's chain table, and wait terminal device response with
The data that to be received in memory space are transferred to terminal device.
The data processing module includes the first storage threshold setting unit, and the first interval threshold setup unit sends number
According to information acquisition unit, data comparing unit is sent, and send data processing unit.The transmission data message acquiring unit,
The size of data is sent for acquisition and to be sent the wait interval of data.The transmission data comparing unit, is used for
The size for being sent data is compared with the first storage threshold value, wait interval and the first interval threshold of data will be sent
Compare, when the size to be sent data is more than the first storage threshold value and to be sent the wait interval of data more than the first interval
During threshold value, start the transmission data processing unit.The transmission data processing unit, for detecting chained list by institute according to application
Send data and move to the corresponding memory space of respective application, and record the destination that respective application to be carried out data transmission
Location, when network begins to respond to be sent data, the data in memory space are transferred to destination address by wireless router.
The data processing module also includes the second storage threshold setting unit, and the second interval threshold setup unit is received
Data message acquiring unit, receives data comparing unit, and receive data processing unit.The reception data message obtains single
Member, to be received the size of data for acquisition and to be received the wait interval of data.The reception data comparing unit, is used
Compared in by the size for being received data with the second storage threshold value, wait interval and the second interval threshold of data will be received
Value compares, between the size to be received data is more than the second storage threshold value and to be received the wait intervals of data more than second
When threshold value, start the reception data processing unit.The reception data processing unit, will for detecting chained list according to application
To be received data and move to the corresponding memory space of respective application, when terminal device begins to respond to be received data, wirelessly
Data in memory space are transferred to corresponding application by router.
Specific embodiment described herein is only to spirit explanation for example of the invention.Technology neck belonging to of the invention
The technical staff in domain can be made various modifications or supplement to described specific embodiment or be replaced using similar mode
Generation, but without departing from the spiritual of the present invention or surmount scope defined in appended claims.