CN113709224B - 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
CN113709224B
CN113709224B CN202110951106.XA CN202110951106A CN113709224B CN 113709224 B CN113709224 B CN 113709224B CN 202110951106 A CN202110951106 A CN 202110951106A CN 113709224 B CN113709224 B CN 113709224B
Authority
CN
China
Prior art keywords
registration
value
instruction
update
count value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110951106.XA
Other languages
Chinese (zh)
Other versions
CN113709224A (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

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

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 registration of devices. The method comprises the following steps: transmitting a registration instruction to a plurality of second devices; determining the received quantity of the first response messages sent by the second devices; determining a numerical value updating instruction sent to the second equipment according to the received number of the first response messages, wherein the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value; determining the receiving quantity 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 received quantity of the second response messages sent by the 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, equipment, system and storage medium.
Background
In a computer system architecture with multiple device connections, one networking strategy is to deploy devices with management rights, where other devices are centrally managed by the devices with management rights. For example, in an intelligent fire protection system, a front-end device node for deploying gateway devices as devices with management authority, which are used for monitoring information such as environmental information, voltage or current in a line, and the like, can report the monitoring information to the gateway devices, and the gateway devices uniformly upload the monitoring information of each node to a platform service center.
Among the interconnected devices, the device without management authority needs to register on the device with management authority, so that the device with management authority records the device information thereof, and further performs communication.
Currently, the registration of devices is mostly realized by manually configuring the device information of each device in the devices with management authority by technicians, and then installing the devices into a system, or additionally adding a registration key in the devices. In engineering, equipment is registered into equipment with management authority one by one through manual interaction, so that the operation is troublesome, the efficiency is low, and the installation, the test and the maintenance are inconvenient.
Disclosure of Invention
The embodiment of the application provides a device registration method, device, system and storage medium, which realize simple and efficient automatic registration of devices.
In order to achieve the above purpose, the embodiment of the application adopts the following technical scheme:
in a first aspect, a device registration method is provided and applied to a first device, and the method may include: transmitting 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 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 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 numerical value updating instruction sent to the second equipment according to the received number of the first response messages, wherein the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value; 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 registration count value or the non-updated registration count value meets a preset value; and determining whether the second equipment meeting the registration condition exists according to the received quantity of the second response messages sent by the second equipment.
According to the device registration method, in the process of registering the second device with the first device, the second device with the registration count value meeting the preset value sends response messages to the first device, and the first device controls the registration count value of the second device by sending a numerical value update instruction according to the received number of the first response messages, so that the received number of the second response messages sent by the second device meets the preset condition, and the registration of the second device is completed. In this way, the first equipment and the second equipment interact and control the registration count value, so that the second equipment actively registers with the first equipment without manual participation, and simple and efficient equipment registration is realized.
Wherein the preset value may be 0.
In one possible implementation manner, the determining, according to the number of received first response messages, the numerical update instruction sent to the second device may be specifically implemented as: if the received quantity of the first response message is larger than a first received quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; or if the received number of the first response messages is smaller than the first received number threshold value, determining a second numerical update instruction sent to the second device. The first numerical value updating instruction is used for indicating 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 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 with the registration count value meeting the preset value through a first updating instruction, reducing the quantity of the second equipment with the registration count value meeting the preset value, and improving the probability of successful registration of the second equipment by sending the second response messages; when the number of the received first response messages is too small, the registration count value of the second equipment with the registration count value not meeting the preset value is updated through the second updating instruction, the number of the second equipment with the registration count value meeting the preset value is increased, and the probability of successful registration of the second equipment through sending the second response messages is improved.
Wherein the first reception number threshold may be 1.
In another possible implementation manner, the device registration method provided by the application may further include: and counting the times of the data transmission bus in a crowded state according to the received quantity of the first response messages. If the number of received first response messages is greater than the first receiving amount threshold, determining a first numerical value updating instruction sent to the second device, including: and if the received number of the first response messages is larger than a first received number threshold, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a crowded state. The number of times that the data transmission bus is in the crowded 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 numerical value updating instructions can be sent to the second devices according to the different times that the data transmission bus is in the crowded state, the number of 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 through sending second response messages is improved.
Wherein the data transmission bus is used to transmit interaction data between the first device and the second device (e.g., master-slave device), the interaction data including, but not limited to, a first reply message, a second reply message, device information, and the like.
The data transmission bus is in a crowded state, which is a state in which more information is transmitted in the data transmission bus and is sent by more than M devices, so that the information cannot be successfully received. M may be determined based on the capabilities of the data transfer bus. For example, on 485 bus, M may be determined to be 2.
In another possible implementation manner, the device registration method provided by the application may further include: and counting the number of times that the data transmission bus is in an idle state according to the received number of the first response messages. If the number of received first response messages is smaller than the first receiving amount threshold, determining a second value updating instruction sent to the second device, including: and if the received number of the first response messages is smaller than the first received number threshold, determining a second numerical value updating instruction sent to the second device according to the number of times that the data transmission bus is in an 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 fewer second devices at the same time, so that different second numerical value updating instructions can be sent to the second devices according to the different number of times that the data transmission bus is in the idle state, the number of the second devices with different degrees of registration count value meeting the preset value can be increased, and the probability of successful registration of the second devices through sending second response messages can be improved.
The data transmission bus is in an idle state, which may be a state that the second device does not send interactive data to the first device.
In another possible implementation manner, the determining the first numerical update instruction sent to the second device according to the number of times that the data transmission bus is in a congestion state may be specifically implemented as: if the number of times that the data transmission bus is in a crowded state is smaller than a first time threshold, 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 a preset value to randomly update the registration count value; or alternatively; if the number of times that the data transmission bus is in a crowded state is greater than or equal to a first time threshold, 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 N times of the current value, and then adding a random number, and N is an integer which is not zero. The number of times that the data transmission bus is in a crowded state is smaller than a first time threshold value, which indicates that the crowding degree of the data transmission bus is not large, and the registration count value of the second equipment with the registration count value meeting the preset value can be finely adjusted through a first updating sub-instruction so as to reduce the number of the second equipment with the registration count value meeting the preset value in a small range; the number of times that the data transmission bus is in the crowded state is greater than or equal to the first time threshold value, which indicates that the crowded degree of the data transmission bus is serious, and the registration count value of the second device, which meets the preset value, can be greatly updated through a third updating sub-instruction, so that the number of the second devices, which meets the preset value, of which the registration count value is greatly reduced.
In another possible implementation manner, determining the second value update instruction 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 an idle state is smaller than a second number of times threshold, 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 a preset value to randomly update the registration 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 number of times threshold, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second device whose registration count value does not meet the preset value to update the respective registration count value to a value obtained by rounding the quotient value 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 an idle state is smaller than a second time threshold value, which indicates that the idle degree of the data transmission bus is not large, and the registration count value of the second device with the registration count value meeting the preset value can be finely adjusted through a second updating sub-instruction so as to realize small-amplitude increase of the number of the second devices with the registration count value meeting the preset value; the number of times that the data transmission bus is in the idle state is greater than or equal to a second number of times threshold value, which indicates that the idle degree of the data transmission bus is serious, and the registration count value of the second device, which satisfies the preset value by the registration count value, can be greatly updated through a fourth updating sub-instruction, so that the number of the second devices, which satisfies the preset value by greatly increasing the registration count value, is realized.
In another possible implementation, if the number of times the data transmission bus is in the idle state is less than a second number of times threshold, determining a second update sub-instruction to send to the second device includes: if the number of times the data transmission bus is in the idle state is less than a second number of times threshold, and the numerical update instruction last transmitted by the first device is a random update instruction (e.g., a first update sub-instruction or a second update sub-instruction), determining a second update sub-instruction to be transmitted to the second device; or if the number of times the data transmission bus is in the idle state is less than the second number of times threshold, and the numerical update instruction last transmitted by the first device is not a random update instruction (for example, a first update sub-instruction or a second update sub-instruction), determining a re-registration instruction transmitted to the second device, wherein the re-registration instruction is used for indicating the second device to register with the first device. When the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, if the previous transmitted instruction of the first device is a random update instruction, which indicates that the data transmission bus is idle caused by the random update instruction, the random update instruction of a second update sub-instruction can be further transmitted, and random registration count value update is performed, so that some second devices can transmit second response messages; if the previous instruction sent by the first device is not a random update instruction, the probability of controlling the second device to send the second response message through the random update instruction is not high, so that the next round of registration can be entered through a re-registration instruction, and the probability of completing registration of the second device 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 the first response 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 second devices according to the detection result. Or determining the number of second response messages sent by the plurality of second devices includes: detecting device information in second response messages sent by a plurality of second devices; and determining the receiving quantity of the second response messages sent by the 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, the detection result of the first device for detecting the device information in the response message can reflect the number of the response message, and the number of the response message can be determined according to the detection result, so that 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 and the second devices are connected through a 485 bus, the first device detects device information in the first response messages sent by the plurality of second devices, if the detection is successful, the number of received first response messages sent by the plurality of second devices is determined to be 1, and if the detection is unsuccessful, the number of received first response messages sent by the plurality of second devices is determined to be not 1.
In another possible implementation manner, the device registration method provided by the embodiment of the application may further include: if the second equipment meeting the registration conditions is determined to exist according to the received number of the second response messages sent by the plurality of second equipment, after the registration operation of the second equipment meeting the registration conditions is completed, a prompt message is sent to the second equipment, and the prompt message is used for notifying that the second equipment is successfully registered. Thus, 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 by the embodiment of the 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 other unregistered second equipment, wherein the re-registration instruction is used for indicating the other unregistered second equipment to update the registration count value and register with the first equipment.
In a second aspect, there is provided another device registration method, the method being applicable to a second device, the method comprising: receiving a registration instruction sent by a first device, wherein the registration instruction is used for indicating a second device to register with the first device; if the registration count value of the local machine meets a preset value, a first response message is sent to the first equipment, so that the first equipment determines a numerical value updating instruction sent to a plurality of second equipment according to the receiving quantity of the first response message, wherein the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value; 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 device, so that the first device determines whether a second device meeting the registration condition exists according to the receiving quantity of the second response message.
According to the device registration method, in the process of registering the second device with the first device, the second device with the registration count value meeting the preset value sends response messages to the first device, and the first device controls the registration count value of the second device by sending a numerical value update instruction according to the received number of the first response messages, so that the received number of the second response messages sent by the second device meets the preset condition, and the registration of the second device is completed. In this way, the first equipment and the second equipment interact and control the registration count value, so that the second equipment actively registers with the first equipment without manual participation, and simple and efficient equipment registration is realized.
In one possible implementation manner, the numerical update instruction includes a first numerical update instruction determined by the first device when the number of received first response messages is greater than a first receiving amount threshold, where the first numerical update instruction is used to instruct the second device whose registration count value meets a preset value to update the respective registration count value. After receiving the numerical value update instruction sent by the first device, the device registration method provided by the application may further include: and 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 first numerical value updating instruction. When the number of the received first response messages is too large, the registration count value of the second device with the registration count value meeting the preset value is updated through the first updating instruction, the number of the second devices with the registration count value meeting the preset value is reduced, and the probability of successful registration of the second device through sending the second response messages is improved.
In another possible implementation manner, the numerical update instruction includes a second numerical update instruction determined by the first device in a case where the number of received first response messages is smaller than the first receiving amount threshold, where the second numerical update instruction is used to instruct the second device whose registration count value does not satisfy the preset value to update the respective registration count value. After receiving the numerical value update instruction sent by the first device, the device registration method provided by the application may further include: if the registration count value of the local machine does not meet the preset value, the registration count value of the local machine is updated based on the second numerical value updating instruction. When the number of the received first response messages is too small, the registration count value of the second equipment with the registration count value not meeting the preset value is updated through the second updating instruction, the number of the second equipment with the registration count value meeting the preset value is increased, and the probability of successful registration of the second equipment through sending the second response messages is improved.
In another possible implementation manner, the numerical update instruction includes a first numerical update instruction that is determined by the first device based on a number of times the data transmission bus between the first device and the second device is in a congestion state when the number of received first response messages is greater than a first reception threshold, where the number of times the data transmission bus is in the congestion state is statistically obtained based on the number of received first response messages. According to the different times of the data transmission buses in the crowded state, different first numerical value updating instructions are determined, so that the number of second devices with different degrees of registration count value meeting the preset value is reduced, and the probability of successful registration of the second devices by sending second response messages is improved.
In another possible implementation manner, the numerical update instruction includes a second numerical update instruction that is determined by the first device based on a number of times the data transmission bus between the first device and the second device is in an idle state when the number of received first response messages is smaller than a first reception threshold, where the number of times the data transmission bus is in the idle state is statistically obtained based on the number of received first response messages. And determining different second numerical value updating instructions according to different times of the data transmission buses in idle states so as to increase the number of second devices with registration count values meeting 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 updating instruction includes: the method comprises the steps that under the condition that the receiving quantity of first response messages is larger than a first receiving quantity threshold value and the times of the data transmission buses in a crowded state is smaller than a first time threshold value, first equipment determines a first updating sub-instruction, and the first updating sub-instruction is used for indicating second equipment with a registration count value meeting a preset value to randomly update the registration count value; alternatively, the first numerical update instruction includes: and under the condition that the receiving quantity of the first response message is larger than a first receiving quantity threshold value and the times of the data transmission bus in a crowded state is larger than or equal to a first time threshold value, the first equipment determines a third updating sub-instruction, 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 N times of the current value and then add a one-bit random number, and N is an integer which is not zero. The number of times that the data transmission bus is in a crowded state is smaller than a first time threshold value, which indicates that the crowding degree of the data transmission bus is not large, and the registration count value of the second equipment with the registration count value meeting the preset value can be finely adjusted through a first updating sub-instruction so as to reduce the number of the second equipment with the registration count value meeting the preset value in a small range; the number of times that the data transmission bus is in the crowded state is greater than or equal to the first time threshold value, which indicates that the crowded degree of the data transmission bus is serious, and the registration count value of the second device, which meets the preset value, can be greatly updated through a third updating sub-instruction, so that the number of the second devices, which meets the preset value, of which the registration count value is greatly reduced.
In another possible implementation manner, the second value updating instruction includes: the first device determines a second updating sub-instruction when the number of received first response messages is smaller than a first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than a second number threshold, wherein the second updating sub-instruction is used for indicating a second device of which the registration count value does not meet a preset value to randomly update the registration count value; alternatively, the second value update instruction includes: and 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 buses are in an idle state is larger than or equal to a second number threshold value, determining a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second equipment with the registration count value not meeting a preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is not zero. The number of times that the data transmission bus is in an idle state is smaller than a second time threshold value, which indicates that the idle degree of the data transmission bus is not large, and the registration count value of the second device with the registration count value meeting the preset value can be finely adjusted through a second updating sub-instruction so as to realize small-amplitude increase of the number of the second devices with the registration count value meeting the preset value; the number of times that the data transmission bus is in the idle state is greater than or equal to a second number of times threshold value, which indicates that the idle degree of the data transmission bus is serious, and the registration count value of the second device, which satisfies the preset value by the registration count value, can be greatly updated through a fourth updating sub-instruction, so that the number of the second devices, which satisfies the preset value by greatly increasing the registration count value, is realized.
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 received first response messages or second response messages based on the detection result.
In another possible implementation manner, the device registration method provided by the 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 machine. Thus, the registration of the local machine is completed.
In a third aspect, a device registration apparatus, deployed on a first device, may include: a transmitting unit, a first determining unit, a second determining unit and a third determining unit. Wherein:
the sending unit is used for sending a registration instruction to a plurality of second devices, and the registration instruction is used for indicating the second devices to register with the first devices.
The first determining unit is used for determining the receiving quantity of first response messages sent by a plurality of second devices, the first response messages are generated and sent by the second devices under the condition that the registration count value meets a preset value, and the value of the registration count value is used for determining whether to send the response messages to the first devices by the second devices.
The second determining unit is configured to determine, according to the number of received first response messages, a numerical update instruction sent to the second devices, where the numerical update instruction is configured to instruct some or all of the second devices to update respective registration count values.
The first determining unit is further configured to determine a received 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 meets a preset value.
The third determining unit is configured to determine whether or not 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 determined by the first determining unit.
It should be noted that, the device registration apparatus provided in the third aspect is configured to perform the device registration method provided in the first aspect or any possible implementation manner of the first aspect, and specific implementation manner may refer to specific implementation manner of the first aspect or any possible implementation manner of the first aspect, which is not repeated herein.
In a fourth aspect, there is provided another device registration apparatus deployed on a second device, 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, and 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 a plurality of second equipment according to the receiving quantity of the first response message, and the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value.
The receiving unit is further configured to receive a numerical 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 device meets a preset value, so that the first device determines whether there is a second device that meets the registration condition according to the number of received second response messages.
It should be noted that, the device registration apparatus provided in the fourth aspect is configured to perform the device registration method provided in the second aspect or any possible implementation manner of the second aspect, and the specific implementation manner of the second aspect or any possible implementation manner of the second aspect may refer to the specific implementation manner of the second aspect, which is not repeated herein.
In a fifth aspect, the present application provides a computer device, where the computer device may implement the functions in the method examples described in any one of the first aspect to the second aspect, where the functions may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software comprises one or more modules corresponding to the functions. The computer device may exist in the form of a chip product.
In one possible implementation, the architecture of the computer device includes a processor and a transceiver, where the processor is configured to support the computer device to perform the corresponding functions of the method described above. The transceiver is for supporting communication between the computer device and other devices. The computer device may also include a memory for coupling with the processor, which holds the 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 perform a device registration method provided in the first aspect or any possible implementation manner thereof; the second device is configured to perform a device registration method provided in the second aspect or any one of its possible implementations.
In a seventh aspect, there is provided a computer readable storage medium comprising computer instructions which, when run on a computer, cause the computer to perform the device registration method provided in the first to second aspects or any one of its possible implementations.
In an eighth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the device registration method provided by the first to second aspects or any one of the possible implementations thereof.
In a ninth aspect, the present application provides a chip system, where the chip system includes a processor and may further include a memory, to implement the corresponding functions in the above method. The chip system may be formed of a chip or may include a chip and other discrete devices.
The various possible implementations of any of the foregoing aspects may be combined without contradiction between the schemes.
Drawings
Fig. 1 is a schematic structural diagram of a computer network according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present application;
Fig. 3 is a schematic flow chart of a device registration method according to an embodiment of the present application;
fig. 4 is a flowchart of another device registration method according to an embodiment of the present application;
fig. 5 is a flowchart of another device registration method according to an embodiment of the present application;
fig. 6 is a flowchart of another device registration method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a device registration apparatus 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 still another device registration apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of still 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, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ. The technical features described in the first and second descriptions are not sequential or in order of magnitude.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion that may be readily understood.
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 this 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, a computer network provided in an embodiment of the present application includes a first device 101 and a plurality of second devices 102. The first device 101 is connected to a plurality of second devices 102 via a data transfer bus.
The first device 101 is a device with management authority, and the first device 101 centrally manages the second device 102.
Specifically, in the man-machine interaction interface of the first device 101, an "auto registration" function (for example, configured as a key or a button function) may be configured, after the first device 101 is powered on, after the administrator clicks "auto registration", the first device 101 and the second device 102 execute the scheme provided in the application to implement auto registration of the second device 102 to the first device 101. After the first device 101 finishes registration, the first device 101 acquires the device information of each second device 102, and may poll each second device 102 according to the device information of each second device 102, acquire the report information of the second device 102, and execute 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 a master-slave architecture.
The first device 101 and the second device 102 may be connected by a 485 bus, for example.
For example, the computer network illustrated in fig. 1 may be a smart fire protection system, the first device 101 may be an electricity consumption host device, the second device 102 may be a plurality of same or different fire protection detection devices (or referred to as electricity consumption demons), and state quantities of branch voltage, current, temperature and the like of the electricity consumption system may be monitored in real time.
The hardware structures of the first device 101 and the second device 102 may be the same or different, and may include, for example, elements included in the computer device shown in fig. 2. The hardware configuration of the first device 101 and the second device 102 will be described below using 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 various constituent elements of computer device 20 are described in detail below in conjunction with FIG. 2:
the memory 202 may be a volatile memory (RAM), such as a random-access memory (RAM); or a nonvolatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); or a combination of the above types of memories for storing application code, configuration files, data information, or other content in which the methods of the present application may be implemented.
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 transceiver circuit or a communication interface, etc. Alternatively, the communication interface may implement communication with other devices through the element having the transceiver function. The above-mentioned elements with transceiving functions may be realized by antennas and/or radio frequency devices.
Processor 201 may be a control center of computer device 20. For example, processor 201 may be a central processing unit (central processing unit, CPU), an application specific integrated circuit (application specific integrated circuit, ASIC), or one or more integrated circuits configured to implement embodiments of the present application, such as: one or more microprocessors (digital signal processor, DSPs), or one or more field programmable gate arrays (field programmable gate array, FPGAs) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 201 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
The processor 201 is capable of implementing the device registration method provided in the following embodiments of the present application by executing or executing software programs and/or modules stored in the memory 202, for example.
The embodiment of the application provides a device registration method, which is used for automatically registering a plurality of second devices to a first device in a computer system in which the first device is connected with the second devices. The second device is configured with a registration count value (hereinafter referred to as Q value), the value of the registration count value is used by the second device to determine whether to send a response message to the first device, and the second device whose registration count value meets a preset value can 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 the first device processing registration of each second device, is the same, and the second devices described in the embodiments described below may be each second device connected to the first device and not yet successfully registered.
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 specifically be performed by a device registration apparatus disposed on the first device. As shown in fig. 3, the method may include:
S301, the first device sends registration instructions to a plurality of second devices.
For example, in S301, the first device may broadcast the registration instruction to the plurality of second devices, or may send the registration instruction to the plurality of second devices in other manners, which is not limited in the manner in which the first device sends the registration instruction.
Wherein, 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 to the first device, where 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, the first device may perform S301 after power-up to initiate a registration procedure of the second device connected thereto.
In one possible implementation, the registration instruction may be configured 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 another value, which is not specifically limited in the embodiment of the present application.
In another possible implementation, the registration instruction may include a re-registration instruction sent by the first device to a second device that has not successfully registered when there is a second device that satisfies the registration condition.
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, 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 reduce its registration count value by a first preset step. The first preset step size may be 1 or other values, which are not limited in the embodiments of the present application.
The device information of the second device may be address information of the second device or information having an identification function such as a unique serial number, and the specific form of the device information of the second device is not limited in the embodiment of the present application.
In one possible implementation, a congestion flag bit may be set in the first device, where the congestion flag bit is used to record the number of times the data transmission bus is congested.
One possibility is that in an implementation, the first device may increment the congestion flag bit by 1 each time it detects that the data transfer bus is congested.
In another possible implementation, the first device may set the congestion flag location to an initial value each time the first device sends a re-registration instruction.
Wherein the data transmission bus is used for transmitting interaction data between the first device and the second device, including but not limited to response messages, device verification identifiers and the like. The content of the data transmission bus transmission is not limited in the application.
The data transmission bus is in a crowded state, which is a state in which more information is transmitted in the data transmission bus and is sent by more than M devices, so that the information cannot be successfully received. M may be determined based on the capabilities of the data transfer bus. For example, on 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 are not limited in the embodiments of the present application. The first device may set the congestion flag position to an initial value after power-up or after transmitting a first registration instruction.
In one possible implementation, an idle flag bit may be set in the first device, where the idle flag bit is used to record the number of times the data transmission bus is idle.
One possibility is that in an implementation, the first device may increment the idle flag bit by 1 each time it detects that the data transfer bus is idle.
In another possible implementation, the first device may set the idle flag location to an initial value each time the first device sends a re-registration instruction.
For example, the initial value of the idle flag bit may be 0 or other values, which are not limited in the embodiments of the present application. The first device may set the idle flag position to an initial value after power-up or after sending a first registration request.
The data transmission bus is in an idle state, which may be a state in which the second device does not send the interaction data to the first device, and may be considered that no interaction data is transmitted in the data transmission bus.
S302, the first device determines the receiving quantity of the first response messages sent by the second devices.
Wherein the first response message is generated and transmitted by the second device in case that the registration count value satisfies a preset value.
For example, the first response message may include device information of the second device, such that the first device detects the device information and determines the reception number of the first response message based on the detection result.
Further, the first response message may further include verification mode indication information, which is used to indicate a verification mode of the transmitted device information.
For example, the check means may be a cyclic redundancy check code (cyclic redundancy check, CRC) 16.
Specifically, in S302, the first device may receive, within a preset duration after sending the registration request, the number of first response messages sent by the second device.
When the first response message includes device information of the second devices, the first device determines, in S302, a number of received first response messages sent by the plurality of second devices, which may be specifically 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 second devices according to the detection result.
For example, the first device detects the device information in the first response message successfully, and determines that the number of received first response messages sent by the plurality of second devices is 1; or the first device detects the device information in the first response message unsuccessfully, and determines that the number of the first response messages sent by the second devices is not 1.
S303, the first device determines a numerical value updating instruction sent to the second device according to the received number of the first response messages.
Specifically, in S303, the first device determines a numerical update instruction to be transmitted to the second device and transmits the determined numerical update instruction.
In a possible implementation manner, the determining, by the first device in S306, the numerical update instruction sent to the second device according to the received number of the first response messages may be specifically implemented as: if the received quantity of the first response message is larger than a first received quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; or if the received number of the first response messages is smaller than the first received number threshold value, determining a second numerical update instruction sent to the second device. The first numerical value updating instruction is used for indicating 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 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 other values, which is not limited in the embodiment of the present application, and may specifically be determined according to the computing capability supported by the first device.
It should be noted that, for the specific implementation of the first numerical value update instruction and the second numerical value update instruction determined by the first device according to the received number of the first response messages, the embodiment of the present application is not limited thereto.
Further, after S302, the method provided in the embodiment of the present application may further include: the first device counts the times that the data transmission bus is in a crowded state according to the received number of the first response messages.
For example, the first device may count the number of times the data transmission bus is in the congestion state according to the received number of the first reply messages when the received number of the first reply messages is greater than the first received amount threshold.
Specifically, in S302, the first device may count the number of times that the data transmission bus is in a congestion state according to the recorded congestion flag bit of the number of times that the data transmission bus is in a congestion state.
After counting the number of times that the data transmission bus is in a congestion state, in S303, if the number of received first response messages is the first receiving amount threshold, determining a first numerical value update instruction sent to the second device may be specifically implemented as: and if the received number of the first response messages is larger than a first received number threshold, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a crowded state.
It should be noted that, for the specific implementation of the first numerical value update instruction determined by the first device according to the number of times that the data transmission bus is in a congestion state, the embodiment of the present application is not limited thereto.
In a possible implementation manner, the determining, by the first device, a first numerical update instruction sent to the second device according to the number of times that the data transmission bus is in a congestion state includes: if the number of times that the data transmission bus is in a congestion state is smaller than a first time threshold, determining a first updating sub-instruction sent to the second device, wherein the first updating sub-instruction is used for indicating the second device of which the registration count value meets a preset value to randomly update the registration count value. Or if the number of times that the data transmission bus is in the crowded state is greater than or equal to the first time threshold, 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 N times of the current value, and then adding a one-bit random number, wherein N is an integer which is not zero.
Illustratively, N may be 2.
Illustratively, the first time count threshold may be 3. Of course, the value of the first time threshold may be configured according to actual requirements, which is not limited in the embodiment of the present application.
In another possible implementation manner, the third updating sub-instruction is further configured to instruct the second device whose registration count value does not meet the preset value to update the respective registration count value to N times the current value and then add a one-bit random number.
Wherein, the registration count value is updated randomly, and the registration count value can be updated to be 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 the embodiments of the present application.
Further, after S302, the method provided in the embodiment of the present application may further include: the first device counts the number of times the data transmission bus is in an idle state according to the received number of the first response messages.
For example, the first device may count the number of times the data transmission bus is in the idle state according to the received number of the first reply messages when the received number of the first reply messages is smaller than the first received 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 recorded idle flag bit of the 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 receiving amount threshold in S303, determining a second numerical value update instruction sent to the second device may be specifically implemented as: and if the received number of the first response messages is smaller than the first received number threshold, determining a second numerical value updating instruction sent to the second device according to the number of times that the data transmission bus is in an idle state.
It should be noted that, for the specific implementation of the second numerical update instruction determined by the first device according to the number of times that the data transmission bus is in the idle state, the embodiment of the present application is not limited thereto.
In a possible implementation manner, the determining, by the first device, a second value update instruction sent to the second device according to the number of times that the data transmission bus is in an idle state includes: if the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, 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 a preset value to randomly update the registration 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 number of times threshold, determining a fourth updating sub-instruction sent to the second device, where the fourth updating sub-instruction is used to instruct the second device whose registration count value does not meet the preset value to update the respective registration count value to a value obtained by rounding the quotient value of the current value and N, where N is an integer that is not zero.
Illustratively, the second time threshold may be 4. Of course, the value of the second time threshold may be configured according to actual requirements, which is not limited in the embodiment of the present application.
In another possible implementation manner, the fourth updating sub-instruction is further configured to instruct the second device whose registration count value meets the preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N.
In another possible implementation, if the number of times the data transmission bus is in the idle state is less than a second number of times threshold, determining a second update sub-instruction to send to the second device includes: if the number of times the data transmission bus is in the idle state is less than a second number of times threshold, and the numerical update instruction last transmitted by the first device is a random update instruction (e.g., a first update sub-instruction or a second update sub-instruction), determining a second update sub-instruction to be transmitted to the second device; or if the number of times the data transmission bus is in the idle state is smaller than the second number of times threshold, and the numerical update instruction sent by the first device last time is not the first update sub-instruction or the second update 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 response messages determined by the first device in S302 is equal to the first receiving amount threshold, there is a second device that satisfies the registration condition, the first device may complete the registration operation of the second device that satisfies the registration condition, and then send a prompt message to the second device that satisfies the registration condition. The prompting message is used for notifying the second device that registration is successful.
The specific content of the registration condition may be configured according to the actual requirement, which is not limited in the embodiment of the present application.
For example, it may be determined that the registration condition may be that the received number of the second reply messages is X, which is the maximum information transfer number supported by the data transfer bus between the first device and the second device.
For example, X may be 1.
S304, the first device determines the receiving quantity of the second response messages sent by the second devices.
The second response message is generated and sent by the second device when the updated registration count value or the non-updated registration count value meets a preset value.
For example, the second response message may include device information of the second device, such that the first device detects the device information, and determines the reception number of the second response message based on the detection result.
Further, the second response message may further include verification mode indication information, which is used to indicate a verification mode of the transmitted device information.
It should be noted that, in S304, the first device determines the number of received second response messages sent by the plurality of second devices, and the specific implementation of determining the number of received first response messages sent by the plurality of second devices by referring to the first device in S302 is not described herein.
Illustratively, the second reply message includes device information of the second devices, and the first device determines, in S304, a number of received second reply messages sent by the plurality of second devices, including: detecting device information in second response messages sent by a plurality of second devices; and determining the receiving quantity of the second response messages sent by the second devices according to the detection result.
For example, the first device detects the device information in the second response messages successfully, and determines that the number of received second response messages sent by the plurality of second devices is 1; or the first device detects the device information in the second response messages unsuccessfully, and determines that the number of the second response messages sent by the second devices is not 1.
S305, the first device determines whether the second device meeting the registration condition exists according to the received quantity of the second response messages sent by the second devices.
According to the device registration method, in the process of registering the second device with the first device, the second device with the registration count value meeting the preset value sends response messages to the first device, and the first device controls the registration count value of the second device by sending a numerical value update instruction according to the received number of the first response messages, so that the received number of the second response messages sent by the second device meets the preset condition, and the registration of the second device is completed. In this way, the first equipment and the second equipment interact and control the registration count value, so that the second equipment actively registers with the first equipment without manual participation, and simple and efficient equipment registration is realized.
Fig. 4 is a flowchart of another device registration method provided in the present application, where the method may be applied to a second device, and may specifically be performed by a device registration apparatus disposed on the second device. As shown in fig. 4, the method may include:
as shown in fig. 4, the device registration method provided in the present application may include:
s401, the second device receives a registration instruction sent by the first device.
The registration instruction received by the second device may be a registration instruction sent by the first device in S301. The transmission timing and content of the registration instruction are described in detail in S301, and are not described here again.
After receiving the registration instruction in S401, the second device executes S402.
S402, if the registration count value of the local machine meets a preset value, the second device sends a first response message to the first device.
The second device sends the 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 quantity of the first response message.
The first response message may include device information of the second device, so that the first device detects the device information and determines the number of received first response messages based on the detection result.
Further, the first response message may further include verification mode indication information, which is used to indicate a verification mode of the transmitted device information.
For example, the verification may be CRC16.
S403, the second device receives the numerical value updating instruction sent by the first device.
It should be noted that, the numerical update instruction received by the second device in S403 is the numerical 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 numerical update instruction, which may specifically include any one of the following cases:
the case 1, the numerical value updating instruction includes a first numerical value updating instruction determined by the first device when the received number of the first response messages is greater than a first received number threshold, where the first numerical value updating instruction is used for indicating the second device whose registration count value meets a preset value to update respective registration count values; after receiving the numerical update instruction sent by the first device, the second device may further include: and 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 first numerical value updating instruction.
In a possible implementation manner, in case 1, the numerical update instruction may further include a first numerical update instruction that is determined by the first device based on the number of times the data transmission bus between the first device and the second device is in a congestion state when the number of received first response messages is greater than the first reception amount threshold. The number of times the data transmission bus is in a congestion state is statistically derived based on the number of received first reply messages.
In one possible implementation, the first numerical update instruction may include: and under the condition that the receiving quantity of the first response messages is larger than a first receiving quantity threshold value and the times of the data transmission buses in the crowded state is smaller than a first time threshold value, the first equipment determines a first updating sub-instruction, and the first updating sub-instruction is used for indicating second equipment with the registration count value meeting a preset value to randomly update the registration count value. Alternatively, the first numerical update instruction includes: and under the condition that the receiving quantity of the first response message is larger than a first receiving quantity threshold value and the times of the data transmission bus in a crowded state is larger than or equal to a first time threshold value, the first equipment determines a third updating sub-instruction, 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 N times of the current value and then add a one-bit random number, and N is an integer which is not zero.
And 2, the numerical value updating instruction comprises a second numerical value updating instruction which is determined by the first device under the condition that the receiving quantity of the first response message is smaller than a first receiving quantity threshold value, and the second numerical value updating instruction is used for indicating the second device of which the registration count value does not meet the preset value to update the respective registration count value. After receiving the numerical update instruction sent by the first device, the second device may further include: if the registration count value of the local machine does not meet the preset value, the registration count value of the local machine is updated based on the second numerical value updating instruction.
In a possible implementation manner, in case 2, the numerical update instruction may further include a second numerical update instruction that is determined by the first device based on a number of times the data transmission bus between the first device and the second device is in an idle state, where the number of received first response messages is smaller than the first reception threshold, and the number of times the data transmission bus is in the idle state is obtained based on statistics of the number of received first response messages.
In one possible implementation, the second value update instruction may include: and 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 number threshold value, the first equipment determines a second updating sub-instruction, and 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. Alternatively, the second value update instruction includes: and 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 buses are in an idle state is larger than or equal to a second number threshold value, determining a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second equipment with the registration count value not meeting a preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is not zero.
After receiving the value update instruction sent by the first device in S403, the second device performs S404 after updating or not updating its own registration count value according to the value update instruction.
S404, if the updated registration count value or the non-updated registration count value of the local machine meets a preset value, a second response message is sent to the first device.
The second device sends a second response message to the first device, so that the first device determines whether the second device meeting the registration condition exists according to the receiving quantity 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 received second response messages based on the detection result.
Further, the second response message may further include verification mode indication information, which is used to indicate a verification mode of the transmitted device information.
According to the device registration method, in the process of registering the second device with the first device, the second device with the registration count value meeting the preset value sends response messages to the first device, and the first device controls the registration count value of the second device by sending a numerical value update instruction according to the received number of the first response messages, so that the received number of the second response messages sent by the second device meets the preset condition, and the registration of the second device is completed. In this way, the first equipment and the second equipment interact and control the registration count value, so that the second equipment actively registers with the first equipment without manual participation, and simple and efficient equipment registration is realized.
The device registration method provided by the application is described below by taking an interaction process of the first device and the second device as an example. As shown in fig. 5, the device registration method may include:
s501, the first device sends registration instructions to a plurality of second devices.
It should be noted that, the specific implementation of S501 is the same as S301, and will not be repeated here
S502, the second device receives a registration instruction sent by the first device.
The registration instruction received by the second device is the registration instruction sent by the first device in S501. The transmission timing and content of the registration instruction 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 second device meets a preset value.
Specifically, after receiving the registration instruction, if the received instruction instructs the second device to update its registration count value, the second device updates the local registration count value first, and in S503, it is determined whether the updated registration count value meets a 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 registration count value that is not updated meets the preset value.
For example, if the second device receives the first registration instruction sent by the first device when the first device is powered on in S502, the registration count value may be updated to an initial value.
For example, if the second device receives the re-registration instruction sent by the first device in S502, the registration count value may be updated to decrease by the first preset step size.
The preset value may be 0 or other values, and may be configured according to actual requirements, which is not limited in the embodiments of the present application.
Optionally, if the second device determines in S503 that the registration count value of the second device meets the preset value, 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 machine meets a preset value, the second device sends a first response message to the first device.
Note that, the specific implementation of S504 is the same as S402, and will not be described here again.
S505, the first device determines the received quantity of the first response messages sent by the second devices.
Wherein the first response message is generated and transmitted by the second device in case that the registration count value satisfies a preset value.
Note that, the specific implementation of S505 is the same as S302, and will not be described here again.
S506, the first device determines a numerical value updating instruction sent to the second device according to the received number of the first response messages.
Note that, the specific implementation of S506 is the same as S303, and will not be described here again.
S507, the second device receives a numerical value updating instruction sent by the first device.
Note that, the numerical update instruction received by the second device in S507 is the numerical 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 numerical update instruction, and the specific implementation is the same as S403, which is not described herein.
S508, the second device judges whether the updated registration count value or the non-updated registration count value of the second device meets a preset value.
Specifically, after receiving the numerical value update instruction, if the received instruction instructs the second device to update its registration count value, the second device updates the local registration count value first, and in S508, it is determined whether the updated registration count value meets a preset value. Or after receiving the numerical value updating instruction, if the received instruction does not instruct the second device to update the registration count value, the second device determines in S508 whether the registration count value that is not updated meets the preset value.
Optionally, if the second device determines in S508 that the locally updated registration count value or the non-updated registration count value meets the preset value, S509 is executed, otherwise, the next instruction sent by the first device is waited to be received.
S509, if the updated registration count value or the non-updated registration count value of the local machine meets a preset value, a second response message is sent to the first device.
The second device sends a second response message to the first device, so that the first device determines whether the second device meeting the registration condition exists according to the receiving quantity of the second response message.
S510, the first device determines the receiving quantity of the second response messages sent by the second devices.
The second response message is generated and sent by the second device when the updated registration count value or the non-updated registration count value meets a preset value.
Note that, the specific implementation of S510 is the same as S304, and will not be described here again.
S511, the first device determines whether the second device meeting the registration condition exists according to the received quantity of the second response messages sent by the second devices.
Further, the device registration method provided by the present application may further include: and if the second equipment meeting the registration conditions exists, sending a prompt message to the second equipment after finishing the registration operation of the second equipment meeting the registration conditions. The second device receives the prompt message sent by the first device.
The prompt message is sent after the first device completes the registration operation of the local machine, and is used for notifying that the second device meeting the registration condition is successfully registered.
In a possible implementation manner, after the second device receives the prompt message, subsequently received registration-related instructions (the registration instruction and the numerical update instruction) are ignored.
Specifically, completing 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: if the second device meeting the registration condition does not exist, the first device determines a numerical value updating instruction sent to the second device according to the receiving quantity of the second response message.
It should be noted that, the specific implementation of the numerical update instruction sent to the second device by the first device according to the received number of the second response message may refer to the specific implementation of S303, which is not described herein again.
According to the device registration method, in the process of registering the second device with the first device, the second device with the registration count value meeting the preset value sends response messages to the first device, and the first device controls the registration count value of the second device by sending a numerical value update instruction according to the received number of the first response messages, so that the received number of the second response messages sent by the second device meets the preset condition, and the registration of the second device is completed. In this way, the first equipment and the second equipment interact and control the registration count value, so that the second equipment actively registers with the first equipment without manual participation, and simple and efficient equipment registration is realized.
In a possible implementation manner, the registration process may be ended by setting an end flag bit in the first device, where an initial value of the end flag bit is X, where X is an integer greater than 1, and when the end flag bit is less than 0. When the first device determines that the data transmission bus is idle, it 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 procedure, and if the end flag bit is greater than 0, execute the procedure to continue registration of the second devices. If the end flag bit is equal to 0, the registration process can be finished or the process can be executed to continue the registration of the second device according to the design of the actual situation.
Wherein X may be 2.
In one possible implementation, after the first device sends the first numerical update instruction, the end flag bit may be increased 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 added with a one-bit random number.
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 the quotient of the current value and N.
In another possible implementation, after the first device sends the re-registration instruction, the end flag bit may be decremented by 1.
In another possible implementation manner, the registration process may be ended by setting a first registration success count value in the first device, adding 1 to the first registration success count value every time the registration of the second device is performed, and ending the registration process when the first registration success count value is equal to the total number of the second devices connected by the first device.
In another possible implementation manner, the registration process may be ended by setting a second registration success count value in the first device, subtracting 1 from the second registration success count value every time the registration of the second device is performed, and ending the registration process when the second registration success count value is equal to 0.
The scheme provided by the application is described below by taking a first device as an electricity consumption host device and a second device as a fire protection detection device as an example through a specific example.
Assuming that 6 fire-fighting detection devices as slaves are connected to the power-consuming master device through a 485 bus, and recorded as T0001 to T0006, respectively, an automatic registration process of T0001 to T0006 will be described below in conjunction with the device registration method illustrated in fig. 5. The power consumption host device is provided with a congestion flag CCN, an idle flag CIN, an end flag ED (initial value is 2), a congestion threshold (the first-time threshold) of 3, and an idle threshold (the second-time threshold) of 4. As shown in fig. 6, the device registration method may include:
and S601, powering up the power utilization host equipment, and sending a first query request on a 485 bus.
After S601 is executed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed is set to an initial value of 2 in the power consumption host device.
S602, the fire protection detection equipment receives a first query request on a 485 bus, sets the Q value of the fire protection detection equipment to 0, and enters a registration state.
After the fire-fighting detection devices T0001-T0006 receive the first inquiry request, the Q value of the fire-fighting detection devices is set to 0, and the fire-fighting detection devices enter a registration state.
S603, the fire protection detection devices T0001-T0006 send a first response message on a 485 bus.
The first response message sent by each fire detection device comprises a self sequence number and CRC16 indication information.
And S604, monitoring 485 bus congestion by the power utilization host equipment.
Because a plurality of fire-fighting detection devices answer at the same time, 485 bus data errors can be caused, and the power consumption host device monitors that CRC16 of data does not pass in S604, and monitors 485 bus congestion.
After S604 is performed, CCN is updated to 1 by 1, cin is set to 0, and ed is set to an initial value of 2 in the power master device.
Since CCN is less than congestion threshold 3, the power host device performs S605.
And S605, the power utilization host equipment transmits a numerical value updating instruction which indicates that the fire protection detection equipment with the Q value of 0 randomly updates the registered count value of the fire protection detection equipment on a 485 bus.
After execution of S604, CCN is 1, cin is set to 0, and ed is updated to 3 in the power master device.
S606, the fire-fighting detection devices T0001-T0006 receive a numerical value updating instruction on a 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, and the fire-fighting detection device with the Q value of 0 updates the Q value into a 1-bit random number.
Assuming that 1-bit random numbers generated by the fire detection devices T0001 to T0006 in S606 are all 1, the Q values of the fire detection devices T0001 to T0006 in S606 are all updated to 1, and the fire detection devices T0001 to T0006 do not transmit the second response message.
S607, the power consumption host equipment monitors 485 bus idleness.
The 485 bus is idle due to no response of the fire detection device, and the electricity consumption host device monitors the 485 bus to be idle in S604.
After S607 is performed, CCN is set to 0, cin is updated to 1 and ed is set to 3 in the power master device.
Since CCN is smaller than the idle threshold 4, and the last instruction sent by the power consumption host device to randomly update the registration count value, the power consumption host device performs S608.
And S608, the power utilization host equipment transmits a numerical value updating instruction which indicates that the fire protection detection equipment with the Q value of 1 randomly updates the registered count value of the fire protection detection equipment on a 485 bus.
S609, the fire-fighting detection devices T0001-T0006 receive a numerical value updating instruction on a 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 the fire-fighting detection device with the Q value of 1 updates the Q value into a 1-bit random number.
Assuming that the 1-bit random numbers generated by the fire detection device T0002 in S609 are all 0, the 1-bit random numbers generated by the remaining fire detection devices are all 1, so that 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 transmits a second response message (including the sequence number of T0002 and CRC 16).
S610, the power utilization host equipment receives a second response message of the fire protection detection equipment T0002, the CRC verifies correct, and the serial number of the fire protection detection equipment T0002 is saved.
S611, the electricity utilization host equipment sends an ACK message to the fire protection detection equipment T0002 according to the fire protection detection equipment T0002 serial number.
After the electricity host device completes the registration of a certain fire protection detection device, an ACK message (corresponding to the aforementioned prompt message) is sent to the fire protection detection device. For example, the ACK message is transmitted in S611 for notifying the fire detection device T0002 that registration is successful.
The electricity consumption host device completes the registration of the fire protection detection device T0002 in S611.
S612, the fire-fighting detection device T0002 receives the ACK message and ends the registration.
Wherein, this ACK message is sent after the electricity host device completes the registration operation of the fire protection detection device T0002.
After S612, the fire detection device T0002 completes registration, ending the registration state.
And S613, the power consumption host equipment transmits a repeated query request.
After S613 is performed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 2 in the power master device.
S614, the fire-fighting detection devices T0001, T0003, T0004, T0005 and T0006 receive repeated inquiry requests on the 485 bus, and the Q value of the fire-fighting detection devices is reduced by 1.
After the fire-fighting detection devices T0001, T0003, T0004, T0005 and T0006 receive repeated inquiry requests, the Q value of the fire-fighting detection devices is reduced by 1 and updated to 0.
S615, the fire detection devices T0001, T0003, T0004, T0005, T0006 send the first response message on the 485 bus.
The first response message sent by each fire detection device comprises a self sequence number and CRC16 indication information.
And S616, the power consumption host equipment monitors 485 bus congestion.
Since a plurality of fire-fighting detection devices answer at the same time, 485 bus data errors are caused, and the power consumption host device monitors 485 bus congestion if CRC16 of the data does not pass in S616.
After execution of S616, CCN is updated to 1 with 1, cin is set to 0, and ed is set to 2 in the power master device.
Since CCN is smaller than congestion threshold 3, the power consumption host device performs S617.
S617, the electricity consumption host equipment sends a numerical value updating instruction which indicates that the fire protection detection equipment with the Q value of 0 updates the registered count value randomly on a 485 bus.
After execution of S617, CCN is 1, cin is set to 0, and ed is updated to 3 in the power master device.
And S618, the fire-fighting detection devices T0001, T0003, T0004, T0005 and T0006 receive a numerical value updating instruction for indicating the fire-fighting detection device with the Q value of 0 to randomly update the registered count value of the fire-fighting detection device on a 485 bus, and the fire-fighting detection device with the Q value of 0 updates the Q value into a 1-bit random number.
Assuming that the 1-bit random numbers generated by the fire detection devices T0001, T0006 are 0 and the 1-bit random numbers generated by the fire detection devices T0003, T0004, T0005 are 1 in S618, the Q values of the fire detection devices T0001, T0006 are updated to 0 and the Q values of the fire detection devices T0003, T0004, T0005 are updated to 1 in S618, and the fire detection devices T0001, T0006 transmit the second response message.
And S619, the power consumption host equipment monitors 485 bus congestion.
Since the two fire protection detection devices T0001 and T0006 answer at the same time, 485 bus data errors may be caused, and the power host device monitors 485 bus congestion if the CRC16 of the data does not pass in S619.
After execution of S619, CCN is updated to 2 with 1 in the power master device, cin is set to 0, and ed remains 3.
Since CCN is less than congestion threshold 3, the power host device performs S620.
S620, the power utilization host equipment sends a numerical value updating instruction which indicates that the fire protection detection equipment with the Q value of 0 updates the registered count value at random on a 485 bus.
After execution of S620, CCN is 2, cin is set to 0, and ed is updated to 4 in the power master device.
S621, fire-fighting detection devices T0001, T0003, T0004, T0005 and T0006 receive a numerical value updating instruction for indicating the fire-fighting detection device with the Q value of 0 to randomly update the registered count value of the fire-fighting detection device on a 485 bus, and the fire-fighting detection device with the Q value of 0 updates the Q value into a 1-bit random number.
The Q values of T0001 and T0006 are 0, and assuming that the 1-bit random number generated by the fire detection device T0001 is 0 and the 1-bit random number generated by T0006 is 1 in S621, the Q values of the fire detection device T0001 are updated to 0, the Q value of T0006 is updated to 1, the Q values of T0003, T0004, and T0005 are updated to 2 in S621, and the fire detection device T0001 transmits the second response message.
S622, the electricity utilization host equipment receives a second response message of the fire protection detection equipment T0001, the CRC verifies correct, and the serial number of the fire protection detection equipment T0001 is saved.
And S623, the electricity utilization host equipment sends an ACK message to the fire protection detection equipment T0001 according to the fire protection detection equipment T0001 serial number.
The electricity consumption host device completes the registration of the fire protection detection device T0001 in S623.
S624, the fire-fighting detection device T0001 receives the ACK message and ends the registration.
After S624, the fire detection device T0001 completes the registration, ending the registration state.
S625, the power utilization host device sends a repeated query request.
After S625 is performed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 3 in the power master device.
S626, the fire-fighting detection devices T0003, T0004, T0005 and T0006 receive repeated inquiry requests on a 485 bus, and the Q value of the fire-fighting detection devices is reduced by 1.
After the fire detection devices T0003, T0004, T0005 and T0006 receive the repeated inquiry requests, the Q values of the fire detection devices T0003, T0004 and T0005 are reduced by 1, the Q values of the fire detection devices T0004 and T0005 are reduced by 1 and updated to 1, the Q values of the fire detection devices T0006 are reduced by 1 and updated to 0, and the fire detection devices T0006 send first response messages.
S627, the power utilization host equipment receives the first response message of the fire control detection equipment T0006, the CRC verifies correct, and the serial number of the fire control detection equipment T0006 is saved.
S628, the electricity utilization host equipment sends an ACK message to the fire protection detection equipment T0006 according to the sequence number of the fire protection detection equipment 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.
S630, the power utilization host device sends a repeated query request.
After execution of S630, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 2 in the power master device.
S631, the fire-fighting detection devices T0003, T0004 and T0005 receive repeated inquiry requests on a 485 bus, and the Q value of the fire-fighting detection devices is reduced by 1.
The Q values of the fire-fighting detection devices T0003, T0004 and T0005 are 1, after repeated inquiry requests are received, the Q values of the fire-fighting detection devices T0003, T0004 and T0005 are updated to 0 by subtracting 1, and the fire-fighting detection devices T0003, T0004 and T0005 send first response messages on 485 buses.
S632, the power consumption host equipment monitors 485 bus congestion.
Since 3 fire-fighting detection devices answer simultaneously, 485 bus data errors can be caused, and the power consumption host device monitors 485 bus congestion if CRC16 of data does not pass in S632.
After S632 is performed, CCN is updated to 1 by 1, cin is set to 0, and ed is set to 2 in the power master device.
Since CCN is smaller than congestion threshold 3, the power consumption host device performs S633.
S633, the power utilization host equipment sends a numerical value updating instruction indicating that the fire protection detection equipment with the Q value of 0 randomly updates the registered count value of the fire protection detection equipment on a 485 bus.
After S633 is executed, CCN is 1, cin is set to 0, and ed is updated to 3 in the power master device.
S634, fire-fighting detection devices T0003, T0004 and T0005 receive a numerical value updating instruction on a 485 bus, wherein the numerical value updating instruction instructs the fire-fighting detection device with the Q value of 0 to randomly update the registered count value, and the fire-fighting detection device with the Q value of 0 updates the Q value into a 1-bit random number.
The Q values of T0003, T0004, and T0005 are 0, and a value update instruction indicating that the fire detection device having the Q value of 0 randomly updates its registration count value is received, and it is assumed that the 1-bit random number generated by the fire detection device T0005 in S634 is 0 and the 1-bit random numbers of T0003 and T0004 are 1, so that the Q values of the fire detection devices T0005 are all updated to 0 and the Q values of T0003 and T0004 are updated to 1 in S634, and the fire detection device T0005 transmits a second response message.
And S635, the electricity utilization host equipment receives a second response message of the fire control detection equipment T0005, the CRC is verified to be correct, and the serial number of the fire control detection equipment T0005 is saved.
S636, the electricity utilization host equipment sends an ACK message to the fire protection detection equipment T0005 according to the fire protection detection equipment T0005 serial number.
S637, the fire-fighting detection device T0005 receives the ACK message and ends registration.
After S637, the fire detection device T0005 registration is completed, ending the registration state.
S638, the power consumption host device transmits a repeat query request.
After execution of S638, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 2 in the power master device.
S639, the fire-fighting detection devices T0003 and T0004 receive repeated inquiry requests on a 485 bus and reduce the Q value of the fire-fighting detection devices by 1.
After the fire detection devices T0003 and T0004 receive the repeated inquiry request, the Q value of the fire detection devices T0003 and T0004 is reduced by 1 and updated to 0, and the fire detection devices T0003 and T0004 send first response messages.
And S640, monitoring 485 bus congestion by the power utilization host equipment.
Since 2 fire-fighting detection devices answer simultaneously, 485 bus data errors can be caused, and the power consumption host device monitors 485 bus congestion if CRC16 of data does not pass in S640.
After execution of S640, CCN is updated to 1 by 1, cin is set to 0, and ed is set to 2 in the power master device.
Since CCN is less than congestion threshold 3, the power host device performs S641.
S641, the power utilization host equipment sends a numerical value updating instruction for indicating the fire protection detection equipment with the Q value of 0 to randomly update the registered count value of the fire protection detection equipment on a 485 bus.
After S641 is performed, CCN is 1, cin is set to 0, and ed is updated to 3 in the power master device.
S642, the fire-fighting detection devices T0003 and T0004 receive a numerical value updating instruction on a 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, and the fire-fighting detection device with the Q value of 0 updates the Q value into a 1-bit random number.
The Q values of T0003 and T0004 are 0, and a value update instruction indicating that the fire detection device having the Q value of 0 randomly updates its registration count value is received, and it is assumed that the 1-bit random number generated by the fire detection device T0003 is 0 and the 1-bit random number of T0004 is 1 in S642, so that the Q value of the fire detection device T0003 is updated to 0 and the Q value of T0004 is updated to 1 in S642, and the fire detection device T0003 transmits the second response message.
S643, the power utilization host equipment receives the second response message of the fire control detection equipment T0003, the CRC verifies correct, and the serial number of the fire control detection equipment T0003 is saved.
S644, the power utilization host equipment sends an ACK message to the fire protection detection equipment T0003 according to the serial number of the fire protection detection equipment T0003,
s645, the fire detection device T0003 receives the ACK message and ends the registration.
After S645, the fire detection device T0003 completes the registration, ending the registration state.
S646, the power consumption host device transmits a repeated query request.
After S646 is performed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 2 in the power master device.
S647, fire-fighting detection equipment T0004 receives repeated inquiry requests on a 485 bus and reduces the Q value of the equipment T0004 by 1.
After receiving the repeated inquiry request, the fire-fighting detection device T0004 updates the Q value of the fire-fighting detection device T0004 by subtracting 1 from 0, and the fire-fighting detection device T0004 sends a first response message.
S648, the electricity consumption host equipment receives the first response message of the fire control detection equipment T0004, the CRC verifies correct, and the serial number of the fire control detection equipment T0004 is saved.
S649, the power consumption host equipment sends an ACK message to the fire protection detection equipment T0004 according to the serial number of the fire protection detection equipment T0004,
s650, the fire-fighting detection device T0004 receives the ACK message and ends registration.
After S650, the fire detection device T0004 completes the registration, ending the registration state.
S651, the power consumption host device sends a repeated query request.
After S651 is executed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 1 in the power master device.
S652, the power consumption host equipment monitors 485 bus idleness.
The 485 bus is idle due to no response of the fire detection device, and the electricity consumption host device monitors the 485 bus to be idle in S652.
After execution of S652, CCN is set to 0, cin is updated to 1 with 1, and ed is set to 1 in the power master device.
Since CIN is smaller than the idle threshold, and the power consumption host device last transmitted a numerical update instruction that does not randomly update its registration count value, the power consumption host device executes S653.
S653, the power consumption host device sends a repeated query request.
After S653 is performed, CCN is set to an initial value of 0, cin is set to an initial value of 0, and ed minus 1 is updated to 0 in the power master device.
And S654, the power utilization host equipment monitors 485 bus idle.
The 485 bus is idle due to no response of the fire detection device, and the electricity host device monitors the 485 bus to be idle in S654.
After S654, the electricity host device ED is already 0, and S655 is executed.
S655, the power utilization host equipment finishes registration and saves a registration result.
The above description has been presented mainly in terms of the working principle of each computer device. It will be appreciated that the computer device, in order to implement the functions described above, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven 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.
The embodiment of the present application may divide functional modules of an apparatus that performs the device registration method provided in the present application according to the above method example, 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 modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Fig. 7 shows a possible schematic structural diagram of a device registration apparatus 70 for performing the device registration method provided in the present application deployed in the computer device involved in the above embodiment. The device registration means 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 transmitting unit 701 is configured to transmit a registration instruction to instruct the second device to register with the first device disposed by the device registering apparatus 70 to the plurality of second devices.
The first determining unit 702 is configured to determine the number of received first response messages sent by the 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 the value of the registration count value is used by the second devices to determine whether to send the response messages to the first device.
The second determining unit 703 is configured to determine, according to the number of received first response messages, a numerical update instruction sent to the second devices, where the numerical update instruction is configured to instruct some or all of the second devices to update respective registration count values.
The first determining unit 702 is further configured to determine a number of received second response messages sent by the plurality of second devices, where the second response messages are generated and sent by the second devices if the updated registration count value or the non-updated registration count value meets a preset value.
The third determining unit 704 is configured to determine whether or not 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 determined by the first determining unit 702.
Further, the second determining unit 702 may specifically be configured to:
if the received quantity of the first response message is larger than a first received quantity threshold value, determining a first numerical value updating instruction sent to the second equipment; or if the received number of the first response messages is smaller than the first received number threshold value, determining a second numerical update instruction sent to the second device.
The first numerical value updating instruction is used for indicating 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 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 statistics unit 705 for counting the number of times the data transmission bus is in a congestion state according to the received number of the first response messages.
Accordingly, the second determining unit 703 may specifically be configured to: and if the received number of the first response messages is larger than a first received number threshold, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a crowded state.
Alternatively, as shown in fig. 8, the device registration apparatus 70 may further include a second counting unit 706 for counting the number of times the data transmission bus is in the idle state according to the received number of the first reply messages.
Accordingly, the second determining unit 703 may specifically be configured to: and if the received number of the first response messages is smaller than the first received number threshold, determining a second numerical value updating instruction sent to the second device according to the number of times that the data transmission bus is in an idle state.
In a possible implementation manner, the second determining unit 703 may specifically be configured to:
and if the receiving quantity of the first response message is larger than the first receiving quantity threshold value and the times that the data transmission bus is in a crowded state is smaller 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 receiving 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 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 one-bit random number, and N is an integer which is not zero.
In another possible implementation manner, the second determining unit 703 may specifically be configured to:
if the number of received first response messages is smaller than the first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than the second number of times threshold, 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 if the number of received first response messages is smaller than the first receiving 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 number of times threshold, determining a fourth updating sub-instruction sent to the second device, wherein the fourth updating sub-instruction is used for indicating the second device with the registration count value not meeting a preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is not zero.
Further, the first response message or the second response message may include device information of the second device.
Accordingly, 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 second devices according to the detection result.
Or the first determining unit 702 may specifically be configured to:
detecting device information in second response messages sent by a plurality of second devices; and determining the receiving quantity of the second response messages sent by the 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 for completing a registration operation of the second device satisfying the registration condition if there is the second device satisfying the registration condition.
The sending unit 701 may be further configured to send, after the registering unit 707 completes the registration operation of the second device that meets the registration condition, a prompt message to the second device, where the prompt message is used to notify that the second device is registered successfully.
The device registration apparatus deployed in the first device may execute any device registration method applied to the first device in the embodiments of the present application, and have corresponding functional modules and beneficial effects of the execution method, and may be specifically referred to the description of the foregoing embodiments.
Fig. 9 shows a possible structural schematic diagram of a device registration apparatus 90 deployed in the computer device and performing the device registration method provided in the present application, which is referred to in the above embodiment. The device registration apparatus 90 may be a functional module or chip, and may be implemented in 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, 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 numerical value update instruction sent to the plurality of second devices, where the numerical value update instruction is used to instruct some or all of the second devices to update respective registration count values.
The receiving unit 901 is further configured to receive a numerical update 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 locally updated registration count value or the non-updated registration count value meets a preset value, so that the first device determines whether there is a second device that meets the registration condition according to the number of received second response messages.
In a possible implementation manner, the numerical update instruction may include a first numerical update instruction determined by the first device in a case where the number of received first response messages is greater than a first receiving amount threshold, where the first numerical update instruction is configured to instruct the second device whose registration count value meets a preset value to update the respective registration count value.
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 value update instruction if the local registration count value satisfies the preset value after the receiving unit 901 receives the value update instruction sent by the first device.
In another possible implementation manner, the numerical update instruction may include a second numerical update instruction determined by the first device when the number of received first response messages is smaller than the first receiving amount threshold, where the second numerical update instruction is used to instruct the second device whose registration count value does not meet the preset value to update the respective registration count value.
Accordingly, the updating unit 903 is configured to update the local registration count value based on the second value update instruction if the local registration count value does not satisfy the preset value after the receiving unit 901 receives the value update instruction sent by the first device.
In one possible implementation manner, the numerical update instruction may include a first numerical update instruction that is determined by the first device based on a number of times the data transmission bus between the first device and the second device is in a congestion state when the number of received first response messages is greater than a first reception threshold, where the number of times the data transmission bus is in the congestion state is statistically obtained based on the number of received first response messages; alternatively, the numerical update instruction may include a second numerical update instruction that is determined by the first device based on a number of times the data transmission bus between the first device and the second device is in an idle state, the number of times the data transmission bus is in the idle state being statistically derived based on the number of times the first response message is received, in a case where the number of times the first response message is received is less than the first reception threshold.
In another possible implementation manner, the first numerical update instruction includes: the method comprises the steps that under the condition that the receiving quantity of first response messages is larger than a first receiving quantity threshold value and the times of the data transmission buses in a crowded state is smaller than a first time threshold value, first equipment determines a first updating sub-instruction, and the first updating sub-instruction is used for indicating second equipment with a registration count value meeting a preset value to randomly update the registration count value; alternatively, the first numerical update instruction includes: and under the condition that the receiving quantity of the first response message is larger than a first receiving quantity threshold value and the times of the data transmission bus in a crowded state is larger than or equal to a first time threshold value, the first equipment determines a third updating sub-instruction, 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 N times of the current value and then add a one-bit random number, and N is an integer which is not zero.
In another possible implementation, the second value update instruction includes: the first device determines a second updating sub-instruction when the number of received first response messages is smaller than a first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than a second number threshold, wherein the second updating sub-instruction is used for indicating a second device of which the registration count value does not meet a preset value to randomly update the registration count value; alternatively, the second value update instruction includes: and 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 buses are in an idle state is larger than or equal to a second number threshold value, determining a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second equipment with the registration count value not meeting a preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is not zero.
Further, the first response message or the second response message includes the device information of the second device, so that the first device detects the device information, and determines the receiving quantity of the first response message or the second response message based on the detection result.
Optionally, the receiving unit 901 may be further configured to: and receiving a prompt message sent by the first equipment, and sending the prompt message after the first equipment completes the registration operation of the local machine.
The device registration apparatus deployed in the second device may execute any device registration method applied to the second device in the embodiment of the present application, and has corresponding functional modules and beneficial effects of the execution method, and may be specifically referred to the description of the foregoing embodiments.
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 perform any device registration method applied to the first device in the embodiment of the present application, and the second device 1102 is configured to perform any device registration method applied to the second device in the embodiment of the present application. The method has the corresponding functional modules and beneficial effects of the execution method, and can be particularly referred to the description of the embodiment.
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 method embodiments described above.
As another form of the present embodiment, there is provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the device registration methods provided in the method embodiments described above when executed.
The embodiment of the application further provides a chip system, which comprises a processor and is used for realizing the technical method of the embodiment of the invention. In one possible design, the system on a chip also includes memory to hold the program instructions and/or data necessary for embodiments of the present invention. In one possible design, the system-on-chip further includes a memory for the processor to invoke application code stored in the memory. The chip system may be formed by one or more chips, or may include chips and other discrete devices, which are not specifically limited in this embodiment.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied in hardware, or may be embodied in software instructions executed by a processor. The software instructions may be comprised of corresponding software modules that may be stored in RAM, flash memory, ROM, erasable programmable read-only memory (erasable programmable ROM, EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disk, a removable 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. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. In addition, the ASIC may be located in a core network interface device. 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, e.g., the memory may be separate and coupled to the processor via a bus. The memory may also be integrated with the processor. The memory may be used for storing application program codes for executing the technical solutions provided in the embodiments of the present application, and the processor may control the execution. The processor is configured to execute the application program code stored in the memory, thereby implementing the technical solution provided in the embodiments of the present application.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the protection 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 in the protection 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 device registration method, 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 indicating the second devices to register with the first devices;
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 response messages to the first devices;
determining a numerical value updating instruction sent to the second equipment according to the received number of the first response messages, wherein the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value;
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 registration count value or the non-updated registration count value meets the preset value;
And determining whether the second devices meeting the registration conditions exist according to the received quantity of the second response messages sent by the plurality of second devices.
2. The method of claim 1, wherein determining the value update instruction to send to the second device based on the received number of the first reply messages comprises:
if the received quantity of the first response message is larger than a first received quantity threshold value, determining a first numerical value updating instruction sent to the second equipment;
or alternatively
If the received quantity of the first response message is smaller than a first received 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 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 second equipment with the registration count value not meeting the preset value to update the respective registration count value.
3. The method according to claim 2, wherein the method further comprises:
counting the times of the data transmission bus in a crowded state according to the received number of the first response messages;
If the received number of the first response message is greater than the first received number threshold, determining a first numerical update instruction sent to the second device, including:
if the received number of the first response messages is larger than the first received number threshold, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a crowded state;
or alternatively
The method further comprises the steps of:
counting the times of the data transmission bus in an idle state according to the received number of the first response messages;
if the number of received first response messages is less than the first received quantity threshold, determining a second numerical update instruction sent to the second device, including:
and if the received number of the first response messages is smaller than the first received number threshold, 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.
4. A method according to claim 3, characterized in that:
according to the times that the data transmission bus is in a crowded state, determining a first numerical value updating instruction sent to the second device, wherein the first numerical value updating instruction comprises:
If the number of times that the data transmission bus is in a crowded state is smaller than a first time threshold, 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 alternatively
If the number of times that the data transmission bus is in a crowded state is greater than or equal to a first time number threshold, 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 N times of the current value, and then adding a one-bit random number, wherein N is an integer which is not zero; or alternatively
Determining a second numerical value updating instruction sent to the second device according to the number of times that the data transmission bus is in an idle state, wherein the second numerical value updating instruction comprises:
if the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, determining a second updating sub-instruction sent to the second device, 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 alternatively
And if the number of times that the data transmission bus is in an idle state is greater than or equal to the second number of times threshold, determining a fourth updating sub-instruction sent to the second device, wherein the fourth updating sub-instruction is used for indicating the second device with the registration count value not meeting the preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is 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 the number of received first response messages sent by the plurality of second devices includes:
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 second devices according to the detection result;
determining the number of received second response messages sent by the plurality of second devices includes:
detecting device information in second response messages sent by the plurality of second devices;
and determining the receiving quantity of the second response messages sent by the second devices according to the detection result.
6. The method according to claim 1, wherein the method further comprises:
and if the second equipment meeting the registration conditions exists, after the registration operation of the second equipment meeting the registration conditions is completed, sending a prompt message to the second equipment, wherein the prompt message is used for informing the second equipment that the registration is successful.
7. A device registration method, applied to a second device, the method comprising:
receiving a registration instruction sent by a first device, wherein the registration instruction is used for indicating the second device to register with the first device;
if the registration count value of the local machine meets a preset value, a first response message is sent to the first equipment, so that the first equipment determines a numerical value updating instruction sent to a plurality of second equipment according to the receiving quantity of the first response message, and the numerical value updating instruction is used for indicating part or all of the second equipment to update the respective registration count value;
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 machine meets the preset value, sending a second response message to the first device so that the first device determines whether second devices meeting the registration condition exist according to the receiving quantity of the second response message.
8. The method of claim 7, wherein the step of determining the position of the probe is performed,
the numerical value updating instruction comprises a first numerical value updating instruction which is determined by the first device when the receiving quantity of the first response message is larger than a first receiving quantity threshold value, and the first numerical value updating instruction is used for indicating second devices with the registration count value meeting the preset value to update the respective registration count value;
after receiving the numerical update 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 alternatively
The numerical value updating instruction comprises a second numerical value updating instruction which is determined by the first device under the condition that the receiving quantity of the first response message is smaller than a first receiving quantity threshold value, and the second numerical value updating instruction is used for indicating second devices of which the registration count values do not meet the preset value to update the respective registration count values;
after receiving the numerical update instruction sent by the first device, the method further includes: and if the registration count value of the local machine does not meet the preset value, updating the registration count value of the local machine based on the numerical value updating instruction.
9. The method according to claim 8, wherein:
the numerical value updating instruction comprises a first numerical value updating instruction which is determined based on the number of times that a data transmission bus between the first device and the second device is in a crowded state when the receiving number of the first response messages is larger than a first receiving number threshold value, wherein the number of times that the data transmission bus is in the crowded state is obtained based on statistics of the receiving number of the first response messages;
or alternatively
The numerical value updating instruction comprises a second numerical value updating instruction which is determined based on the number of times that a data transmission bus between the first device and the second device is in an idle state when the number of received 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 statistics of the number of received first response messages.
10. The method of claim 9, wherein the step of determining the position of the substrate comprises,
the first numerical update instruction includes: the first device determines a first update sub-instruction when the number of received first response messages is greater than a first receiving 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 update sub-instruction is used for indicating a second device of which the registration count value meets the preset value to randomly update the registration count value; or alternatively
The first numerical update instruction includes: the first device determines a third updating sub-instruction when the number of received first response messages is greater than a first receiving amount threshold 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, wherein the third updating sub-instruction is used for indicating second devices with registration count values meeting the preset value to update the respective registration count values to N times of the current value and then add a one-bit random number, and N is an integer which is not zero;
or alternatively
The second numerical update instruction includes: the first device determines a second updating sub-instruction when the number of received first response messages is smaller than a first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, 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 alternatively
The second numerical update instruction includes: and under the condition that the receiving number of the first response messages is smaller than a first receiving amount threshold value and the number of times that the data transmission bus is in an idle state is larger than or equal to a second number of times threshold value, the first device determines a fourth updating sub-instruction, wherein the fourth updating sub-instruction is used for indicating the second device with the registration count value not meeting the preset value to update the respective registration count value into a value obtained by rounding the quotient value of the current value 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, such that the first device detects the device information, and determines a received number of the first response message or the second response message based on a detection result.
12. The method of claim 7, wherein the method further comprises:
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 machine.
13. A device registration apparatus, the apparatus deployed to a first device, the apparatus comprising: a transmitting unit, a first determining unit, a second determining unit, and a third determining unit; wherein:
the sending unit is used for 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;
the first determining unit is configured to determine the number of received 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 meets a preset value, and the value of the registration count value is used by the second devices to determine whether to send response messages to the first devices;
The second determining unit is configured to determine, according to the number of received first response messages, a numerical value update instruction sent to the second device, where the numerical value update instruction is used to instruct some or all second devices to update respective registration count values;
the first determining unit is further configured to determine a received 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 meets 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 received quantity of the first response message is larger than a first received quantity threshold value, determining a first numerical value updating instruction sent to the second equipment;
or alternatively
If the received quantity of the first response message is smaller than a first received 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 second equipment with the registration count value meeting the preset value to update respective registration count values, and the second numerical value updating instruction is used for indicating second equipment with the registration count value not meeting the preset value to update respective registration count values;
the device also comprises a first statistics unit, a second statistics unit and a second statistics unit, wherein the first statistics unit is used for counting the times that the data transmission bus is in a crowded state according to the received quantity of the first response messages;
the second determining unit is specifically configured to: if the received number of the first response messages is larger than the first received number threshold, determining a first numerical value updating instruction sent to the second equipment according to the times that the data transmission bus is in a crowded state;
or alternatively
The device also comprises a second statistics unit, a first statistics unit and a second statistics unit, wherein the second statistics unit is used for counting the times that the data transmission bus is in an idle state according to the received number of the first response messages;
the second determining unit is specifically configured to: if the received number of the first response messages is smaller than the first received number threshold, 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 received number of the first response messages is larger than the first receiving amount threshold and the times that the data transmission bus is in a crowded state is smaller than a first time threshold, determining a first updating sub-instruction sent to the second device, 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 alternatively
If the number of received first response messages is greater than the first receiving amount threshold and the number of times that the data transmission bus is in a crowded state is greater than or equal to a first time threshold, 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 add a one-bit random number, and N is an integer which is not zero;
or alternatively
The second determining unit is specifically configured to:
if the number of received first response messages is smaller than the first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, determining a second updating sub-instruction sent to the second device, 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 alternatively
If the number of received first response messages is smaller than the first receiving amount threshold and the number of times that the data transmission bus is in an idle state is larger than or equal to the second number of times threshold, determining a fourth updating sub-instruction sent to the second device, wherein the fourth updating sub-instruction is used for indicating a second device with a registration count value which does not meet the preset value to update the respective registration count value to a value obtained by rounding the current value and the quotient value of N, and N is an integer which is not zero;
the first response message or the second response message comprises equipment information of the 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 second devices according to the detection result;
or the first determining unit is further specifically configured to:
detecting device information in second response messages sent by the plurality of second devices;
determining the receiving quantity of the second response messages sent by the second devices according to the detection result;
the device also comprises a registration unit, a registration unit and a registration unit, wherein the registration unit is used for completing 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. A device registration apparatus, wherein the apparatus is deployed to a second device, the apparatus comprising: a receiving unit, a transmitting unit; wherein:
the receiving unit is used for receiving a registration instruction sent by a first device, wherein the registration instruction is used for indicating the second device to register with the first device;
the sending unit is configured to send 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 update instruction sent to a plurality of second devices according to the number of received first response messages, where the numerical value update instruction is used to instruct some or all of the second devices to update respective registration count values;
the receiving unit is further configured to receive the numerical 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 device meets the preset value, so that the first device determines whether there is a second device that meets the registration condition according to the number of received second response messages.
16. The apparatus of claim 15, wherein the device comprises a plurality of sensors,
the numerical value updating instruction comprises a first numerical value updating instruction which is determined by the first device when the receiving quantity of the first response message is larger than a first receiving quantity threshold value, and the first numerical value updating instruction is used for indicating second devices with the registration count value meeting the preset value to update the respective registration count value;
the device further comprises an updating unit, configured to update the local registration count value based on the first numerical value updating instruction if the local registration count value meets the preset value after the receiving unit receives the first numerical value updating instruction sent by the first device;
or alternatively
The numerical value updating instruction comprises a second numerical value updating instruction which is determined by the first device under the condition that the receiving quantity of the first response message is smaller than a first receiving quantity threshold value, and the second numerical value updating instruction is used for indicating second devices of which the registration count values do not meet the preset value to update the respective registration count values;
the device further comprises an updating unit, configured to update the local registration count value based on the second value updating instruction if the local registration count value does not meet the preset value after the receiving unit receives the second value updating instruction sent by the first device;
Or alternatively
The numerical value updating instruction comprises a first numerical value updating instruction which is determined based on the number of times that a data transmission bus between the first device and the second device is in a crowded state when the receiving number of the first response messages is larger than a first receiving number threshold value, wherein the number of times that the data transmission bus is in the crowded state is obtained based on statistics of the receiving number of the first response messages;
or alternatively
The numerical value updating instruction comprises a second numerical value updating instruction which is determined based on the number of times that a data transmission bus between the first device and the second device is in an idle state when the receiving quantity of the first response message is smaller than a first receiving quantity threshold value, wherein the number of times that the data transmission bus is in the idle state is obtained based on statistics of the receiving quantity of the first response message;
the first numerical update instruction includes: the first device determines a first update sub-instruction when the number of received first response messages is greater than a first receiving 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 update sub-instruction is used for indicating a second device of which the registration count value meets the preset value to randomly update the registration count value; or alternatively
The first numerical update instruction includes: the first device determines a third updating sub-instruction when the number of received first response messages is greater than a first receiving amount threshold 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, wherein the third updating sub-instruction is used for indicating second devices with registration count values meeting the preset value to update the respective registration count values to N times of the current value and then add a one-bit random number, and N is an integer which is not zero;
or alternatively
The second numerical update instruction includes: the first device determines a second updating sub-instruction when the number of received first response messages is smaller than a first receiving amount threshold and the number of times that the data transmission bus is in an idle state is smaller than a second number of times threshold, 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 alternatively
The second numerical 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 receiving amount threshold and the number of times that the data transmission bus is in an idle state is larger than or equal to a second number threshold, wherein the fourth updating sub-instruction is used for indicating a second device with registration count values not meeting the preset value to update the respective registration count values to a value obtained by rounding the quotient of the current value and N, and N is an integer which is not zero;
The first response message or the second response message comprises the equipment information of the second equipment, so that the first equipment detects the equipment information and determines the receiving quantity 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 machine.
17. A computer device, the computer device comprising: 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, perform the device registration method of any one of claims 1 to 6 or the device registration method of any one of claims 7 to 12.
18. A device registration system, wherein the device registration system comprises a first device and a second device; the first device being configured to perform the device registration method as claimed in any one of claims 1 to 6; the second device is configured to perform the device registration method as claimed in 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 to 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 CN113709224A (en) 2021-11-26
CN113709224B true 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 (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

Also Published As

Publication number Publication date
CN113709224A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
JP3930649B2 (en) Wireless network operation method
EP2489169B1 (en) Group owner selection with crossing requests
US9552490B1 (en) Managing resource dependent workflows
BRPI0806772B1 (en) SYSTEM FOR REMOTE MONITORING OF A DEVICE, AND METHOD OF TRACKING A DEVICE
US20140143588A1 (en) Instant Communication Error Indication From Slave
PT2311220E (en) Collision mitigation for multicast transmission in wireless local area networks
KR101742997B1 (en) Method and Apparatus for Transmitting and Receiving of Data
JP3872524B2 (en) Registration of mobile packet data terminals after disaster
JP4121302B2 (en) Wireless data collection system, wireless terminal
US20070055968A1 (en) Reliable BIOS updates
CN110944371A (en) Paging configuration adjustment method, terminal, network equipment and storage medium
US7117283B2 (en) Multi-master extended I2C protocol
US20230185613A1 (en) Electronic device for securing usable dynamic memory and operating method thereof
EP2259625A1 (en) Paging signal transmission method, wireless base station, and network device
CN113709224B (en) Equipment registration method, device, equipment, system and storage medium
WO2008134556A1 (en) System and method for remote operation of a node
EP3923139A1 (en) Electronic control device and method for using non-volatile memory
EP3454153A1 (en) Data storage method for electronic control system of vehicle, and electronic control system
CN109996319B (en) Beacon signal processing device
CN116827493A (en) Dual-mode communication method and device based on HPLC and micropower
EP3739961A1 (en) Indication method for system broadcast information, network device, and terminal device
US20090248862A1 (en) Device and Computer Readable Medium
CN102255902A (en) Network equipment function sharing method and device
CN108738111B (en) Verification association method, mobile wireless access point and station
CN114584930B (en) Multi-device communication method, electronic device, and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant