Equipment access method and device, computer readable storage medium and program product

By obtaining device parameters from the communication address set through network nodes and automatically establishing communication connections, the problem of cumbersome device access after gateway replacement is solved, achieving efficient and accurate device access.

CN121585704APending Publication Date: 2026-02-27GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511952723.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

When the gateway is replaced, the old gateway's configuration is lost, causing the new gateway to be unable to connect to the device normally, making the device connection process cumbersome and inefficient.

Method used

The network node obtains the device parameters from a preset set of communication addresses, establishes a communication connection with the device using the parameters, and realizes automatic device access. This includes storing parameters in the device's registers and using a protocol library and register address library to determine the device model and communication protocol.

Benefits of technology

No manual parameter input is required, improving the efficiency and accuracy of device connection and simplifying the device connection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121585704A_ABST
    Figure CN121585704A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, in particular to an equipment access method and device, a computer readable storage medium and a program product. The equipment access method comprises the following steps: sending a reading request according to a communication address set; under the condition that a response for the reading request is received from the communication address in the communication address set, determining parameters of equipment corresponding to the communication address; and establishing communication connection with the equipment according to the parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to a device access method and apparatus, a computer-readable storage medium, and a program product. Background Technology

[0002] With the development of communication technologies, such as the Internet of Things (IoT), they are being applied to more and more fields to improve the intelligence and efficiency of equipment management. Taking IoT as an example, the communication connection between gateways and terminal devices enables gateways to acquire data from terminal devices and manage terminal devices.

[0003] However, in related technologies, when the gateway is replaced, for example, in the event of a gateway failure, the configuration of the old gateway is lost, causing the new gateway to be unable to connect to the device normally. Manual reconfiguration is required, making the device access process cumbersome and inefficient. Summary of the Invention

[0004] In view of this, the present disclosure provides a device access method and apparatus, a computer-readable storage medium and a program product, which can effectively solve the above problems.

[0005] According to a first aspect of this disclosure, a device access method is provided, comprising: sending a read request based on a set of communication addresses; upon receiving a response to the read request from a communication address in the set of communication addresses, determining parameters of a device corresponding to the communication address; and establishing a communication connection with the device based on the parameters.

[0006] In the technical solution of this disclosure embodiment, the network node can obtain the device parameters from a preset set of communication addresses and establish a communication connection with the device using the parameters, thereby realizing automatic device access without the need for manual parameter input and improving the efficiency of device access.

[0007] In some embodiments, the communication address includes the register address of the device, and determining the parameters of the device corresponding to the communication address includes: if the parameters are stored in the register of the device, obtaining the parameters from the register of the device according to the register address, wherein the parameters include at least one of the device model and communication protocol.

[0008] In the technical solution of this disclosure embodiment, by storing the parameters corresponding to the device in the device's register, the network node can automatically read the corresponding parameters from the device's register when accessing the network, thereby improving the efficiency of device access.

[0009] In some embodiments, determining the parameters of the device corresponding to the communication address further includes: if the device's register does not store the parameters, determining the device's model based on the response to the read request; and determining the device's communication protocol based on the device's model.

[0010] In the technical solution of this disclosure embodiment, even when no parameters are stored in the device's register, the network node can still determine the device model through the received response, and then determine the device's communication protocol as the basic communication parameters corresponding to the device, thereby improving the efficiency of device access.

[0011] In some embodiments, determining the device model based on the response to the read request includes: determining the device model based on at least one of a preset protocol library and a register address library, wherein the protocol library includes a range of communication protocols corresponding to each device model, and the register address library includes a range of register addresses corresponding to each device model.

[0012] In the technical solution of this disclosure embodiment, a protocol library and register address library can be built into the network node. Based on the correspondence between the device model and the communication protocol and / or register address, the device model can be accurately determined after receiving the response, thereby improving the accuracy of device access.

[0013] In some embodiments, the parameters include parameters stored in the device's registers during the device's historical communication processes.

[0014] In the technical solution of this disclosure embodiment, parameters can be stored in the device's register while the old network node is running normally, so that they can be read after the network node is replaced, thereby improving the efficiency of device access.

[0015] In some embodiments, the parameters of the device include a historical communication address corresponding to the device and a communication protocol of the device. Establishing a communication connection with the device according to the parameters includes: determining whether the historical communication address is supported based on the communication address range corresponding to the communication protocol; and if the historical communication address is supported, establishing a communication connection with the device based on the historical communication address.

[0016] In the technical solution of this disclosure embodiment, after reading the device parameters, it is determined whether the historical communication address in the parameters can be reused through the communication address range corresponding to the communication protocol. If it can be reused, a connection is directly established with the device based on the historical communication address, thereby further improving the efficiency of device access.

[0017] In some embodiments, determining whether to support the historical communication address based on the communication address range corresponding to the communication protocol includes: determining whether to support the historical communication address based on the idle communication address range and the communication address range corresponding to the communication protocol.

[0018] In the technical solution of this disclosure embodiment, in addition to the communication address range corresponding to the communication protocol, the idle address range of network nodes can be further considered to determine whether historical communication addresses can be reused, thereby avoiding address conflicts and improving the accuracy of device access.

[0019] In some embodiments, establishing a communication connection with the device according to the parameters further includes: if the historical communication address is not supported, determining the current communication address according to the communication address range corresponding to the communication protocol, and sending it to the device; and establishing a communication connection with the device according to the current communication address.

[0020] In the technical solution of this disclosure embodiment, when historical communication addresses cannot be reused, a new communication address can be reallocated to the device according to the range of communication addresses corresponding to the communication protocol in the network node, and a communication connection can be established based on the new communication address, thereby improving the accuracy of device access.

[0021] In some embodiments: the device access method is executed by an IoT gateway, the device including a frequency converter in the IoT; and / or the historical communication address includes at least one of a historical master address and a historical slave address.

[0022] In the technical solution of this disclosure embodiment, the network node executing the device access method can be an IoT gateway, and the device to be accessed can be a frequency converter in the IoT. By connecting the frequency converter to the IoT through the gateway based on the frequency converter's parameters, the efficiency of frequency converter access can be improved. Furthermore, the device's historical communication address can include not only the device's own historical slave address but also the historical master address assigned to the device by the old network node. These parameters, provided as a reference for the replaced network node during access, can further improve the device access efficiency.

[0023] In some embodiments, sending a read request based on a set of communication addresses includes: sending a read request to an initial communication address in the set of communication addresses; if no response is received from the initial communication address, sending a read request to the next communication address in the set of communication addresses; and if no response is received from any communication address in the set of communication addresses, waiting for a specified time or waiting for a specified event, and then resending the read request.

[0024] In the technical solution of this disclosure embodiment, a read request can be sent to each communication address in the communication address set one by one through polling. Upon receiving a response from a certain communication address, it can be determined that a corresponding device exists at that communication address, and subsequent device access can be performed based on the device's parameters. By using polling, the timing of device access can be ensured, conflicts between devices during the access process can be avoided, and the accuracy of device access can be improved.

[0025] In some embodiments, multiple responses to the read request are received from multiple communication addresses, and the devices corresponding to the multiple communication addresses include multiple devices, with each communication address corresponding to one of the multiple devices.

[0026] In the technical solution of this disclosure embodiment, a communication address that corresponds one-to-one with the device can be used, thereby avoiding conflicts when obtaining device parameters based on the communication address and improving the accuracy of device access.

[0027] According to a second aspect of this disclosure, a device access apparatus is provided, comprising: a sending module configured to send a read request based on a set of communication addresses; a determining module configured to determine parameters of a device corresponding to a communication address upon receiving a response to the read request from a communication address in the set of communication addresses; and a connecting module configured to establish a communication connection with the device based on the parameters.

[0028] In the technical solution of this disclosure embodiment, the device access device can obtain the device parameters from a preset set of communication addresses and establish a communication connection with the device using the parameters, thereby realizing automatic device access without the need for manual parameter input and improving the efficiency of device access.

[0029] According to a third aspect of this disclosure, a device access apparatus is provided, comprising: at least one memory; and at least one processor coupled to the at least one memory, the at least one processor being configured to execute a device access method as described in any embodiment of this disclosure based on instructions stored in the at least one memory.

[0030] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the device access method as described in any embodiment of this disclosure.

[0031] According to a fifth aspect of this disclosure, a computer program product is provided that, when run on a computer, causes the computer to implement the device access method as described in any embodiment of this disclosure.

[0032] In the technical solution of this disclosure embodiment, the device access method allows network nodes to obtain device parameters from a preset set of communication addresses and establish a communication connection with the device using the parameters, thereby achieving automatic device access without the need for manual parameter input and improving the efficiency of device access. Attached Figure Description

[0033] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the specification, serve to explain the principles of this disclosure.

[0034] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:

[0035] Figure 1 A flowchart illustrating a device access method according to some embodiments of the present disclosure is shown;

[0036] Figure 2 This diagram illustrates a flowchart of sending a read request according to some embodiments of the present disclosure;

