CN112235370A - Equipment information synchronization method, synchronization device, main equipment and storage medium - Google Patents

Equipment information synchronization method, synchronization device, main equipment and storage medium Download PDF

Info

Publication number
CN112235370A
CN112235370A CN202011052584.9A CN202011052584A CN112235370A CN 112235370 A CN112235370 A CN 112235370A CN 202011052584 A CN202011052584 A CN 202011052584A CN 112235370 A CN112235370 A CN 112235370A
Authority
CN
China
Prior art keywords
target
slave device
slave
master device
information
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
CN202011052584.9A
Other languages
Chinese (zh)
Other versions
CN112235370B (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.)
Wocao Technology Shenzhen Co ltd
Original Assignee
Wocao Technology Shenzhen 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 Wocao Technology Shenzhen Co ltd filed Critical Wocao Technology Shenzhen Co ltd
Priority to CN202011052584.9A priority Critical patent/CN112235370B/en
Publication of CN112235370A publication Critical patent/CN112235370A/en
Application granted granted Critical
Publication of CN112235370B publication Critical patent/CN112235370B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application is applicable to the technical field of communication, and provides a device information synchronization method, a synchronization device, a main device and a storage medium, wherein the method comprises the following steps: periodically checking a target connection state of the master device and the slave device; if the target connection state is an unconnected state, the master device establishes connection with the slave device; after establishing a connection with the slave device, the master device sending a target command to the slave device; and the master device receives first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command. The method and the device can solve the problem that the master device cannot be connected with the slave device for a long time at present to the extent that the master device cannot acquire the information of the slave device quickly.

Description

