CN116010329A - USB communication synchronous control method, terminal, intelligent lock and medium - Google Patents

USB communication synchronous control method, terminal, intelligent lock and medium Download PDF

Info

Publication number
CN116010329A
CN116010329A CN202310301221.1A CN202310301221A CN116010329A CN 116010329 A CN116010329 A CN 116010329A CN 202310301221 A CN202310301221 A CN 202310301221A CN 116010329 A CN116010329 A CN 116010329A
Authority
CN
China
Prior art keywords
communication terminal
terminal
module
communication
master
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
CN202310301221.1A
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.)
Xiamen Leelen Technology Co Ltd
Original Assignee
Xiamen Leelen 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 Xiamen Leelen Technology Co Ltd filed Critical Xiamen Leelen Technology Co Ltd
Priority to CN202310301221.1A priority Critical patent/CN116010329A/en
Publication of CN116010329A publication Critical patent/CN116010329A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention discloses a USB communication synchronous control method, a terminal, an intelligent lock and a medium, wherein in the USB communication synchronous control method, after a constant-current terminal is electrified, a master-slave mode of a first communication terminal and a second communication terminal is set, and a zone bit is reset; whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval, if so, the corresponding communication terminal marks the first mark, and if not, the corresponding communication terminal marks are turned over to the second mark; the second time interval is larger than the sending interval of the heartbeat packet; the constant-current terminal compares the zone bits of the first communication terminal and the second communication terminal, and performs master-slave setting according to the last master-slave setting mode when the zone bits are consistent; and when the zone bits are inconsistent, setting the communication terminal with the zone bits not turned over as a host. According to the invention, different communication terminal states are identified through the zone bit, master-slave mode setting of the module is performed, and the problem of signal asynchronism during USB communication of a plurality of communication terminals is solved.

Description