[0037] Figure 3A A flowchart illustrating the establishment of a communication connection according to some embodiments of the present disclosure is shown;

[0038] Figure 3B A flowchart illustrating the establishment of a communication connection according to other embodiments of this disclosure is shown;

[0039] Figure 4 The diagram illustrates a method for performing device access in some embodiments of this disclosure;

[0040] Figure 5 A schematic diagram illustrating the determination of parameters according to some embodiments of the present disclosure is shown;

[0041] Figure 6 This diagram illustrates a process for determining communication parameters based on a gateway in some embodiments of the collapse;

[0042] Figure 7 A block diagram of a device access apparatus according to some embodiments of the present disclosure is shown;

[0043] Figure 8 This is a block diagram illustrating a device access apparatus according to other embodiments of the present disclosure;

[0044] Figure 9 This is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.

[0045] It should be understood that the dimensions of the various parts shown in the accompanying drawings are not drawn to actual scale. Furthermore, the same or similar reference numerals denote the same or similar components. Detailed Implementation

[0046] Various embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The descriptions of the embodiments are merely illustrative and are in no way intended to limit the scope of the disclosure or its application or use. The present disclosure may be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided so that this disclosure will be thorough and complete, and will fully express the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specifically stated, the relative arrangement of components and steps set forth in these embodiments should be interpreted as merely illustrative and not as limiting.

[0047] The terms “first,” “second,” and similar words used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different parts. Words such as “including” mean that the element preceding the word covers the element listed after the word, and do not exclude the possibility of covering other elements as well.

[0048] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.

[0049] All terms used in this disclosure (including technical or scientific terms) have the same meaning as understood by one of ordinary skill in the art to which this disclosure pertains, unless otherwise specifically defined. It should also be understood that terms defined in a general dictionary, such as a dictionary, should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or highly formalized meaning, unless expressly defined herein.

[0050] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0051] In related technologies, when a gateway is replaced, for example, when the gateway fails, the configuration of the old gateway is lost, causing the new gateway to be unable to connect to the device normally. Manual reconfiguration is required, making the device connection process cumbersome and inefficient.

[0052] In view of this, this disclosure proposes a device access method that allows network nodes to obtain device parameters from a preset set of communication addresses and establish a communication connection with the device using the parameters, thereby achieving automatic device access without the need for manual parameter input and improving the efficiency of device access.

[0053] First, combined Figure 1 The device access method in this disclosure is described. Figure 1 A flowchart illustrating a device access method according to some embodiments of the present disclosure is shown.

[0054] like Figure 1 As shown, the device access method may include: step S1, sending a read request according to a set of communication addresses; step S2, upon receiving a response to the read request from a communication address in the set of communication addresses, determining the parameters of the device corresponding to the communication address; and step S3, establishing a communication connection with the device according to the parameters.

[0055] The aforementioned set of communication addresses could be, for example, a set of possible communication addresses corresponding to a device. For instance, in a master-slave architecture between a network node and a device, the set of communication addresses could be, for example, all possible slave addresses. For example, in the case of using the Modbus protocol between the network node and the device, the range of all possible slave addresses could be, for example, from 1 to 247.

[0056] The parameters of the aforementioned device may include, for example, the device model, the types of protocols that can be used, the communication address, and write flags. Using these parameters, network nodes can establish communication connections with the device.

[0057] By using a set of communication addresses, after a network node is replaced, the possible communication addresses of the device can be traversed to obtain the device's parameters and enable subsequent device access, thereby improving the efficiency of device access.

[0058] The following will detail the steps involved in the device access method described above. First, we will combine... Figure 2 This section describes how the network node sends a read request in step S1. Figure 2 A flowchart illustrating the sending of a read request according to some embodiments of the present disclosure is shown.

[0059] like Figure 2 As shown, sending a read request according to the communication address set may include: step S11, sending a read request to the initial communication address in the communication address set; step S12, if no response is received from the initial communication address, sending a read request to the next communication address in the communication address set; step S13, if no response is received from any communication address in the communication address set, waiting for a specified time or waiting for a specified event, and resending the read request.

[0060] In other words, network nodes can use a polling method to send read requests to the communication addresses where devices may exist. If a network node receives a valid response from a communication address, it can determine that a corresponding device exists at that address and determine the device's parameters based on the response.

[0061] Continuing to refer to the master-slave architecture example using the Modbus protocol above, the communication address set includes slave addresses from 1 to 247, and the initial communication address can be set to slave address 1 by default.

