Address determination method and device of device, electronic equipment and storage medium

By creating an address mapping table and mapping package, the I2C protocol's shortcomings in addressing 10-bit address devices are solved, effective communication with different address devices is achieved, and address address addressing requirements of all devices on the bus are met.

CN119271603APending Publication Date: 2025-01-07SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411151531.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

SMBus, a subset of the I2C protocol in the prior art, can only support addressing I2C devices with 7 bit addresses, and cannot realize all addressing communications of 10 bit addresses.

Method used

By creating an address mapping table, obtaining the device to be detected, and mapping and reverse mapping package are carried out based on the message data and the device address in the initial mapping table, the target address communication address of the device to be detected is obtained, so as to realize the device with different addresses Destination addressing.

Benefits of technology

The addressing problem of 10-bit address devices is solved, and communication of all device addresses on the bus is realized, meeting the addressing needs of different address devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271603A_ABST
    Figure CN119271603A_ABST
Patent Text Reader

Abstract

The invention provides a device address determination method and device, electronic equipment and a storage medium, and the method comprises the steps: creating an address mapping table, and obtaining a to-be-detected device; wherein the address mapping table comprises a corresponding relation between the detection device and the device address; when the to-be-detected device does not belong to the detection device in the address mapping table, registering the to-be-detected device in the address mapping table to obtain an initial mapping table; obtaining message data sent by a file interface and a to-be-detected device on a bus called by an application layer; and performing mapping packaging and reverse mapping packaging according to the message data and the device address in the initial mapping table to obtain a target addressing communication address corresponding to the device to be detected. According to the technical scheme, mapping packaging and reverse mapping packaging are carried out according to the message data and the device address in the initial mapping table, the target addressing communication address corresponding to the to-be-detected device is obtained, and the target addressing communication addresses of the to-be-detected devices with different addresses are determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of extended address communication technology, and in particular to a device address determination method, device, electronic equipment and storage medium. Background Art

[0002] The Inter Integrated Circuit Bus (I2C) is a simple half-duplex two-wire universal bus protocol standard. It uses a clock line and a data line to transfer information between two devices connected to the bus, providing a simple and efficient method for data exchange between devices.

[0003] At present, in the prior art, SMBus, a subset of the I2C protocol, can only support addressing of I2C devices with 7-bit addresses. Therefore, when devices with 10-bit addresses are mounted on the bus, addressing communication of all devices on the bus cannot be achieved. Summary of the invention

[0004] The present invention provides a device address determination method, device, electronic device and storage medium, which are used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses. When a device with 10-bit addresses is mounted on a bus, addressing communication of all devices on the bus cannot be realized. The method achieves this by acquiring the application layer calling a file interface and message data sent by a device to be detected on the bus; mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in an initial mapping table to obtain the target addressing communication address corresponding to the device to be detected, thereby determining the target addressing communication address of devices to be detected with different addresses, and meeting the addressing of devices to be detected with different addresses.

[0005] The present invention provides a method for determining an address of a device, comprising the following steps.

[0006] An address mapping table is created, and the device to be detected is obtained; wherein the address mapping table contains the correspondence between the detection device and the device address.

[0007] In the case that the device to be detected does not belong to the detection devices in the address mapping table, the device to be detected is registered in the address mapping table to obtain an initial mapping table.

[0008] Get the application layer calling file interface and the message data sent by the device to be detected on the bus.

[0009] Mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0010] A device address determination method provided according to the present invention also includes: determining whether the device to be detected belongs to the detection device in the address mapping table; if the device to be detected belongs to the detection device in the address mapping table, determining the target addressing communication address corresponding to the device to be detected according to the address mapping table.

[0011] According to a device address determination method provided by the present invention, a device to be detected is registered in an address mapping table to obtain an initial mapping table, including: registering the device to be detected in the address mapping table, and determining whether the device to be detected is a target address device; in the case that the device to be detected is a target address device, determining whether the device address of the device to be detected has an address duplication with a registered device that has been registered in the address mapping table; in the case that the device address of the device to be detected has an address duplication with a registered device that has been registered in the address mapping table, mapping the address duplication to the device address to obtain the initial mapping table, and returning to execute the step of determining whether the device to be detected belongs to the detection device in the address mapping table.

