CN113709224A - Equipment registration method, device, equipment, system and storage medium - Google Patents

Equipment registration method, device, equipment, system and storage medium Download PDF

Info

Publication number
CN113709224A
CN113709224A CN202110951106.XA CN202110951106A CN113709224A CN 113709224 A CN113709224 A CN 113709224A CN 202110951106 A CN202110951106 A CN 202110951106A CN 113709224 A CN113709224 A CN 113709224A
Authority
CN
China
Prior art keywords
value
registration
instruction
equipment
updating
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
CN202110951106.XA
Other languages
Chinese (zh)
Other versions
CN113709224B (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.)
Hangzhou Haikang Fire Technology Co ltd
Original Assignee
Hangzhou Haikang Fire Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Haikang Fire Technology Co ltd filed Critical Hangzhou Haikang Fire Technology Co ltd
Priority to CN202110951106.XA priority Critical patent/CN113709224B/en
Publication of CN113709224A publication Critical patent/CN113709224A/en
Application granted granted Critical
Publication of CN113709224B publication Critical patent/CN113709224B/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
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1073Registration or de-registration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application discloses a device registration method, a device, a system and a storage medium, which relate to the field of computers and realize simple and efficient automatic device registration. The method comprises the following steps: sending a registration instruction to a plurality of second devices; determining the receiving number of the first response messages sent by the plurality of second devices; determining a value updating instruction sent to the second equipment according to the receiving quantity of the first response messages, wherein the value updating instruction is used for indicating part or all of the second equipment to update respective registration count values; determining the receiving number of second response messages sent by a plurality of second devices; and determining whether the second equipment meeting the registration condition exists according to the receiving quantity of the second response messages sent by the plurality of second equipment. The embodiment of the application can realize simple and efficient automatic registration of the equipment.

Description