[0062] Network nodes can send read requests to the slave addresses in the order of their slave addresses. If a read request is sent to slave address 1 and no valid response is received, a read request can be sent to slave address 2 until a valid response is received, or all slave addresses can be traversed.

[0063] If a valid response is received from slave address 5, the parameters of the corresponding device can be determined based on slave address 5.

[0064] In some embodiments, multiple responses to the read request may be received from multiple communication addresses. Correspondingly, the devices corresponding to the multiple communication addresses include multiple devices. There may be a one-to-one correspondence between the multiple communication addresses and the multiple devices.

[0065] For example, if a valid response is received from slave addresses 5, 10, and 35, the parameters of the corresponding devices 5, 10, and 35 can be determined, and access to these devices can be performed.

[0066] By using a communication address that corresponds one-to-one with each device, conflicts can be avoided when retrieving device parameters based on the communication address, thus improving the accuracy of device access.

[0067] If no valid response is received from any of the slave addresses, the network node can temporarily enter a standby or listening state. After waiting for a specified time, such as 5 minutes, or after waiting for a specified event, it can resend a read request based on the set of slave addresses to attempt to obtain the device parameters.

[0068] Figure 2 In the illustrated embodiment, a polling method is used to send read requests to each communication address in the communication address set one by one. Upon receiving a response from a particular communication address, it can be determined that a corresponding device exists at that address, and subsequent device access is performed based on the device's parameters. The polling method ensures the timing of device access, avoids conflicts between devices during the access process, and improves the accuracy of device access.

[0069] The above text combines Figure 2 The method for sending read requests in the device access process has been described. Next, we will continue to describe how to determine the parameters of the device corresponding to the communication address in step S2.

[0070] In some embodiments, the communication address includes the register address of the device, and determining the parameters of the device corresponding to the communication address includes: if the parameters are stored in the register of the device, obtaining the parameters from the register of the device according to the register address, wherein the parameters include at least one of the device model and communication protocol.

[0071] A device's registers refer to the storage units within the device used to store operating parameters, instructions, and status. A device's register address is a communication address that allows interaction with the registers; it can be the device's own address or a further subdivided sub-communication address within the device's address.

[0072] If the parameters are stored in the device's registers, the network node can send a read request to the register based on its address to retrieve the device's parameters. By storing the device's corresponding parameters in its registers, network nodes can automatically read the corresponding parameters from the device's registers upon connection, thereby improving the efficiency of device access.

[0073] Device parameters may include, for example, the device model and the communication protocols it can use. The device model can be a specific model number or a brand name, among other parameters. These parameters enable synchronization between network nodes and devices, improving the efficiency of device access.

[0074] In addition, the device parameters may include other parameters such as a write flag. By obtaining the device's write flag, network nodes can, for example, send a message with a preset trigger value to the write flag during subsequent access processes to verify whether the device has successfully accessed the network, thereby improving the accuracy of device access.

[0075] The parameters in the registers can be, for example, parameters stored in the device's registers during the device's historical communication process. In other words, the network node before replacement can store the parameters of each device in the registers of each device while the system is running normally, so that the network node after replacement can read them from the registers, thereby improving the efficiency of device access.

[0076] In some embodiments, determining the parameters of the device corresponding to the communication address may further include: if the device's register does not store the parameters, determining the device's model based on the response to the read request; and determining the device's communication protocol based on the device's model.

[0077] In other words, even if the device's registers do not store the parameters, the network node can still determine the device's model, communication protocol, and other parameters based on the received response, using these as the basic communication parameters corresponding to the device, thereby improving the efficiency of device access.

[0078] Network nodes can determine the device model, for example, based on the register address or communication protocol in the received response.

[0079] For example, determining the device model based on the response to the read request may include: determining the device model based on at least one of a preset protocol library and a register address library, wherein the protocol library includes a range of communication protocols corresponding to each device model, and the register address library includes a range of register addresses corresponding to each device model.

[0080] The aforementioned protocol library may include the range of communication protocols corresponding to each device model, that is, the correspondence between device models and communication protocols.

[0081] The aforementioned register address library can include register address ranges corresponding to various device models, that is, the correspondence between device models and register addresses. For example, register address 0x0010 corresponds to model A, register address 0x0100 corresponds to model B, and register address 0x1000 corresponds to model C.

[0082] By pre-setting a protocol library or register address library in the network node, the network node can accurately determine the device model after receiving a response based on the correspondence between the device model and the communication protocol and / or register address, thereby improving the accuracy of device access.