Equipment information synchronization method, synchronization device, main equipment and storage medium
Technical Field
The present application belongs to the field of communications, and in particular, to a device information synchronization method, a synchronization apparatus, a master device, and a storage medium.
Background
Currently, some systems will include multiple devices. At this time, one of the devices is generally set as a master device, and the other devices are set as slave devices. The master device connects with the slave device and then forwards the command to the slave device, thereby controlling the slave device.
However, when the master device does not interact with the slave device, the master device often interrupts the connection with the slave device. Therefore, when the master device needs to acquire the information of the slave device, the master device and the slave device need to be reconnected, and the master device cannot acquire the information of the slave device quickly.
Therefore, currently, the master device and the slave device cannot maintain long connection, so that the master device cannot quickly acquire information of the slave device.
Disclosure of Invention
The embodiment of the application provides a device information synchronization method, a synchronization device, a master device and a storage medium, which can solve the problem that the master device cannot quickly acquire information of a slave device because the master device cannot keep long connection with the slave device at present to a certain extent.
In a first aspect, an embodiment of the present application provides an apparatus information synchronization method, including:
periodically checking a target connection state of the master device and the slave device;
if the target connection state is an unconnected state, the master device establishes connection with the slave device;
after establishing connection with the slave device, the master device transmitting a target command to the slave device;
and the master device receives first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command.
In a second aspect, an embodiment of the present application provides an apparatus information synchronization apparatus, including:
the checking module is used for periodically checking the target connection state of the master device and the slave device;
a connection establishing module, configured to establish a connection between the master device and the slave device if the target connection state is an unconnected state;
a sending module, configured to send a target command to the slave device by the master device after establishing a connection with the slave device;
a receiving module, configured to receive, by the master device, a first target reply message, and update device information of the slave device according to the first target reply message, where the first target reply message is a message sent by the slave device in response to the target command.
In a third aspect, an embodiment of the present application provides a host device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program implements the steps of the method according to the first aspect when executed by a processor.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a master device, causes the master device to execute the device information synchronization method according to any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that:
the application provides a device information synchronization method, which is characterized in that firstly, target connection states of a master device and a slave device are periodically checked. And if the target connection state is the unconnected state, the master device establishes connection with the slave device. After establishing a connection with the slave device, the master device sends a target command to the slave device. And then the master device receives the first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is the information sent by the slave device in response to the target command. Since in the present application, the master device can periodically check the target connection state of the master device and the slave device. When the target connection state is an unconnected state, the master device establishes a connection with the slave device, so that a long connection is maintained between the master device and the slave device. Since the master device maintains a long connection with the slave device, it can directly transmit when the master device needs to transmit a target command to the slave device, so that the master device can quickly synchronize the device information of the slave device.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a device information synchronization method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus information synchronization device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a master device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The device information synchronization method provided in the embodiment of the present application may be applied to a main device such as a mobile phone, a tablet computer, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the present application does not limit the specific type of the main device.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Example one
In the following, a method for synchronizing device information provided in an embodiment of the present application is described, referring to fig. 1, where the method includes:
step S101, periodically checking the target connection state of the master device and the slave device.
In step S101, the master device refers to a device that can transmit a command to control the slave device. The slave device is a device that receives a command sent by the master device and then performs a corresponding operation according to the command sent by the master device. It should be noted that the slave device may include at least one slave device. The number of slave devices can be selected by the user according to actual conditions, and the application is not specifically limited herein. It should be understood that the master and slave devices may or may not be the same type of device. The present application is not specifically limited herein.
It should be noted that, when the master device and the slave device are the same type of device (for example, both the master device and the slave device are a sweeper or a curtain), which device is the master device and which device is the slave device is opposite between the two devices. For example, at time a, device a is set as the master and device b is set as the slave. At time B, device a is set as the slave and device B is set as the master. When the master device and the slave device are the same type of device, which device is set as the master device and which device is set as the slave device, and the user may select or set the devices according to the actual situation, which is not specifically limited herein.
When a user sets one device as a master device and at least one other device as a slave device, the master device may periodically check a target connection state between the master device and the slave device.
And step S102, if the target connection state is the unconnected state, the master device establishes connection with the slave device.
In step S102, if the target connection state is an unconnected state, the master device establishes a connection with the slave device.
In some embodiments, the master device establishing a connection with the slave device includes: the master device sends a connection request to the slave device; and if receiving second target reply information returned by the slave equipment, judging that the connection between the master equipment and the slave equipment is successful.
In this embodiment, when the master device needs to establish a connection with the slave device, the master device may send a connection request to the slave device, and then periodically check whether the second target reply information returned by the slave device is received. After the slave device receives the connection request sent by the master device, if the slave device is successfully connected with the master device, the second target reply information is sent to the master device according to the connection request. And if the master device receives the second target reply message, the master device and the slave device are successfully connected. It should be noted that the content of the second target reply message may be set by the user according to the actual situation, and the application is not specifically limited herein.
In other embodiments, if a second target reply message returned from the device is not received, whether a preset event exists is detected; and if the preset event exists, returning to the execution of the main equipment to send the connection request to the slave equipment.
When the master device does not receive the second target reply information returned by the slave device, the master device and the slave device may still be in the process of connecting, and the master device and the slave device may also fail to connect. If the master device directly resends the connection request to the slave device when the master device does not receive the second target reply message returned by the slave device and the master device and the slave device are still in the connection process, more time is consumed for the connection of the master device and the slave device.
Therefore, when the master device does not receive the second target reply message returned by the slave device, the master device first detects whether a preset event exists, if the preset event exists, the connection between the master device and the slave device fails, and at this time, the master device returns to execute sending a connection request to the slave device. If the preset event does not exist, the master device and the slave device are still in the connection process, and at this time, the master device returns to execute the periodic check whether the second target reply information returned by the slave device is received.
Therefore, in this embodiment, when the master device does not receive the second target reply message returned by the slave device, it is checked whether a preset event exists first, and if the preset event exists, the master device returns to execute sending the connection request to the slave device, thereby reducing the connection time between the master device and the slave device.
It should be understood that the preset event may include an event that interrupts the connection between the master device and the slave device (e.g., some devices establish a connection with the master device that would result in the master device being disconnected from the slave device), a connection time between the master device and the slave device exceeding a preset time, and the like. The preset event user can select or set according to the actual situation, and the application is not limited herein.
In other embodiments, the master device sending a connection request to the slave device includes: obtaining reconnection times; and if the reconnection times are less than or equal to the preset times, the master device sends a connection request to the slave device after a first preset time interval, and the reconnection times are added by 1.
In this embodiment, when sending a connection request to a slave device, the number of reconnection times is obtained first. And if the reconnection times are less than or equal to the preset times, the master device sends a connection request to the slave device after the first preset time interval, and adds 1 to the reconnection times.
In other embodiments, if the reconnection number is greater than the preset number, the master device performs a preset error handling operation.
When the reconnection times are more than the preset times, the connection between the master device and the slave device is possibly wrong. Therefore, when the number of reconnection times is greater than the preset number, the master device performs a preset error handling operation. It should be noted that the preset error handling operation can be set by the user according to actual situations. Such as resetting the host system or initializing connection parameters, etc. The present application is not limited thereto.
Step S103, after establishing connection with the slave device, the master device transmits the target command to the slave device.
In step S103, the master device may transmit the target command to the slave device after the master device establishes a connection with the slave device. It should be noted that, the manner of sending the target command to the master device may be set by the user according to actual situations. For example, the master device may send the target command to the slave device in a message queue. The present application is not limited thereto.
In some embodiments, the master device sends the target command to the slave device, including: determining a target difference value according to the timestamp of the current time and a target timestamp, wherein the target timestamp is the timestamp corresponding to the time of receiving the first target reply information last time; and if the target difference value is larger than the preset threshold value, the master device sends a target command to the slave device.
In this embodiment, the master device periodically sends a target command to the slave device. And when the primary equipment receives the first target reply information every time, updating the timestamp corresponding to the received first target reply information. And then determining a target difference value according to the timestamp of the current time and the target timestamp, wherein the target timestamp is the timestamp corresponding to the time of receiving the first target reply information last time. If the target difference is greater than the preset threshold, it indicates that the master device needs to acquire the device information of the slave device at the current time. At this time, the master device transmits a target command to the slave device.
In other embodiments, the master device sends the target command to the slave device, including: when the master device receives the trigger signal, a target command is sent to the slave device.
In this embodiment, when the master device receives the trigger signal, the master device transmits the target command to the slave device. It should be noted that the trigger signal may be sent from the control end to the master device (the control end may be an application program or an applet). Or the user can directly operate the main device, and the main device receives the trigger signal. The present application is not limited thereto.
Step S104, the master device receives the first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command.
In step S104, after the master device sends the target command to the slave device, the slave device sends the first target reply message to the master device according to the target command, and the master device thus receives the first target reply message. After the master device receives the first target reply message sent by the slave device, the master device can update the device information of the slave device stored in the master device according to the first target reply message, so that the master device can synchronize with the current device information of the slave device.
The target command is a command to acquire device information of the slave device. The first target reply message is the device information of the slave device. For example, if the target command is a command for acquiring the working state of the slave device, the first target reply message is the current working state information of the slave device. The device information of the slave device includes power information, operation state information, sensor data of the slave device, current location information of the slave device, and the like.
It should be noted that, when the master device does not receive the first target reply message after the second preset time interval, it is indicated that a problem occurs in the connection between the master device and the slave device. At this time, the master device returns to perform establishment of a connection with the slave device.
In other embodiments, when the slave device detects that the device information of the slave device changes, the slave device may also actively send the changed device information to the master device.
In summary, the present application provides a device information synchronization method, which first periodically checks a target connection state between a master device and a slave device. And if the target connection state is the unconnected state, the master device establishes connection with the slave device. After establishing a connection with the slave device, the master device sends a target command to the slave device. And then the master device receives the first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is the information sent by the slave device in response to the target command. Since in the present application, the master device can periodically check the target connection state of the master device and the slave device. When the target connection state is an unconnected state, the master device establishes a connection with the slave device, so that a long connection is maintained between the master device and the slave device. Since the master device maintains a long connection with the slave device, it can directly transmit when the master device needs to transmit a target command to the slave device, so that the master device can quickly synchronize the device information of the slave device.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two
Fig. 2 shows an example of a device information synchronization apparatus, and for convenience of explanation, only the parts related to the embodiments of the present application are shown. The apparatus 200 comprises:
a checking module 201, configured to periodically check a target connection state of the master device and the slave device.
A connection establishing module 202, configured to establish a connection between the master device and the slave device if the target connection state is an unconnected state.
A sending module 203, configured to send the target command to the slave device by the master device after establishing the connection with the slave device.
The receiving module 204 is configured to receive, by the master device, the first target reply message, and update the device information of the slave device according to the first target reply message, where the first target reply message is a message sent by the slave device in response to the target command.
Optionally, the establishing connection module 202 includes:
and the sending unit is used for sending the connection request to the slave equipment by the master equipment.
And the judging unit is used for judging that the connection between the master device and the slave device is successful if the second target reply information returned by the slave device is received.
Optionally, the establishing connection module 202 further includes:
and the detection unit is used for detecting whether a preset event exists or not if the second target reply information returned by the slave equipment is not received.
And the return execution unit is used for returning and executing the connection request sent by the main equipment to the slave equipment if a preset event exists.
Optionally, the sending unit includes:
and the frequency acquisition subunit is used for acquiring the reconnection frequency.
Accordingly, the sending unit is configured to perform:
and if the reconnection times are less than or equal to the preset times, the master device sends a connection request to the slave device after a first preset time interval, and the reconnection times are added by 1.
Optionally, the sending unit further includes:
and the error processing operation subunit is used for executing the preset error processing operation by the main equipment if the reconnection times are greater than the preset times.
Optionally, the sending module 203 is configured to perform:
determining a target difference value according to the timestamp of the current time and a target timestamp, wherein the target timestamp is the timestamp corresponding to the time of receiving the first target reply information last time;
and if the target difference value is larger than the preset threshold value, the master device sends a target command to the slave device.
Optionally, the sending module 203 is configured to perform:
when the master device receives the trigger signal, a target command is sent to the slave device.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the method embodiment of the present application, and specific reference may be made to a part of the method embodiment, which is not described herein again.
EXAMPLE III
Fig. 3 is a schematic diagram of a master device provided in the third embodiment of the present application. As shown in fig. 3, the master device 300 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and operable on the processor 301. The processor 301 implements the steps of the above-described method embodiments when executing the computer program 303. Alternatively, the processor 301 implements the functions of the modules/units in the device embodiments when executing the computer program 303.
Illustratively, the computer program 303 may be divided into one or more modules/units, which are stored in the memory 302 and executed by the processor 301 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 303 in the main device 300. For example, the computer program 303 may be divided into a checking module, a connection establishing module, a sending module and a receiving module, and the functions of the modules are as follows:
periodically checking a target connection state of the master device and the slave device;
if the target connection state is an unconnected state, the master device establishes connection with the slave device;
after establishing a connection with the slave device, the master device sending a target command to the slave device;
and the master device receives first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command.
The master device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that fig. 3 is merely an example of a master device 300 and is not intended to be limiting of master device 300, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the master device may also include input output devices, network access devices, buses, etc.
The Processor 301 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware card, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 302 may be an internal storage unit of the main device 300, such as a hard disk or a memory of the main device 300. The memory 302 may be an external storage device of the host device 300, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided in the host device 300. Further, the memory 302 may include both an internal storage unit and an external storage device of the main device 300. The memory 302 is used to store the computer programs and other programs and data required by the host device. The memory 302 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/host device and method may be implemented in other ways. For example, the above-described apparatus/host embodiment is merely illustrative, and for example, the division of the above modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or plug-ins may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above method embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a processor, so as to implement the steps of the above method embodiments. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An apparatus information synchronization method, comprising:
periodically checking a target connection state of the master device and the slave device;
if the target connection state is an unconnected state, the master device establishes connection with the slave device;
after establishing a connection with the slave device, the master device sending a target command to the slave device;
and the master device receives first target reply information, and updates the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command.
2. The method for synchronizing device information according to claim 1, wherein the step of establishing a connection between the master device and the slave device comprises:
the master device sending a connection request to the slave device;
and if second target reply information returned by the slave equipment is received, judging that the connection between the master equipment and the slave equipment is successful.
3. The device information synchronization method of claim 2, further comprising:
if the second target reply message returned by the slave equipment is not received, detecting whether a preset event exists or not;
and if the preset event exists, returning to execute the main equipment to send a connection request to the slave equipment.
4. The device information synchronization method according to any one of claims 2 or 3, wherein the master device sending a connection request to the slave device includes:
obtaining reconnection times;
if the reconnection number is less than or equal to a preset number, the master device sends a connection request to the slave device after a first preset time interval, and the reconnection number is added by 1.
5. The device information synchronization method of claim 4, further comprising:
and if the reconnection times are greater than the preset times, the main equipment executes preset error processing operation.
6. The device information synchronization method of claim 1, wherein the master device sending a target command to the slave device comprises:
determining a target difference value according to a timestamp of the current time and a target timestamp, wherein the target timestamp is a timestamp corresponding to the time when the first target reply message is received last time;
and if the target difference value is larger than a preset threshold value, the master device sends a target command to the slave device.
7. The device information synchronization method of claim 1, wherein the master device sending a target command to the slave device comprises:
and when the master device receives a trigger signal, sending a target command to the slave device.
8. An apparatus information synchronization device, comprising:
the checking module is used for periodically checking the target connection state of the master device and the slave device;
a connection establishing module, configured to establish a connection between the master device and the slave device if the target connection state is an unconnected state;
a sending module, configured to send, by the master device, a target command to the slave device after establishing a connection with the slave device;
and the receiving module is used for receiving first target reply information by the master device and updating the device information of the slave device according to the first target reply information, wherein the first target reply information is information sent by the slave device in response to the target command.
9. A master device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202011052584.9A 2020-09-29 2020-09-29 Equipment information synchronization method, synchronization device, main equipment and storage medium Active CN112235370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011052584.9A CN112235370B (en) 2020-09-29 2020-09-29 Equipment information synchronization method, synchronization device, main equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011052584.9A CN112235370B (en) 2020-09-29 2020-09-29 Equipment information synchronization method, synchronization device, main equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112235370A true CN112235370A (en) 2021-01-15
CN112235370B CN112235370B (en) 2023-04-28

