CN104601655A - Intelligent socket control method and device - Google Patents

Intelligent socket control method and device Download PDF

Info

Publication number
CN104601655A
CN104601655A CN201410742764.8A CN201410742764A CN104601655A CN 104601655 A CN104601655 A CN 104601655A CN 201410742764 A CN201410742764 A CN 201410742764A CN 104601655 A CN104601655 A CN 104601655A
Authority
CN
China
Prior art keywords
smart jack
command
order
client
command buffer
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.)
Granted
Application number
CN201410742764.8A
Other languages
Chinese (zh)
Other versions
CN104601655B (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.)
DONGGUAN ORIENT ELECTRONICS & METAL Co.,Ltd.
Original Assignee
Shanghai Feixun Data 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 Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410742764.8A priority Critical patent/CN104601655B/en
Publication of CN104601655A publication Critical patent/CN104601655A/en
Application granted granted Critical
Publication of CN104601655B publication Critical patent/CN104601655B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01RELECTRICALLY-CONDUCTIVE CONNECTIONS; STRUCTURAL ASSOCIATIONS OF A PLURALITY OF MUTUALLY-INSULATED ELECTRICAL CONNECTING ELEMENTS; COUPLING DEVICES; CURRENT COLLECTORS
    • H01R13/00Details of coupling devices of the kinds covered by groups H01R12/70 or H01R24/00 - H01R33/00
    • H01R13/66Structural association with built-in electrical component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • H04L1/1671Details of the supervisory signal the supervisory signal being transmitted together with control information
    • H04L1/1678Details of the supervisory signal the supervisory signal being transmitted together with control information where the control information is for timing, e.g. time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention relates to the technical field of electronics, in particular to an intelligent socket control method and device. The intelligent socket control method includes the steps: firstly, judging whether a client transmits an external instruction to an intelligent socket or not by the intelligent socket; secondly, judging whether the external instruction can be received or not by the intelligent socket, generating a state message by the intelligent socket if not, transmitting the external instruction again by the client after time is set in a delayed manner according to the state message, and repeating the step 1; thirdly, placing the external instruction into an instruction buffering queue; fourthly, sequentially executing the instructions in the instruction buffering queue according to a sequence of the instruction buffering queue. The intelligent socket control method and the client negotiate to execute remote instructions, on one hand, buffer overflow of the socket caused by excessive instructions can be prevented, on the other hand, the pressure of the socket executing the excessive instructions in the short time is relieved, a more effective solving scheme is provided when the intelligent socket executes the remote instructions from the client.

Description