Equipment registration method, device, equipment, system and storage medium
Technical Field
The embodiment of the application relates to the field of computers, in particular to a device registration method, device, system and storage medium.
Background
In a multi-device connected computer system architecture, one networking policy is to deploy a device with management authority and perform centralized management on other devices by the device with management authority. For example, in an intelligent fire-fighting system, a deployed gateway device is a device with management authority, a front-end device node for monitoring information such as environmental information, voltage or current in a line and the like can report monitoring information to the gateway device, and the gateway device uploads the monitoring information of each node to a platform service center in a unified manner.
The device without management authority among the multiple devices connected to each other needs to be registered on the device with management authority, so that the device with management authority records the device information thereof, and then performs communication.
Currently, the registration of the device is mostly realized in a manual interaction manner, in which a technician manually configures device information of each device in a device with a management authority, and then installs the device in a system, or additionally adds a registration key to the device. The equipment is registered to the equipment with the management authority one by one through manual interaction in engineering, and the equipment is troublesome to operate, low in efficiency and inconvenient to install, test and maintain.
Disclosure of Invention
The embodiment of the application provides a device registration method, a device, a system and a storage medium, and realizes simple and efficient automatic device registration.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a device registration method is provided, which is applied to a first device, and may include: sending a registration instruction to a plurality of second devices, wherein the registration instruction is used for indicating the second devices to register with the first devices; determining the receiving quantity of first response messages sent by a plurality of second devices, wherein the first response messages are generated and sent by the second devices under the condition that the register count values meet the preset values, and the values of the register count values are used for the second devices to determine whether to send the response messages to the first devices; determining a value updating instruction sent to the second equipment according to the receiving quantity of the first response messages, wherein the value updating instruction is used for indicating part or all of the second equipment to update respective registration count values; determining the receiving quantity of second response messages sent by a plurality of second devices, wherein the second response messages are generated and sent by the second devices under the condition that the updated register count value or the non-updated register count value meets a preset value; and determining whether the second equipment meeting the registration condition exists according to the receiving quantity of the second response messages sent by the plurality of second equipment.
According to the device registration method provided by the application, in the registration process of the second device to the first device, the second device with the registration count value meeting the preset value sends the response message to the first device, and the first device controls the registration count value of the second device by sending the numerical value updating instruction according to the receiving quantity of the first response message, so that the receiving quantity of the second response message sent by the second device meets the preset condition, and the registration of the second device is completed. Therefore, the first equipment and the second equipment are interacted and control the registration count value, active registration of the second equipment to the first equipment is achieved, manual participation is not needed, and simple and efficient equipment registration is achieved.
The preset value may be 0.
In a possible implementation manner, the determining, according to the number of received first response messages, a value update instruction sent to the second device may specifically be implemented as: if the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; alternatively, if the number of receptions of the first reply message is less than the first reception amount threshold, a second value update instruction to be transmitted to the second device is determined. The first numerical value updating instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value, and the second numerical value updating instruction is used for indicating the second equipment with the registration count value not meeting the preset value to update the respective registration count value. When the receiving quantity of the first response messages is too large, updating the registration count value of the second equipment of which the registration count value meets the preset value through a first updating instruction, reducing the quantity of the second equipment of which the registration count value meets the preset value, and improving the probability of successful registration of the second equipment by sending the second response messages; when the receiving quantity of the first response messages is too small, the register count value of the second equipment of which the register count value does not meet the preset value is updated through a second updating instruction, the quantity of the second equipment of which the register count value meets the preset value is increased, and the probability of successful registration of the second equipment by sending the second response messages is improved.
Wherein the first receiving number threshold may be 1.
In another possible implementation manner, the device registration method provided by the present application may further include: and counting the times of the data transmission bus in the congestion state according to the receiving quantity of the first response messages. The determining a first value update instruction to be sent to the second device if the number of received first response messages is greater than the first received amount threshold includes: and if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in a congestion state. The number of times that the data transmission bus is in the congestion state indicates the number of times that the first device performs data interaction with more second devices at the same time, so that different first value updating instructions can be sent to the second devices according to different numbers of times that the data transmission bus is in the congestion state, the number of the second devices with registration count values meeting preset values can be reduced to different degrees, and the probability of successful registration of the second devices by sending second response messages is improved.
The data transmission bus is used for transmitting interaction data between a first device and a second device (such as a master device and a slave device), wherein the interaction data includes, but is not limited to, a first response message, a second response message, device information and the like.
The congestion state of the data transfer bus means a state in which a large amount of information is transferred through the data transfer bus and is transmitted by M or more devices, and the information cannot be successfully received. M may be determined based on the capabilities of the data transfer bus. For example, on the 485 bus, M may be determined to be 2.
In another possible implementation manner, the device registration method provided by the present application may further include: and counting the times of the data transmission bus in the idle state according to the receiving quantity of the first response messages. The determining a second value update instruction to be sent to the second device if the number of receptions of the first reply message is smaller than the first reception amount threshold includes: and if the receiving quantity of the first response messages is less than the first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in the idle state. The number of times that the data transmission bus is in the idle state indicates the number of times that the first device performs data interaction with the second device less, so that different second numerical value updating instructions can be sent to the second device according to different numbers of times that the data transmission bus is in the idle state, the number of the second devices with registration count values meeting preset values can be increased to different degrees, and the probability of successful registration of the second device by sending a second response message is improved.
The data transmission bus is in an idle state, which may be a state where the second device does not send the interactive data to the first device.
In another possible implementation manner, the determining, according to the number of times that the data transmission bus is in the congestion state, the first value update instruction sent to the second device may specifically be implemented as: if the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold value, determining a first updating sub-instruction sent to second equipment, wherein the first updating sub-instruction is used for indicating the second equipment with a registration count value meeting a preset value to randomly update the registration count value; or; and if the number of times that the data transmission bus is in the congestion state is greater than or equal to the first time threshold value, determining a third updating sub-instruction sent to the second equipment, wherein the third updating sub-instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value to be N times of the current value and then adding a random number, and N is an integer not zero. The number of times that the data transmission bus is in a congestion state is smaller than the first time threshold, which indicates that the congestion degree of the data transmission bus is not large, and the registration count value of the second device of which the registration count value meets the preset value can be finely adjusted through the first updating sub-instruction, so that the number of the second devices of which the registration count value meets the preset value can be reduced in a small range; the number of times that the data transmission bus is in the congestion state is greater than or equal to the first time threshold, which indicates that the congestion degree of the data transmission bus is serious, and the register count value of the second device meeting the register count value and meeting the preset value can be greatly updated through the third update sub-instruction, so that the number of the second devices meeting the preset value and the register count value can be greatly reduced.
In another possible implementation manner, determining, according to the number of times that the data transmission bus is in the idle state, a second value update instruction to be sent to the second device includes: if the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, determining a second updating sub-instruction sent to the second equipment, wherein the second updating sub-instruction is used for indicating the second equipment of which the register count value does not meet the preset value to randomly update the register count value; or if the number of times that the data transmission bus is in the idle state is greater than or equal to the second time threshold value, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second devices whose registration count values do not satisfy the preset value to update their respective registration count values to a value obtained by rounding a quotient of the current value and N, where N is an integer that is not zero. The number of times that the data transmission bus is in the idle state is smaller than the second secondary threshold, which indicates that the idle degree of the data transmission bus is not large, and the registration count value of the second device of which the registration count value meets the preset value can be finely adjusted through the second updating sub-instruction, so that the number of the second devices of which the registration count value meets the preset value is increased in a small range; the number of times that the data transmission bus is in the idle state is greater than or equal to the second time threshold, which indicates that the idle degree of the data transmission bus is serious, and the register count value of the second device meeting the register count value and meeting the preset value can be greatly updated through the fourth update sub-instruction, so that the number of the second devices meeting the register count value and the preset value can be greatly increased.
In another possible implementation manner, if the number of times that the data transmission bus is in the idle state is less than the second time threshold, determining a second update sub-instruction to be sent to the second device includes: if the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, and the last numerical value updating instruction sent by the first device is a random updating instruction (for example, a first updating sub-instruction or a second updating sub-instruction), determining a second updating sub-instruction sent to the second device; or, if the number of times that the data transmission bus is in the idle state is less than the second time threshold, and the last numerical update instruction sent by the first device is not a random update instruction (e.g., a first update sub-instruction or a second update sub-instruction), determining a re-registration instruction sent to the second device, where the re-registration instruction is used to instruct the second device to register with the first device. When the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, if the instruction sent by the first device for the previous time is a random update instruction, which indicates that the data transmission bus is idle due to the random update instruction, the random update instruction of the second update sub-instruction can be sent again, and the random register count value is updated, so that some second devices can send second response messages; if the instruction sent by the first device last time is not the random updating instruction, the probability that the second device is controlled to send the second response message through the random updating instruction is not high, so that the next round of registration can be entered through the re-registration instruction, and the probability that the second device completes the registration is improved.
In another possible implementation manner, the first response message or the second response message may include device information of the second device. The determining the number of received first reply messages sent by the plurality of second devices includes: detecting device information in first response messages sent by a plurality of second devices; and determining the receiving quantity of the first response messages sent by the plurality of second devices according to the detection result. Or, determining the number of receptions of the second response messages sent by the plurality of second devices includes: detecting the equipment information in the second response messages sent by the plurality of second equipment; and determining the receiving quantity of the second response messages sent by the plurality of second devices according to the detection result. The device information of the second device can be transmitted to the first device by sending the response message, and the detection result of the first device for detecting the device information in the response message can reflect the number of the response message, so that the number of the response message can be determined according to the detection result, the control of the registration count value of the second device is realized, and the registration efficiency of the second device is improved.
In another possible implementation manner, the first device is connected to the second devices through a 485 bus, the first device detects device information in first reply messages sent by the plurality of second devices, if the detection is successful, it is determined that the number of received first reply messages sent by the plurality of second devices is 1, and if the detection is unsuccessful, it is determined that the number of received first reply messages sent by the plurality of second devices is not 1.
In another possible implementation manner, the device registration method provided in this embodiment of the present application may further include: if the second equipment meeting the registration condition is determined to exist according to the receiving quantity of the second response messages sent by the plurality of second equipment, after the registration operation of the second equipment meeting the registration condition is completed, a prompt message is sent to the second equipment, and the prompt message is used for notifying the second equipment that the registration is successful. By this, the registration of the second device satisfying the registration condition is completed.
Wherein the registration condition may be successful detection of the device information. The completion of the registration operation of the second device satisfying the registration condition may be to record device information of the second device satisfying the registration condition.
In another possible implementation manner, the device registration method provided in this embodiment of the present application may further include: and after sending the prompt message to the second equipment meeting the registration condition, sending a re-registration instruction to the rest unregistered second equipment, wherein the re-registration instruction is used for instructing the rest unregistered second equipment to update the registration value and register to the first equipment.
In a second aspect, another device registration method is provided, which may be applied to a second device, and may include: receiving a registration instruction sent by first equipment, wherein the registration instruction is used for indicating second equipment to register to the first equipment; if the registration count value of the local device meets a preset value, sending a first response message to the first device, so that the first device determines a numerical value updating instruction sent to a plurality of second devices according to the receiving number of the first response message, wherein the numerical value updating instruction is used for indicating part or all of the second devices to update respective registration count values; receiving a numerical value updating instruction sent by first equipment; and if the updated registration count value or the non-updated registration count value meets the preset value, sending a second response message to the first equipment, so that the first equipment determines whether second equipment meeting the registration condition exists according to the receiving quantity of the second response message.
According to the device registration method provided by the application, in the registration process of the second device to the first device, the second device with the registration count value meeting the preset value sends the response message to the first device, and the first device controls the registration count value of the second device by sending the numerical value updating instruction according to the receiving quantity of the first response message, so that the receiving quantity of the second response message sent by the second device meets the preset condition, and the registration of the second device is completed. Therefore, the first equipment and the second equipment are interacted and control the registration count value, active registration of the second equipment to the first equipment is achieved, manual participation is not needed, and simple and efficient equipment registration is achieved.
In a possible implementation manner, the value updating instruction includes a first value updating instruction determined by the first device when the number of received first response messages is greater than a first received amount threshold, and the first value updating instruction is used for instructing the second devices whose registration count values satisfy the preset values to update the respective registration count values. After receiving the value update instruction sent by the first device, the device registration method provided by the present application may further include: and if the local registration count value meets the preset value, updating the local registration count value based on the first numerical value updating instruction. When the receiving quantity of the first response messages is overlarge, the register count value of the second equipment of which the register count value meets the preset value is updated through the first updating instruction, the quantity of the second equipment of which the register count value meets the preset value is reduced, and the probability of successful registration of the second equipment by sending the second response messages is improved.
In another possible implementation manner, the value updating instruction includes a second value updating instruction determined by the first device when the number of received first reply messages is smaller than the first received amount threshold, and the second value updating instruction is used for instructing the second devices whose registration count values do not satisfy the preset values to update the respective registration count values. After receiving the value update instruction sent by the first device, the device registration method provided by the present application may further include: and if the local registration count value does not meet the preset value, updating the local registration count value based on the second numerical value updating instruction. When the receiving quantity of the first response messages is too small, the register count value of the second equipment of which the register count value does not meet the preset value is updated through a second updating instruction, the quantity of the second equipment of which the register count value meets the preset value is increased, and the probability of successful registration of the second equipment by sending the second response messages is improved.
In another possible implementation manner, the value updating instruction includes a first value updating instruction that is determined by the first device based on the number of times that the data transmission bus between the first device and the second device is in the congestion state when the number of receptions of the first reply message is greater than the first reception amount threshold, where the number of times that the data transmission bus is in the congestion state is statistically obtained based on the number of receptions of the first reply message. And determining different first value updating instructions according to different times of the data transmission bus in the congestion state so as to reduce the number of the second devices with the registration count values meeting the preset values to different degrees and improve the probability of successful registration of the second devices by sending the second response message.
In another possible implementation manner, the value updating instruction includes a second value updating instruction that is determined by the first device based on the number of times that the data transmission bus between the first device and the second device is in the idle state when the number of received first response messages is smaller than the first received amount threshold, where the number of times that the data transmission bus is in the idle state is obtained based on statistics of the number of received first response messages. And determining different second numerical value updating instructions according to different times of idle states of the data transmission bus, so as to increase the number of the second devices with the registration count values meeting the preset values to different degrees and improve the probability of successful registration of the second devices by sending second response messages.
In another possible implementation manner, the first value update instruction includes: the first equipment determines a first updating sub-instruction under the condition that the receiving quantity of the first response messages is larger than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold value, wherein the first updating sub-instruction is used for indicating second equipment of which the registration count value meets a preset value to randomly update the registration count value; alternatively, the first value update instruction includes: and the first equipment determines a third updating sub-instruction under the condition that the receiving quantity of the first response messages is greater than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, wherein the third updating sub-instruction is used for indicating second equipment with registration count values meeting preset values to update the respective registration count values to be N times of the current values and then adding a random number, and N is an integer not zero. The number of times that the data transmission bus is in a congestion state is smaller than the first time threshold, which indicates that the congestion degree of the data transmission bus is not large, and the registration count value of the second device of which the registration count value meets the preset value can be finely adjusted through the first updating sub-instruction, so that the number of the second devices of which the registration count value meets the preset value can be reduced in a small range; the number of times that the data transmission bus is in the congestion state is greater than or equal to the first time threshold, which indicates that the congestion degree of the data transmission bus is serious, and the register count value of the second device meeting the register count value and meeting the preset value can be greatly updated through the third update sub-instruction, so that the number of the second devices meeting the preset value and the register count value can be greatly reduced.
In another possible implementation manner, the second value updating instruction includes: the first equipment determines a second updating sub-instruction under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value and the number of times that the data transmission bus is in an idle state is smaller than a second time threshold value, wherein the second updating sub-instruction is used for indicating second equipment of which the registration count value does not meet the preset value to randomly update the registration count value; alternatively, the second numerical update instruction may include: and under the condition that the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is larger than or equal to the second number threshold value, the first device determines a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second devices of which the registration count values do not meet the preset value to update the respective registration count values to numerical values obtained by rounding the quotient of the current values and N, and N is an integer not zero. The number of times that the data transmission bus is in the idle state is smaller than the second secondary threshold, which indicates that the idle degree of the data transmission bus is not large, and the registration count value of the second device of which the registration count value meets the preset value can be finely adjusted through the second updating sub-instruction, so that the number of the second devices of which the registration count value meets the preset value is increased in a small range; the number of times that the data transmission bus is in the idle state is greater than or equal to the second time threshold, which indicates that the idle degree of the data transmission bus is serious, and the register count value of the second device meeting the register count value and meeting the preset value can be greatly updated through the fourth update sub-instruction, so that the number of the second devices meeting the register count value and the preset value can be greatly increased.
In another possible implementation manner, the first response message or the second response message includes device information of the second device, so that the first device detects the device information, and determines the number of receptions of the first response message or the second response message based on the detection result.
In another possible implementation manner, the device registration method provided by the present application may further include: and receiving a prompt message sent by the first equipment, wherein the prompt message is sent after the first equipment completes the registration operation of the local equipment. At this point, the registration of the local computer is completed.
In a third aspect, an apparatus for registering a device, the apparatus being deployed in a first device, may include: the device comprises a sending unit, a first determining unit, a second determining unit and a third determining unit. Wherein:
the sending unit is configured to send a registration instruction to the plurality of second devices, where the registration instruction is used to instruct the second devices to register with the first device.
The first determining unit is configured to determine a receiving number of first response messages sent by a plurality of second devices, where the first response messages are generated and sent by the second devices when the registration count value satisfies a preset value, and a value of the registration count value is used by the second devices to determine whether to send the response messages to the first devices.
The second determining unit is configured to determine, according to the number of received first response messages, a value update instruction to be sent to the second device, where the value update instruction is used to instruct part or all of the second devices to update their respective registration count values.
The first determining unit is further configured to determine a reception number of second response messages sent by the plurality of second devices, where the second response messages are generated and sent by the second devices when the updated registration count value or the non-updated registration count value satisfies a preset value.
The third determining unit is configured to determine whether there is a second device that satisfies the registration condition according to the number of receptions of the second response messages sent by the plurality of second devices determined by the first determining unit.
It should be noted that, the device registration apparatus provided in the third aspect is configured to execute the device registration method provided in the first aspect or any one of the possible implementations of the first aspect, and specific implementation of the first aspect or any one of the possible implementations of the first aspect may refer to specific implementation of the first aspect or any one of the possible implementations of the first aspect, and details are not described here again.
In a fourth aspect, another apparatus for registering a device is provided, where the apparatus is deployed in a second device, and the apparatus may include: a receiving unit and a transmitting unit. Wherein:
the receiving unit is used for receiving a registration instruction sent by the first device, wherein the registration instruction is used for indicating the second device to register with the first device.
And the sending unit is used for sending a first response message to the first equipment if the registration count value of the local equipment meets a preset value, so that the first equipment determines a numerical value updating instruction sent to the plurality of second equipment according to the receiving number of the first response message, and the numerical value updating instruction is used for indicating part or all of the second equipment to update respective registration count values.
The receiving unit is further configured to receive a value update instruction sent by the first device.
The sending unit is further configured to send a second response message to the first device if the updated registration count value or the non-updated registration count value of the local computer meets a preset value, so that the first device determines whether a second device meeting the registration condition exists according to the receiving number of the second response message.
It should be noted that, the device registration apparatus provided in the fourth aspect is configured to execute the device registration method provided in the second aspect or any possible implementation manner thereof, and specific implementation may refer to specific implementation of the second aspect or any possible implementation manner thereof, and is not described herein again.
In a fifth aspect, the present application provides a computer device, which may implement the functions in the method examples described in any of the first to second aspects, where the functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software comprises one or more modules corresponding to the functions. The computer device may be in the form of a chip product.
In one possible implementation, the computer device includes a processor and a transceiver in the structure, and the processor is configured to support the computer device to execute the corresponding functions of the method. The transceiver is used to support communication between the computer device and other devices. The computer device may also include a memory for coupling with the processor that retains program instructions and data necessary for the computer device.
In a sixth aspect, a device registration system is provided that includes a first device and a second device. The first device is configured to execute the device registration method provided by the first aspect or any possible implementation manner of the first aspect; the second device is configured to execute the device registration method provided by the second aspect or any possible implementation manner thereof.
In a seventh aspect, a computer-readable storage medium is provided, which includes computer instructions, when executed on a computer, cause the computer to perform the device registration method provided in the first aspect to the second aspect or any possible implementation manner thereof.
In an eighth aspect, a computer program product containing instructions is provided, which when run on a computer, causes the computer to perform the device registration method provided in the first aspect to the second aspect or any possible implementation manner thereof.
In a ninth aspect, the present application provides a chip system, which includes a processor and may further include a memory, and is configured to implement corresponding functions in the foregoing method. The chip system may be formed by a chip, and may also include a chip and other discrete devices.
It should be noted that, all possible implementation manners of any one of the above aspects may be combined without departing from the scope of the claims.
Drawings
Fig. 1 is a schematic structural diagram of a computer network according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a device registration method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another device registration method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another device registration method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another device registration method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus registration device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another device registration apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another device registration apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of another device registration apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device registration system according to an embodiment of the present application.
Detailed Description
In the embodiments of the present application, for convenience of clearly describing the technical solutions of the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance. The technical features described in the first and second descriptions have no sequence or magnitude order.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion for ease of understanding.
In the embodiments of the present application, at least one may also be described as one or more, and a plurality may be two, three, four or more, which is not limited in the present application.
The device registration method provided by the embodiment of the application can be applied to the computer network illustrated in fig. 1. As shown in fig. 1, the computer network provided by the embodiment of the present application includes a first device 101 and a plurality of second devices 102. The first device 101 and the plurality of second devices 102 are connected by a data transmission bus.
The first device 101 is a device having a management authority, and the first device 101 centrally manages the second device 102.
Specifically, in a human-computer interaction interface of the first device 101, an "automatic registration" function (for example, configured as a key or a button function) may be configured, and after the first device 101 is powered on and an administrator clicks the "automatic registration", the first device 101 and the second device 102 execute the scheme provided by the present application to implement automatic registration of the second device 102 with the first device 101. After all the second devices 102 complete the registration of the first device 101, the first device 101 may obtain the device information of each second device 102, poll each second device 102 according to the device information of each first device 102, obtain the report information of the second device 102, and execute the subsequent corresponding processing.
For example, the first device 101 may be a master device in a master-slave architecture, and the second device 102 may be a slave device in the master-slave architecture.
For example, the first device 101 and the second device 102 may be connected via a 485 bus.
For example, the computer network illustrated in fig. 1 may be an intelligent fire protection system, the first device 101 may be an electricity-consuming host device, and the second device 102 may be a plurality of identical or different fire protection detection devices (or called "electricity-consuming sprites"), which may monitor branch voltages, currents, temperatures, and other state quantities of the electricity-consuming system in real time.
The hardware structures of the first device 101 and the second device 102 may be the same or different, and for example, both may include elements included in the computer device shown in fig. 2. The hardware structures of the first device 101 and the second device 102 will be described below by taking the computer device shown in fig. 2 as an example.
As shown in fig. 2, the computer device 20 may include a processor 201, a memory 202, a transceiver 203.
The following describes the various components of the computer device 20 in detail with reference to fig. 2:
the memory 202 may be a volatile memory (volatile memory), such as a random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, for storing application program code, configuration files, data information, or other content that may implement the methods of the present application.
The transceiver 203 is used for information interaction of the computer device 20 with other devices. The transceiver 203 may be a communication port, or may be a transceiving circuit or a communication interface, etc. Alternatively, the communication interface may be configured to communicate with another device through the element having the transmission/reception function. The above-mentioned elements with transceiving functions may be implemented by antennas and/or radio frequency devices.
The processor 201 may be the control center of the computer device 20. For example, the processor 201 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, such as: one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 201 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
The processor 201 can implement the device registration method provided by the following embodiments of the present application by running or executing the software programs and/or modules stored in the memory 202.
The embodiment of the application provides a device registration method, which is used for automatically registering a second device to a first device in a computer system in which the first device is connected with a plurality of second devices. The second device is configured with a registration count value (hereinafter referred to as a Q value), a value of the registration count value is used for the second device to determine whether to send the response message to the first device, and the second device whose registration count value satisfies a preset value may send the response message to the first device. It should be noted that the process of registering each second device with the first device, or the process of processing registration of each second device by the first device, is the same, and the second device described in the following embodiments of the present application may be each second device that is connected to the first device and has not been successfully registered currently.
Fig. 3 is a flowchart of a device registration method provided in the present application, where the method may be applied to a first device, and may be specifically executed by a device registration apparatus deployed on the first device. As shown in fig. 3, the method may include:
s301, the first device sends a registration instruction to the plurality of second devices.
For example, in S301, the first device may broadcast the registration instruction to the plurality of second devices, or may also send the registration instruction to the plurality of second devices in another manner, and the embodiment of the present application is not limited to the manner in which the first device sends the registration instruction.
In S301, the first device may send a registration instruction to a plurality of second devices that are not currently registered. Alternatively, in S301, the first device may send a registration instruction to the second device connected thereto, and the second device that has completed registration ignores the registration instruction, which is equivalent to the first device sending a registration instruction to a plurality of second devices that are not currently registered.
In a possible implementation manner, the first device may perform S301 after being powered on, so as to start a registration procedure of the second device connected thereto.
In one possible implementation, the registration instruction may be used to instruct the second device that receives the registration instruction to update its registration count value to an initial value.
Wherein the initial value may be 0. Of course, the initial value may be other values, which is not particularly limited in the embodiment of the present application.
In another possible implementation manner, the registration instruction may include a re-registration instruction sent by the first device to the second device that has not been successfully registered when the second device that satisfies the registration condition exists.
For example, the registration condition may be that the first device may successfully acquire device information of the second device, where the device information is used to complete registration of the second device with the first device.
In a possible implementation manner, the re-registration instruction is used to instruct the remaining unregistered second devices to update the registration count value and register with the first device, for example, may be used to instruct the second device that receives the re-registration instruction to decrease its registration count value by a first preset step. The first predetermined step may be 1 or other values, which is not limited in the embodiments of the present application.
The device information of the second device may be address information or unique serial number of the second device, which has an identification function.
In one possible implementation, a congestion flag bit for indicating that the data transmission bus is in a congestion state may be set in the first device, and the congestion flag bit is used to record the number of times the data transmission bus is congested.
In one possible implementation, the first device may increment the congestion flag by 1 each time it detects congestion on the data transfer bus.
In another possible implementation manner, the congestion flag may be set to an initial value each time the first device sends the re-registration instruction.
The data transmission bus is used for transmitting interaction data between the first device and the second device, including but not limited to a response message, a device authentication identifier and the like. The content of the data transfer bus transfer is not limited in the present application.
The congestion state of the data transfer bus means a state in which a large amount of information is transferred through the data transfer bus and is transmitted by M or more devices, and the information cannot be successfully received. M may be determined based on the capabilities of the data transfer bus. For example, on the 485 bus, M may be determined to be 2.
For example, the initial value of the congestion flag may be 0 or other values, which is not limited in the embodiments of the present application. The first device may set the congestion flag to an initial value after powering on or after sending a first registration instruction.
In a possible implementation manner, an idle flag bit may be set in the first device, and the idle flag bit is used for recording the number of times that the data transmission bus is idle.
In one possible implementation, the first device may increment the idle flag by 1 each time it detects that the data transfer bus is idle.
In another possible implementation manner, after the first device sends the re-registration instruction each time, the idle flag may be set to an initial value.
For example, the initial value of the idle flag may be 0 or other values, which is not limited in the embodiments of the present application. After the first device is powered on or sends a first registration request, the idle flag may be set to an initial value.
The data transmission bus is in an idle state, which may be a state where the second device does not send the interactive data to the first device, and it may be considered that the interactive data is not transmitted in the data transmission bus.
S302, the first device determines the receiving number of the first response messages sent by the plurality of second devices.
And the first response message is generated and sent by the second equipment under the condition that the registration count value meets a preset value.
For example, the first reply message may include device information of the second device, such that the first device detects the device information and determines the number of receptions of the first reply message based on the detection result.
Further, the first reply message may further include check mode indication information for indicating a check mode of the transmitted device information.
For example, the check method may be a Cyclic Redundancy Check (CRC) 16.
Specifically, in S302, the first device may receive the number of the first response messages sent by the second device within a preset time length after the registration request is sent.
When the first reply message includes the device information of the second device, the first device determines, in S302, the number of received first reply messages sent by the plurality of second devices, which may specifically be implemented as: detecting device information in first response messages sent by a plurality of second devices; and determining the receiving quantity of the first response messages sent by the plurality of second devices according to the detection result.
For example, the first device successfully detects the device information in the first reply message, and determines that the number of received first reply messages sent by the plurality of second devices is 1; or the first device fails to detect the device information in the first reply message, and determines that the number of the first reply messages sent by the plurality of second devices is not 1.
S303, the first equipment determines a numerical value updating instruction sent to the second equipment according to the receiving quantity of the first response messages.
Specifically, in S303, the first device determines a value update instruction to be sent to the second device and sends the determined value update instruction.
In a possible implementation manner, in S306, the first device determines, according to the number of received first response messages, a value update instruction to be sent to the second device, which may specifically be implemented as: if the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; alternatively, if the number of receptions of the first reply message is less than the first reception amount threshold, a second value update instruction to be transmitted to the second device is determined. The first numerical value updating instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value, and the second numerical value updating instruction is used for indicating the second equipment with the registration count value not meeting the preset value to update the respective registration count value.
The first receiving amount threshold may be 1 or another value, which is not limited in this embodiment of the application and may be determined according to a computing capability supported by the first device.
It should be noted that, for the specific implementation of the first device determining the first numerical value update instruction and the second numerical value update instruction according to the number of received first response messages, this is not limited in the embodiment of the present application.
Further, after S302, the method provided in the embodiment of the present application may further include: and the first equipment counts the times of the data transmission bus in the congestion state according to the receiving quantity of the first response messages.
For example, the first device may count the number of times the data transfer bus is in a congested state according to the number of receptions of the first reply message when the number of receptions of the first reply message is greater than a first reception amount threshold.
Specifically, in S302, the first device may count the number of times that the data transmission bus is in the congestion state according to the recorded congestion flag of the number of times that the data transmission bus is in the congestion state.
After counting the number of times that the data transmission bus is in a congestion state, if the number of received first response messages is the first received amount threshold in S303, determining a first numerical value update instruction sent to the second device, which may specifically be implemented as: and if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in a congestion state.
It should be noted that, for the first device, the specific implementation of the first value update instruction is determined according to the number of times that the data transmission bus is in the congestion state, which is not limited in the embodiment of the present application.
In one possible implementation manner, the determining, by the first device, the first value update instruction to be sent to the second device according to the number of times that the data transmission bus is in the congestion state includes: and if the number of times that the data transmission bus is in the congestion state is less than the first time threshold value, determining a first updating sub-instruction sent to the second equipment, wherein the first updating sub-instruction is used for indicating the second equipment with the registration count value meeting the preset value to randomly update the registration count value. Or, if the number of times that the data transmission bus is in the congestion state is greater than or equal to the first time threshold, determining a third update sub-instruction sent to the second device, where the third update sub-instruction is used to instruct the second devices whose registration count values meet the preset value to update their respective registration count values to N times of the current value, and then add a random number, where N is an integer not zero.
Illustratively, N may be 2.
Illustratively, the first count threshold may be 3. Of course, the value of the first time threshold may also be configured according to actual requirements, which is not limited in this embodiment of the present application.
In another possible implementation manner, the third updating sub-instruction is further configured to instruct the second devices whose registration count values do not satisfy the preset value to update their respective registration count values to N times of the current value, and then add a random number.
The register count value is randomly updated, and the register count value may be updated to 1-bit random number 0 or 1. Of course, the specific implementation of the random update may be configured according to actual requirements, which is not limited in this embodiment of the application.
Further, after S302, the method provided in the embodiment of the present application may further include: and the first equipment counts the times of the data transmission bus in the idle state according to the receiving quantity of the first response messages.
For example, the first device may count the number of times the data transfer bus is in the idle state according to the number of receptions of the first reply message when the number of receptions of the first reply message is less than the first reception amount threshold.
Specifically, the first device may count the number of times that the data transmission bus is in the idle state according to the idle flag of the recorded number of times that the data transmission bus is in the idle state.
After the first device counts the number of times that the data transmission bus is in the idle state, if the number of received first response messages is smaller than the first received quantity threshold in S303, the second value update instruction sent to the second device is determined, which may specifically be implemented as: and if the receiving quantity of the first response messages is less than the first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in the idle state.
It should be noted that, for a specific implementation that the first device determines the second value update instruction according to the number of times that the data transmission bus is in the idle state, this is not limited in this embodiment of the application.
In one possible implementation manner, the determining, by the first device, the second value update instruction to be sent to the second device according to the number of times that the data transmission bus is in the idle state includes: if the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, determining a second updating sub-instruction sent to the second equipment, wherein the second updating sub-instruction is used for indicating the second equipment of which the register count value does not meet the preset value to randomly update the register count value; or if the number of times that the data transmission bus is in the idle state is greater than or equal to the second time threshold value, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second devices whose registration count values do not satisfy the preset value to update their respective registration count values to a value obtained by rounding a quotient of the current value and N, where N is an integer that is not zero.
Illustratively, the second count threshold may be 4. Of course, the value of the second-time threshold may also be configured according to actual requirements, which is not limited in this embodiment of the present application.
In another possible implementation manner, the fourth updating sub-instruction is further configured to instruct the second devices whose registration count values satisfy the preset value to update the respective registration count values to values obtained by rounding a quotient of the current value and N.
In another possible implementation manner, if the number of times that the data transmission bus is in the idle state is less than the second time threshold, determining a second update sub-instruction to be sent to the second device includes: if the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, and the last numerical value updating instruction sent by the first device is a random updating instruction (for example, a first updating sub-instruction or a second updating sub-instruction), determining a second updating sub-instruction sent to the second device; or if the number of times that the data transmission bus is in the idle state is less than the second time threshold value, and the last numerical value updating instruction sent by the first device is not the first updating sub-instruction or the second updating sub-instruction, determining a re-registration instruction sent to the second device, wherein the re-registration instruction is used for indicating the second device to register with the first device.
Further, if the number of received first reply messages determined by the first device in S302 is equal to the first received amount threshold, then there is a second device that meets the registration condition, and then the first device may complete the registration operation of the second device that meets the registration condition, and send a prompt message to the second device that meets the registration condition. The prompt message is used for notifying the second device that the registration is successful.
The specific content of the registration condition may be configured according to actual requirements, which is not limited in this embodiment of the application.
For example, it may be determined that the registration condition may be that the number of receptions of the second response message is X, where X is the maximum number of information transmissions supported by the data transmission bus between the first device and the second device.
For example, X may be 1.
S304, the first device determines the receiving number of the second response messages sent by the plurality of second devices.
And the second response message is generated and sent by the second device under the condition that the updated registration count value or the non-updated registration count value meets the preset value.
For example, the second response message may include device information of the second device, so that the first device detects the device information and determines the number of receptions of the second response message based on the detection result.
Further, the second response message may further include check mode indication information for indicating a check mode of the sent device information.
It should be noted that, the first device determines the number of received second response messages sent by the multiple second devices in S304, which may refer to a specific implementation that the first device determines the number of received first response messages sent by the multiple second devices in S302, and details are not described here again.
Illustratively, the second response message includes device information of the second device, and the determining, by the first device, the number of receptions of the second response messages sent by the plurality of second devices in S304 includes: detecting the equipment information in the second response messages sent by the plurality of second equipment; and determining the receiving quantity of the second response messages sent by the plurality of second devices according to the detection result.
For example, the first device successfully detects the device information in the second response message, and determines that the number of received second response messages sent by the plurality of second devices is 1; or the first device fails to detect the device information in the second response message, and determines that the number of the second response messages sent by the plurality of second devices is not 1.
S305, the first device determines whether the second devices meeting the registration condition exist according to the receiving number of the second response messages sent by the plurality of second devices.
According to the device registration method provided by the application, in the registration process of the second device to the first device, the second device with the registration count value meeting the preset value sends the response message to the first device, and the first device controls the registration count value of the second device by sending the numerical value updating instruction according to the receiving quantity of the first response message, so that the receiving quantity of the second response message sent by the second device meets the preset condition, and the registration of the second device is completed. Therefore, the first equipment and the second equipment are interacted and control the registration count value, active registration of the second equipment to the first equipment is achieved, manual participation is not needed, and simple and efficient equipment registration is achieved.
Fig. 4 is a flowchart of another device registration method provided in the present application, which may be applied to a second device and specifically may be executed by a device registration apparatus deployed on the second device. As shown in fig. 4, the method may include:
as shown in fig. 4, the device registration method provided by the present application may include:
s401, the second equipment receives a registration instruction sent by the first equipment.
The registration instruction received by the second device may be the registration instruction sent by the first device in S301. The sending timing and content of the registration command are described in detail in S301, and are not described herein again.
After receiving the registration instruction in S401, the second device executes S402.
S402, if the register count value of the local device meets a preset value, the second device sends a first response message to the first device.
The second equipment sends the first response message to the first equipment, so that the first equipment determines the numerical value updating instructions sent to the plurality of second equipment according to the receiving number of the first response messages.
Wherein the first reply message may include device information of the second device, such that the first device detects the device information and determines the number of receptions of the first reply message based on the detection result.
Further, the first reply message may further include check mode indication information for indicating a check mode of the transmitted device information.
For example, the check may be CRC 16.
And S403, the second device receives the numerical value updating instruction sent by the first device.
It should be noted that the value update instruction received by the second device in S403 is the value update instruction sent by the first device in S303.
After S403, the second device determines whether to update its own registration count value according to the function of the value update instruction, which may specifically include any of the following cases:
in case 1, the value updating instruction includes a first value updating instruction determined by the first device when the number of received first response messages is greater than a first received amount threshold, where the first value updating instruction is used to instruct the second devices whose registration count values meet a preset value to update their respective registration count values; after the second device receives the value update instruction sent by the first device, the method provided by the application may further include: and if the local registration count value meets the preset value, updating the local registration count value based on the first numerical value updating instruction.
In a possible implementation manner, in case 1, the value updating instruction may further include a first value updating instruction that is determined by the first device based on the number of times that the data transmission bus between the first device and the second device is in a congested state in a case where the number of receptions of the first reply message is greater than the first reception amount threshold. The number of times the data transfer bus is in a congested state is counted based on the number of receptions of the first reply message.
In one possible implementation, the first value update instruction may include: and the first equipment determines a first updating sub-instruction under the condition that the receiving quantity of the first response messages is greater than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is less than a first time threshold value, wherein the first updating sub-instruction is used for indicating the second equipment of which the registration count value meets a preset value to randomly update the registration count value. Alternatively, the first value update instruction includes: and the first equipment determines a third updating sub-instruction under the condition that the receiving quantity of the first response messages is greater than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, wherein the third updating sub-instruction is used for indicating second equipment with registration count values meeting preset values to update the respective registration count values to be N times of the current values and then adding a random number, and N is an integer not zero.
And 2, the value updating instruction comprises a second value updating instruction which is determined by the first device under the condition that the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value, and the second value updating instruction is used for indicating the second devices of which the registration count values do not meet the preset value to update the respective registration count values. After the second device receives the value update instruction sent by the first device, the method provided by the application may further include: and if the local registration count value does not meet the preset value, updating the local registration count value based on the second numerical value updating instruction.
In a possible implementation manner, in case 2, the value updating instruction may further include a second value updating instruction that is determined by the first device based on the number of times that the data transmission bus between the first device and the second device is in the idle state when the number of the received first reply messages is smaller than the first received amount threshold, where the number of times that the data transmission bus is in the idle state is counted based on the number of the received first reply messages.
In one possible implementation, the second numerical update instruction may include: and under the condition that the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is smaller than the second time threshold value, the first device determines a second updating sub-instruction, wherein the second updating sub-instruction is used for indicating the second device of which the registration count value does not meet the preset value to randomly update the registration count value. Alternatively, the second value update instruction comprises: and under the condition that the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is larger than or equal to the second number threshold value, the first device determines a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second devices of which the registration count values do not meet the preset value to update the respective registration count values to numerical values obtained by rounding the quotient of the current values and N, and N is an integer not zero.
After receiving the value update instruction sent by the first device in S403, the second device updates or does not update its own registration count value according to the value update instruction, and then executes S404.
S404, if the updated register count value or the non-updated register count value of the local computer meets the preset value, a second response message is sent to the first device.
And the second equipment sends a second response message to the first equipment, so that the first equipment determines whether the second equipment meeting the registration condition exists according to the receiving number of the second response message.
The second response message may include device information of the second device, so that the first device detects the device information and determines the number of receptions of the second response message based on a detection result.
Further, the second response message may further include check mode indication information for indicating a check mode of the sent device information.
According to the device registration method provided by the application, in the registration process of the second device to the first device, the second device with the registration count value meeting the preset value sends the response message to the first device, and the first device controls the registration count value of the second device by sending the numerical value updating instruction according to the receiving quantity of the first response message, so that the receiving quantity of the second response message sent by the second device meets the preset condition, and the registration of the second device is completed. Therefore, the first equipment and the second equipment are interacted and control the registration count value, active registration of the second equipment to the first equipment is achieved, manual participation is not needed, and simple and efficient equipment registration is achieved.
The device registration method provided by the present application is described below by taking an interaction process between a first device and a second device as an example. As shown in fig. 5, the device registration method may include:
s501, the first device sends a registration instruction to the plurality of second devices.
It should be noted that the specific implementation of S501 is the same as S301, and the details are not repeated here
S502, the second equipment receives the registration instruction sent by the first equipment.
The registration instruction received by the second device is the registration instruction sent by the first device in S501. The sending timing and content of the registration command are described in detail in S501, and are not described here again.
After receiving the registration instruction in S502, the second device executes S503.
S503, the second device judges whether the registration count value of the local device meets a preset value.
Specifically, after the second device receives the registration instruction, if the received instruction instructs the second device to update its registration count value, the second device updates the registration count value of the second device first, and in S503, determines whether the updated registration count value satisfies the preset value. Or, after receiving the registration instruction, if the received instruction does not instruct the second device to update its registration count value, the second device determines in S503 whether the non-updated registration count value satisfies the preset value.
For example, if the second device receives the first registration instruction sent by the first device when powering on in S502, the registration count value may be updated to the initial value.
For example, if the second device receives a re-registration instruction sent by the first device in S502, the registration count value may be updated to be decreased by a first preset step.
The preset value may be 0 or other values, and may be configured according to actual requirements, which is not limited in this embodiment of the application.
Optionally, if the second device determines that the registration count value of the second device meets the preset value in S503, S504 is executed, otherwise, the next instruction sent by the first device is waited to be received.
S504, if the registration count value of the local device meets the preset value, the second device sends a first response message to the first device.
It should be noted that the specific implementation of S504 is the same as S402, and is not described here again.
And S505, the first device determines the receiving number of the first response messages sent by the plurality of second devices.
And the first response message is generated and sent by the second equipment under the condition that the registration count value meets a preset value.
It should be noted that the specific implementation of S505 is the same as S302, and is not described here again.
S506, the first equipment determines a numerical value updating instruction sent to the second equipment according to the receiving quantity of the first response messages.
It should be noted that the specific implementation of S506 is the same as S303, and is not described herein again.
And S507, the second equipment receives the numerical value updating instruction sent by the first equipment.
It should be noted that the value update instruction received by the second device in S507 is the value update instruction sent by the first device in S506.
After S507, the second device determines whether to update its own registration count value according to the function of the value update instruction, which is the same as S403 in specific implementation and is not described here again.
And S508, the second device judges whether the updated registration count value or the non-updated registration count value of the local device meets a preset value.
Specifically, after receiving the value update instruction, the second device updates the registration count value of the second device if the received instruction instructs the second device to update the registration count value, and in S508, determines whether the updated registration count value satisfies the preset value. Or, after receiving the value updating instruction, if the received instruction does not instruct the second device to update its registration count value, the second device determines in S508 whether the non-updated registration count value meets the preset value.
Optionally, in S508, if the second device determines that the updated registration count value or the non-updated registration count value of the local device meets the preset value, S509 is executed, otherwise, the next instruction sent by the first device is waited to be received.
And S509, if the updated registration count value or the non-updated registration count value of the local device meets a preset value, sending a second response message to the first device.
And the second equipment sends a second response message to the first equipment, so that the first equipment determines whether the second equipment meeting the registration condition exists according to the receiving number of the second response message.
And S510, the first equipment determines the receiving quantity of the second response messages sent by the plurality of second equipment.
And the second response message is generated and sent by the second device under the condition that the updated registration count value or the non-updated registration count value meets the preset value.
It should be noted that the specific implementation of S510 is the same as S304, and is not described herein again.
S511, the first device determines whether there is a second device that satisfies the registration condition according to the number of received second response messages sent by the plurality of second devices.
Further, the device registration method provided by the present application may further include: and if the second equipment meeting the registration condition exists, sending a prompt message to the second equipment after the registration operation of the second equipment meeting the registration condition is completed. And the second equipment receives the prompt message sent by the first equipment.
The prompt message is sent by the first device after the registration operation of the first device is completed, and the prompt message is used for notifying the second device meeting the registration condition that the registration is successful.
In a possible implementation manner, after the second device receives the prompt message, the subsequently received registration-related instructions (the registration instruction and the value update instruction) are ignored and not processed.
Specifically, completing the registration of the second device may include recording device information of the second device to ensure successful communication with the second device that satisfies the registration condition.
Further, after sending the prompt message to the second device, the device registration method provided in the embodiment of the present application may further include: the first device sends a re-registration instruction to the second device, and the second device which is not successfully registered is indicated to register with the first device.
Further, the device registration method provided by the present application may further include: and if the second equipment meeting the registration condition does not exist, the first equipment determines a numerical value updating instruction sent to the second equipment according to the receiving quantity of the second response messages.
It should be noted that, the first device determines, according to the received number of the second response messages, a specific implementation of the value update instruction sent to the second device, which may refer to the specific implementation of S303, and details are not described here.
According to the device registration method provided by the application, in the registration process of the second device to the first device, the second device with the registration count value meeting the preset value sends the response message to the first device, and the first device controls the registration count value of the second device by sending the numerical value updating instruction according to the receiving quantity of the first response message, so that the receiving quantity of the second response message sent by the second device meets the preset condition, and the registration of the second device is completed. Therefore, the first equipment and the second equipment are interacted and control the registration count value, active registration of the second equipment to the first equipment is achieved, manual participation is not needed, and simple and efficient equipment registration is achieved.
In a possible implementation manner, the first device may set an end flag, where an initial value of the end flag is X, and X is an integer greater than 1, and when the end flag is smaller than 0, the registration procedure is ended. When determining that the data transmission bus is idle, the first device may first determine whether the end flag bit is less than 0, if the end flag bit is less than 0, it indicates that all the second devices have completed registration, and may end the registration process, and if the end flag bit is greater than 0, execute the above process to continue registration of the second devices. If the ending flag is equal to 0, ending the registration process or executing the process to continue the registration of the second device may be designed according to actual conditions.
Wherein X may be 2.
In a possible implementation manner, after the first device sends the first value updating instruction, the end flag may be incremented by 1.
In another possible implementation manner, after the first device sends the third update sub-instruction, the end flag bit may be multiplied by N, and then a random number may be added.
In another possible implementation manner, after the first device sends the fourth update sub-instruction, the end flag bit may be updated to a value obtained by rounding a quotient of the current value and N.
In another possible implementation manner, after the first device sends the re-registration instruction, the end flag bit may be decremented by 1.
In another possible implementation manner, a first registration success count value may be set in the first device, and the first registration success count value is incremented by 1 every time the registration of the second device is completed, and when the first registration success count value is equal to the total number of the second devices connected to the first device, the registration process is ended.
In another possible implementation manner, a second registration success count value may be set in the first device, and the second registration success count value is decremented by 1 every time the registration of the second device is completed, and when the second registration success count value is equal to 0, the registration process is ended.
In the following, by taking a specific example that the first device is an electric host device and the second device is a fire detection device, the scheme provided by the present application is described by way of example.
Assuming that the electricity-consuming host device is connected to 6 fire-fighting detection devices as slaves via 485 buses, which are recorded as T0001 to T0006, the automatic registration process of T0001 to T0006 will be described below with reference to the device registration method illustrated in fig. 5. The electric host device is provided with a congestion flag CCN, an idle flag CIN, and an end flag ED (initial value is 2), and is configured such that a congestion threshold (the first-order threshold) is 3 and an idle threshold (the second-order threshold) is 4. As shown in fig. 6, the device registration method may include:
and S601, powering on the electricity utilization host equipment, and sending a first query request on the 485 bus.
After S601 is executed, CCN in the electricity consumption host device is set to an initial value 0, CIN is set to an initial value 0, and ED is set to an initial value 2.
And S602, receiving the first query request on the 485 bus by the fire-fighting detection equipment, setting the Q value of the fire-fighting detection equipment to be 0, and entering a registration state.
After receiving the first query request, the fire detection devices T0001 to T0006 all set their own Q values to 0, and enter a registration state.
S603, the fire fighting detection equipment T0001-T0006 sends a first response message on the 485 bus.
The first reply message sent by each fire detection device includes its own serial number and CRC16 indication information.
And S604, monitoring 485 bus congestion by using the electric host equipment.
Due to the fact that multiple fire-fighting detection devices respond simultaneously, 485 bus data errors can be caused, and 485 bus congestion is monitored when the CRC16 of the monitoring data of the power consumption host device in S604 does not pass through.
After S604 is executed, the CCN in the electrical host device is updated to 1 by adding 1, CIN is set to 0, and ED is set to an initial value 2.
Since CCN is less than congestion threshold 3, the electrical host device executes S605.
And S605, the electric host device sends a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire-fighting detection device with the Q value of 0 randomly updates the registered count value of the fire-fighting detection device.
After S604 is executed, the CCN in the electricity-consuming host device is 1, the CIN is 0, and the ED is updated to 3 by adding 1.
S606, the fire-fighting detection devices T0001-T0006 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire-fighting detection device with the Q value of 0 randomly updates the registration count value of the fire-fighting detection device, and the fire-fighting detection device with the Q value of 0 updates the Q value to be a 1-bit random number.
Assuming that the 1-bit random numbers generated by the fire protection detection devices T0001 to T0006 in S606 are all 1, the Q values of the fire protection detection devices T0001 to T0006 in S606 are all updated to 1, and no second response message is sent by any of the fire protection detection devices T0001 to T0006.
And S607, monitoring 485 bus idle by the electric host equipment.
Due to the fact that no fire-fighting detection device responds, the 485 bus is free, and the electric host device monitors the 485 bus to be free in S604.
After S607 is executed, CCN in the electricity-consuming host device is set to 0, CIN is updated to 1 by adding 1, and ED is set to 3.
Since the CCN is less than the idle threshold 4 and the instruction to randomly update the registration count value is last sent by the electric host device, the electric host device performs S608.
And S608, the electric host device sends a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire-fighting detection device with the Q value of 1 randomly updates the registered count value of the fire-fighting detection device.
And S609, the fire protection detection devices T0001-T0006 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire protection detection device with the Q value of 1 randomly updates the registration count value of the fire protection detection device, and the fire protection detection device with the Q value of 1 updates the Q value to be a 1-bit random number.
Assuming that the 1-bit random numbers generated by the fire detection device T0002 in S609 are all 0, and the 1-bit random numbers generated by the remaining fire detection devices are all 1, the Q values of the fire detection device T0002 in S609 are all updated to 0, the Q values of the remaining fire detection devices are all updated to 1, and the fire detection device T0002 sends a second response message (including the serial number of T0002 and CRC 16).
And S610, receiving a second response message of the fire-fighting detection device T0002 by the electric host device, verifying the CRC correctly, and storing the serial number of the fire-fighting detection device T0002.
And S611, the electricity utilization host device sends an ACK message to the fire-fighting detection device T0002 according to the fire-fighting detection device T0002 serial number.
After the electric host device completes the registration of a certain fire-fighting detection device, an ACK message (equivalent to the aforementioned prompt message) is sent to the fire-fighting detection device. For example, the ACK message is sent in S611 to notify the fire detection device T0002 that the registration is successful.
In S611, the powered host device completes registration of the fire detection device T0002.
And S612, the fire fighting detection equipment T0002 receives the ACK message and finishes the registration.
Wherein, the ACK message is sent by the power consumption host device after the registration operation of the fire protection detection device T0002 is completed.
After S612, the fire fighting detection device T0002 completes registration, and the registration state is ended.
S613, the electricity consumption host device sends a repeat query request.
After S613 is executed, CCN in the electricity-consuming host device is set to an initial value 0, CIN is set to an initial value 0, and ED is updated to 2 by subtracting 1.
And S614, the fire fighting detection devices T0001, T0003, T0004, T0005 and T0006 receive repeated inquiry requests on the 485 bus, and subtract 1 from the self Q value.
After receiving the repeat query request, the fire detection devices T0001, T0003, T0004, T0005 and T0006 all subtract 1 from their own Q values and update them to 0.
S615, the fire fighting detection devices T0001, T0003, T0004, T0005 and T0006 send first response messages on the 485 bus.
The first reply message sent by each fire detection device includes its own serial number and CRC16 indication information.
And S616, monitoring 485 bus congestion by the electric host equipment.
Due to the fact that multiple fire-fighting detection devices respond simultaneously, 485 bus data errors can be caused, and 485 bus congestion is monitored when the CRC16 of the monitoring data of the power consumption host device in S616 does not pass through.
After S616 is executed, CCN in the electrical host device is updated to 1 by adding 1, CIN is set to 0, and ED is set to 2.
Since CCN is less than congestion threshold 3, the powered host device performs S617.
And S617, the electric host device sends a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire-fighting detection device with the Q value of 0 randomly updates the registered count value.
After S617 is executed, the CCN in the power consumption host device is 1, the CIN is set to 0, and the ED is set to 1 and updated to 3.
And S618, the fire detection devices T0001, T0003, T0004, T0005 and T0006 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire detection device with the Q value of 0 randomly updates the registration count value of the fire detection device, and the fire detection device with the Q value of 0 updates the Q value to be a 1-bit random number.
Assuming that the 1-bit random numbers generated by the fire detection devices T0001 and T0006 in S618 are 0 and the 1-bit random numbers generated by the fire detection devices T0003, T0004 and T0005 are 1, the Q values of the fire detection devices T0001 and T0006 in S618 are both updated to 0, the Q values of the fire detection devices T0003, T0004 and T0005 are both updated to 1, and the fire detection devices T0001 and T0006 transmit the second response message.
S619, monitoring 485 bus congestion by the electric host equipment.
Due to the fact that the T0001 and the T0006 fire-fighting detection devices respond simultaneously, 485 bus data errors can be caused, and if the CRC16 of the monitoring data of the electricity-using host device in S619 does not pass, 485 bus congestion is monitored.
After S619 is executed, CCN is updated to 2 by adding 1, CIN is set to 0, and ED remains to 3 in the electrical host device.
Since CCN is less than congestion threshold 3, the powered host device performs S620.
And S620, the electric host equipment sends a numerical value updating instruction which indicates that the fire-fighting detection equipment with the Q value of 0 randomly updates the registered count value of the fire-fighting detection equipment on the 485 bus.
After S620 is executed, the CCN in the electricity-consuming host device is 2, the CIN is 0, and the ED is updated to 4 by adding 1.
And S621, the fire detection devices T0001, T0003, T0004, T0005 and T0006 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire detection device with the Q value of 0 randomly updates the registration count value of the fire detection device, and the fire detection device with the Q value of 0 updates the Q value to a 1-bit random number.
The Q values of T0001 and T0006 are 0, and it is assumed that the 1-bit random number generated by the fire protection detection device T0001 in S621 is 0 and the 1-bit random number generated by T0006 is 1, and therefore, the Q values of the fire protection detection device T0001 in S621 are all updated to 0, the Q value of T0006 is updated to 1, the Q values of T0003, T0004, and T0005 plus 1 are updated to 2, and the fire protection detection device T0001 transmits the second response message.
And S622, the electric host equipment receives the second response message of the fire-fighting detection equipment T0001, the CRC is verified correctly, and the serial number of the fire-fighting detection equipment T0001 is saved.
And S623, the electricity utilization host equipment sends an ACK message to the fire-fighting detection equipment T0001 according to the serial number of the fire-fighting detection equipment T0001.
In S623, the power consumption host device completes registration of the fire detection device T0001.
And S624, the fire fighting detection device T0001 receives the ACK message and finishes the registration.
After S624, the fire detection device T0001 completes registration, and ends the registration state.
And S625, the power consumption host equipment sends a repeated inquiry request.
After S625 is executed, CCN in the electricity-consuming host device is set to an initial value 0, CIN is set to an initial value 0, and ED is decremented by 1 and updated to 3.
And S626, the fire fighting detection devices T0003, T0004, T0005 and T0006 receive repeated inquiry requests on the 485 bus, and subtract 1 from the Q value of the fire fighting detection devices.
After receiving the repeat query request, the fire detection devices T0003, T0004, T0005, and T0006 all subtract 1 from their Q values, update the Q values of T0003, T0004, and T0005 minus 1 to 1, update the Q values of T0006 minus 1 to 0, and send a first response message by the fire detection device T0006.
And S627, receiving the first response message of the fire-fighting detection device T0006 by the electric host device, verifying the CRC correctly, and storing the serial number of the fire-fighting detection device T0006.
And S628, the electricity utilization host device sends an ACK message to the fire-fighting detection device T0006 according to the serial number of the fire-fighting detection device T0006.
S629, the fire fighting detection device T0006 receives the ACK message, and ends the registration.
After S629, the fire detection device T0006 completes registration, ending the registration state.
And S630, the electricity utilization host equipment sends a repeated inquiry request.
After S630 is executed, CCN in the electricity-consuming host device is set to an initial value 0, CIN is set to an initial value 0, and ED is decremented by 1 and updated to 2.
S631, the fire fighting detection devices T0003, T0004 and T0005 receive repeated inquiry requests on the 485 bus and subtract 1 from the Q value of the devices.
The Q values of the fire fighting detection devices T0003, T0004 and T0005 are 1, after receiving the repeated inquiry request, the Q values of the fire fighting detection devices T0003, T0004 and T0005 are all reduced by 1 and updated to be 0, and the fire fighting detection devices T0003, T0004 and T0005 send first response messages on the 485 bus.
And S632, monitoring 485 bus congestion by using the electric host equipment.
Due to the fact that the 3 fire-fighting detection devices respond simultaneously, 485 bus data errors can be caused, and 485 bus congestion is monitored when the power consumption host device monitors that CRC16 of the data does not pass in S632.
After S632 is executed, CCN in the electrical host device is updated to 1 by adding 1, CIN is set to 0, and ED is set to 2.
Since CCN is less than congestion threshold 3, the electrical host device executes S633.
And S633, the electric host equipment sends a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire-fighting detection equipment with the Q value of 0 randomly updates the registered count value of the fire-fighting detection equipment.
After S633, the CCN in the power consumption host device is 1, the CIN is 0, and the ED is updated to 3 by adding 1.
And S634, the fire detection devices T0003, T0004 and T0005 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire detection device with the Q value of 0 randomly updates the registration count value of the fire detection device, and the fire detection device with the Q value of 0 updates the Q value to be a 1-bit random number.
If the Q values of T0003, T0004, and T0005 are 0, and a numerical value update instruction indicating that the fire detection apparatus having a Q value of 0 randomly updates its registration count value is received, it is assumed that the 1-bit random number generated by the fire detection apparatus T0005 in S634 is 0 and the 1-bit random numbers of T0003 and T0004 are 1, and therefore, the Q values of the fire detection apparatus T0005 in S634 are all updated to 0, the Q values of T0003 and T0004 are all updated to 1, and the fire detection apparatus T0005 transmits the second response message.
And S635, receiving the second response message of the fire-fighting detection device T0005 by the electric host device, verifying the CRC correctly, and storing the serial number of the fire-fighting detection device T0005.
And S636, the electricity utilization host equipment sends an ACK message to the fire-fighting detection equipment T0005 according to the fire-fighting detection equipment T0005 serial number.
And S637, receiving the ACK message by the fire-fighting detection equipment T0005, and ending the registration.
After S637, the fire detection device T0005 completes registration, and ends the registration state.
And S638, the electricity utilization host device sends a repeated inquiry request.
After S638 is executed, CCN in the powered host apparatus is set to an initial value 0, CIN is set to an initial value 0, and ED is updated to 2 by subtracting 1.
And S639, receiving the repeated inquiry request by the fire fighting detection devices T0003 and T0004 on the 485 bus, and subtracting 1 from the Q value of the fire fighting detection devices.
After receiving the repeat query request, the fire detection devices T0003 and T0004 all subtract 1 from their Q values, update the Q values of T0003 and T0004 to 0 by subtracting 1, and send first response messages.
And S640, monitoring 485 bus congestion by using the electric host equipment.
Due to the fact that 2 fire-fighting detection devices answer simultaneously, 485 bus data errors can be caused, and 485 bus congestion is monitored when the power consumption host device monitors that CRC16 of the data does not pass in S640.
After S640 is executed, CCN in the electrical host device is updated to 1 by adding 1, CIN is set to 0, and ED is set to 2.
Since CCN is less than congestion threshold 3, the powered host device performs S641.
S641, the electric host device sends a numerical value updating instruction which indicates that the fire-fighting detection device with the Q value of 0 randomly updates the registered count value of the fire-fighting detection device on the 485 bus.
After S641 is executed, the CCN in the powered host device is 1, the CIN is set to 0, and the ED is set to 1 and updated to 3.
S642, the fire fighting detection devices T0003 and T0004 receive a numerical value updating instruction on the 485 bus, wherein the numerical value updating instruction indicates that the fire fighting detection device with the Q value of 0 randomly updates the registration count value of the fire fighting detection device, and the fire fighting detection device with the Q value of 0 updates the Q value to be a 1-bit random number.
When the Q values of T0003 and T0004 are 0, and a value update command is received that instructs the fire detection apparatus having a Q value of 0 to randomly update its registration count value, the Q value of the fire detection apparatus T0003 in S642 is updated to 0 and the Q value of T0004 is updated to 1, and therefore the fire detection apparatus T0003 transmits a second response message, assuming that the 1-bit random number generated by the fire detection apparatus T0003 in S642 is 0 and the 1-bit random number of T0004 is 1.
And S643, the electric host device receives the second response message of the fire protection detection device T0003, the CRC is verified to be correct, and the serial number of the fire protection detection device T0003 is saved.
S644, the electricity utilization host device sends an ACK message to the fire-fighting detection device T0003 according to the serial number of the fire-fighting detection device T0003,
and S645, the fire fighting detection equipment T0003 receives the ACK message and finishes the registration.
After S645, the fire detection device T0003 completes registration, ending the registration state.
And S646, the electricity utilization host equipment sends a repeated inquiry request.
After S646 is executed, CCN in the powered host device is set to an initial value 0, CIN is set to an initial value 0, and ED is decremented by 1 and updated to 2.
S647, the fire fighting detection device T0004 receives the repeated inquiry request on the 485 bus, and subtracts 1 from the Q value of the fire fighting detection device.
After receiving the repeated inquiry request, the fire fighting detection device T0004 subtracts 1 from its Q value and updates the Q value to 0, and the fire fighting detection device T0004 sends a first response message.
S648, the electric host device receives the first response message of the fire-fighting detection device T0004, the CRC is verified correctly, and the serial number of the fire-fighting detection device T0004 is saved.
S649, the electricity utilization host device sends an ACK message to the fire-fighting detection device T0004 according to the serial number of the fire-fighting detection device T0004,
and S650, the fire fighting detection equipment T0004 receives the ACK message and finishes the registration.
After S650, the fire fighting detection device T0004 completes registration, and the registration state is ended.
And S651, the electricity consumption host equipment sends a repeated inquiry request.
After S651 is executed, CCN in the electricity-consuming host device is set to an initial value 0, CIN is set to an initial value 0, and ED is decremented by 1 and updated to 1.
And S652, monitoring 485 bus idle by the electric host equipment.
Due to the fact that no fire-fighting detection device responds, the 485 bus is free, and the electric host device monitors the 485 bus to be free in S652.
After S652 is executed, the CCN in the electricity-consuming host device is set to 0, CIN is updated to 1 by adding 1, and ED is set to 1.
Since CIN is smaller than the idle threshold value and the electricity host apparatus transmitted the last time a numerical update instruction that does not randomly update its registration count value, the electricity host apparatus executes S653.
And S653, the electricity consumption host equipment sends a repeated inquiry request.
After S653 is executed, CCN in the electricity-consuming host device is set to an initial value of 0, CIN is set to an initial value of 0, and ED is updated to 0 by subtracting 1.
And S654, monitoring 485 bus idle by the electric host equipment.
Due to the fact that no fire-fighting detection device responds, the 485 bus is idle, and the 485 bus is monitored to be idle by the electric host device at S654.
After the execution of S654, the electrical host device ED is already 0, and S655 is executed.
And S655, the power utilization host equipment finishes the registration and stores the registration result.
The above description mainly introduces the solutions provided in the embodiments of the present application from the perspective of the working principle of each computer device. It is understood that the computer device comprises hardware structures and/or software modules for performing the functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. 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 embodiment of the present application, functional modules of a device for executing the device registration method provided by the present application may be divided according to the above method examples, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
Fig. 7 shows a schematic structural diagram of a device registration apparatus 70 deployed in the computer device involved in the foregoing embodiment and executing the device registration method provided in this application. The device registration apparatus 70 may be a functional module or a chip. Software and/or hardware implementations may be employed. The device registration apparatus 70 may be deployed at a first device. As shown in fig. 7, the device registration apparatus 70 may include: a transmitting unit 701, a first determining unit 702, a second determining unit 703, and a third determining unit 704. Wherein:
the sending unit 701 is configured to send a registration instruction to the plurality of second devices, where the registration instruction is used to instruct the second devices to register with the first device deployed by the device registration apparatus 70.
The first determining unit 702 is configured to determine a receiving number of first response messages sent by a plurality of second devices, where the first response messages are generated and sent by the second devices when a registration count value satisfies a preset value, and a value of the registration count value is used by the second devices to determine whether to send a response message to the first device.
The second determining unit 703 is configured to determine, according to the number of received first response messages, a value updating instruction to be sent to the second device, where the value updating instruction is used to instruct part or all of the second devices to update their respective registration count values.
The first determining unit 702 is further configured to determine a receiving number of second response messages sent by a plurality of second devices, where the second response messages are generated and sent by the second devices when the updated registration count value or the non-updated registration count value satisfies a preset value.
The third determining unit 704 is configured to determine whether there is a second device that satisfies the registration condition according to the number of receptions of the second response messages sent by the plurality of second devices, which is determined by the first determining unit 702.
Further, the second determining unit 702 may specifically be configured to:
if the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; alternatively, if the number of receptions of the first reply message is less than the first reception amount threshold, a second value update instruction to be transmitted to the second device is determined.
The first numerical value updating instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value, and the second numerical value updating instruction is used for indicating the second equipment with the registration count value not meeting the preset value to update the respective registration count value.
Further, as shown in fig. 8, the device registration apparatus 70 may further include a first counting unit 705 configured to count the number of times the data transmission bus is in the congestion state according to the number of receptions of the first reply message.
Correspondingly, the second determining unit 703 may specifically be configured to: and if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in a congestion state.
Alternatively, as shown in fig. 8, the device registration apparatus 70 may further include a second counting unit 706 configured to count the number of times the data transmission bus is in the idle state according to the number of received first reply messages.
Correspondingly, the second determining unit 703 may specifically be configured to: and if the receiving quantity of the first response messages is less than the first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in the idle state.
In a possible implementation manner, the second determining unit 703 may be specifically configured to:
and if the receiving quantity of the first response messages is greater than the first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is less than the first time threshold value, determining a first updating sub-instruction sent to the second equipment, wherein the first updating sub-instruction is used for indicating the second equipment with the registration count value meeting the preset value to randomly update the registration count value. Or, if the number of received first response messages is greater than the first received amount threshold and the number of times that the data transmission bus is in a congestion state is greater than or equal to the first time threshold, determining a third update sub-instruction sent to the second device, where the third update sub-instruction is used to instruct the second devices whose registration count values meet the preset value to update their respective registration count values to N times of the current value and then add a random number, where N is an integer not zero.
In another possible implementation manner, the second determining unit 703 may be specifically configured to:
and if the receiving quantity of the first response messages is less than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is less than the second time threshold value, determining a second updating sub-instruction sent to the second equipment, wherein the second updating sub-instruction is used for indicating the second equipment of which the registration count value does not meet the preset value to randomly update the registration count value. Or if the receiving number of the first response messages is smaller than the first receiving amount threshold and the number of times that the data transmission bus is in the idle state is larger than or equal to the second number threshold, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second devices whose registration count values do not satisfy the preset value to update their respective registration count values to the values obtained by rounding the quotient of the current value and N, where N is an integer not zero.
Further, the first reply message or the second reply message may include device information of the second device.
Correspondingly, the first determining unit 702 may specifically be configured to:
detecting device information in first response messages sent by a plurality of second devices; and determining the receiving quantity of the first response messages sent by the plurality of second devices according to the detection result.
Or the first determining unit 702 may specifically be configured to:
detecting the equipment information in the second response messages sent by the plurality of second equipment; and determining the receiving quantity of the second response messages sent by the plurality of second devices according to the detection result.
Further, as shown in fig. 8, the device registration apparatus 70 may further include a registration unit 707 configured to complete a registration operation of the second device satisfying the registration condition if there is a second device satisfying the registration condition.
The sending unit 701 may be further configured to send a prompt message to the second device after the registration unit 707 completes the registration operation of the second device that meets the registration condition, where the prompt message is used to notify that the second device is successfully registered.
The device registration apparatus deployed in the first device may execute the device registration method applied to the first device in this embodiment of the present application, and has a functional module and an advantageous effect corresponding to the execution method, which may be referred to in the description of the foregoing embodiment specifically.
Fig. 9 shows a schematic structural diagram of a device registration apparatus 90 deployed in the computer device involved in the foregoing embodiment and executing the device registration method provided in this application. The device registration apparatus 90 may be a functional module or a chip, and may be implemented by software and/or hardware. The device registration apparatus 90 may be deployed at a second device. As shown in fig. 9, the device registration apparatus 90 may include: receiving section 901 and transmitting section 902. Wherein:
the receiving unit 901 is configured to receive a registration instruction sent by a first device, where the registration instruction is used to instruct a second device to register with the first device.
The sending unit 902 is configured to send a first response message to the first device if the local registration count value meets a preset value, so that the first device determines, according to the number of received first response messages, a value update instruction to be sent to the plurality of second devices, where the value update instruction is used to instruct part or all of the second devices to update their respective registration count values.
The receiving unit 901 is further configured to receive a value updating instruction sent by the first device.
The sending unit 902 is further configured to send a second response message to the first device if the updated registration count value or the non-updated registration count value of the local computer meets a preset value, so that the first device determines whether a second device meeting the registration condition exists according to the received number of the second response message.
In a possible implementation manner, the value updating instruction may include a first value updating instruction determined by the first device in a case that the number of receptions of the first reply message is greater than a first reception amount threshold, where the first value updating instruction is used to instruct the second devices whose registration count values satisfy the preset values to update the respective registration count values.
Accordingly, as shown in fig. 10, the device registration apparatus 90 may further include an updating unit 903, configured to update the local registration count value based on the first numerical value update instruction if the local registration count value meets the preset value after the receiving unit 901 receives the numerical value update instruction sent by the first device.
In another possible implementation manner, the value updating instruction may include a second value updating instruction that is determined by the first device when the number of receptions of the first reply message is less than the first reception amount threshold, and the second value updating instruction is used to instruct the second devices whose registration count values do not satisfy the preset values to update the respective registration count values.
Accordingly, the updating unit 903 is configured to update the local registration count value based on the second numerical value updating instruction if the local registration count value does not satisfy the preset value after the receiving unit 901 receives the numerical value updating instruction sent by the first device.
In a possible implementation manner, the value updating instruction may include a first value updating instruction that is determined by the first device based on the number of times that the data transmission bus between the first device and the second device is in the congestion state when the number of receptions of the first reply message is greater than the first reception amount threshold, where the number of times that the data transmission bus is in the congestion state is statistically obtained based on the number of receptions of the first reply message; alternatively, the value update instruction may include a second value update instruction that is determined by the first device based on the number of times that the data transfer bus between the first device and the second device is in the idle state, where the number of receptions of the first reply message is smaller than the first reception amount threshold, the number of times that the data transfer bus is in the idle state being counted based on the number of receptions of the first reply message.
In another possible implementation manner, the first value update instruction includes: the first equipment determines a first updating sub-instruction under the condition that the receiving quantity of the first response messages is larger than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold value, wherein the first updating sub-instruction is used for indicating second equipment of which the registration count value meets a preset value to randomly update the registration count value; alternatively, the first value update instruction includes: and the first equipment determines a third updating sub-instruction under the condition that the receiving quantity of the first response messages is greater than a first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, wherein the third updating sub-instruction is used for indicating second equipment with registration count values meeting preset values to update the respective registration count values to be N times of the current values and then adding a random number, and N is an integer not zero.
In another possible implementation manner, the second numerical value updating instruction includes: the first equipment determines a second updating sub-instruction under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value and the number of times that the data transmission bus is in an idle state is smaller than a second time threshold value, wherein the second updating sub-instruction is used for indicating second equipment of which the registration count value does not meet the preset value to randomly update the registration count value; alternatively, the second value update instruction comprises: and under the condition that the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is larger than or equal to the second number threshold value, the first device determines a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second devices of which the registration count values do not meet the preset value to update the respective registration count values to numerical values obtained by rounding the quotient of the current values and N, and N is an integer not zero.
Further, the first response message or the second response message includes device information of the second device, so that the first device detects the device information, and determines the receiving number of the first response message or the second response message based on the detection result.
Optionally, the receiving unit 901 may further be configured to: and receiving a prompt message sent by the first equipment, wherein the prompt message is sent after the first equipment completes the registration operation of the local equipment.
The device registration apparatus deployed in the second device may execute the device registration method applied to the second device in this embodiment of the present application, and has a functional module and an advantageous effect corresponding to the execution method, which may be specifically referred to the description of the foregoing embodiment.
As shown in fig. 11, an embodiment of the present application provides a device registration system 110. The device registration system 110 includes a first device 1101 and a second device 1102.
The first device 1101 is configured to execute a device registration method arbitrarily applied to the first device in the embodiment of the present application, and the second device 1102 is configured to execute a device registration method arbitrarily applied to the second device in the embodiment of the present application. The functional modules and the beneficial effects corresponding to the execution method can be found in the description of the above embodiments.
As another form of the present embodiment, there is provided a computer-readable storage medium having stored thereon instructions that, when executed, perform any of the device registration methods provided in the above-described method embodiments.
As another form of the present embodiment, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the device registration methods provided in the above-described method embodiments.
The embodiment of the present invention further provides a chip system, which includes a processor and is used for implementing the technical method of the embodiment of the present invention. In one possible design, the system-on-chip further includes a memory for storing program instructions and/or data necessary for an embodiment of the present invention. In one possible design, the system-on-chip further includes a memory for the processor to call application code stored in the memory. The chip system may be composed of one or more chips, and may also include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied in hardware or in software instructions executed by a processor. The software instructions may consist of corresponding software modules that may be stored in RAM, flash memory, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), registers, a hard disk, a removable hard disk, a compact disc read only memory (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in a core network interface device. Of course, the processor and the storage medium may reside as discrete components in a core network interface device. Alternatively, the memory may be coupled to the processor, for example, the memory may be separate and coupled to the processor via a bus. The memory may also be integral to the processor. The memory can be used for storing application program codes for executing the technical scheme provided by the embodiment of the application, and the processor is used for controlling the execution. The processor is used for executing the application program codes stored in the memory, so as to realize the technical scheme provided by the embodiment of the application.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, 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 be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. 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 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 readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (19)

1. A method for device registration, applied to a first device, the method comprising:
sending a registration instruction to a plurality of second devices, wherein the registration instruction is used for instructing the second devices to register with the first device;
determining the receiving quantity of first response messages sent by the plurality of second devices, wherein the first response messages are generated and sent by the second devices under the condition that a registration count value meets a preset value, and the value of the registration count value is used for the second devices to determine whether to send the response messages to the first devices;
determining a value updating instruction sent to the second equipment according to the receiving quantity of the first response messages, wherein the value updating instruction is used for indicating part or all of the second equipment to update respective register count values;
determining the receiving quantity of second response messages sent by the plurality of second devices, wherein the second response messages are generated and sent by the second devices under the condition that the updated register count value or the non-updated register count value meets the preset value;
and determining whether the second equipment meeting the registration condition exists according to the receiving quantity of the second response messages sent by the plurality of second equipment.
2. The method of claim 1, wherein determining the value update command to be sent to the second device according to the number of received first reply messages comprises:
if the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment;
or
If the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment;
the first numerical value updating instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value, and the second numerical value updating instruction is used for indicating the second equipment with the registration count value not meeting the preset value to update the respective registration count value.
3. The method of claim 2, further comprising:
counting the times of the data transmission bus in a congestion state according to the receiving quantity of the first response messages;
if the number of the first response messages received is greater than the first received amount threshold, determining a first value update instruction sent to the second device, including:
if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a congestion state;
or
The method further comprises the following steps:
counting the times of the data transmission bus in an idle state according to the receiving quantity of the first response messages;
determining a second value update instruction to be sent to the second device if the number of receptions of the first reply message is less than the first reception amount threshold, including:
and if the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in the idle state.
4. The method of claim 3, wherein:
determining a first value update instruction sent to the second device according to the number of times the data transmission bus is in a congestion state, including:
if the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold value, determining a first updating sub-instruction sent to the second device, wherein the first updating sub-instruction is used for indicating the second device with a registration count value meeting the preset value to randomly update the registration count value; or
If the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, determining a third updating sub-instruction sent to the second device, wherein the third updating sub-instruction is used for indicating the second device with the registration count value meeting the preset value to update the respective registration count value to be N times of the current value and then adding a random number, and N is an integer not zero; or
Determining a second numerical value update instruction sent to the second device according to the number of times that the data transmission bus is in the idle state, including:
if the number of times that the data transmission bus is in the idle state is smaller than a second time threshold value, determining a second updating sub-instruction sent to the second device, wherein the second updating sub-instruction is used for indicating the second device of which the registration count value does not meet the preset value to randomly update the registration count value; or
And if the number of times that the data transmission bus is in the idle state is greater than or equal to the second time threshold value, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second devices whose registration count values do not satisfy the preset value to update their respective registration count values to a value obtained by rounding a quotient of the current value and N, and N is an integer not zero.
5. The method of claim 1, wherein the first reply message or the second reply message includes device information of a second device;
determining a number of receptions of first reply messages sent by the plurality of second devices, comprising:
detecting device information in first response messages sent by the plurality of second devices;
determining the receiving quantity of the first response messages sent by the plurality of second devices according to the detection result;
determining a number of receptions of second reply messages sent by the plurality of second devices, comprising:
detecting the device information in the second response messages sent by the plurality of second devices;
and determining the receiving quantity of the second response messages sent by the plurality of second devices according to the detection result.
6. The method of claim 1, further comprising:
and if the second equipment meeting the registration condition exists, sending a prompt message to the second equipment after the registration operation of the second equipment meeting the registration condition is completed, wherein the prompt message is used for notifying the second equipment of successful registration.
7. A method for device registration, applied to a second device, the method comprising:
receiving a registration instruction sent by first equipment, wherein the registration instruction is used for indicating the second equipment to register to the first equipment;
if the registration count value of the local device meets a preset value, sending a first response message to the first device, so that the first device determines a value updating instruction sent to a plurality of second devices according to the receiving number of the first response messages, wherein the value updating instruction is used for indicating part or all of the second devices to update respective registration count values;
receiving the numerical value updating instruction sent by the first equipment;
and if the updated registration count value or the non-updated registration count value of the local computer meets the preset value, sending a second response message to the first equipment, so that the first equipment determines whether second equipment meeting the registration condition exists according to the receiving quantity of the second response message.
8. The method of claim 7,
the value updating instruction comprises a first value updating instruction determined by the first device under the condition that the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, and the first value updating instruction is used for indicating second devices with register count values meeting the preset value to update respective register count values;
after receiving the value updating instruction sent by the first device, the method further includes: if the registration count value of the local machine meets the preset value, updating the registration count value of the local machine based on the numerical value updating instruction;
or
The value updating instruction comprises a second value updating instruction determined by the first device under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value, and the second value updating instruction is used for indicating second devices of which the register count values do not meet the preset value to update the respective register count values;
after receiving the value updating instruction sent by the first device, the method further includes: and if the local registration count value does not meet the preset value, updating the local registration count value based on the numerical value updating instruction.
9. The method of claim 8, wherein:
the numerical value updating instruction comprises a first numerical value updating instruction which is determined by the first equipment based on the number of times that a data transmission bus between the first equipment and the second equipment is in a congestion state under the condition that the receiving number of the first response messages is larger than a first receiving amount threshold value, wherein the number of times that the data transmission bus is in the congestion state is obtained based on the receiving number statistics of the first response messages;
or
The numerical value updating instruction comprises a second numerical value updating instruction which is determined by the first device based on the number of times that a data transmission bus between the first device and the second device is in an idle state under the condition that the receiving number of the first response messages is smaller than a first receiving amount threshold value, wherein the number of times that the data transmission bus is in the idle state is obtained based on the receiving number statistics of the first response messages.
10. The method of claim 9,
the first value update instruction includes: the first device determines a first updating sub-instruction when the number of the first response messages received is greater than a first received amount threshold and the number of times that the data transmission bus is in a congestion state is less than a first time threshold, wherein the first updating sub-instruction is used for indicating a second device with a registration count value meeting the preset value to randomly update the registration count value; or
The first value update instruction includes: the first device determines a third updating sub-instruction under the condition that the receiving number of the first response messages is greater than a first receiving amount threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, wherein the third updating sub-instruction is used for indicating second devices, the register count values of which meet the preset value, to update the respective register count values to be N times of the current values and then adding a random number, and N is an integer not zero;
or
The second value update instruction includes: the first device determines a second updating sub-instruction under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value and the number of times that the data transmission bus is in an idle state is smaller than a second time threshold value, wherein the second updating sub-instruction is used for indicating a second device of which the registration count value does not meet the preset value to randomly update the registration count value; or
The second value update instruction includes: and the first device determines a fourth updating sub-instruction under the condition that the receiving quantity of the first response messages is less than a first receiving quantity threshold value and the number of times that the data transmission bus is in an idle state is greater than or equal to a second time threshold value, wherein the fourth updating sub-instruction is used for indicating second devices, the registration count values of which do not meet the preset value, to update the respective registration count values to numerical values obtained by rounding the quotient of the current values and N, and N is an integer which is not zero.
11. The method of claim 7, wherein the first response message or the second response message includes device information of the second device, so that the first device detects the device information and determines the number of receptions of the first response message or the second response message based on the detection result.
12. The method of claim 7, further comprising:
and receiving a prompt message sent by the first equipment, wherein the prompt message is sent after the first equipment completes the registration operation of the local equipment.
13. An apparatus for device registration, the apparatus being deployed at a first device, the apparatus comprising: a sending unit, a first determining unit, a second determining unit and a third determining unit; wherein:
the sending unit is configured to send a registration instruction to a plurality of second devices, where the registration instruction is used to instruct the second devices to register with the first device;
the first determining unit is configured to determine a receiving number of first response messages sent by the plurality of second devices, where the first response messages are generated and sent by the second devices when a registration count value satisfies a preset value, and a value of the registration count value is used by the second devices to determine whether to send a response message to the first devices;
the second determining unit is configured to determine, according to the number of received first response messages, a value update instruction sent to the second device, where the value update instruction is used to instruct part or all of the second devices to update respective registration count values;
the first determining unit is further configured to determine a receiving number of second response messages sent by the plurality of second devices, where the second response messages are generated and sent by the second devices when the updated registration count value or the non-updated registration count value satisfies the preset value;
the third determining unit is configured to determine whether there is a second device that satisfies a registration condition according to the number of received second response messages sent by the plurality of second devices determined by the first determining unit.
14. The apparatus according to claim 13, wherein the second determining unit is specifically configured to:
if the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment;
or
If the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment;
the first numerical value updating instruction is used for indicating the second equipment with the registration count value meeting the preset value to update the respective registration count value, and the second numerical value updating instruction is used for indicating the second equipment with the registration count value not meeting the preset value to update the respective registration count value;
the device also comprises a first statistic unit, a second statistic unit and a third statistic unit, wherein the first statistic unit is used for counting the times that the data transmission bus is in a congestion state according to the receiving quantity of the first response messages;
the second determining unit is specifically configured to: if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a congestion state;
or
The device also comprises a second statistical unit used for counting the times of the data transmission bus in an idle state according to the receiving quantity of the first response messages;
the second determining unit is specifically configured to: if the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value, determining a second numerical value updating instruction sent to the second equipment according to the number of times that the data transmission bus is in an idle state;
the second determining unit is specifically configured to:
if the receiving quantity of the first response messages is larger than the first receiving quantity threshold value and the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold value, determining a first updating sub-instruction sent to the second equipment, wherein the first updating sub-instruction is used for indicating the second equipment with the registration count value meeting the preset value to randomly update the registration count value of the second equipment; or
If the number of the first response messages received is greater than the first received quantity threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, determining a third updating sub-instruction sent to the second device, wherein the third updating sub-instruction is used for indicating the second device with the registration count value meeting the preset value to update the respective registration count value to be N times of the current value and then adding a random number, and N is an integer not zero;
or
The second determining unit is specifically configured to:
if the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is smaller than a second time threshold value, determining a second updating sub-instruction sent to the second equipment, wherein the second updating sub-instruction is used for indicating the second equipment of which the registration count value does not meet the preset value to randomly update the registration count value; or
If the receiving quantity of the first response messages is smaller than the first receiving quantity threshold value and the number of times that the data transmission bus is in the idle state is larger than or equal to the second time threshold value, determining a fourth updating sub-instruction sent to the second equipment, wherein the fourth updating sub-instruction is used for indicating the second equipment of which the registration count value does not meet the preset value to update the respective registration count value to a numerical value obtained by rounding a quotient of a current value and N, and N is an integer not zero;
the first response message or the second response message comprises equipment information of second equipment;
the first determining unit is specifically configured to:
detecting device information in first response messages sent by the plurality of second devices;
determining the receiving quantity of the first response messages sent by the plurality of second devices according to the detection result;
or the first determining unit is further specifically configured to:
detecting the device information in the second response messages sent by the plurality of second devices;
determining the receiving quantity of the second response messages sent by the plurality of second devices according to the detection result;
the device also comprises a registration unit, a registration unit and a control unit, wherein the registration unit is used for finishing the registration operation of the second equipment meeting the registration condition if the second equipment meeting the registration condition exists;
the sending unit is further configured to send a prompt message to the second device after the registration unit completes the registration operation of the second device that meets the registration condition, where the prompt message is used to notify that the second device is successfully registered.
15. An apparatus for device registration, the apparatus being deployed at a second device, the apparatus comprising: a receiving unit and a transmitting unit; wherein:
the receiving unit is configured to receive a registration instruction sent by a first device, where the registration instruction is used to instruct the second device to register with the first device;
the sending unit is used for sending a first response message to the first device if the registration count value of the local device meets a preset value, so that the first device determines a numerical value updating instruction sent to a plurality of second devices according to the receiving number of the first response message, wherein the numerical value updating instruction is used for indicating part or all of the second devices to update respective registration count values;
the receiving unit is further configured to receive the value updating instruction sent by the first device;
the sending unit is further configured to send a second response message to the first device if the updated registration count value or the non-updated registration count value of the local device meets the preset value, so that the first device determines whether a second device meeting the registration condition exists according to the receiving number of the second response message.
16. The apparatus of claim 15,
the value updating instruction comprises a first value updating instruction determined by the first device under the condition that the receiving quantity of the first response messages is larger than a first receiving quantity threshold value, and the first value updating instruction is used for indicating second devices with register count values meeting the preset value to update respective register count values;
the device further comprises an updating unit, configured to update a local registration count value based on the first numerical update instruction if the local registration count value meets the preset value after the receiving unit receives the first numerical update instruction sent by the first device;
or
The value updating instruction comprises a second value updating instruction determined by the first device under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value, and the second value updating instruction is used for indicating second devices of which the register count values do not meet the preset value to update the respective register count values;
the device further comprises an updating unit, configured to update a local registration count value based on the second numerical value updating instruction if the local registration count value does not satisfy the preset value after the receiving unit receives the second numerical value updating instruction sent by the first device;
or
The numerical value updating instruction comprises a first numerical value updating instruction which is determined by the first equipment based on the number of times that a data transmission bus between the first equipment and the second equipment is in a congestion state under the condition that the receiving number of the first response messages is larger than a first receiving amount threshold value, wherein the number of times that the data transmission bus is in the congestion state is obtained based on the receiving number statistics of the first response messages;
or
The numerical value updating instruction comprises a second numerical value updating instruction which is determined by the first equipment based on the number of times that a data transmission bus between the first equipment and the second equipment is in an idle state under the condition that the receiving number of the first response messages is smaller than a first receiving amount threshold value, wherein the number of times that the data transmission bus is in the idle state is obtained based on the receiving number statistics of the first response messages;
the first value update instruction includes: the first device determines a first updating sub-instruction when the number of the first response messages received is greater than a first received amount threshold and the number of times that the data transmission bus is in a congestion state is less than a first time threshold, wherein the first updating sub-instruction is used for indicating a second device with a registration count value meeting the preset value to randomly update the registration count value; or
The first value update instruction includes: the first device determines a third updating sub-instruction under the condition that the receiving number of the first response messages is greater than a first receiving amount threshold value and the number of times that the data transmission bus is in a congestion state is greater than or equal to a first time threshold value, wherein the third updating sub-instruction is used for indicating second devices, the register count values of which meet the preset value, to update the respective register count values to be N times of the current values and then adding a random number, and N is an integer not zero;
or
The second value update instruction includes: the first device determines a second updating sub-instruction under the condition that the receiving quantity of the first response messages is smaller than a first receiving quantity threshold value and the number of times that the data transmission bus is in an idle state is smaller than a second time threshold value, wherein the second updating sub-instruction is used for indicating a second device of which the registration count value does not meet the preset value to randomly update the registration count value; or
The second value update instruction includes: the first device determines a fourth updating sub-instruction when the number of received first response messages is smaller than a first received amount threshold and the number of times that the data transmission bus is in an idle state is greater than or equal to a second time threshold, where the fourth updating sub-instruction is used to instruct second devices whose registration count values do not meet the preset value to update their respective registration count values to a value obtained by rounding a quotient of a current value and N, where N is an integer not zero;
the first response message or the second response message comprises equipment information of the second equipment, so that the first equipment detects the equipment information and determines the receiving number of the first response message or the second response message based on the detection result;
the receiving unit is further configured to: and receiving a prompt message sent by the first equipment, wherein the prompt message is sent after the first equipment completes the registration operation of the local equipment.
17. A computer device, characterized in that the computer device comprises: a processor and a memory;
the memory is connected with the processor; the memory is for storing computer instructions which, when executed by the processor, cause the computer device to perform the device registration method of any of claims 1 to 6 or to perform the device registration method of any of claims 7 to 12.
18. A device registration system, characterized in that the device registration system comprises a first device and a second device; the first device is configured to perform the device registration method of any one of claims 1 to 6; the second device is configured to perform the device registration method according to any one of claims 7 to 12.
19. A computer-readable storage medium, comprising computer instructions which, when run on a computer, cause the computer to perform the device registration method of any one of claims 1 to 6, or perform the device registration method of any one of claims 7 to 12.
CN202110951106.XA 2021-08-18 2021-08-18 Equipment registration method, device, equipment, system and storage medium Active CN113709224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110951106.XA CN113709224B (en) 2021-08-18 2021-08-18 Equipment registration method, device, equipment, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110951106.XA CN113709224B (en) 2021-08-18 2021-08-18 Equipment registration method, device, equipment, system and storage medium

Publications (2)

Publication Number Publication Date
CN113709224A true CN113709224A (en) 2021-11-26
CN113709224B CN113709224B (en) 2024-02-09

Family

ID=78653313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110951106.XA Active CN113709224B (en) 2021-08-18 2021-08-18 Equipment registration method, device, equipment, system and storage medium

Country Status (1)

Country Link
CN (1) CN113709224B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1910564A (en) * 2004-01-07 2007-02-07 松下电器产业株式会社 Server, terminal apparatus, device registering system, registering method, registering program, and recording medium
CN109819051A (en) * 2019-03-08 2019-05-28 深圳联想懂的通信有限公司 A kind of automatic registration method, equipment and system
CN111107513A (en) * 2019-12-05 2020-05-05 中国联合网络通信集团有限公司 Management method and management subsystem of road side unit and V2X message access gateway
CN112866193A (en) * 2020-12-30 2021-05-28 北京天融信网络安全技术有限公司 Equipment deployment method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1910564A (en) * 2004-01-07 2007-02-07 松下电器产业株式会社 Server, terminal apparatus, device registering system, registering method, registering program, and recording medium
US20090132705A1 (en) * 2004-01-07 2009-05-21 Natsume Matsuzaki Server, terminal apparatus, device registering system, registering method, registering program and recording medium
CN109819051A (en) * 2019-03-08 2019-05-28 深圳联想懂的通信有限公司 A kind of automatic registration method, equipment and system
CN111107513A (en) * 2019-12-05 2020-05-05 中国联合网络通信集团有限公司 Management method and management subsystem of road side unit and V2X message access gateway
CN112866193A (en) * 2020-12-30 2021-05-28 北京天融信网络安全技术有限公司 Equipment deployment method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113709224B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
US9736132B2 (en) Workflow directed resource access
US9552490B1 (en) Managing resource dependent workflows
US20080024591A1 (en) Wireless communication system, wireless communication apparatus, and computer readable medium storing wireless information setting program
KR101723930B1 (en) Wireless local area network (wlan) traffic load measurement provisioning to wireless cellular networks
KR20120075477A (en) Group owner selection with crossing requests
US8594041B2 (en) Inhibiting system traffic from unregistered mobile stations
US20090161628A1 (en) Communication system and information management method
JP4121302B2 (en) Wireless data collection system, wireless terminal
CN110944371A (en) Paging configuration adjustment method, terminal, network equipment and storage medium
EP2923276A1 (en) Instant communication error indication from slave
CN114598735B (en) Data processing method and system
CN107124398B (en) Method, device and system for authenticating terminal equipment
WO2015164252A1 (en) System and method for energy management within a group of devices
CN113709224A (en) Equipment registration method, device, equipment, system and storage medium
US10719468B2 (en) USB management system and USB management method using USB relay device
CN110870286B (en) Fault tolerance processing method and device and server
JP6248713B2 (en) Communication control system, information processing apparatus, and communication control method
CN115776687A (en) Electric power telecontrol terminal bus communication load balancing algorithm, equipment and storage medium
CN114302386B (en) Wireless network connection method, device, access point and storage medium
JP2004062441A (en) Service management system and method, server management device, communication terminal, and server device
US20220159769A1 (en) Method, device, extender, and computer medium for automatically restoring connection
AU2018401442A1 (en) Indication method for system broadcast information, network device, and terminal device
WO2019010784A1 (en) Method and system for split backup of internet of things repeater
CN110830279B (en) Management method and device for management service
JPWO2012017545A1 (en) Control program, control device, and control method

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