[0083] The above text describes how the network node determines the device parameters in step S2. By analyzing the communication address, such as the device register address, the relevant parameters of the device corresponding to that address can be determined, so as to improve the efficiency and accuracy of device access.

[0084] Below, we will combine Figure 3A and Figure 3B This section describes how to establish a communication connection with the device based on its parameters in step S3. Figure 3A A flowchart illustrating the establishment of a communication connection according to some embodiments of the present disclosure is shown.

[0085] like Figure 3AAs shown, when the parameters of the device include the historical communication address corresponding to the device and the communication protocol of the device, step S3, establishing a communication connection with the device according to the parameters, includes: step S31, determining whether the historical communication address is supported according to the communication address range corresponding to the communication protocol; step S32, if the historical communication address is supported, establishing a communication connection with the device according to the historical communication address.

[0086] In the above embodiments, the historical communication address corresponding to the device may be, for example, a communication address assigned to the device by an old network node during the device's historical communication process. The communication protocol may be, for example, the communication protocol used between the device and the old network node during the device's historical communication process.

[0087] As an example, the device access method can be executed by an IoT gateway, and the device may include a frequency converter in the IoT. By connecting the frequency converter to the IoT through the gateway based on the frequency converter's parameters, the efficiency of frequency converter access can be improved.

[0088] Furthermore, in the case of a master-slave architecture between network nodes and devices, the historical communication address can include at least one of the historical master address and the historical slave address. In other words, the device's historical communication address can include not only the device's own historical slave address, but also the historical master address assigned to the device by the old network node. These parameters, provided for reference when a new network node connects, can further improve the device's access efficiency.

[0089] In step S31, the network node can determine whether the historical communication address of the device can be reused based on the communication address range corresponding to the communication protocol.

[0090] For example, the replaced network node can determine the communication protocol used for communication with the device by using its own allowed communication protocols and the communication protocols allowed by the device. Subsequently, based on the correspondence between communication protocols and communication addresses, the range of communication addresses that the network node can use in communication can be determined, and whether the device's historical communication addresses are supported can be determined by checking whether they fall within that range.

[0091] In some embodiments, determining whether to support the historical communication address based on the communication address range corresponding to the communication protocol may include: determining whether to support the historical communication address based on the idle communication address range and the communication address range corresponding to the communication protocol.

[0092] The range of unused addresses for a network node can be determined, for example, based on the cached blank addresses within the network node. If a device's historical communication address belongs to a blank address in the network node that has not been assigned a function, it can be determined that the historical communication address is valid, meaning the network node supports the historical communication address.

[0093] In the above embodiments, in addition to the communication address range corresponding to the communication protocol, the idle address range of network nodes can also be further considered to determine whether historical communication addresses can be reused, thereby avoiding address conflicts and improving the accuracy of device access.

[0094] In step S32, if the network node determines that the historical communication address can be reused, it can directly use the device's historical communication address to establish a communication connection with the device without assigning a new communication address to the device.

[0095] It should be understood that the above-mentioned historical communication address is only an example of a device parameter. In addition to historical communication data, other parameters may also be included so that network nodes can determine whether the address can be reused for subsequent device access.

[0096] Figure 3A This paper illustrates an embodiment of the device access method according to the present disclosure, which establishes a communication connection based on device parameters. In the above embodiment, after reading the device parameters, the system determines whether a historical communication address in the parameters can be reused based on the communication address range corresponding to the communication protocol. If reuse is possible, a connection is directly established with the device based on the historical communication address, thereby further improving the efficiency of device access.

[0097] Figure 3B A flowchart illustrating the establishment of a communication connection according to other embodiments of this disclosure is shown. For example... Figure 3B As shown, in Figure 3A Based on the above, establishing a communication connection with the device according to the parameters may further include: step S33, in the absence of support for the historical communication address, determining the current communication address according to the communication address range corresponding to the communication protocol, and sending it to the device; step S34, establishing a communication connection with the device according to the current communication address.

[0098] In step S33, if the network node does not support the device's historical communication address, a new communication address can be assigned to the device based on the range of communication addresses that the network node can use in communication, that is, the current communication address can be determined.

[0099] After determining the current communication address, the network node can send the reassigned communication address to the device so that a communication connection can be established between the network node and the device using the current communication address.

[0100] In addition, during the process of determining the current communication address, network nodes can also refer to the idle address range mentioned above, which is the blank address cached in the network node, to determine the current communication address to be reassigned by the device.

[0101] After determining the reassigned current communication address, the updated communication address can also be stored in the device's register, that is, the communication address stored in the device's register is updated for later use.

[0102] In step S34, the network node can establish a communication connection with the device based on the updated current communication address.