The control method of smart jack and device
Technical field
The present invention relates to electronic technology field, be specifically related to a kind of control method and device of smart jack.
Background technology
A lot of smart jack supports that user carries out Long-distance Control by local area network (LAN) or the Internet to it at present.Routinely, smart jack receives the remote command requests that client sends, and after command execution is complete, result is returned to client.If multiple user simultaneously, or unique user sends many orders continuously to socket, and so these orders of buffer memory understood usually by socket, then perform one by one and return results to client.But the shortcoming of prior art is once remote command is sent to socket too much, brings excessive pressure by socket, if process not in time, be easy to cause order to lose.
Summary of the invention
The object of the invention is to, a kind of control method of smart jack is provided, solve above technical problem.
The present invention also aims to, a kind of control device of smart jack is provided, solve above technical problem.
Technical problem solved by the invention can realize by the following technical solutions:
The invention provides a kind of control method of smart jack, wherein, comprise the following steps:
Step 1, smart jack has judged whether that client sends an external command to described smart jack;
Step 2, described smart jack judges whether described external command can accept, and if not, described smart jack produces a state information, and described client resends described external command after postponing setting-up time according to described state information, repeats step 1;
Step 3, inserts a command buffer alignment by described external command;
Step 4, the order according to described command buffer alignment performs the order in described command buffer alignment successively.
The control method of smart jack of the present invention, the concrete steps of described step 2 are as follows:
Step 21: described smart jack judges that whether described command buffer alignment is full, if full, performs step 26;
Step 22, obtains the timeout value that order that in described command buffer alignment, each is waited in line is corresponding;
Step 23, calculates the stand-by period of the complete needs of all command execution in described command buffer alignment;
Step 24, calculates the difference of the timeout value corresponding with the described external command that active client sends of described stand-by period;
Step 25, judges whether described difference is greater than zero, if not, performs step 3;
Step 26, described smart jack returns one with reference to delay time value to described client, and described client resends described external command according to described with reference to after delay time value delay setting-up time, repeats step 1.
The present invention also provides a kind of control device of smart jack, for implementing the control method of above-mentioned smart jack, comprises,
Interface module, with described client's side link, for receiving described external command;
Memory module, stores described command buffer alignment, and described command buffer alignment comprises the order waited in line successively;
According to imposing a condition, judge module, judges whether described external command can accept;
Module is added in order, in order to add described external command to described command buffer alignment;
Executive Module, order performs the order in described command buffer alignment.
Smart jack control device of the present invention, described memory module also stores each and orders corresponding timeout value.
Smart jack control device of the present invention, described judge module comprises a spilling judge module, in order to judge that whether described command buffer alignment is full.
Smart jack control device of the present invention, described judge module comprises the first computing module, in order to calculate in the current command buffer queue the stand-by period of the complete needs of all command execution waited in line.
Smart jack control device of the present invention, described judge module also comprises the second computing module, in order to the described timeout value of described stand-by period and described external command is got difference.
Smart jack control device of the present invention, described interface module connects a local area network or cloud server, the described external command that the described client that reception is connected with described local area network or described cloud server sends.
Beneficial effect: owing to adopting above technical scheme, the present invention, by performing remote command with client negotiate, prevents socket from causing buffer overflow owing to ordering too much on the one hand; Alleviate the pressure performing too much order in the socket short time on the other hand; Due to the state information that client can return according to socket, after reasonably postponing setting-up time, resend order, thus improve Consumer's Experience; For smart jack is performing when the remote command of client, provide solution more efficiently to see, and realize relatively simple.
Accompanying drawing explanation
Fig. 1 is method flow schematic diagram of the present invention;
Fig. 2 is the method flow schematic diagram of a kind of embodiment of step 2 of the present invention;
Fig. 3 is system framework schematic diagram of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all belongs to the scope of protection of the invention.
It should be noted that, when not conflicting, the embodiment in the present invention and the feature in embodiment can combine mutually.
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
With reference to Fig. 1, the control method of smart jack, wherein, comprises the following steps:
Step 1, smart jack has judged whether that client sends an external command to smart jack;
Step 2, smart jack judges whether external command can accept, and if not, smart jack produces a state information, and client resends external command after postponing setting-up time according to state information;
Step 3, inserts a command buffer alignment by external command;
Step 4, according to the order of order successively in fill order buffer queue of command buffer alignment.
In order to ensure the read-write consistency of data, smart jack normally serial performs these orders one by one, and the command execution before the client sending order so rearward just needs to wait until is complete, could obtain result, stand-by period is likely longer, thus affects the Consumer's Experience of client.The hardware processing capability of smart jack itself is limited after all, if improve hardware performance for this reason, will increase manufacturing cost.The control method of smart jack of the present invention is after receiving long-range external command, and the current processing capabilities of first evaluating system, if resource allows, just accepts external command and insert command buffer alignment to wait in line to perform; If discovery system is busy or resource soon reaches critical point, just return the state information of socket to inform client, state information can be some reference values, such as advises when client resends order.
The control method of smart jack of the present invention, with reference to Fig. 2, a kind of concrete steps of step 2 are as follows:
Step 21: smart jack judges that whether command buffer alignment is full, if full, performs step 26;
Step 22, obtains the timeout value that in command buffer alignment, each order waited in line is corresponding;
Step 23, the stand-by period of the complete needs of all command execution in calculation command buffer queue;
Step 24, the difference of the timeout value that the calculating stand-by period is corresponding with the external command that active client sends;
Step 25, judges whether difference is greater than zero, if not, performs step 3;
Step 26, smart jack returns one with reference to delay time value to client, and client resends external command after postponing setting-up time with reference to delay time value, repeats step 1.
Smart jack needs the timeout value (command_timeout) of the every bar order of predefined, and sets up a module specially to carry out system resource assessment.When smart jack receives the external command of client, first this external command is assessed, if external command can accept, inserted queue and wait execution; Otherwise return a time of delay, and by this loopback time of delay to client, as postponing the reference value resending this external command.
Whether can be in time processed key point of the present invention if being how accurate evaluation goes out order.On the one hand, it is more accurate to assess, and socket is higher with the coordinating efficiency of client; But then, assessment itself also can consume jack system resource, and technical difficulty also can correspondingly increase.So assessment will average out between the two in accuracy and performance.The implementation procedure of step 2 can select other modes flexibly, object is to make smart jack before order can not process in time, the state information of smart jack can be returned client, and issue the reference value of a time of delay, such as advise that client resends external command after postponing 2 seconds.
Step 2 can be realized by following computer program, provides pseudo-code below:
The present invention also provides a kind of control device of smart jack, with reference to Fig. 3, for implementing the control method of above-mentioned smart jack, comprises,
Interface module 1, with client's side link, for receiving external command;
Memory module 2, memory command buffer queue, command buffer alignment comprises the order waited in line successively;
Judge module 3, judges whether external command can accept;
Module 4 is added in order, in order to add external command to command buffer alignment;
Executive Module 5, the order in order fill order buffer queue.
Smart jack control device of the present invention, memory module 2 also stores each and orders corresponding timeout value.
Smart jack control device of the present invention, judge module 3 can comprise a spilling judge module, in order to judge that whether described command buffer alignment is full.
Smart jack control device of the present invention, judge module 3 can also comprise the first computing module, in order to calculate in the current command buffer queue the stand-by period of the complete needs of all command execution waited in line;
Smart jack control device of the present invention, all right second computing module of judge module 3, in order to get difference by stand-by period and external command timeout value.
Smart jack control device of the present invention, interface module 1 connects a local area network or cloud server, the external command that the client that reception is connected with local area network or cloud server sends.
The present invention realizes relatively simple, by performing remote command with client negotiate, prevents socket from causing buffer overflow owing to ordering too much on the one hand; Alleviate the pressure performing too much order in the socket short time on the other hand; Due to the state information that client can return according to socket, reasonably postpone or retransmit order, thus improving Consumer's Experience; For smart jack is performing when the remote command of client, provide solution more efficiently.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection range is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations specification of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.