[0012] A device address determination method provided according to the present invention also includes: when the device to be detected is not the target address device, updating the target address device according to the device address of the device to be detected, completing the detection and registration of the device to be detected, obtaining an initial mapping table, and returning to execute the step of determining whether the device to be detected belongs to the detection device in the address mapping table.

[0013] According to a device address determination method provided by the present invention, mapping encapsulation and reverse mapping encapsulation are performed according to message data and the device address in an initial mapping table to obtain a target addressing communication address corresponding to the device to be detected, including: mapping encapsulation is performed according to message data and the device address in an initial mapping table to obtain a mapping message; reverse mapping encapsulation is performed on the mapping message and the device address in the initial mapping table to obtain a target addressing communication address corresponding to the device to be detected.

[0014] According to a device address determination method provided by the present invention, mapping and encapsulation are performed according to message data and the device address in an initial mapping table to obtain a mapping message, including: unpacking the message data to determine the data address corresponding to the data information of the device to be detected; mapping is performed according to the data address and the device address in the initial mapping table to obtain a mapping address; and message encapsulation is performed on the mapping address to obtain a mapping message.

[0015] According to a device address determination method provided by the present invention, a mapping message and a device address in an initial mapping table are reverse mapped and encapsulated to obtain a target addressing communication address corresponding to the device to be detected, including: extracting the address according to the mapping message to determine the message transmission address; wherein the message transmission address is used to determine the transmission address of the mapping message; reverse mapping and encapsulating the device address of the message transmission address in the initial mapping table to determine the target addressing communication address.

[0016] The present invention also provides a device for determining an address of a device, comprising the following modules.

[0017] The device acquisition module is used to create an address mapping table and acquire the device to be detected; wherein the address mapping table contains the corresponding relationship between the detection device and the device address.

[0018] The mapping table determination module is used to register the device to be detected in the address mapping table to obtain an initial mapping table when the device to be detected does not belong to the detection device in the address mapping table.

[0019] The data acquisition module is used to acquire the message data sent by the application layer calling the file interface and the device to be detected on the bus.

[0020] The address mapping module is used to perform mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0021] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a method for determining the address of any device when executing the computer program.

[0022] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for determining an address of any device is implemented.

[0023] The present invention also provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, the method for determining the address of any device is implemented.

[0024] The present invention provides a device address determination method, device, electronic device and storage medium, which create an address mapping table and obtain a device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address; when the device to be detected does not belong to the detection device in the address mapping table, the device to be detected is registered in the address mapping table to obtain an initial mapping table; the application layer calls the file interface and the message data sent by the device to be detected on the bus are obtained; mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected. The technical solution of the present invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses. In the case of a 10-bit address device mounted on the bus, addressing communication of all device addresses on the bus cannot be realized. The technical solution of the present invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses. The technical solution of the present invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses. The technical solution of the present invention is used to solve the defect that the prior art can not realize addressing communication of all device addresses on the bus when facing the situation that a 10-bit address device is mounted on the bus. The technical solution of the present invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses ... BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 This is one of the flow charts of the method for determining the address of a device provided by the present invention.

[0027] Figure 2 This is the second flow chart of the method for determining the address of the device provided by the present invention.

[0028] Figure 3 This is the third flow chart of the method for determining the address of the device provided by the present invention.

[0029] Figure 4 It is a structural schematic diagram of the device for determining the address of the device provided by the present invention.

[0030] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] Combine the following Figure 1-Figure 3 The address determination method of the device provided by the present invention is described. The address determination method of the device provided by the present invention can be applicable to expanded address communication situations. The executor of the method can be an electronic device or an address determination device of the device set in the electronic device. The address determination device of the device can be implemented by software, hardware or a combination of both. Figure 1 FIG. 1 is one of the flow charts of the method for determining the address of a device provided by the present invention, such as Figure 1 As shown, the method includes the following steps.

