IP generation method, device, equipment and medium

By generating hash seeds and hash calculations, the IP address of the node device of the EOPS printing system is automatically generated, and conflict detection is carried out through the ARP protocol, the problem of low reliability and stability of the network environment in the DHCP-free server environment is solved, and the uniqueness and stability of the IP address are achieved.

CN119788643APending Publication Date: 2025-04-08BEIJING BOYUAN HENGXIN TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411728437.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the DHCP server-free environment, the existing EOPS printing system has low reliability and stability in the network environment, which may cause the printing task to fail to be executed normally.

Method used

By obtaining the basic data of the node device, a hash seed is generated, and hash calculation is performed based on the hash seed, the hash value is obtained, mapped into the preset IP address range, the initial IP address is generated, and conflict detection is performed through the ARP protocol until a collision-free target IP address is generated.

Benefits of technology

It realizes that in a DHCP server environment, it automatically generates a unique and stable IP address for the EOPS printing system node device, improves the reliability and stability of the network environment, and ensures the normal execution of printing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788643A_ABST
    Figure CN119788643A_ABST
Patent Text Reader

Abstract

The present invention discloses an IP generation method, device, equipment and medium, and relates to the technical field of EOPS printing system, so as to solve the technical problem of low reliability and stability of network environment in existing EOPS printing scenarios. The method includes obtaining basic data of node devices for which IP addresses are to be generated; generating hash seeds according to unique identification numbers and network port MAC addresses; performing hash calculations based on hash seeds to obtain hash values; mapping hash values ​​to preset IP address ranges to obtain initial IP addresses; performing IP address conflict detection on the initial IP addresses based on the ARP protocol; when there is a conflict in the initial IP address, increasing the generation data of the hash seeds by preset values ​​in sequence, and generating new IP addresses based on the hash seeds with the increased preset values, until the new IP addresses do not conflict with the IP addresses of other node devices, and obtaining the target IP address. The IP generation method provided by the present invention is used to avoid conflicts between the generated IP addresses and other devices, and improve the reliability and stability of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of EOPS printing systems, and in particular to an IP generation method, device, equipment and medium. Background Art

[0002] Compared with the traditional scanning and printing method, the EOPS printing system can complete more printing tasks in the same time, and the mechanical structure is simpler, which can be widely used in various large-scale printing scenarios. The EOPS inkjet printing system is a single-pass printing control system, which is usually composed of multiple node devices such as a PC, an Ethernet switch, a main control board, and multiple EOPS head boards. Among them, the PC is installed with EOPS printing control software, which is responsible for the control management and status monitoring of the EOPS printing system. The main control board is not connected to the nozzle and is used to realize control movement, electrical signal synchronization, etc. Each EOPS head board includes one or more nozzles for sending printing data to the nozzle. The Ethernet switch connects the PC, the main control board and the head board through a network cable to realize communication between the PC, the main control board and the head board.

[0003] However, each of the above node devices requires a different IP address to achieve communication between the node devices. It can be seen that the normal operation of the EOPS printing system requires a stable network environment as a prerequisite. The current EOPS printing system has poor robustness. If the network environment is unstable, there is a high possibility that it may not print normally. Therefore, there is an urgent need in the prior art for a technical solution that can improve the reliability and stability of the network environment in the EOPS printing scenario. Summary of the invention

[0004] The purpose of the present invention is to provide an IP generation method, device, equipment and medium to solve the technical problem of low reliability and stability of the network environment in the existing EOPS printing scenario.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides an IP generation method, comprising:

[0007] Obtain basic data of the node device for which the IP address is to be generated; the basic data includes a unique identification number and a network port MAC address;

[0008] Generate a hash seed according to the unique identification number and the network port MAC address; the hash seed includes generation data;

[0009] Perform hash calculation based on the hash seed to obtain a hash value;

[0010] Mapping the hash value to a preset IP address range to obtain an initial IP address;

[0011] Perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0012] When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0013] Compared with the prior art, the present invention provides an IP generation method, which generates a hash seed through a unique identification number and a network port MAC address; performs hash calculation based on the hash seed to obtain a hash value; maps the hash value to a preset IP address range to obtain an initial IP address; can realize the generation of an IP address without a DHCP server, and then performs IP address conflict detection on the initial IP address based on the ARP protocol; when there is a conflict in the initial IP address, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value, until the new IP address does not conflict with the IP address of other node devices, and the target IP address is obtained. Performing conflict detection on the generated IP address can ensure that the generated IP address does not conflict with the IP address of other node devices, and ensure the uniqueness of the generated address. At the same time, the preset value is increased by the preset value of the pending data of the hash seed, and the IP address generated based on the hash seed with the increased preset value improves the randomness of IP address generation, and can ensure that the generated IP address is not easy to conflict with other node devices.

[0014] Optionally, the hash seed also includes value data; and generating the hash seed according to the unique identification number and the network port MAC address includes:

[0015] Concatenate the unique identification number and the network port MAC address in a preset order to obtain unique identification data;

[0016] Process the unique identification data according to a hash algorithm, and determine the last 64 bits of the processed unique identification data as value data;

[0017] The initial generation data of the generation data and the value data are concatenated into a 128-bit hash seed.

[0018] Optionally, mapping the hash value to a preset IP address range to obtain an initial IP address includes:

[0019] Convert the data from the 8th bit to the 15th bit of the hash value into decimal form to obtain the third part of the initial IP address;

[0020] Convert the data from bit 0 to bit 7 of the hash value into decimal form to obtain the fourth part of the initial IP address;

[0021] The fixed value in the preset IP address range, the third part and the fourth part are combined to obtain an initial IP address; the first part and the second part of the preset IP address range are fixed values.

[0022] Optionally, the performing IP address conflict detection on the initial IP address based on the ARP protocol includes:

[0023] Sending an ARP probe packet carrying a request message to the ad hoc network; the request message is used to inquire whether there are other devices in the ad hoc network using the initial IP address;

[0024] Receiving an ARP response packet returned from the self-organizing network, wherein the ARP response packet is used to inform conflict information;

[0025] When an ARP response packet is received, the initial IP address is updated.

[0026] Optionally, the IP generation method is applied to an EOPS inkjet printing system, and the node device is an EOPS head plate device of the EOPS inkjet printing system.

[0027] Optionally, when there is a conflict in the initial IP address, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value, until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes:

[0028] The target IP address and the hash seed corresponding to the target IP address are stored in a local storage device of the node device.

[0029] Optionally, when there is a conflict in the initial IP address, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value, until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes:

[0030] Allocating the target IP address to the node device of the IP address to be generated;

[0031] Broadcast ARP address announcement packets to the ad hoc network;

[0032] The ARP cache of other node devices in the ad hoc network is updated according to the ARP address announcement packet.

[0033] In a second aspect, the present invention provides an IP generation device, comprising:

[0034] A basic data acquisition module for a node device, used to acquire basic data of a node device for which an IP address is to be generated; the basic data includes a unique identification number and a network port MAC address;

[0035] A hash seed generation module, used to generate a hash seed according to the unique identification number and the network port MAC address; the hash seed includes generation data;

[0036] A hash calculation module, used to perform hash calculation based on the hash seed to obtain a hash value;

[0037] An address mapping module is used to map the hash value to a preset IP address range to obtain an initial IP address;

[0038] A conflict detection module is used to perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0039] The IP address update module is used to increase the generation data of the hash seed by a preset value in sequence when there is a conflict in the initial IP address, and generate a new IP address based on the hash seed with the preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0040] In a third aspect, the present invention provides an IP generation device, comprising:

[0041] A communication unit / communication interface, used to obtain basic data of a node device for which an IP address is to be generated; the basic data includes a unique identification number and a network port MAC address;

[0042] A processing unit / processor, configured to generate a hash seed according to the unique identification number and the network port MAC address; the hash seed includes generation data;

[0043] Perform hash calculation based on the hash seed to obtain a hash value;

[0044] Mapping the hash value to a preset IP address range to obtain an initial IP address;

[0045] Perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0046] When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0047] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, the above-mentioned IP generation method is implemented.