Claims (8)

1. the control method of smart jack, is characterized in that, comprises the following steps:
Step 1, smart jack has judged whether that client sends an external command to described smart jack;
Step 2, described smart jack judges whether described external command can accept, and if not, described smart jack produces a state information, and described client resends described external command after postponing setting-up time according to described state information, repeats step 1;
Step 3, inserts a command buffer alignment by described external command;
Step 4, the order according to described command buffer alignment performs the order in described command buffer alignment successively.
2. the control method of smart jack according to claim 1, is characterized in that, the concrete steps of described step 2 are as follows:
Step 21: described smart jack judges that whether described command buffer alignment is full, if full, performs step 26;
Step 22, obtains the timeout value that order that in described command buffer alignment, each is waited in line is corresponding;
Step 23, calculates the stand-by period of the complete needs of all command execution in described command buffer alignment;
Step 24, calculates the difference of the timeout value corresponding with the described external command that active client sends of described stand-by period;
Step 25, judges whether described difference is greater than zero, if not, performs step 3;
Step 26, described smart jack returns one with reference to delay time value to described client, and described client resends described external command according to described with reference to after delay time value delay setting-up time, repeats step 1.
3. the control device of smart jack, is characterized in that, for implementing the claims the control method of the smart jack described in 1, comprises,
Interface module, with described client's side link, for receiving described external command;
Memory module, stores described command buffer alignment, and described command buffer alignment comprises the order waited in line successively;
Judge module, judges whether described external command can accept;
Module is added in order, in order to add described external command to described command buffer alignment;
Executive Module, order performs the order in described command buffer alignment.
4. smart jack control device according to claim 3, is characterized in that, described memory module also stores each and orders corresponding timeout value.
5. smart jack control device according to claim 3, is characterized in that, described judge module comprises a spilling judge module, in order to judge that whether described command buffer alignment is full.
6. smart jack control device according to claim 4, is characterized in that, described judge module comprises the first computing module, in order to calculate in the current command buffer queue the stand-by period of the complete needs of all command execution waited in line.
7. smart jack control device according to claim 6, is characterized in that, described judge module also comprises the second computing module, in order to the described timeout value of described stand-by period and described external command is got difference.
8. smart jack control device according to claim 3, it is characterized in that, described interface module connects a local area network or cloud server, the described external command that the described client that reception is connected with described local area network or described cloud server sends.
CN201410742764.8A 2014-12-05 2014-12-05 The control method and device of smart jack Active CN104601655B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410742764.8A CN104601655B (en) 2014-12-05 2014-12-05 The control method and device of smart jack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410742764.8A CN104601655B (en) 2014-12-05 2014-12-05 The control method and device of smart jack