[0033] Step 101: Create an address mapping table and obtain devices to be detected.

[0034] In this step, the address mapping table includes the corresponding relationship between the detection device and the device address.

[0035] Specifically, the target area is first detected to determine the number of serial communication protocol (Inter-Integrated Circuit, I2C) buses in the target area, and then an address mapping table is created based on the detection device of each I2C and the corresponding device address. The address mapping tables corresponding to each I2C device are independent of each other and do not interfere with each other. Furthermore, the essence of the address mapping table is a data structure between software layers. A part of the hardware storage space or hardware storage device is required at each device of the bus for storage and reading. The main functions of the address mapping table are to store the original address of the device to be detected, store the mapped address of the device to be detected, match the original address with the mapped address, and provide access services. After creating the address mapping table, the device to be detected is obtained.

[0036] Step 102: When the device to be detected does not belong to the detection devices in the address mapping table, register the device to be detected in the address mapping table to obtain an initial mapping table.

[0037] Specifically, when the device to be detected does not belong to the detection devices in the address mapping table, the device to be detected is registered in the address mapping table to obtain an initial mapping table.

[0038] In a specific embodiment, Figure 2 FIG. 2 is a flow chart of the method for determining the address of a device provided by the present invention. Figure 2 As shown, the specific implementation method of registering the device to be detected in the address mapping table and obtaining the initial mapping table includes the following steps.

[0039] Step 201: Determine whether the device to be detected belongs to the detection device in the address mapping table.

[0040] Specifically, it is determined whether the device to be detected belongs to the detection device in the address mapping table. If the device to be detected belongs to the detection device in the address mapping table, step 202 is continued; if the device to be detected does not belong to the detection device in the address mapping table, step 203 is continued.

[0041] Exemplarily, if the address mapping table contains detection device A, detection device B, and detection device C, if the device to be detected is A, it is determined that the device to be detected belongs to the detection device A in the address mapping table, and step 202 is continued; if the address mapping table contains detection device A, detection device B, and detection device C, if the device to be detected is D, it is determined that the device to be detected D does not belong to the detection device in the address mapping table, and step 203 is continued.

[0042] In a specific embodiment, before determining whether the device to be detected belongs to the detection device in the address mapping table, it also includes: determining whether the device to be detected is detected, if it is determined that the device to be detected is not detected, then terminating the detection, and determining that all devices on the I2C bus have completed the detection. If it is determined that the device to be detected is detected, then executing step 201.

[0043] Step 202: Determine the target addressing communication address corresponding to the device to be detected according to the address mapping table.

[0044] Specifically, when the device to be detected is a detection device in the address mapping table, it is determined that the device to be detected is not a new I2C device, and therefore the target addressing communication address corresponding to the device to be detected is directly determined according to the address mapping table.

[0045] Step 203: register the device to be detected in the address mapping table, and determine whether the device to be detected is a target address device.

[0046] In this step, the target address device is a preset device, for example, a 7-bit device, which is not limited in this embodiment.

[0047] Specifically, when the device to be detected does not belong to the detection device in the address mapping table, the new device to be detected is registered in the address mapping table, so as to update the address mapping table, and further determine whether the device to be detected is the target address device; if it is determined that the device to be detected is the target address device, continue to execute step 204; if it is determined that the device to be detected is not the target address device, determine that the device to be detected is other address devices, for example, it can be a 10-bit address device, and continue to execute step 206.

[0048] Step 204: Determine whether the device address of the device to be detected overlaps with the address of the registered device that has completed registration in the address mapping table.

[0049] Specifically, when the device to be detected is the target address device, determine whether the device address of the device to be detected has an address duplication with the registered device that has been registered in the address mapping table. If it is determined that the device address of the device to be detected has an address duplication with the registered device that has been registered in the address mapping table, continue to step 205; if it is determined that the device address of the device to be detected has no address duplication with the registered device that has been registered in the address mapping table, continue to step 206.

[0050] Step 205: Map the addresses with duplicate addresses to device addresses to obtain an initial mapping table.

[0051] Specifically, when the device address of the device to be detected overlaps with the registered device registered in the address mapping table, the duplicated address is mapped to a new device address to obtain an initial mapping table, and the process returns to step 201 to determine whether the device to be detected belongs to the detection device in the address mapping table.

[0052] Step 206: Update the target address device according to the device address of the device to be detected, complete the detection and registration of the device to be detected, and obtain an initial mapping table.

[0053] Specifically, when the device to be detected is not the target address device, the target address device is updated according to the device address of the device to be detected, the detection and registration of the device to be detected is completed, the initial mapping table is obtained, and the process returns to step 201 of determining whether the device to be detected belongs to the detection device in the address mapping table.

[0054] Step 103: Acquire the application layer calling file interface and the message data sent by the device to be detected on the bus.

[0055] In this step, the application layer calling the file interface may be, for example, the application layer calling the I2C file interface, and the device to be detected on the bus may be, for example, an I2C hardware device on the bus, which is not limited in this embodiment.

[0056] The message data may be, for example, temperature data of a temperature sensor, humidity data of a humidity sensor, pressure data of a pressure sensor, storage data of a memory, etc., which is not limited in this embodiment.

[0057] Specifically, the application layer calls the file interface and the message data sent by the device to be detected on the bus, such as the temperature data of the temperature sensor, the humidity data of the humidity sensor, the pressure data of the pressure sensor, the storage data of the memory, etc., are obtained.

[0058] Step 104: Mapping and reverse mapping are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0059] Specifically, after obtaining the message data, the data address of the message data transmission is checked according to the message data, and then the data address is mapped with the device address in the initial mapping table, and the mapped address is re-encapsulated to determine the encapsulated mapping message. Reverse mapping is performed according to the encapsulated mapping message and the device address in the initial mapping table, and the reverse mapped address is re-encapsulated to obtain the target addressing communication address corresponding to the device to be detected.

[0060] The invention provides a device address determination method, which is to create an address mapping table and obtain a device to be detected; wherein the address mapping table contains a corresponding relationship between the detection device and the device address; when the device to be detected does not belong to the detection device in the address mapping table, the device to be detected is registered in the address mapping table to obtain an initial mapping table; the application layer calls the file interface and the message data sent by the device to be detected on the bus is obtained; mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected. The technical scheme of the invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses, so when facing the situation that a 10-bit address device is mounted on the bus, it will not be possible to achieve addressing communication of all devices on the bus, and the target addressing communication address corresponding to the device to be detected is obtained by obtaining the message data sent by the application layer calling the file interface and the device to be detected on the bus; mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected, so as to determine the target addressing communication address of the device to be detected with different addresses, and meet the addressing of the device to be detected with different addresses.

[0061] Figure 3This is the third flow chart of the device address determination method provided by the present invention. The device address determination method provided by the present invention can be applied to the expansion of address communication conditions. The execution subject of this method can be an electronic device or a device address determination device set in the electronic device. The device address determination device can be implemented by software, hardware or a combination of the two. Figure 3 As shown, mapping encapsulation and reverse mapping encapsulation are further performed on the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected and optimize the method, which includes the following steps.

[0062] Step 301: Create an address mapping table and obtain devices to be detected.

[0063] In this step, the address mapping table includes the corresponding relationship between the detection device and the device address.

[0064] Specifically, the target area is first detected to determine the number of serial communication protocol (Inter-Integrated Circuit, I2C) buses in the target area, and then an address mapping table is created based on the detection device of each I2C and the corresponding device address. The address mapping tables corresponding to each I2C device are independent of each other and do not interfere with each other. Furthermore, the essence of the address mapping table is a data structure between software layers. A part of the hardware storage space or hardware storage device is required at each device of the bus for storage and reading. The main functions of the address mapping table are to store the original address of the device to be detected, store the mapped address of the device to be detected, match the original address with the mapped address, and provide access services. After creating the address mapping table, the device to be detected is obtained.