[0048] The technical effects achieved by the device type solution provided in the second aspect, the equipment type solution provided in the third aspect, and the computer-readable storage medium solution provided in the fourth aspect are the same as those of the method type solution provided in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0050] Figure 1 A flow chart of an IP generation method provided by the present invention;

[0051] Figure 2 A schematic diagram of the IP generation process provided by the present invention;

[0052] Figure 3 A schematic diagram of the structure of an IP generation device provided by the present invention;

[0053] Figure 4 A schematic diagram of the structure of an IP generation device provided by the present invention. DETAILED DESCRIPTION

[0054] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. For example, the first threshold and the second threshold are only used to distinguish different thresholds, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0055] It should be noted that, in the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0056] In the present invention, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, the combination of a and b, the combination of a and c, the combination of b and c, or the combination of a, b and c, where a, b, c can be single or multiple.

[0057] Before introducing the embodiments of the present invention, the following definitions are given for the relevant terms involved in the embodiments of the present invention:

[0058] EOPS (Ethernet One Pass System) inkjet printing technology: It is an efficient printing method that uses advanced control systems and optimized nozzle design to achieve inkjet operation of the entire printing area in one scanning process.

[0059] eMMC is the abbreviation of Embedded Multi Media Card, which is a standard for flash memory cards. It defines the physical architecture, access interface and protocol of the storage system based on embedded multimedia cards.

[0060] In the absence of DHCP service, the following solution is used: For example, school computer rooms and company computers are managed by personnel, and IP addresses can be manually set through the human-computer interaction interface. However, the devices in EOPS must be automatic and do not require human participation in management, so a method for automatically generating IP is needed.

[0061] In the EOPS inkjet printing system, all network nodes except the PC end have no human-computer interaction interface, and it is impossible to manually set the IP address through human-computer interaction interfaces such as mouse, keyboard, and monitor as in school computer rooms and company computers. EOPS network nodes must have the ability to automatically configure IP addresses. The function of automatically configuring IP addresses in the EOPS system can be achieved by external access to DHCP services. For example, each EOPS headboard device usually dynamically allocates IPv4 addresses through a DHCP server to ensure that each node in the network has a unique IP address. In scenarios where there is no DHCP server or the DHCP server is unavailable, the IP addresses of school computer rooms and company computers can be manually set, and the devices in EOPS must be automatic and do not require human participation in management. The devices need to be able to automatically generate and configure IPv4 addresses. The second method requires the system to have certain IP address generation rules and conflict detection mechanisms to prevent multiple devices from using the same IP address and causing communication conflicts. At the same time, the IP address generated by the device needs to remain stable to avoid frequent changes. To solve the above problems, the embodiments of the present invention provide the following two technical solutions: 1. After the equipment leaves the factory, a certain IP address is configured, and before networking, a new IP address is manually configured for each board. However, this method requires manual participation, and the uniqueness of the IP address is manually guaranteed. When there are many devices, the operation is frequent and prone to errors. 2. Generate IPv4 addresses based on the existing network fixed algorithm, but it lacks a reliable conflict detection mechanism. IP address conflicts are easily caused under complex network topologies, resulting in network instability, and still cannot meet the stable network environment required by the EOPS system. Therefore, based on the above embodiments, a solution is needed that can automatically generate and allocate unique IP addresses without a DHCP server, and has the ability of real-time conflict detection and dynamic adjustment.

[0062] To solve the above problems, the present invention provides an IP generation method, device, equipment and medium, which can automatically generate and allocate IPv4 addresses for Ethernet device nodes such as EOPS headboards without human-machine interaction interfaces in an environment without a DHCP server, and ensure the uniqueness and stability of the IP address of each node through an effective conflict detection mechanism. The present invention generates IP addresses through hardware characteristics, and combines ARP to implement conflict detection, has the ability to automatically adjust IP addresses, and ensures the stability of the system's network communication. The following is an explanation with reference to the accompanying drawings.

[0063] See also Figure 1 The present invention provides an IP generation method, which is applied to generate an IP address of an EOPS head plate device in an EOPS inkjet printing system, comprising the following steps:

[0064] Step 101: Obtain basic data of a node device for which an IP address is to be generated;

