CN112187487B - Method and device for establishing device chain - Google Patents

Method and device for establishing device chain Download PDF

Info

Publication number
CN112187487B
CN112187487B CN202011057022.3A CN202011057022A CN112187487B CN 112187487 B CN112187487 B CN 112187487B CN 202011057022 A CN202011057022 A CN 202011057022A CN 112187487 B CN112187487 B CN 112187487B
Authority
CN
China
Prior art keywords
equipment
information
establishing
slave
behind
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.)
Active
Application number
CN202011057022.3A
Other languages
Chinese (zh)
Other versions
CN112187487A (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 CN202011057022.3A priority Critical patent/CN112187487B/en
Publication of CN112187487A publication Critical patent/CN112187487A/en
Application granted granted Critical
Publication of CN112187487B publication Critical patent/CN112187487B/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
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/185Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with management of multicast group membership
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • 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/141Setup of application sessions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The application is applicable to the technical field of computers, and provides a method for establishing an equipment chain, which comprises the following steps: receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted; if the first inserting position is behind the first equipment, establishing a pairing relation with the second equipment according to the first equipment information; if the first inserting position is behind the target equipment, the equipment inserting instruction is sent to slave equipment of the first equipment; wherein the target device is a device in the device chain after the first device. In the device group obtained by the method for establishing the device chain, each slave device only has one master device, and the control end device only communicates with one device, so that the control and state acquisition of the whole group of devices can be carried out, and the devices in the whole device group can be synchronously controlled and managed.

Description

Method and device for establishing device chain
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a method and an apparatus for establishing an apparatus chain.
Background
When device management is performed, a master device and a slave device are generally set in a device group, one master device is paired with a plurality of slave devices, and a server manages the plurality of slave devices through the master device. When the devices in the device group are paired, a plurality of slave devices are paired with the master device at the same time, so that a device chain is established. However, according to the method for establishing the device chain, since one master device is connected with a plurality of slave devices, and a plurality of master devices may exist in the device group, the device chain may not be able to synchronously control and manage the devices in the entire device group.
Disclosure of Invention
The embodiment of the application provides a method and equipment for establishing an equipment chain, which can solve the problem that the obtained equipment chain cannot synchronously control and manage the equipment in the whole equipment group in the conventional method for establishing the equipment chain.
In a first aspect, an embodiment of the present application provides a method for establishing a device chain, which is applied to a first device, and includes:
receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
if the first inserting position is behind the first equipment, establishing a pairing relation with the second equipment according to the first equipment information;
if the first inserting position is behind the target equipment, the equipment inserting instruction is sent to slave equipment of the first equipment; wherein the target device is a device in the device chain after the first device.
Further, if the first insertion position is behind the first device, establishing a pairing relationship with the second device according to the first device information includes:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
and sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment.
Further, if the first insertion position is behind the first device, establishing a pairing relationship with the second device according to the first device information includes:
if the first inserting position is behind the first equipment and the first equipment has slave equipment, acquiring equipment information of third equipment, and disconnecting the third equipment from the third equipment, wherein the third equipment is the slave equipment of the first equipment;
establishing a pairing relation with the second equipment according to the first equipment information;
sending the device information of the third device to the second device; and the device information of the third device is used for triggering the second device to establish a pairing relationship with the third device.
Further, still include:
receiving a device deleting instruction; the equipment deleting instruction comprises second equipment information of fourth equipment to be deleted;
if the position of the fourth device is behind the first device, deleting the fourth device from the device chain according to the second device information;
if the position of the fourth device is behind the target device, sending the device deleting instruction to the slave device of the first device; wherein the target device is a device in the device chain after the first device.
Further, if the location of the fourth device is behind the first device, deleting the fourth device from the device chain according to the second device information, including:
and if the position of the fourth equipment is behind the first equipment and the fourth equipment does not have slave equipment, disconnecting the fourth equipment according to the second equipment information.
Further, if the location of the fourth device is behind the first device, deleting the fourth device from the device chain according to the second device information, including:
if the position of the fourth device is behind the first device and the fourth device has a slave device, disconnecting the fourth device according to the second device information and establishing a pairing relationship with the fifth device, wherein the fifth device is the slave device of the fourth device.
In a second aspect, an embodiment of the present application provides an apparatus, including:
a first receiving unit for receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
the first processing unit is used for establishing a pairing relation with the second equipment according to the first equipment information if the first inserting position is behind the first equipment;
the second processing unit is used for sending the equipment insertion instruction to the slave equipment of the first equipment if the first insertion position is behind the target equipment; wherein the target device is a device in the device chain after the first device.
Further, the first processing unit is specifically configured to:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
and sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment.
Further, the first processing unit is specifically configured to:
if the first inserting position is behind the first equipment and the first equipment has slave equipment, acquiring equipment information of third equipment, and disconnecting the third equipment from the third equipment, wherein the third equipment is the slave equipment of the first equipment;
establishing a pairing relation with the second equipment according to the first equipment information;
sending the device information of the third device to the second device; the device information of the third device is used for triggering the second device to establish a pairing relationship with the third device.
Further, still include:
a second receiving unit configured to receive a device deletion instruction; the equipment deleting instruction comprises second equipment information of fourth equipment to be deleted;
a third processing unit, configured to delete the fourth device from the device chain according to the second device information if the location of the fourth device is behind the first device;
a fourth processing unit, configured to send the device deletion instruction to a slave device of the first device if the position of the fourth device is behind a target device; wherein the target device is a device in the device chain after the first device.
Further, the third processing unit is specifically configured to:
and if the position of the fourth equipment is behind the first equipment and the fourth equipment does not have slave equipment, disconnecting the fourth equipment according to the second equipment information.
Further, the third processing unit is specifically configured to:
if the position of the fourth device is behind the first device and the fourth device has a slave device, disconnecting the fourth device according to the second device information and establishing a pairing relationship with a fifth device, wherein the fifth device is the slave device of the fourth device.
In a third aspect, an embodiment of the present application provides an apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for establishing an apparatus chain as described in the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the method for establishing a device chain as described in the first aspect.
In the embodiment of the application, a device insertion instruction is received; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted; if the first inserting position is behind the first equipment, establishing a pairing relation with the second equipment according to the first equipment information; if the first inserting position is behind the target equipment, the equipment inserting instruction is sent to slave equipment of the first equipment; wherein the target device is a device in the device chain after the first device. In the device group obtained by the method for establishing the device chain, each slave device only has one master device, and the control end device only communicates with one device, so that the control and state acquisition of the whole group of devices can be carried out, and the devices in the whole device group can be synchronously controlled and managed.
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 based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for establishing a device chain according to a first embodiment of the present application;
fig. 2 is a schematic flowchart of S104 to S106 in a method for establishing a device chain according to a first embodiment of the present application;
FIG. 3 is a schematic view of an apparatus provided in a second embodiment of the present application;
fig. 4 is a schematic diagram of an apparatus provided in a third 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 a relative importance or 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.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for establishing a device chain according to a first embodiment of the present application. An execution subject of the method for establishing the device chain in this embodiment is a device in the device chain, and is referred to as a first device in this embodiment. The method for establishing the device chain as shown in fig. 1 may include:
s101: receiving a device insertion instruction; the device insertion instruction includes first device information and a first insertion location of a second device to be inserted.
The method for establishing the device chain in this embodiment is used for establishing the device chain, and all devices in the device chain form a device group including at least two devices. An execution main body of the method for establishing the device chain in this embodiment is referred to as a first device, and the first device may be a communication master device in communication connection with the control-end device, or may be another device in the device chain except the communication master device. The whole equipment chain can be controlled by the control end equipment, the control end equipment is in communication connection with only one equipment in the equipment chain, and the equipment in communication connection with the control end equipment can be called communication main equipment. Before the device group is established, the control end device establishes a communication connection with the communication master device. After the equipment is connected to the equipment chain, the equipment is divided into master equipment and slave equipment. The master device and the slave device are opposite, if the device has a previous stage, the device is the slave device, and the previous stage device is the master device of the device.
The method comprises the steps that a first device receives a device insertion instruction, and when the first device is a target device, the device insertion instruction is sent by a control end device; when the first device is a device other than the communication master device in the device chain, the device insertion instruction is transmitted by the master device of the first device.
The device insertion instruction comprises first device information of a second device to be inserted and a first insertion position. The second device is a device to be inserted into the device chain, and the first device information may include address information, device identification, and the like of the second device. The first insertion position is an insertion position of the second device in the device chain.
S102: and if the first inserting position is behind the first equipment, establishing a pairing relation with the second equipment according to the first equipment information.
After the first device obtains the device insertion instruction, the first device needs to obtain a first insertion position in the device insertion instruction, and if the first insertion position is behind the first device, a pairing relationship is established between the first device and the second device according to the first device information. When the pairing relationship is established, the first device may send a pairing relationship establishment request to the second device, where the pairing relationship establishment request includes pairing information. After receiving the pairing relationship establishment request, the second device may check whether the second device is already configured as a slave device, that is, when receiving the pairing relationship establishment request, the second device checks whether the second device is a slave device of another device, if the second device receives the pairing relationship establishment request, the second device considers that the second device is an error group, and returns error information to the first device, so that the first device cancels the pairing operation, and after receiving the error information returned by the second device, the first device cancels the pairing operation, and returns the error information to the control end device. And if the second equipment is not the slave equipment of other equipment, checking whether the pairing information is legal or not, if not, returning error information, otherwise, recording the main equipment of the second equipment as the first equipment, updating the configuration information of the second equipment, and marking the second equipment as the slave equipment of the first equipment.
The first insertion position is that two situations can exist after the first device, wherein one situation is that the first device is the last device in the device chain, namely the first device does not have a slave device; the other is that the first device is an intermediate device of the device chain, i.e. the first device is a slave device present. In both cases, when the device is inserted, the specific implementation is as follows:
in one embodiment, if the first insertion position is behind the first device and the first device does not have a slave device, that is, the first device is the last device in the device chain, the first device directly establishes a connection with the second device. And sending the binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment.
In another embodiment, if the first inserting position is behind the first device, and the first device has a slave device, that is, the first device is an intermediate device of the device chain, and the slave device of the first device is a third device, a second device needs to be inserted between the first device and the third device, and the first device needs to first acquire device information of the third device and then disconnect from the third device; after the first equipment is disconnected with the third equipment, the current state of the third equipment is a free state, and the first equipment establishes a pairing relation with the second equipment according to the first equipment information; after the first equipment and the second equipment establish a pairing relationship, equipment information of the third equipment is sent to the second equipment; and the device information of the third device is used for triggering the second device to establish a pairing relationship with the third device. And after receiving the equipment information of the third equipment, the second equipment establishes a pairing relationship with the third equipment to complete the establishment of the equipment chain.
S103: if the first inserting position is behind the target equipment, the equipment inserting instruction is sent to slave equipment of the first equipment; wherein the target device is a device in the device chain after the first device.
After the first device acquires the device insertion instruction, the first device needs to acquire a first insertion position in the device insertion instruction, and if the first insertion position is behind a target device, the device insertion instruction is sent to a slave device of the first device, where the target device is a device behind the first device in a device chain, and the target device may be the slave device of the first device, or may be the slave device of the first device, and as long as the device behind the first device may be the target device. That is, the first insertion position of the second device is behind the device behind the first device, then the first device sends the device insertion instruction to the slave device of the first device, and the primary transmission is to the target device. And after receiving the equipment insertion instruction, the target equipment establishes a pairing relation with the second equipment and establishes an equipment chain.
When the device chain is established, if the paired devices in the device chain need to be deleted, the methods in S104 to S106 may be used, as shown in fig. 2, where S104 to S106 are specifically as follows:
s104: receiving a device deleting instruction; the device deletion instruction includes second device information of a fourth device to be deleted.
The first device receives a device deletion instruction, and when the first device is a device other than the target device in the device chain, the device deletion instruction is sent by the master device of the first device. The device deletion instruction includes second device information of a fourth device to be deleted. The second device information may include address information, device identification, and the like of the fourth device to be deleted.
S105: and if the position of the fourth device is behind the first device, deleting the fourth device from the device chain according to the second device information.
And after the first device acquires the device deletion instruction, the first device needs to acquire the position of the fourth device, and if the position of the fourth device is behind the first device, the fourth device is deleted from the device chain according to the second device information. And when the fourth equipment is deleted, the first equipment sends an unbinding instruction, and the fourth equipment is unbound and disconnected.
The position of the fourth device in the device chain has two situations, one is that the fourth device is the last device in the device chain, namely the fourth device has no slave device; the other is that the fourth device is an intermediate device of the device chain, i.e. the fourth device is a slave device present. In the two cases, when the device is deleted, the specific implementation manner is as follows:
in one embodiment, if the position of the fourth device is behind the first device and the fourth device does not have a slave device, that is, the fourth device is the last device in the device chain, the fourth device is disconnected from the fourth device according to the second device information.
In another embodiment, if the position of the fourth device is behind the first device and the fourth device has a slave device, that is, the fourth device is a middle device of the device chain, and the fifth device is a slave device of the fourth device. Disconnecting the fourth device according to the second device information, and establishing a pairing relationship with the fifth device.
S106: if the position of the fourth device is behind the target device, sending the device deleting instruction to the slave device of the first device; wherein the target device is a device in the device chain after the first device.
After the first device acquires the device deletion instruction, the first device needs to acquire the location of the fourth device, and if the location of the fourth device is behind the target device, the device deletion instruction is sent to the slave device of the first device, where the target device is a device behind the first device in the device chain, and the target device may be the slave device of the first device, or may be the slave device of the first device, and as long as the devices behind the first device may all be the target device. That is, the fourth device is located behind the device behind the first device, then the first device sends a device delete instruction to the slave device of the first device, and the first-level transmission is to the target device. And after receiving the equipment deleting instruction, the target equipment disconnects the connection with the fourth equipment.
In the embodiment of the application, a device insertion instruction is received; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted; if the first inserting position is behind the first equipment, establishing a pairing relation with the second equipment according to the first equipment information; if the first inserting position is behind the target equipment, the equipment inserting instruction is sent to slave equipment of the first equipment; wherein the target device is a device in the device chain after the first device. In the device group obtained by the method for establishing the device chain, each slave device only has one master device, and the control end device only communicates with one device, so that the control and state acquisition of the whole group of devices can be carried out, and the devices in the whole device group can be synchronously controlled and managed.
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.
Referring to fig. 3, fig. 3 is a schematic diagram of an apparatus according to a second embodiment of the present application. The units included are used to perform the steps in the corresponding embodiments of fig. 1-2. Please refer to the related description of the embodiments in fig. 1-2. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 3, the apparatus 3 includes:
a first receiving unit 310 for receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
a first processing unit 320, configured to establish a pairing relationship with the second device according to the first device information if the first insertion position is behind the first device;
the second processing unit 330 is configured to send the device insertion instruction to a slave device of the first device if the first insertion position is behind a target device; wherein the target device is a device in the device chain after the first device.
Further, the first processing unit 320 is specifically configured to:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
and sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment.
Further, the first processing unit 320 is specifically configured to:
if the first inserting position is behind the first equipment and the first equipment has slave equipment, disconnecting the first inserting position from third equipment, wherein the third equipment is the slave equipment of the first equipment;
establishing a pairing relationship with the second equipment according to the first equipment information;
acquiring the equipment information of the third equipment, and sending the equipment information of the third equipment to the second equipment; and the device information of the third device is used for triggering the second device to establish a pairing relationship with the third device.
Further, still include:
a second receiving unit configured to receive a device deletion instruction; the equipment deleting instruction comprises second equipment information of fourth equipment to be deleted;
a third processing unit, configured to delete the fourth device from the device chain according to the second device information if the location of the fourth device is behind the first device;
a fourth processing unit, configured to send the device deletion instruction to a slave device of the first device if the position of the fourth device is behind a target device; wherein the target device is a device in the device chain after the first device.
Further, the third processing unit is specifically configured to:
and if the position of the fourth equipment is behind the first equipment and the fourth equipment does not have slave equipment, disconnecting the fourth equipment according to the second equipment information.
Further, the third processing unit is specifically configured to:
if the position of the fourth device is behind the first device and the fourth device has a slave device, disconnecting the fourth device according to the second device information and establishing a pairing relationship with a fifth device, wherein the fifth device is the slave device of the fourth device.
Fig. 4 is a schematic diagram of an apparatus provided in a third embodiment of the present application. As shown in fig. 4, the apparatus 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40, such as a program establishing a chain of devices. The processor 40, when executing the computer program 42, implements the steps in the various method embodiments described above for establishing a device chain, such as the steps 101 to 103 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 310 to 330 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units, which are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of the computer program 42 in the device 4. For example, the computer program 42 may be divided into a first receiving unit, a first processing unit, and a second processing unit, and each unit has the following specific functions:
a first receiving unit for receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
the first processing unit is used for establishing a pairing relationship with the second device according to the first device information if the first insertion position is behind the first device;
the second processing unit is used for sending the equipment inserting instruction to slave equipment of the first equipment if the first inserting position is behind target equipment; wherein the target device is a device in the device chain after the first device.
The apparatus may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a device 4 and does not constitute a limitation of device 4 and may include more or fewer components than shown, or some components in combination, or different components, e.g., the device may also include input output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the device 4, such as a hard disk or a memory of the device 4. The memory 41 may also be an external storage device of the device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the device 4. Further, the device 4 may also comprise both an internal storage unit and an external storage device of the device 4. The memory 41 is used for storing the computer program and other programs and data required by the device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
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 embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
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 function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform 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.
An embodiment of the present application further provides a network device, where the network device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above may be implemented by instructing relevant hardware by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the methods described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal device, recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunication signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any 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/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and other divisions may be realized in practice, for example, multiple units or components 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.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit 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 (9)

1. A method for establishing a device chain, applied to a first device, includes:
receiving a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
if the first insertion position is behind the first device, establishing a pairing relationship with the second device according to the first device information, wherein the first device is a communication main device in communication connection with a control end device or other devices except the communication main device in a device chain;
when the pairing relationship is established, the first equipment sends a pairing relationship establishing request to the second equipment, wherein the pairing relationship establishing request comprises pairing information; when receiving a request for establishing a pairing relationship, the second device checks whether the second device is a slave device of other devices, if so, the second device considers that the second device is an error group, and returns error information to the first device to enable the first device to cancel the pairing operation, and after receiving the error information returned by the second device, the first device cancels the pairing operation and returns the error information to the control end device; if the second equipment is not the slave equipment of other equipment, checking whether the pairing information is legal, and returning error information if the pairing information is illegal, otherwise, recording the main equipment of the second equipment as the first equipment, updating the self configuration information, and marking the self equipment as the slave equipment of the first equipment;
if the first insertion position is behind the first device, establishing a pairing relationship with the second device according to the first device information, including:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment;
if the first inserting position is behind a target device, the device inserting instruction is sent to a slave device of the first device, primary transmission is carried out on the slave device to the target device, and after receiving the device inserting instruction, the target device establishes a pairing relation with the second device and establishes a device chain; wherein the target device is a device in the device chain after the first device.
2. The method for establishing a device chain according to claim 1, wherein if the first insertion position is behind the first device, establishing a pairing relationship with the second device according to the first device information includes:
if the first inserting position is behind the first equipment and the first equipment has slave equipment, acquiring equipment information of third equipment, and disconnecting the third equipment from the third equipment, wherein the third equipment is the slave equipment of the first equipment;
establishing a pairing relation with the second equipment according to the first equipment information;
sending the device information of the third device to the second device; and the device information of the third device is used for triggering the second device to establish a pairing relationship with the third device.
3. The method of establishing a device chain of claim 1, further comprising:
receiving a device deleting instruction; the equipment deleting instruction comprises second equipment information of fourth equipment to be deleted;
if the position of the fourth device is behind the first device, deleting the fourth device from the device chain according to the second device information;
if the position of the fourth device is behind the target device, sending the device deleting instruction to the slave device of the first device; wherein the target device is a device in the device chain after the first device.
4. The method of claim 3, wherein deleting the fourth device from the device chain according to the second device information if the location of the fourth device is behind the first device comprises:
and if the position of the fourth equipment is behind the first equipment and the fourth equipment does not have slave equipment, disconnecting the fourth equipment according to the second equipment information.
5. The method of claim 3, wherein deleting the fourth device from the device chain according to the second device information if the location of the fourth device is behind the first device comprises:
if the position of the fourth device is behind the first device and the fourth device has a slave device, disconnecting the fourth device according to the second device information and establishing a pairing relationship with a fifth device, wherein the fifth device is the slave device of the fourth device.
6. A device, wherein the device is a first device in a chain of devices, the device comprising:
a first receiving unit configured to receive a device insertion instruction; the device insertion instruction comprises first device information and a first insertion position of a second device to be inserted;
a first processing unit, configured to establish a pairing relationship with the second device according to the first device information if the first insertion position is behind the first device, where the first device is a communication master device that is in communication connection with a control-end device or another device in a device chain except the communication master device;
when a pairing relationship is established, the first equipment sends a pairing relationship establishing request to the second equipment, and the pairing relationship establishing request comprises pairing information; when receiving the request for establishing the pairing relationship, the second device checks whether the second device is a slave device of other devices, if the second device is a slave device of other devices, the second device considers that the second device is an error group, and returns error information to the first device to enable the first device to cancel the pairing operation, and after receiving the error information returned by the second device, the first device cancels the pairing operation and returns the error information to the control end device; if the second equipment is not the slave equipment of other equipment, checking whether the pairing information is legal, and returning error information if the pairing information is illegal, otherwise, recording the main equipment of the second equipment as the first equipment, updating the self configuration information, and marking the self equipment as the slave equipment of the first equipment;
if the first inserting position is behind the first device, establishing a pairing relationship with the second device according to the first device information, including:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment;
the second processing unit is used for sending the equipment insertion instruction to slave equipment of the first equipment if the first insertion position is behind target equipment, transmitting the equipment insertion instruction to the target equipment in a primary level, and after receiving the equipment insertion instruction, the target equipment establishes a pairing relationship with the second equipment and establishes an equipment chain; wherein the target device is a device in the device chain after the first device.
7. The device of claim 6, wherein the first processing unit is specifically configured to:
if the first inserting position is behind the first equipment and the first equipment does not have slave equipment, establishing connection with the second equipment;
and sending a binding instruction and the equipment information of the first equipment to the second equipment according to the first equipment information, and establishing a pairing relation with the second equipment.
8. An apparatus 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 of claims 1 to 5 when executing the computer program.
9. 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 to 5.
CN202011057022.3A 2020-09-29 2020-09-29 Method and device for establishing device chain Active CN112187487B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011057022.3A CN112187487B (en) 2020-09-29 2020-09-29 Method and device for establishing device chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011057022.3A CN112187487B (en) 2020-09-29 2020-09-29 Method and device for establishing device chain

Publications (2)

Publication Number Publication Date
CN112187487A CN112187487A (en) 2021-01-05
CN112187487B true CN112187487B (en) 2023-04-18

Family

ID=73946454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011057022.3A Active CN112187487B (en) 2020-09-29 2020-09-29 Method and device for establishing device chain

Country Status (1)

Country Link
CN (1) CN112187487B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859436A (en) * 2005-08-04 2006-11-08 上海华为技术有限公司 Method for distributing address in cascade group net
CN107147522A (en) * 2017-05-11 2017-09-08 京信通信系统(中国)有限公司 A kind of method and device for determining networking topological structure
CN110166338A (en) * 2019-05-17 2019-08-23 华东师范大学 A kind of Cascading Methods of serial communication interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2567120B (en) * 2016-08-19 2019-10-02 Motorola Solutions Inc Methods and systems for adding device to sequential personal area network chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859436A (en) * 2005-08-04 2006-11-08 上海华为技术有限公司 Method for distributing address in cascade group net
CN107147522A (en) * 2017-05-11 2017-09-08 京信通信系统(中国)有限公司 A kind of method and device for determining networking topological structure
CN110166338A (en) * 2019-05-17 2019-08-23 华东师范大学 A kind of Cascading Methods of serial communication interface

Also Published As

Publication number Publication date
CN112187487A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN109656873B (en) Block chain-based data archiving method and device and terminal equipment
CN1996834B (en) Method and apparatus for acquiring domain information and domain-related data
CN110856126B (en) Information reporting and receiving method, terminal equipment and storage medium
CN109376126B (en) File or folder processing method, mobile terminal and storage medium
CN108829526B (en) Inter-process communication method, electronic equipment and readable storage medium
CN112187487B (en) Method and device for establishing device chain
CN110019040B (en) Folder processing method, mobile terminal and storage medium
CN108920962A (en) Firmware downloads sign test method, firmware dissemination method, mobile terminal and server
CN111182527B (en) OTA (over the air) firmware upgrading method and device, terminal equipment and storage medium thereof
CN112799763A (en) Function management method, management device, terminal equipment and readable storage medium
CN111143092A (en) Fault recording data processing method and system and terminal equipment
CN103823702A (en) Application installation method and electronic equipment
CN107506386B (en) Data aggregation method and device based on NAS, terminal equipment and storage medium
CN103970572A (en) Server component upgrading method, device and system
CN112819464B (en) Intelligent contract processing method, processing device, terminal equipment and storage medium
CN112637821B (en) Management platform and management method of vehicle communication chip and vehicle communication management system
CN112822087B (en) Data distinguishing method, data distinguishing device, router and network relay equipment
CN108629175B (en) Access control method and access control device of USB mass storage equipment
CN114217911A (en) Cross-chain transaction processing method, device, computing equipment and medium
CN108874564B (en) Inter-process communication method, electronic equipment and readable storage medium
CN110018908B (en) Inter-process communication method, electronic equipment and readable storage medium
CN114461418A (en) Inter-process communication method and device and electronic equipment
CN114567644B (en) Data synchronization method and device and electronic equipment
CN112203264A (en) Equipment pairing method applied to equipment group and equipment in equipment group
CN111736859B (en) Version updating method of operating system, server and terminal

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