[0065] Step 302: When the device to be detected does not belong to the detection devices in the address mapping table, register the device to be detected in the address mapping table to obtain an initial mapping table.

[0066] Specifically, when the device to be detected does not belong to the detection device in the address mapping table, the device to be detected is registered in the address mapping table; when the device to be detected does not belong to the detection device in the address mapping table, a new device to be detected is registered in the address mapping table, thereby updating the address mapping table and further determining whether the device to be detected is the target address device; if it is determined that the device to be detected is the target address device, it is determined whether the device address of the device to be detected is duplicated with the registered device registered in the address mapping table; when the device address of the device to be detected is duplicated with the registered device registered in the address mapping table, the address with the duplicated address is mapped to a new device address to obtain an initial mapping table.

[0067] Step 303: Acquire the application layer calling file interface and the message data sent by the device to be detected on the bus.

[0068] Specifically, the application layer calls the file interface and the message data sent by the device to be detected on the bus, such as the temperature data of the temperature sensor, the humidity data of the humidity sensor, the pressure data of the pressure sensor, the storage data of the memory, etc., are obtained.

[0069] Step 304: Map and encapsulate the message data and the device address in the initial mapping table to obtain a mapping message.

[0070] In a specific implementation, mapping and encapsulating are performed according to the message data and the device address in the initial mapping table to obtain the specific implementation steps of the mapping message, including: unpacking the message data to determine the data address corresponding to the data information of the device to be detected; mapping is performed according to the data address and the device address in the initial mapping table to obtain the mapping address; and message encapsulation is performed on the mapping address to obtain the mapping message.

[0071] Specifically, the message data is unpacked. According to the I2C standard protocol, the information contained in the first byte or the second byte is the message address of the message data, so as to check the message address of the message data, and then, the data address and the device address in the initial mapping table are mapped to obtain the mapping address; the mapping address is message encapsulated to obtain a mapping message.

[0072] Step 305: reverse mapping and encapsulating the mapping message and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0073] In a specific implementation, the mapping message and the device address in the initial mapping table are reverse mapped and encapsulated, and the specific implementation steps for obtaining the target addressing communication address corresponding to the device to be detected include: extracting the address according to the mapping message and determining the message transmission address; wherein the message transmission address is used to determine the transmission address of the mapping message; reverse mapping and encapsulating the device address of the message transmission address in the initial mapping table to determine the target addressing communication address.

[0074] Specifically, the message transmission address of the mapping message is checked according to the message packet header of the mapping message, the address is extracted to obtain the message transmission address, the device address of the message transmission address in the initial mapping table is reversely mapped and encapsulated to determine the target addressing communication address.

[0075] The invention provides a device address determination method, which is implemented by creating an address mapping table and obtaining a device to be detected; in the case where the device to be detected does not belong to the detection device in the address mapping table, registering the device to be detected in the address mapping table to obtain an initial mapping table; obtaining the application layer calling the file interface and the message data sent by the device to be detected on the bus; mapping and encapsulating according to the message data and the device address in the initial mapping table to obtain a mapping message; reverse mapping and encapsulating the mapping message and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected. The technical scheme of the invention is used to solve the defect that the prior art can only support addressing of I2C devices with 7-bit addresses, so when a 10-bit address device is mounted on the bus, it will not be possible to achieve addressing communication of all devices on the bus, and achieves by obtaining the application layer calling the file interface and the message data sent by the device to be detected on the bus; mapping and encapsulating according to the message data and the device address in the initial mapping table and reverse mapping and encapsulating to obtain the target addressing communication address corresponding to the device to be detected, and achieving the determination of the target addressing communication address of the device to be detected with different addresses, so as to meet the addressing of the device to be detected with different addresses.