[0065] The basic data includes a unique identification number and a network port MAC address; the node device may be an EOPS head board device, a nozzle control device, etc. within the EOPS inkjet printing system self-organizing network.

[0066] The unique identification number can be the unique identification number of the hardware chip with a unique identification number of the node device, such as: the CID number of eMMC, the serial number of the 1-wire chip, the unique identifier UniqueID of the CPU, etc. It should be noted that the above-mentioned unique identification number is only an example, which is the source of the universal unique identification data in the EOPS system. In fact, there is no specific limitation on this. The unique identification number can be generated according to one or more of the above examples. If the board does not have the unique identification number listed above, other information that can distinguish the board from other devices can also be used as the unique identification number. The unique identification number is usually a unique string in binary or hexadecimal format. The embodiment of the present invention does not limit the type and quantity of the unique identification number of the hardware chip, because the length information also contributes to the randomness of the HASH value.

[0067] Step 102: Generate a hash seed according to the unique identification number and the network port MAC address;

[0068] The hash seed is 128 bits in total. The hash seed consists of 64 bits of generation data and 64 bits of value data. The generation data is a 64-bit unsigned integer representing the number of iterations. The integer represented by the first generation data is 0, the integer represented by the next generation data is 1, the integer represented by the next generation data is 2, and so on. Each time an IP address is generated, the integer represented by the generation data is incremented by 1 or other preset value.

[0069] As an optional method, step 102 specifically includes:

[0070] The unique identification number is concatenated with the network port MAC address in a preset order to obtain unique identification data; the number of unique identification numbers can be one or more. When the number of unique identification numbers is one, the network port MAC address and the unique identification number are concatenated in order to obtain unique identification data. If the number of unique identification numbers is multiple, the network port MAC address and multiple unique identification numbers are concatenated in sequence to obtain unique identification data.

[0071] Process the unique identification data according to a hash algorithm, and determine the last 64 bits of the processed unique identification data as value data;

[0072] The initial generation data of the generation data and the value data are concatenated into a 128-bit hash seed.

[0073] Step 103: Perform hash calculation based on the hash seed to obtain a hash value;

[0074] The hash value is a fixed-length HASH value. If the SIPH ASH24 algorithm is used, the generated HASH value is 64 bits.

[0075] Step 104: Map the hash value to a preset IP address range to obtain an initial IP address;

[0076] The initial IP address can be generated by intercepting the corresponding number of bits of the HASH value. The preset IP address range is a specific private IP address range, which can be 169.254.0.0 / 16, that is, 169.254.0.0 to 169.254.255.255. 169.254.0.0 / 16 is the Link-Local address range, an address range designed for automatic IP configuration to avoid conflicts with other LAN or WAN addresses. The preset IP address range consists of four decimal values. The first and second parts of the preset IP address range are fixed values. The fixed value of the first part is 169, and the fixed value of the second part is 254. Specifically, the mapping of the hash value to the preset IP address range to obtain the initial IP address includes:

[0077] Convert the data from the 8th bit to the 15th bit of the hash value into decimal form to obtain the third part of the initial IP address;

[0078] Convert the data from bit 0 to bit 7 of the hash value into decimal form to obtain the fourth part of the initial IP address;

[0079] Or, converting the data from the 8th bit to the 15th bit of the hash value into decimal form to obtain the fourth part of the initial IP address;

[0080] Convert the data from bit 0 to bit 7 of the hash value into decimal form to obtain the third part of the initial IP address;

[0081] The fixed value in the preset IP address range, the third part and the fourth part are combined to obtain an initial IP address.

[0082] By introducing the network port MAC address, the initial IP address is generated. On a multi-network port device, although the device's unique data is the same, the data for generating the hash seed is different due to the combination of the MAC address of a specific network port, so that different network ports on the same device can generate completely different IP addresses.

[0083] Step 105: Perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0084] The conflict detection is performed in the self-organizing network in the EOPS inkjet printing system. The self-organizing network may be a network composed of a print head, a nozzle control system, an ink supply system, a data transmission system, a power supply system, etc. in the EOPS inkjet printing system.