Family

ID=74119633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011052584.9A Active CN112235370B (en) 2020-09-29 2020-09-29 Equipment information synchronization method, synchronization device, main equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112235370B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422559A (en) * 2021-12-31 2022-04-29 深圳海翼智新科技有限公司 Device control method and device, electronic device and storage medium
CN114490454A (en) * 2021-12-29 2022-05-13 广州河东科技有限公司 Self-adaptive driving method and device for serial port of equipment and serial port equipment
CN115190044A (en) * 2022-06-28 2022-10-14 平安银行股份有限公司 Equipment connection state checking method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022451A (en) * 2006-02-14 2007-08-22 杭州华为三康技术有限公司 Connection state synchronizing method in data communication and applied communication node thereof
WO2012147176A1 (en) * 2011-04-27 2012-11-01 富士通株式会社 Program, information processing device, and monitoring method
CN103518418A (en) * 2012-09-27 2014-01-15 华为终端有限公司 Connecting method between Bluetooth devices and device
CN107995051A (en) * 2017-12-29 2018-05-04 国网安徽省电力有限公司 Secondary equipment of intelligent converting station visualized O&M module information interactive system and method
CN110677767A (en) * 2019-10-31 2020-01-10 歌尔科技有限公司 Wireless headset control method and system and TWS headset
CN111193769A (en) * 2019-11-25 2020-05-22 泰康保险集团股份有限公司 Method, system, device, electronic equipment and storage medium for recovering long connection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022451A (en) * 2006-02-14 2007-08-22 杭州华为三康技术有限公司 Connection state synchronizing method in data communication and applied communication node thereof
WO2012147176A1 (en) * 2011-04-27 2012-11-01 富士通株式会社 Program, information processing device, and monitoring method
CN103518418A (en) * 2012-09-27 2014-01-15 华为终端有限公司 Connecting method between Bluetooth devices and device
CN107995051A (en) * 2017-12-29 2018-05-04 国网安徽省电力有限公司 Secondary equipment of intelligent converting station visualized O&M module information interactive system and method
CN110677767A (en) * 2019-10-31 2020-01-10 歌尔科技有限公司 Wireless headset control method and system and TWS headset
CN111193769A (en) * 2019-11-25 2020-05-22 泰康保险集团股份有限公司 Method, system, device, electronic equipment and storage medium for recovering long connection

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490454A (en) * 2021-12-29 2022-05-13 广州河东科技有限公司 Self-adaptive driving method and device for serial port of equipment and serial port equipment
CN114422559A (en) * 2021-12-31 2022-04-29 深圳海翼智新科技有限公司 Device control method and device, electronic device and storage medium
CN115190044A (en) * 2022-06-28 2022-10-14 平安银行股份有限公司 Equipment connection state checking method, device, equipment and storage medium
CN115190044B (en) * 2022-06-28 2023-08-08 平安银行股份有限公司 Device connection state checking method, device and storage medium