[0076] The device for determining an address of a device provided by the present invention is described below. The device for determining an address of a device described below and the device address determining method described above can be referred to each other.

[0077] Figure 4 is a schematic diagram of the structure of the device address determination device provided by the present invention, referring to Figure 3 As shown, the device address determination apparatus 400 includes: a device acquisition module 401 , a mapping table determination module 402 , a data acquisition module 403 and an address mapping module 404 .

[0078] The device acquisition module 401 is used to create an address mapping table and acquire the device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address.

[0079] The mapping table determination module 402 is used to register the device to be detected in the address mapping table to obtain an initial mapping table when the device to be detected does not belong to the detection device in the address mapping table.

[0080] The data acquisition module 403 is used to acquire the message data sent by the application layer calling the file interface and the device to be detected on the bus.

[0081] The address mapping module 404 is used to perform mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0082] In an exemplary embodiment, the device further includes an address determination module. The address determination module is used to: determine whether the device to be detected belongs to the detection device in the address mapping table; if the device to be detected belongs to the detection device in the address mapping table, determine the target addressing communication address corresponding to the device to be detected according to the address mapping table.

[0083] In an exemplary embodiment, the mapping table determination module 402 is specifically used to: register the device to be detected in the address mapping table, and determine whether the device to be detected is a target address device; when the device to be detected is a target address device, determine whether the device address of the device to be detected has an address duplication with a registered device that has been registered in the address mapping table; when the device address of the device to be detected has an address duplication with a registered device that has been registered in the address mapping table, map the address with the address duplication to the device address, obtain an initial mapping table, and return to execute the step of determining whether the device to be detected belongs to the detection device in the address mapping table.

[0084] In an exemplary embodiment, the mapping table determination module 402 is also used to: when the device to be detected is not the target address device, update the target address device according to the device address of the device to be detected, complete the detection and registration of the device to be detected, obtain the initial mapping table, and return to execute the step of determining whether the device to be detected belongs to the detection device in the address mapping table.

[0085] In an exemplary embodiment, the address mapping module 404 is specifically used to: perform mapping and encapsulation according to the message data and the device address in the initial mapping table to obtain a mapping message; perform reverse mapping and encapsulation on the mapping message and the device address in the initial mapping table to obtain a target addressing communication address corresponding to the device to be detected.

[0086] In an exemplary embodiment, the address mapping module 404 performs mapping and encapsulation according to the message data and the device address in the initial mapping table to obtain a mapping message, which is specifically used to: unpack the message data to determine the data address corresponding to the data information of the device to be detected; map according to the data address and the device address in the initial mapping table to obtain a mapping address; and perform message encapsulation on the mapping address to obtain a mapping message.

[0087] In an exemplary embodiment, the address mapping module 404 performs reverse mapping and encapsulation on the mapping message and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected, and is specifically used for: extracting the address according to the mapping message to determine the message transmission address; wherein the message transmission address is used to determine the transmission address of the mapping message; reverse mapping and encapsulating the device address of the message transmission address in the initial mapping table to determine the target addressing communication address.

[0088] The device of this embodiment can be used to execute the method of any embodiment in the device address determination method side embodiment. Its specific implementation process and technical effects are similar to those in the device address determination method side embodiment. For details, please refer to the detailed introduction in the device address determination method side embodiment, which will not be repeated here.