[0085] As an optional manner, the IP address conflict detection for the initial IP address based on the ARP protocol includes:

[0086] ARP detection: After the node device generates an IP address, it sends an ARP detection packet carrying a request message to the ad hoc network of the EOPS inkjet printing system, and broadcasts to check whether the IP address has been used by other devices. The ARP detection packet contains the IP address generated by the node device. The request message is used to inquire whether there are other devices in the ad hoc network using the initial IP address;

[0087] Listening for ARP responses: The device listens for and receives ARP response packets returned from the ad hoc network; if the IP address is already used by a device in the ad hoc network, the device will send back an ARP response packet to inform of the conflict. When an ARP response packet is received, it indicates that there is a conflict with the IP address and the IP address needs to be regenerated to update the initial IP address.

[0088] When there is no conflict in the initial IP address, the initial IP address is determined as the target IP address.

[0089] Conflict handling: If a conflict is detected, the device will generate a new hash seed based on the current hash seed data, map it to a new IP address, and perform ARP detection again until an unused address is found. Each regenerated IP address has a certain degree of randomness, which can avoid multiple conflicts. Specifically, the conflict handling is as shown in step 106.

[0090] Step 106: When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0091] The added preset value can be set according to needs. The preset value is generally 1. Other values, such as 2, 3, 4, etc., can also be used according to needs.

[0092] As an optional manner, when the initial IP address conflicts, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes:

[0093] Allocating the target IP address to the node device of the IP address to be generated;

[0094] Broadcast ARP address announcement packets to the ad hoc network;

[0095] The ARP cache of other node devices in the ad hoc network is updated according to the ARP address announcement packet.

[0096] The above steps are confirmation of IP address allocation: when the node device confirms that there is no conflict in the generated IP address, it formally allocates the IP address to its own device and broadcasts the ARP address announcement packet to the ad hoc network. The broadcast informs other devices in the network that this device will use this IP address, which will cause all other node devices in the network to update their respective ARP caches. At the beginning of the subsequent communication process, there is no need to obtain the other party's MAC address through the ARP protocol, thereby speeding up the subsequent communication speed.

[0097] As an optional manner, when the initial IP address conflicts, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes:

[0098] The target IP address and the hash seed corresponding to the target IP address are stored in a local storage device of the node device.

[0099] The above steps provide the stability and cache mechanism of the IP address provided by the present invention: In order to ensure that the IP address of the node device in the network remains stable and prevent the IP address of the node device from changing after each startup, the system introduces a local cache mechanism for the IP address. Specifically, after the hash value is mapped to the preset IP address range and the initial IP address is obtained, the initial IP address and the hash seed corresponding to the initial IP address are saved in the local storage device of the node device, such as eMMC, EEPROM, etc., so that the address can be used preferentially the next time it is started. In addition, when a conflict occurs, the saved hash seed can be directly extracted to update the IP address, thereby improving the efficiency of generating the IP address. In this way, the IP address conflict detection can be passed at one time with a high probability, the system startup efficiency can be improved, and the IP address of each node device will remain stable and will not change if there is no new or replaced node in the network topology.

[0100] Optionally, even when the node device is running, the system will continue to monitor the ARP traffic in the network to ensure that no other device uses the same IP address. The node device captures potential address conflicts by passively monitoring the ARP traffic in the network. If it detects that other devices are trying to use the same IP address, the system will trigger the conflict handling mechanism, automatically stop using the current IP address, and regenerate a unique IP address to ensure the continuity and stability of network communication.

[0101] In the prior art, IP addresses are usually "one-to-one mapped" with the source of generation, so IP is also unique and will not conflict, so there is no need for IP address conflict detection; in the EOPS system, the unique identification data of the device and the IP address are not "one-to-one mapped", especially we require that all network nodes of the EOPS system are in one "subnet". This solution uses multiple iterations and IP address duplication detection mechanisms to achieve the uniqueness of the IP address.