USB communication synchronous control method, terminal, intelligent lock and medium
Technical Field
The invention relates to the technical field of USB communication synchronous control, in particular to a USB communication synchronous control method, a terminal, an intelligent lock and a medium.
Background
USB communication is one of the common communication means, but in practical application, a problem of asynchronous USB communication may occur.
For example, in the video transmission of the intelligent lock, due to the fact that a plurality of MCUs exist, the problem of starting speed in the process of powering up and down can lead to the problem that USB signals are asynchronous, black screen and restarting occur, or due to the fact that a chip possibly has different scenes of supplying power at the same time, under the condition that Host does not power down, if the mode of initializing by USB software is adopted, the inside of the chip is reversely initialized, and the starting time of the chip is prolonged. The intelligent lock with the screen is a typical scene, and because the camera module and the screen module are far away in structure distance, USB communication is needed, but in the switching and awakening of the functional scene, the problem of asynchronous USB communication can occur, so that the black screen and the restarting of the system are caused.
Disclosure of Invention
A first object of the present invention is to provide a method for controlling synchronization of USB communication, which includes:
the constant-current terminal is at least in communication connection with the first communication terminal and the second communication terminal respectively and is used for controlling USB communication between the first communication terminal and the second communication terminal; after the constant power terminal is electrified, a master-slave mode of the first communication terminal and the second communication terminal is set, and the flag bit of the first communication terminal and the flag bit of the second communication terminal are reset; whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the sending interval of the heartbeat packets; and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
Further, the constant electric terminal compares the zone bits of the first communication terminal and the second communication terminal through a truth table, and executes corresponding master-slave mode setting;
the truth table is that the true value of the true value table is that,
Figure SMS_1
the initial flag bit of the first communication terminal is the same as that of the second communication terminal.
Further, the constant electric terminal sets an initiating communication terminal of the initial USB transaction as a master device mode, and sets an executing communication terminal of the initial USB transaction as a slave device mode.
A second object of the present invention is to provide a USB communication synchronization control method, which includes: the first communication terminal is connected with the constant electric terminal and is at least connected with a second communication terminal USB in a communication way; the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval; the first communication terminal receives a flag bit value given by the constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the first time interval; the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
A third object of the present invention is to provide a USB communication synchronization control terminal: the system comprises a first communication terminal, a second communication terminal, a constant current terminal and a control unit, wherein the constant current terminal is at least connected with the first communication terminal and the second communication terminal respectively and used for controlling USB communication of the first communication terminal and the second communication terminal; after the constant power terminal is electrified, a master-slave mode of the first communication terminal and the second communication terminal is set, and the zone bit of the first communication terminal and the zone bit of the second communication terminal are reset; whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the mark position of the corresponding communication terminal is turned over to be the second mark; and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
A fourth object of the present invention is to provide a communication terminal: is configured as a first communication terminal to communicate with a second communication terminal USB under the control of a constant current terminal; the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval; the first communication terminal receives a flag bit value given by the constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the first time interval; the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
The fifth object of the present invention is to provide an intelligent lock, which comprises a video module and a screen module, wherein the video module is in USB communication with the screen module, and the intelligent lock further comprises a normal electric module which is respectively in communication connection with the video module and the screen module; after the normal power module is electrified, a master-slave mode of the video module and the screen module is set, and the marker bit of the video module and the marker bit of the screen module are reset; the video module and the screen module respectively send heartbeat packets to the constant current module at a first time interval;
the normal electric module judges whether heartbeat packages sent by the video module and the screen module are received respectively in a second time interval, if yes, the mark position of the corresponding module is first marked, and if not, the mark position of the corresponding module is turned over to be second marked; the second time interval is greater than the first time interval; and comparing the flag bit of the video module with the flag bit of the communication module by the normal electric module, performing master-slave setting according to the master-slave mode set last time when the flag bit is consistent, and setting the module with the non-turned flag bit as a host when the flag bit is inconsistent.
Further, the constant electric module compares the marker bits of the video module and the screen module through a truth table, and executes corresponding master-slave mode setting;
the truth table is that the true value of the true value table is that,
Figure SMS_2
the initial zone bit of the video module is the same as that of the screen module.
Further, the normal electric module is a microwave radar sensing module, a fingerprint identification module or a key module.
A sixth object of the present invention is to provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the USB communication synchronization control method as described above.
After the technical scheme is adopted, compared with the background technology, the invention has the following advantages:
1. the invention recognizes the heartbeat state of different communication terminals through the setting of the zone bit, so as to set the master-slave mode, solve the problem of signal non-synchronization when a plurality of communication terminals carry out USB communication, and prevent the abnormality of USB reverse initialization.
2. The invention is applied to the intelligent lock, and effectively solves the problem of black screen generated by asynchronous signals when the video module and the screen module are in USB communication in the intelligent lock.
Drawings
FIG. 1 is a schematic flow chart of an embodiment 1 of the present invention;
FIG. 2 is a schematic flow chart of embodiment 2 of the present invention;
FIG. 3 is a schematic diagram of a topology of embodiment 3 of the present invention;
FIG. 4 is a schematic diagram of a topology of embodiment 4 of the present invention;
FIG. 5 is a schematic diagram of the topology of embodiment 5 of the present invention;
fig. 6 is a schematic flow chart of embodiment 5 of the present invention.
Description of the embodiments
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. In order that the above-described aspects may be better understood, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Example 1
The first aspect of the present invention discloses a method for controlling synchronization of USB communications, which is executed by a constant-current terminal to achieve synchronization control of USB communications among a plurality of communication terminals.
Referring to fig. 1, the control method includes:
the constant-current terminal is at least in communication connection with the first communication terminal and the second communication terminal respectively and is used for controlling USB communication between the first communication terminal and the second communication terminal;
after the normal electric terminal is electrified, a master-slave mode of the first communication terminal and the second communication terminal is set, and the flag bits of the first communication terminal and the second communication terminal are reset;
whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the mark position of the corresponding communication terminal is turned over to be the second mark;
and the constant-power terminal compares the zone bits of the first communication terminal and the second communication terminal, performs master-slave setting according to the last master-slave mode setting when the zone bits are consistent, and sets the communication terminal with the zone bit not turned over as a host when the zone bits are inconsistent.
Therefore, when the terminal is continuously powered on, USB initialization can be performed according to the set master-slave mode, and black screen is prevented from being generated in USB initialization.
The terminal is a hardware input or output terminal, and the terminal is provided with a microprocessor and a control circuit for power-on management and master-slave setting.
The constant-power terminal is a terminal which keeps power supply and does not sleep in a normal state, and the MCU is usually a low-power-consumption singlechip, such as an STM32 singlechip or a 51 singlechip. Taking the intelligent lock scenario as an example, it may be a third party constant-electricity low-power consumption module possibly attached to the intelligent lock, such as a microwave radar sensing module for human body sensing, a fingerprint identification module for fingerprint identification or a key module for key operation, and the modules are kept powered in a normal state to execute functions thereof in real time.
The first communication terminal and the second communication terminal are terminals for executing USB communication, and the first communication terminal and the second communication terminal can respectively set master-slave modes. Setting a Host mode, namely taking the Host mode as a master Device (USB Host), and managing data transmission and port management in a USB bus to perform data interaction with other slave devices (USB devices); the slave Device mode machine is set as a downstream Device taking the slave Device mode machine as a host, and takes a slave Device (USB Device) role in the USB bus to provide specific functions for the system.
The first communication terminal, the second communication terminal and the constant terminal may be terminals that are morphologically independent of each other, or may be modules that are integrated into a certain device. If in the smart lock scenario, the first communication terminal may be a video module, the second communication terminal may be a screen module, and the constant electric terminal may be a microwave radar sensing module, a pattern recognition module, or a key module, i.e. at this time, each terminal is a different module integrated in the same device.
In a preferred embodiment, the constant electric terminal adopts a truth table form to compare the flag bits of the first communication terminal and the second communication terminal, and executes a corresponding master-slave mode setting strategy.
Specifically, the truth table is:
Figure SMS_3
and after the normal electric terminal is electrified, the flag bits of the first communication terminal and the second communication terminal are reset, and at the moment, the initial flag bits of the first communication terminal and the second communication terminal are the same, and can be the same as the first mark or the second mark.
In this embodiment, the first identifier is marked with 0 and the second identifier is marked with 1, and the truth table becomes:
Figure SMS_4
it is easy to understand that when the flag bits of the first communication terminal and the second communication terminal are both initial set values, the last time of setting the master-slave mode refers to the master-slave mode that the power-on module initially sets.
When the normal electric terminal sets an initial master-slave device mode, the master-slave mode is set according to the initiating flow direction of the USB transaction, the initiating communication terminal of the initial USB transaction is set as a master device mode, and the executing communication terminal of the initial USB transaction is set as a slave device mode. Taking the smart lock scenario as an example, the USB transaction is initiated by the video module at the beginning, so that the video module is set to the master device mode and the screen module is set to the slave device mode at the beginning of the setting.
Example 2
The second aspect of the present invention discloses a USB communication synchronization control method, which is different from embodiment 1 in that the execution body is different from embodiment 2 in that the execution body is a communication terminal.
Referring to fig. 2, the method for controlling USB communication synchronization is applied to a certain communication terminal to perform USB communication with another communication terminal, and includes:
the first communication terminal is connected with the constant electric terminal and is at least connected with a second communication terminal USB in a communication way; the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval;
the first communication terminal receives a flag bit value given by a constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval, if so, turning the mark position of the corresponding communication terminal to the first mark, and if not, turning the mark position of the corresponding communication terminal to the second mark, wherein the second time interval is larger than the first time interval;
the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and the constant-power terminal compares the zone bits of the first communication terminal and the second communication terminal, performs master-slave setting according to the last master-slave mode setting when the zone bits are consistent, and sets the communication terminal with the zone bit not turned over as a host when the zone bits are inconsistent.
The definition of the first communication terminal, the second communication terminal and the constant terminal is the same as that of embodiment 1, and the detailed description of the first communication terminal, the second communication terminal and the constant terminal is omitted herein for brevity.
Example 3
A third aspect of the present invention is to provide a USB communication synchronization control terminal, configured to implement the method described in embodiment 1.
Referring to fig. 3, the following technical scheme is adopted in the present invention:
the USB communication synchronous control terminal is configured as a first communication terminal and is used for USB communication with a second communication terminal under the control of a constant electric terminal;
the first communication terminal sends a heartbeat packet to the constant-current terminal according to a first time interval;
the first communication terminal receives a zone bit value given by the constant electric terminal, wherein the zone bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval, if so, turning the mark position of the corresponding communication terminal to the first mark, and if not, turning the mark position of the corresponding communication terminal to the second mark, wherein the second time interval is larger than the first time interval;
the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and the constant-power terminal compares the zone bits of the first communication terminal and the second communication terminal, performs master-slave setting according to the last master-slave mode setting when the zone bits are consistent, and sets the communication terminal with the zone bit not turned over as a host when the zone bits are inconsistent.
Example 4
A fourth aspect of the present invention is to provide a communication terminal for implementing the method described in embodiment 2.
Referring to fig. 4, the following technical scheme is adopted in the present invention:
is configured as a first communication terminal to communicate with a second communication terminal USB under the control of a constant current terminal;
the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval;
the first communication terminal receives a flag bit value given by the constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the first time interval;
the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
Example 5
The fifth aspect of the present invention is to provide an intelligent lock, so as to solve the problem of signal asynchronism caused by different start time when the video module and the screen module are far apart in the intelligent lock.
Referring to fig. 5 and 6, the following technical scheme is adopted in the present invention:
an intelligent lock comprises a video module, a screen module and a constant-current module. The video module (also called a camera module) is in USB communication with the screen module, and the constant electric module is respectively connected with the video module and the screen module to control the USB communication between the video module and the screen module.
After the normal electric module is electrified, a master-slave mode of the video module and the screen module is set, and as the USB transaction is initiated by the video module in the initial setting, the video module is set to be in a master device mode and the screen module is set to be in a slave device mode.
Setting a Host mode, namely taking the Host mode as a master Device (USB Host), and managing data transmission and port management in a USB bus to perform data interaction with other slave devices (USB devices); the slave Device mode machine is set as a downstream Device taking the slave Device mode machine as a host, and takes a slave Device (USB Device) role in the USB bus to provide specific functions for the system.
Meanwhile, after the normal power module is powered on, the zone bit of the video module and the screen module is reset, and the initial zone bit of the video module and the screen module is the same.
The video module and the screen module respectively send heartbeat packets to the constant-current module at a first time interval (2S in the embodiment).
The normal electric module judges whether heartbeat packages sent by the video module and the screen module are respectively received in a second time interval (which is larger than the first time interval, in the embodiment, 3S), if yes, the mark position of the corresponding module is first marked, and if not, the mark position of the corresponding module is turned to be second marked.
The normal electric module compares the zone bit of the video module and the communication module, and performs master-slave setting according to the last master-slave mode setting when the zone bit is consistent, and sets the module with the zone bit not turned as a host when the zone bit is inconsistent.
In this embodiment, the normal electric module compares the flag bits of the video module and the screen module through a truth table, and executes corresponding master-slave mode setting;
the truth table is that the data of the truth table,
Figure SMS_5
in this embodiment, the first identifier is marked with 0 and the second identifier is marked with 1, and the truth table becomes:
Figure SMS_6
the normal electric module is a normal electric low-power consumption module in the intelligent lock, such as a microwave radar sensing module for sensing human bodies, a fingerprint identification module for looking for identification or a key module for key operation.
The invention can effectively identify the power-on condition of the video module and the screen module by setting the zone bit, and establishes a corresponding master-slave strategy, thereby solving the phenomenon of anti-initialization or screen blackout caused by asynchronous signals of the video module and the screen module.
Example 6
A sixth object of the present invention is to provide a computer readable storage medium, which adopts the following technical scheme: a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the USB communication synchronization control method according to any one of embodiments 1-2.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
In the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms should not be understood as necessarily being directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.

Claims (10)

  1. The USB communication synchronous control method is characterized by comprising the following steps:
    the constant-current terminal is at least in communication connection with the first communication terminal and the second communication terminal respectively and is used for controlling USB communication between the first communication terminal and the second communication terminal;
    after the constant power terminal is electrified, a master-slave mode of the first communication terminal and the second communication terminal is set, and the flag bit of the first communication terminal and the flag bit of the second communication terminal are reset;
    whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the mark position of the corresponding communication terminal is turned over to be the second mark; the second time interval is larger than the sending interval of the heartbeat packet;
    and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
  2. 2. The USB communication synchronization control method of claim 1, wherein:
    the constant electric terminal compares the zone bits of the first communication terminal and the second communication terminal through a truth table and executes corresponding master-slave mode setting;
    the truth table is that the true value of the true value table is that,
    Figure QLYQS_1
    the initial flag bit of the first communication terminal is the same as that of the second communication terminal.
  3. 3. The USB communication synchronization control method of claim 1, wherein:
    and the constant electric terminal sets the initiating communication terminal of the initial USB transaction as a master device mode and sets the executing communication terminal of the initial USB transaction as a slave device mode.
  4. The USB communication synchronous control method is characterized by comprising the following steps:
    the first communication terminal is connected with the constant electric terminal and is at least connected with a second communication terminal USB in a communication way;
    the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval;
    the first communication terminal receives a flag bit value given by the constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the first time interval;
    the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
  5. USB communication synchronous control terminal, its characterized in that:
    the system comprises a first communication terminal, a second communication terminal, a constant current terminal and a control unit, wherein the constant current terminal is at least connected with the first communication terminal and the second communication terminal respectively and used for controlling USB communication of the first communication terminal and the second communication terminal;
    after the constant power terminal is electrified, a master-slave mode of the first communication terminal and the second communication terminal is set, and the zone bit of the first communication terminal and the zone bit of the second communication terminal are reset;
    whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the mark position of the corresponding communication terminal is turned over to be the second mark;
    and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
  6. 6. Communication terminal, its characterized in that:
    is configured as a first communication terminal to communicate with a second communication terminal USB under the control of a constant current terminal;
    the first communication terminal sends a heartbeat packet to the constant electric terminal according to a first time interval;
    the first communication terminal receives a flag bit value given by the constant electric terminal, wherein the flag bit value is given by the constant electric terminal according to the following rule: whether the constant electric terminal respectively receives heartbeat packets sent by the first communication terminal and the second communication terminal in a second time interval or not, if so, the first mark of the mark position of the corresponding communication terminal is turned over to be the second mark, and if not, the second time interval is larger than the first time interval;
    the first communication terminal sets a master-slave mode, wherein the master-slave mode is that the constant-current terminal is set according to the following rules: and comparing the zone bits of the first communication terminal and the second communication terminal by the constant electric terminal, performing master-slave setting according to a master-slave mode set last time when the zone bits are consistent, and setting the communication terminal with the non-overturned zone bit as a host when the zone bits are inconsistent.
  7. 7. The intelligent lock comprises a video module and a screen module, wherein the video module and the screen module are in USB communication, and the intelligent lock is characterized in that:
    the system also comprises a normal electric module which is respectively in communication connection with the video module and the screen module; after the normal power module is electrified, a master-slave mode of the video module and the screen module is set, and the marker bit of the video module and the marker bit of the screen module are reset;
    the video module and the screen module respectively send heartbeat packets to the constant current module at a first time interval;
    the normal electric module judges whether heartbeat packages sent by the video module and the screen module are received respectively in a second time interval, if yes, the mark position of the corresponding module is first marked, and if not, the mark position of the corresponding module is turned over to be second marked; the second time interval is greater than the first time interval;
    and comparing the flag bit of the video module with the flag bit of the communication module by the normal electric module, performing master-slave setting according to the master-slave mode set last time when the flag bit is consistent, and setting the module with the non-turned flag bit as a host when the flag bit is inconsistent.
  8. 8. The smart lock of claim 7, wherein: the normal electric module compares the zone bit of the video module and the zone bit of the screen module through a truth table and executes corresponding master-slave mode setting;
    the truth table is that the true value of the true value table is that,
    Figure QLYQS_2
    the initial zone bit of the video module is the same as that of the screen module.
  9. 9. The smart lock of any one of claims 7-8, wherein: the normal electric module is a microwave radar sensing module, a fingerprint identification module or a key module.
  10. 10. A computer-readable storage medium, characterized by: the computer readable storage medium stores a computer program which, when executed by a processor, implements the USB communication synchronization control method according to any one of claims 1 to 4.
CN202310301221.1A 2023-03-27 2023-03-27 USB communication synchronous control method, terminal, intelligent lock and medium Pending CN116010329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310301221.1A CN116010329A (en) 2023-03-27 2023-03-27 USB communication synchronous control method, terminal, intelligent lock and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310301221.1A CN116010329A (en) 2023-03-27 2023-03-27 USB communication synchronous control method, terminal, intelligent lock and medium

Publications (1)

Publication Number Publication Date
CN116010329A true CN116010329A (en) 2023-04-25

Family

ID=86025192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310301221.1A Pending CN116010329A (en) 2023-03-27 2023-03-27 USB communication synchronous control method, terminal, intelligent lock and medium

Country Status (1)

Country Link
CN (1) CN116010329A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113038425A (en) * 2019-12-25 2021-06-25 厦门雅迅网络股份有限公司 Method for maintaining long connection with low power consumption and computer readable storage medium
CN113297013A (en) * 2020-04-26 2021-08-24 阿里巴巴集团控股有限公司 Device switching method and device, electronic device and storage medium
CN114490152A (en) * 2021-12-31 2022-05-13 北京航天测控技术有限公司 Method for establishing dual-computer complete machine level hot standby system
US20220240653A1 (en) * 2021-02-03 2022-08-04 Chunlei Zhang Convertible combination of attire and backpack with network communication and intelligent sensing features
CN115766410A (en) * 2022-11-11 2023-03-07 北京和利时工业软件有限公司 Method, system, device and medium for switching working states of machine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113038425A (en) * 2019-12-25 2021-06-25 厦门雅迅网络股份有限公司 Method for maintaining long connection with low power consumption and computer readable storage medium
CN113297013A (en) * 2020-04-26 2021-08-24 阿里巴巴集团控股有限公司 Device switching method and device, electronic device and storage medium
US20220240653A1 (en) * 2021-02-03 2022-08-04 Chunlei Zhang Convertible combination of attire and backpack with network communication and intelligent sensing features
CN114490152A (en) * 2021-12-31 2022-05-13 北京航天测控技术有限公司 Method for establishing dual-computer complete machine level hot standby system
CN115766410A (en) * 2022-11-11 2023-03-07 北京和利时工业软件有限公司 Method, system, device and medium for switching working states of machine