[0103] Figure 3B This illustration shows another embodiment of establishing a communication connection based on device parameters according to the embodiments of this disclosure. When historical communication addresses cannot be reused, a new communication address can be reallocated to the device based on the range of communication addresses corresponding to the communication protocol in the network nodes, and a communication connection can be established based on the new communication address, thus improving the accuracy of device access.

[0104] The preceding text has detailed each step of the device access method proposed in this disclosure. Below, we will combine... Figures 4 to 6 This section describes the specific implementation of the device access method. Figure 4 The diagram illustrates a method for performing device access in some embodiments of this disclosure.

[0105] Figure 4 The illustrated embodiment shows the access process of a frequency converter to a gateway in the Internet of Things (IoT). For example... Figure 4 As shown, the process of the device access method may include processes 401 to 415.

[0106] In process 401, device access can begin, for example, after the gateway is replaced, the device can be reconnected.

[0107] In process 402, the gateway's communication interface can be initialized to facilitate the subsequent establishment of a communication connection between the gateway and the frequency converter. For example, the gateway can use an RS485 / Ethernet interface for communication with the frequency converter.

[0108] In addition, the range of communication protocols supported by the gateway can be determined based on the gateway's communication interface, so as to determine the communication protocol to be used with the frequency converter later.

[0109] In process 403, a protocol library and a parameter address mapping table can be loaded. The protocol library includes register address ranges corresponding to various device models, and the parameter address mapping table includes communication address ranges corresponding to the communication protocol.

[0110] In process 404, you can set the initial value of the slave address, for example, set the initial slave address to slave address 1.

[0111] In process 405, a read request can be sent to the current slave address. After sending the read request, you can wait for the slave address to respond.

[0112] In process 406, you can determine whether a valid response has been received.

[0113] In process 407, if no valid response is received or the response times out, the value of the slave address can be incremented by 1, for example, changing slave address 1 to slave address 2.

[0114] In process 408, if a valid response is received, the returned data from the slave address can be parsed.

[0115] Specifically, in process 408, the brand and model of the frequency converter can be determined. For example, this can be done by reading directly from the frequency converter's registers. Alternatively, the brand and model can be determined through the communication protocol or register address in the response sent by the frequency converter.

[0116] Figure 5 A schematic diagram illustrating the determination of parameters according to some embodiments of the present disclosure is shown. For example... Figure 5 As shown, the old gateway 51 can save the inverter's parameters in the inverter's register 52 during normal operation, and update the protocol library and register address library 53 stored at the gateway.

[0117] After the gateway is replaced or restarted, the new gateway 54 can directly read the inverter parameters from register 52, or determine the inverter parameters based on the protocol library, register address library, and inverter response.

[0118] In addition, parameters such as the inverter's historical communication address can be obtained from the inverter's registers, which can be used to determine the specific access parameters with the inverter later.

[0119] The parameters of the frequency converter may also include parameters such as the write flag bit of the frequency converter, which are used to verify whether the communication status between the gateway and the frequency converter is normal after connection.

[0120] In process 409, the communication parameters used to communicate with the frequency converter can be determined. The following will combine... Figure 6 This section details the internal processing of the gateway and the process for determining communication parameters. Figure 6 This diagram illustrates a process for determining communication parameters based on a gateway in some embodiments of the collapse.

[0121] like Figure 6As shown, gateway 6 may include inverter identification area 61, inverter parameter cache area 62, special data cache area 63, IoT gateway feature parameter cache area 64, feature parameter generation area 65, and communication processing area 66.

[0122] The inverter identification area 61 may include an inverter protocol library 611 and an inverter address polling block 612, which are used to poll the slave address to determine the inverter parameters.

[0123] The inverter parameter buffer 62 may include an inverter identification result buffer 621, an inverter data reading buffer 622, and an inverter blank address feature parameter reading 623, which are used to buffer the parameters determined by the inverter identification area 61.

[0124] The special data buffer 63 may include a feature parameter protocol library 631, a blank inverter feature parameter buffer 632, and a feature parameter determination area 633. The feature parameter protocol library may include the correspondence between various protocols and the feature parameters supported by the gateway. The blank inverter feature parameter buffer may include blank inverter addresses cached in the gateway, which can be used to determine the gateway's idle communication addresses. The feature parameter determination area, based on the above references, determines the parameters used for communication between the gateway and the inverter.

[0125] The IoT gateway feature parameter cache 64 may include the master station address used when the gateway communicates with the frequency converter, which is used to distinguish each gateway when there are multiple gateways in the IoT.