[0102] During the specific implementation process, the node device first obtains the cached IP address and the corresponding hash seed. If the acquisition is successful, a conflict detection is performed on the obtained IP address. If the acquisition is unsuccessful, it means that the initial IP address has not been generated at this time. The initial hash seed is determined according to the unique identification number of the node device, and then the IP address is generated based on the initial hash seed, and the IP address conflict detection continues; when the IP address conflict detection is successful, that is, no conflict is detected, the IP address is set to its own address, and the ARP address is announced to determine whether the local cache needs to be updated. If not, it ends. If necessary, the current hash seed and IP address are written to the local cache; if a conflict is detected during the IP address conflict detection, the hash seed is updated, and the IP address is generated based on the hash seed, and the IP address conflict detection continues.

[0103] Here is an example:

[0104] Assume that the network port MAC address is: AA:BB:CC:DD:EE:FF; CPU UniqueID is: 1234567890ABCDEF; 1-wire chip serial number is: 1A2B3C4D; eMMC CID is: FEDCBA0987654321. The process of generating a hash seed based on these data is: first, use a simple series combination method to form the above data into a string AABBCCDDEEFF1234567890ABC DEF1A2B3C4DFEDCBA0987654321. Then input the string into the HASH algorithm to obtain a 64-bit HASH value of 8D2A4C3F8D2A4C3F, which is the value data of the hash seed. At this time, the generation data of the hash seed is 0. The process of generating the IP address is to first merge the value data of the hash seed and the generation data into a 128-bit data: 8D2A4C3F8D2A4C3F0000000000000000, input the data into the HASH algorithm, and obtain a 64-bit HASH value of B3C4DFEDCBA09876, then take the 8th to 15th bit data as the third part of the IP, and the 0th to 7th bit data as the fourth part of the IP address, or take the 0th to 7th bit data as the third part of the IP address, and the 8th to 15th bit data as the fourth part of the IP; among them, the 8th to 15th bit data is 0x98, which is 152 in decimal, and the 0th to 7th bit data is 0x76, which is 118 in decimal. So the initial IP address generated this time is 169.254.152.118. If the IP address is invalid, illegal or has been occupied, the generation data of the HASH seed data is increased by 1, and then a candidate IP address is generated until the generated candidate IP address is legal and not occupied by other devices.

[0105] The present invention can achieve the following effects: uniqueness guarantee: IP addresses are generated by hardware ID, which reduces the possibility of IP address conflicts; stability: once an IP address is allocated, it remains stable in the absence of topology changes; dynamic adjustment: the system has the ability to detect conflicts and adjust IP addresses in real time to ensure the continuity of network communications; efficiency improvement, the introduction of a cache mechanism, avoids the process of re-generating and allocating IP addresses each time the system is started.

[0106] The embodiment of the present invention can divide the functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0107] In the case of dividing each functional module into corresponding functional modules, Figure 3 FIG. 1 shows a schematic diagram of the structure of an IP generation device provided by the present invention. Figure 3 As shown, the device comprises:

[0108] The basic data acquisition module 301 of the node device is used to acquire the basic data of the node device for which the IP address is to be generated, wherein the basic data includes a unique identification number and a network port MAC address;

[0109] A hash seed generation module 302, configured to generate a hash seed according to the unique identification number and the network port MAC address; the hash seed includes generation data;

[0110] A hash calculation module 303, configured to perform hash calculation based on the hash seed to obtain a hash value;

[0111] An address mapping module 304 is used to map the hash value to a preset IP address range to obtain an initial IP address;

[0112] A conflict detection module 305 is used to perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0113] The IP address update module 306 is used to increase the generation data of the hash seed by a preset value in sequence when there is a conflict in the initial IP address, and generate a new IP address based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0114] Optionally, the hash seed also includes value data; the hash seed generation module 302 includes:

[0115] A series connection unit, used to connect the unique identification number and the network port MAC address in series according to a preset order to obtain unique identification data;

[0116] A hash calculation unit, used to process the unique identification data according to a hash algorithm, and determine the last 64 bits of the processed unique identification data as value data;

[0117] A concatenation unit is used to concatenate the initial generation data of the generation data and the value data into a 128-bit hash seed.

[0118] Optionally, the address mapping module 304 may include:

[0119] The initial IP address third part determination unit is used to convert the data from the 9th bit to the 15th bit of the hash value into a decimal form to obtain the third part of the initial IP address;

[0120] The fourth part determination unit of the initial IP address is used to convert the data from the 0th bit to the 8th bit of the hash value into a decimal form to obtain the fourth part of the initial IP address;

[0121] The initial IP address determination unit is used to combine the fixed value in the preset IP address range, the third part and the fourth part to obtain the initial IP address; the first part and the second part of the preset IP address range are fixed values.

[0122] Optionally, the performing IP address conflict detection on the initial IP address based on the ARP protocol includes:

[0123] Sending an ARP probe packet carrying a request message to the ad hoc network; the request message is used to inquire whether there are other devices in the ad hoc network using the initial IP address;

[0124] Receiving an ARP response packet returned from the self-organizing network; the ARP response packet is used to inform conflict information;

[0125] When an ARP response packet is received, the initial IP address is updated.

[0126] Optionally, the IP generation method is applied to an EOPS inkjet printing system, and the node device is an EOPS head plate device of the EOPS inkjet printing system.

[0127] Optionally, the device also includes a storage module, used to store the target IP address and the hash seed corresponding to the target IP address in a local storage device of the node device.

[0128] Optionally, the device further includes an ARP address announcement module, configured to assign the target IP address to the node device for which the IP address is to be generated;

[0129] Broadcast ARP address announcement packets to the ad hoc network;

[0130] The ARP cache of other node devices in the ad hoc network is updated according to the ARP address announcement packet.

[0131] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the interaction of each module. It can be understood that in order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0132] In the case of using the corresponding integrated unit, Figure 4 FIG. 1 is a schematic diagram showing the structure of an IP generation device provided by the present invention. Figure 4 As shown, the device includes:

[0133] A communication unit / communication interface, used to obtain basic data of a node device for which an IP address is to be generated, the basic data including a unique identification number and a network port MAC address;

[0134] A processing unit / processor, configured to generate a hash seed according to the unique identification number and the network port MAC address; the hash seed includes generation data;

[0135] Perform hash calculation based on the hash seed to obtain a hash value;

[0136] Mapping the hash value to a preset IP address range to obtain an initial IP address;

[0137] Perform IP address conflict detection on the initial IP address based on the ARP protocol;

[0138] When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

[0139] Among them, the processor can be a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessors, and the like. The communication module can be a transceiver, a transceiver circuit or a communication interface, and the like. The storage module can be a memory.

[0140] like Figure 4 As shown, the terminal device may further include a communication line. The communication line may include a path to transmit information between the components.

[0141] Optional, such as Figure 4 As shown, the terminal device may further include a memory. The memory is used to store computer-executable instructions for executing the solution of the present invention, and the execution is controlled by the processor. The processor is used to execute the computer-executable instructions stored in the memory, thereby implementing the method provided by the embodiment of the present invention.

[0142] like Figure 4 As shown, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor through a communication line. The memory may also be integrated with the processor.

[0143] Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in the embodiment of the present invention.

[0144] In a specific implementation, as an example, Figure 4 As shown, the processor may include one or more CPUs, such as Figure 4 CPU0 and CPU1 in.

[0145] In a specific implementation, as an example, Figure 4 As shown, the terminal device may include multiple processors, such as Figure 4 Each of these processors can be a single-core processor or a multi-core processor.

[0146] On the one hand, a computer-readable storage medium is provided, in which instructions are stored, and when the instructions are executed, the above-mentioned IP generation method is implemented.

[0147] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present invention is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user device or other programmable device. The computer program or instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instruction can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as a solid state drive (SSD).

[0148] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0149] Although the present invention has been described in conjunction with specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present invention. Accordingly, this specification and the accompanying drawings are merely exemplary illustrations of the present invention as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present invention. Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, the present invention is intended to include such modifications and variations if they fall within the scope of the claims of the present invention and their equivalents.

Claims

1. A method for generating an IP, characterized in that: include: Obtain basic data of the node device for which the IP address is to be generated; the basic data includes a unique identification number and a network port MAC address; Generate a hash seed according to the unique identification number and the network port MAC address; The hash seed includes generation data; Perform hash calculation based on the hash seed to obtain a hash value; Mapping the hash value to a preset IP address range to obtain an initial IP address; Perform IP address conflict detection on the initial IP address based on the ARP protocol; When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

2. The IP generation method according to claim 1, characterized in that: The hash seed also includes value data; generating the hash seed according to the unique identification number and the network port MAC address includes: Concatenate the unique identification number and the network port MAC address in a preset order to obtain unique identification data; Process the unique identification data according to a hash algorithm, and determine the last 64 bits of the processed unique identification data as value data; The initial generation data of the generation data and the value data are concatenated into a 128-bit hash seed.

3. The IP generation method according to claim 1, characterized in that: Mapping the hash value to a preset IP address range to obtain an initial IP address includes: Convert the data from the 8th bit to the 15th bit of the hash value into decimal form to obtain the third part of the initial IP address; Convert the data from bit 0 to bit 7 of the hash value into decimal form to obtain the fourth part of the initial IP address; The fixed value in the preset IP address range, the third part and the fourth part are combined to obtain an initial IP address; the first part and the second part of the preset IP address range are fixed values.

4. The IP generation method according to claim 1, characterized in that: The IP address conflict detection based on the ARP protocol for the initial IP address includes: Sending an ARP probe packet carrying a request message to the ad hoc network; the request message is used to inquire whether there are other devices in the ad hoc network using the initial IP address; Receiving an ARP response packet returned from the self-organizing network, wherein the ARP response packet is used to inform conflict information; When an ARP response packet is received, the initial IP address is updated.

5. The IP generation method according to claim 1, characterized in that: The IP generation method is applied to an EOPS inkjet printing system, and the node device is an EOPS head plate device of the EOPS inkjet printing system.

6. The IP generation method according to claim 1, characterized in that: When the initial IP address conflicts, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes: The target IP address and the hash seed corresponding to the target IP address are stored in a local storage device of the node device.

7. The IP generation method according to claim 1, characterized in that: When the initial IP address conflicts, the generation data of the hash seed is sequentially increased by a preset value, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP address of other node devices, and after obtaining the target IP address, the method further includes: Allocating the target IP address to the node device of the IP address to be generated; Broadcast ARP address announcement packets to the ad hoc network; The ARP cache of other node devices in the ad hoc network is updated according to the ARP address announcement packet.

8. An IP generation device, characterized in that: include: A basic data acquisition module for a node device, used to acquire basic data of a node device for which an IP address is to be generated, wherein the basic data includes a unique identification number and a network port MAC address; A hash seed generation module, used to generate a hash seed according to the unique identification number and the network port MAC address; The hash seed includes generation data; A hash calculation module, used to perform hash calculation based on the hash seed to obtain a hash value; An address mapping module is used to map the hash value to a preset IP address range to obtain an initial IP address; A conflict detection module is used to perform IP address conflict detection on the initial IP address based on the ARP protocol; The IP address update module is used to increase the generation data of the hash seed by a preset value in sequence when there is a conflict in the initial IP address, and generate a new IP address based on the hash seed with the preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

9. An IP generation device, characterized in that: include: A communication unit / communication interface, used to obtain basic data of a node device for which an IP address is to be generated, the basic data including a unique identification number and a network port MAC address; A processing unit / processor, configured to generate a hash seed according to the unique identification number and the network port MAC address; The hash seed includes generation data; Perform hash calculation based on the hash seed to obtain a hash value; Mapping the hash value to a preset IP address range to obtain an initial IP address; Perform IP address conflict detection on the initial IP address based on the ARP protocol; When there is a conflict in the initial IP address, the generation data of the hash seed is increased by a preset value in sequence, and a new IP address is generated based on the hash seed with the increased preset value until the new IP address does not conflict with the IP addresses of other node devices, thereby obtaining the target IP address.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, an IP generation method as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Indoor unit address allocation method of multi-split air conditioner

    CN120074980A

  • Multi-protocol ammeter bus address self-allocation method based on dynamic conflict avoidance

    CN121151371A

  • IO-Link slave station address dynamic allocation method and related equipment

    CN122053564A

  • Method for dynamic allocation of io-link slave addresses and related device

    CN122053564B