Similar Documents

Publication Publication Date Title
USRE49682E1 (en) System, device, and method for initializing a plurality of electronic devices using a single packet
US20110151930A1 (en) Apparatus and method for supporting sim card in mobile communication terminal having multiple modems
US20150100711A1 (en) Low power camera control interface bus and devices
CN105932733B (en) OTG power supply and its method of supplying power to, OTG equipment and mobile communication equipment
CN112332927B (en) Control method and related product
CN111488048A (en) Power supply management method and system
CN104270740B (en) A kind of detection method of neck T cards and SIM card altogether
CN105446916A (en) USB bus state switching method and apparatus
CN103078756B (en) Mode switching method and CAN (Controller Area Network)
CN112269086A (en) Charging cable identification method and device, charging cable and readable storage medium
CN116010329A (en) USB communication synchronous control method, terminal, intelligent lock and medium
CN104251536B (en) One-to-many current loop communication method and communication device
CN110865959B (en) Method and circuit for waking up I2C equipment
CN102508799A (en) Automatic control method, system and USB (universal serial bus) device
CN111347414A (en) Robot shutdown control method and device and robot
CN108965019A (en) Dynamic Configuration, wireless communication device and the relevant device of communication protocol
EP3779635A1 (en) Interactive smart tablet and data processing method and device thereof
CN105322977B (en) A kind of active RFID tag low power consumption data reception device and its method
CN110888829B (en) Method for starting up and awakening communication module through serial port
CN111376245A (en) Steering engine control method and system and robot
CN116932054A (en) System starting method and device
CN112944565A (en) Outdoor unit awakening method and device and multi-split air conditioning system
CN107241252B (en) CAN communication polarity control circuit and system and multi-connected air conditioning system
CN204993887U (en) Networking system
CN221177840U (en) Image acquisition circuit based on singlechip

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