Publications (2)

Publication Number Publication Date
CN104601655A true CN104601655A (en) 2015-05-06
CN104601655B CN104601655B (en) 2018-02-13

Family

ID=53127149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410742764.8A Active CN104601655B (en) 2014-12-05 2014-12-05 The control method and device of smart jack

Country Status (1)

Country Link
CN (1) CN104601655B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027341A (en) * 2016-06-21 2016-10-12 杭州古北电子科技有限公司 Control method of smart home device
CN112769895A (en) * 2020-12-18 2021-05-07 杭州涂鸦信息技术有限公司 Group or scene control method and related device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810437B1 (en) * 1999-05-25 2004-10-26 Mitsubishi Denki Kabushiki Kaisha Peripheral unit for a programmable controller
CN101751291A (en) * 2009-12-30 2010-06-23 广东威创视讯科技股份有限公司 Method of sharing one serial port by application programs and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810437B1 (en) * 1999-05-25 2004-10-26 Mitsubishi Denki Kabushiki Kaisha Peripheral unit for a programmable controller
CN101751291A (en) * 2009-12-30 2010-06-23 广东威创视讯科技股份有限公司 Method of sharing one serial port by application programs and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘迎澍: "《基于电力线载波的智能插座设计》", 《电子设计工程》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027341A (en) * 2016-06-21 2016-10-12 杭州古北电子科技有限公司 Control method of smart home device
CN112769895A (en) * 2020-12-18 2021-05-07 杭州涂鸦信息技术有限公司 Group or scene control method and related device
CN112769895B (en) * 2020-12-18 2023-10-13 杭州涂鸦信息技术有限公司 Group or scene control method and related device

Also Published As

Publication number Publication date
CN104601655B (en) 2018-02-13

Similar Documents

Publication Publication Date Title
CN109905259B (en) Communication connection maintaining method, system and related equipment
CN111277511B (en) Transmission rate control method, device, computer system and readable storage medium
CN113259415B (en) Network message processing method and device and network server
CN109769029B (en) Communication connection method based on electricity consumption information acquisition system and terminal equipment
CN105391536A (en) Communication method and device between client end and service end
US20170264682A1 (en) Data movement among distributed data centers
CN114979024A (en) Computing power network transaction method and device, computer readable medium and electronic equipment
CN107454136B (en) Calculation unloading method and device based on end-to-end P2P and control equipment
CN104601655A (en) Intelligent socket control method and device
CN106657076B (en) TCP service implementation method and device for network name space
CN111352715A (en) Method, system, terminal and storage medium for destroying flash thread
CN111913817A (en) Data transmission method, system and equipment and computer readable storage medium
CN108924773B (en) Message processing method and device
CN103746843A (en) Method and equipment for processing RPC (Remote Procedure Call Protocol) command
CN108289165B (en) Method and device for realizing camera control based on mobile phone and terminal equipment
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
CN106102126B (en) A kind of connection control method and device
CN114785871A (en) Log query method and device
CN110753043B (en) Communication method, device, server and medium
CN104426704A (en) Integration network device and service integration method thereof
CN114301980A (en) Method, device and system for scheduling container cluster and computer readable medium
CN110288356B (en) Payment service processing method, device, electronic equipment, storage medium and system
CN108108243B (en) Resource sharing system and method
WO2024016622A1 (en) Timeout parameter determination method and apparatus and communication device
CN105207795A (en) IOT communication method and device

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
TR01 Transfer of patent right

Effective date of registration: 20201104

Address after: 318015 no.2-3167, zone a, Nonggang City, no.2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee after: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Guangfulin road 4855 Lane 20

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210127

Address after: 523460 building A2, Zhigu Science Park, Gekeng Industrial Zone, Hengli Town, Dongguan City, Guangdong Province

Patentee after: DONGGUAN ORIENT ELECTRONICS & METAL Co.,Ltd.

Address before: 318015 no.2-3167, area a, nonggangcheng, 2388 Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee before: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right