[0126] The feature parameter generation area 65 can record and cache the inverter's feature parameters when they are available, and generate the corresponding feature parameters based on the inverter's blank address when no feature parameters are available.

[0127] The communication processing area 66 can, for example, interact with the frequency converter via an RTU (Remote Terminal Unit) interface. This includes receiving the frequency converter's response to a read request, retrieving parameters stored in the frequency converter's registers, or sending characteristic parameters generated by the frequency converter.

[0128] Figure 6 An example of a gateway architecture is shown. From Figure 6 As can be seen, after the gateway receives the response from the frequency converter, it can determine the parameters used to communicate with the frequency converter, such as the communication protocol, master station address, slave station address, etc., which is one way of implementing process 409.

[0129] Now, let's go back to... Figure 4 Next, we will introduce an example process for device access methods.

[0130] In process 410, after determining the communication parameters, a communication connection can be established with the frequency converter to collect data from the frequency converter. For example, when the frequency converter is connected to a water pump, parameters of the water pump connected to each frequency converter can be collected through periodic data acquisition tasks.

[0131] In process 411, after data collection, the data can be continuously uploaded to the server through the communication connection between the gateway and the server, such as the MQTT (Message Queuing Telemetry Transport) protocol.

[0132] In process 412, after confirming that there are no communication issues, the frequency converter can be marked as identified, thus completing the frequency converter connection. Furthermore, the slave address value can be incremented by 1 to enable the gateway to connect to frequency converters corresponding to other slave addresses.

[0133] In process 413, it can be determined whether the current value of the slave address is less than or equal to a preset maximum value, for example in... Figure 4 In the example shown using a master-slave architecture, the maximum value of the slave address is 247.

[0134] In process 414, if the slave address is less than or equal to the preset maximum value, the process can return to process 405 and continue sending a read request to the next slave address.

[0135] In process 415, if the slave address is greater than the maximum value, it can be determined that the first round of scanning has been completed, enter standby / listening mode, and wait for a specified time interval or trigger a specified event before scanning again.

[0136] The above describes the device access method provided in this disclosure. Through the device access method described above, network nodes can obtain device parameters from a preset set of communication addresses and establish a communication connection with the device using these parameters, thereby achieving automatic device access without requiring manual parameter input and improving the efficiency of device access.

[0137] The following is for reference. Figure 7 and Figure 8 This invention describes a device access apparatus according to embodiments of the present disclosure, used to execute any of the embodiments of the control methods described above. Figure 7 A block diagram of a device access apparatus according to some embodiments of the present disclosure is shown.

[0138] like Figure 7As shown, the device access device 7 includes a sending module 71, configured to send a read request based on a set of communication addresses; a determining module 72, configured to determine the parameters of the device corresponding to the communication address when a response to the read request is received from a communication address in the set of communication addresses; and a connecting module 73, configured to establish a communication connection with the device based on the parameters.

[0139] The sending module 71 of the device access device can be used to perform Figure 1 Step S1. The device access device determination module 72 can be used to perform... Figure 1 Step S2. The connection module 73 of the device access device can be used to perform... Figure 1 Step S3 in the process.

[0140] Figure 8 This is a block diagram illustrating a device access apparatus according to other embodiments of the present disclosure. For example... Figure 8 As shown, the device access device 8 includes at least one memory 81; and at least one processor 82 coupled to the at least one memory, the at least one processor being configured to operate based on instructions stored in the at least one memory.

[0141] The aforementioned device access device can obtain device parameters from a preset set of communication addresses and establish a communication connection with the device using these parameters, thereby enabling automatic device access without the need for manual parameter input and improving the efficiency of device access.

[0142] Figure 9 This is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.

[0143] like Figure 9 As shown, computer system 9 can be represented in the form of a general computing device. Computer system 9 includes memory 91, processor 92, and bus 90 connecting different system components.

[0144] The memory 91 can be various forms of computer-readable storage media, such as system memory, non-volatile storage media, etc. System memory may store, for example, an operating system, application programs, a bootloader, and other programs. System memory may include volatile storage media, such as random access memory (RAM) and / or cache memory. Non-volatile storage media may store, for example, instructions for performing a corresponding embodiment of the device access method. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, etc.

[0145] Processor 92 can be implemented using a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic devices, discrete hardware components such as discrete gates or transistors. Accordingly, each module can be implemented by executing instructions in the central processing unit (CPU) memory to perform the corresponding steps, or by implementing dedicated circuits to perform the corresponding steps.

[0146] Bus 90 can use any of the various bus architectures. For example, bus architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MCA) bus, and the Peripheral Component Interconnect (PCI) bus.

[0147] The computer system 9 may also include an input / output interface 93, a network interface 94, and a storage interface 95. These interfaces 93, 94, and 95, as well as the memory 91 and processor 92, can be connected via a bus 90. The input / output interface 93 provides a connection interface for input / output devices such as a monitor, mouse, and keyboard. The network interface 94 provides a connection interface for various networked devices. The storage interface 95 provides a connection interface for external storage devices such as floppy disks, USB flash drives, and SD cards.

[0148] According to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product that, when run on a computer, causes the computer to implement the device access method described in any of the foregoing embodiments. The computer program product includes computer instructions carried on a computer-readable medium, the computer instructions containing program code for performing the methods shown in the flowcharts.

[0149] Various embodiments of this disclosure have now been described in detail. To avoid obscuring the concept of this disclosure, some details known in the art have not been described. Those skilled in the art will fully understand how to implement the technical solutions disclosed herein based on the above description.

[0150] While specific embodiments of this disclosure have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments or equivalent substitutions can be made to some technical features without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A device access method, comprising: Send a read request based on the set of communication addresses; Upon receiving a response to the read request from a communication address in the set of communication addresses, determine the parameters of the device corresponding to the communication address; A communication connection is established with the device based on the parameters.

2. The device access method according to claim 1, wherein, The communication address includes the register address of the device, and the parameters for determining the device corresponding to the communication address include: If the parameters are stored in the device's registers, the parameters are retrieved from the device's registers according to the register address. The parameters include at least one of the device's model and communication protocol.

3. The device access method according to claim 2, wherein, Determining the parameters of the device corresponding to the communication address further includes: If the device's register does not store the parameter, the device model is determined based on the response to the read request; The communication protocol of the device is determined based on the device model.

4. The device access method according to claim 3, wherein, Based on the response to the read request, the device model is determined by: The model of the device is determined based on at least one of the preset protocol library and register address library, wherein the protocol library includes the communication protocol range corresponding to each model of the device, and the register address library includes the register address range corresponding to each model of the device.

5. The device access method according to claim 2, wherein, The parameters include those stored in the device's registers during the device's historical communication processes.

6. The device access method according to claim 1, wherein, The parameters of the device include the historical communication address corresponding to the device and the communication protocol of the device. Establishing a communication connection with the device based on the parameters includes: Determine whether the historical communication address is supported based on the communication address range corresponding to the communication protocol; If the historical communication address is supported, a communication connection is established with the device based on the historical communication address.

7. The device access method according to claim 6, wherein, Determining whether the historical communication address is supported based on the communication address range corresponding to the communication protocol includes: Based on the range of idle communication addresses and the range of communication addresses corresponding to the communication protocol, determine whether the historical communication address is supported.

8. The device access method according to claim 6, wherein, Establishing a communication connection with the device based on the parameters further includes: If the historical communication address is not supported, the current communication address is determined according to the communication address range corresponding to the communication protocol and sent to the device; Establish a communication connection with the device based on the current communication address.

9. The device access method according to claim 6, wherein: The device access method is executed by an IoT gateway, and the device includes a frequency converter in the IoT; and / or The historical communication address includes at least one of the historical master station address and the historical slave station address.

10. The device access method according to claim 1, wherein, Based on the set of communication addresses, sending a read request includes: Send a read request to the initial communication address in the set of communication addresses; If no response is received from the initial communication address, a read request is sent to the next communication address in the set of communication addresses; If no response is received from any of the communication addresses in the set of communication addresses, wait for a specified time or a specified event, and then resend the read request.

11. The device access method according to any one of claims 1 to 10, wherein, Multiple responses to the read request are received from multiple communication addresses, and the devices corresponding to the multiple communication addresses include multiple devices, with each communication address corresponding to one of the multiple devices.

12. A device access apparatus, comprising: The sending module is configured to send read requests based on a set of communication addresses; The determination module is configured to determine the parameters of the device corresponding to the communication address when a response to the read request is received from a communication address in the set of communication addresses; The connection module is configured to establish a communication connection with the device based on the parameters.

13. A device access device, comprising: At least one memory; as well as At least one processor coupled to the at least one memory, the at least one processor being configured to execute the device access method as described in any one of claims 1 to 11 based on instructions stored in the at least one memory.

14. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the device access method as described in any one of claims 1 to 11.

15. A computer program product, when run on a computer, causes the computer to implement the device access method as described in any one of claims 1 to 11.