[0089] Figure 5 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the device address determination method, which includes: creating an address mapping table and obtaining the device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address; in the case where the device to be detected does not belong to the detection device in the address mapping table, registering the device to be detected in the address mapping table to obtain an initial mapping table; obtaining the application layer calling the file interface and the message data sent by the device to be detected on the bus; performing mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0090] In addition, the logical instructions in the memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0091] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the device address determination method provided by each method, and the method includes: creating an address mapping table and obtaining a device to be detected; wherein the address mapping table contains a correspondence between the detection device and the device address; when the device to be detected does not belong to the detection device in the address mapping table, registering the device to be detected in the address mapping table to obtain an initial mapping table; obtaining the application layer calling the file interface and the message data sent by the device to be detected on the bus; performing mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0092] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the address determination method of the device provided by each method, the method comprising: creating an address mapping table and obtaining the device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address; in the case that the device to be detected does not belong to the detection device in the address mapping table, registering the device to be detected in the address mapping table to obtain an initial mapping table; obtaining the application layer calling the file interface and the message data sent by the device to be detected on the bus; performing mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on this understanding, the technical solution can be essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for determining an address of a device, characterized in that: include: Creating an address mapping table and acquiring the device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address; In the case that the device to be detected does not belong to the detection devices in the address mapping table, registering the device to be detected in the address mapping table to obtain an initial mapping table; Acquire the application layer calling file interface and the message data sent by the device to be detected on the bus; Mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain a target addressing communication address corresponding to the device to be detected.

2. The device address determination method according to claim 1, characterized in that: Also includes: Determine whether the device to be detected belongs to the detection device in the address mapping table; In a case where the device to be detected belongs to the detection devices in the address mapping table, the target addressing communication address corresponding to the device to be detected is determined according to the address mapping table.

3. The device address determination method according to claim 1, characterized in that: Registering the device to be detected in the address mapping table to obtain an initial mapping table includes: Registering the device to be detected in the address mapping table, and determining whether the device to be detected is a target address device; In the case where the device to be detected is the target address device, determining whether the device address of the device to be detected overlaps with the address of the registered device that has completed registration in the address mapping table; In the case that the device address of the device to be detected overlaps with the registered device that has completed registration in the address mapping table, the address with the duplicate address is mapped to the device address to obtain the initial mapping table, and the step of determining whether the device to be detected belongs to the detection device in the address mapping table is returned to execute.

4. The device address determination method according to claim 2, characterized in that: Also includes: In the case that the device to be detected is not the target address device, the target address device is updated according to the device address of the device to be detected, the detection and registration of the device to be detected is completed, the initial mapping table is obtained, and the step of determining whether the device to be detected belongs to the detection device in the address mapping table is returned to execute.

5. The device address determination method according to claim 1, characterized in that: The mapping encapsulation and reverse mapping encapsulation are performed according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected, including: Perform mapping encapsulation according to the message data and the device address in the initial mapping table to obtain a mapping message; The mapping message and the device address in the initial mapping table are reversely mapped and encapsulated to obtain the target addressing communication address corresponding to the device to be detected.

6. The device address determination method according to claim 5, characterized in that: The mapping and encapsulation is performed according to the message data and the device address in the initial mapping table to obtain a mapping message, including: Unpacking the message data to determine the data address corresponding to the data information of the device to be detected; Mapping is performed according to the data address and the device address in the initial mapping table to obtain the mapping address; The mapping address is encapsulated into a message to obtain the mapping message.

7. The device address determination method according to claim 5, characterized in that: The reverse mapping and encapsulating the mapping message and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected includes: Performing address extraction according to the mapping message to determine a message transmission address; wherein the message transmission address is used to determine the transmission address of the mapping message; The device address of the message transmission address in the initial mapping table is reversely mapped and encapsulated to determine the target addressing communication address.

8. A device for determining an address of a device, characterized in that: include: A device acquisition module is used to create an address mapping table and acquire the device to be detected; wherein the address mapping table contains the correspondence between the detection device and the device address; A mapping table determination module, configured to register the device to be detected in the address mapping table to obtain an initial mapping table when the device to be detected does not belong to the detection device in the address mapping table; A data acquisition module, used for acquiring the application layer calling file interface and the message data sent by the device to be detected on the bus; The address mapping module is used to perform mapping encapsulation and reverse mapping encapsulation according to the message data and the device address in the initial mapping table to obtain the target addressing communication address corresponding to the device to be detected.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the address determination method of the device according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the address determination method of the device according to any one of claims 1 to 7 is implemented.