Also Published As

Publication number Publication date
CN112235370B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN112235370A (en) Equipment information synchronization method, synchronization device, main equipment and storage medium
CN110377570B (en) Node switching method and device, computer equipment and storage medium
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN109213530B (en) USB-based communication connection method, mobile terminal and storage medium
CN112630557A (en) Equipment state detection method, device, equipment and medium
CN112636987B (en) Cross-chain gateway determination method and system for block chain and terminal equipment
CN106533976B (en) data packet processing method and device
CN111200653B (en) Multi-platform communication method, multi-platform communication device and intermediate server
CN110445700B (en) Master-slave communication system and method and terminal equipment
CN112068414B (en) Multi-system timing method, device, equipment and medium
CN115277707A (en) Service processing method, device, electronic equipment and storage medium
CN112566082B (en) Data transmission method, device, equipment and medium
CN112818336A (en) Data access method, data access device and computer readable storage medium
CN114124275A (en) Time synchronization method, device, equipment and storage medium
CN113708938B (en) Token obtaining method, token obtaining device and terminal equipment
CN112738162B (en) Terminal-device communication method, terminal, electronic device, and storage medium
CN116431533A (en) Peripheral interactive system, peripheral roll call method, main control equipment and readable storage medium
CN104052776A (en) VM boot method, VMM, shared storage system, VDI system and physical host
CN110876852A (en) Network game data processing method and system of micro-service
CN114567644B (en) Data synchronization method and device and electronic equipment
CN112187487B (en) Method and device for establishing device chain
CN117033276B (en) Bus communication method, system, electronic device and storage medium
CN117979265A (en) Bluetooth communication method, device, equipment and storage medium
CN116450414A (en) Bus management method, device, equipment and readable storage medium
CN112825586B (en) Service processing method, terminal and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant