Secure address allocation method and device, electronic equipment and medium

By obtaining the configuration range of the security address, generating the slave security address and making uniqueness judgments, the problems of high hardware costs and cumbersome configuration processes in the existing technology are solved, and the uniqueness and simplified configuration processes of slave addresses are realized.

CN120091005APending Publication Date: 2025-06-03HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510303223.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

In the prior art, the allocation of a secure address to a slave station through the DIP dial switch results in high hardware costs, cumbersome configuration processes, and it is difficult to ensure the uniqueness of the slave station address.

Method used

Provide a secure address allocation method, by obtaining the configuration range of the secure address, generating a slave security address, and determining whether it is repeated with the historical address. If it is not repeated, it is written to the master station to realize the unique communication address configuration between the slave station and the master station.

Benefits of technology

It reduces the hardware design cost of slave security address configuration, simplifies the configuration process, ensures the uniqueness of slave address, and is easy to maintain and manage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091005A_ABST
    Figure CN120091005A_ABST
Patent Text Reader

Abstract

The invention discloses a secure address allocation method and device, electronic equipment and a medium, and is applied to the technical field of communication. The secure address allocation method provided by the invention is applied to an upper computer, and comprises the following steps: acquiring a configuration range of a secure address; generating a slave station security address based on the configuration range; judging whether the slave station security address is the same as each historical security address stored in the slave station; if the slave station security address is the same as any one of the historical security addresses, returning to the step of generating the slave station security address based on the configuration range; and if the slave station security address is different from each historical security address, writing the slave station security address into the master station, so that the master station and the corresponding slave station realize communication according to the slave station security address. Therefore, the slave station security address is configured and generated by adopting a software method, so that the hardware design cost of the slave station security address configuration is reduced, the actual application complexity is simplified, and the maintenance is convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and particularly to a secure address allocation method, apparatus, electronic device, and medium. Background Art

[0002] In FSoE (FailSafe over EtherCAT, an internationally standardized technology) protocol communication, its secure address serves as the only addressing method for the master station and slave stations. The current traditional method for allocating secure addresses to slave stations is to configure them through DIP switches.

[0003] However, when using DIP switches to allocate secure addresses to slave stations, it is necessary to add a design circuit for the DIP switches inside the slave stations, which increases the size and cost of the printed circuit board (PCB). Moreover, during the configuration process, since one master station can correspond to multiple slave stations simultaneously, each slave station needs to ensure the uniqueness of the configured secure address. At the same time, when new or internal modules need to be added or replaced in the slave station, it is also necessary to consider the original secure address situation to reconfigure non-duplicate secure addresses, and the overall configuration process is too cumbersome.

[0004] In view of the above technologies, seeking a secure address allocation method is an urgent problem for those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a secure address allocation method, apparatus, electronic device, and medium, which can solve the cost problem and the cumbersome configuration process caused by using DIP switches to allocate addresses to slave stations in the prior art.

[0006] To solve the above technical problems, this application provides a secure address allocation method, which is applied to a host computer and includes:

[0007] Obtain the configuration range of the secure address;

[0008] Generate a slave station secure address based on the configuration range;

[0009] Determine whether the slave station secure address is the same as each historical secure address stored in itself;

[0010] If the slave station secure address is the same as any one of the historical secure addresses, return to the step of generating the slave station secure address based on the configuration range;

[0011] If the slave station secure address is different from each historical secure address, write the slave station secure address into the master station so that the master station and the corresponding slave station can communicate according to the slave station secure address.

[0012] Preferably, obtaining the configuration range of the secure address includes:

[0013] Obtain each historical security address stored by itself;

[0014] Determine each address data range based on each security historical address;

[0015] Determine the corresponding configuration range based on each address data range.

[0016] Preferably, generating a slave station security address based on the configuration range includes:

[0017] Determine the byte range corresponding to each different byte according to the configuration range;

[0018] Determine the characters corresponding to different bytes based on the corresponding byte range according to the preset numerical selection rule;

[0019] Sort the characters corresponding to different bytes based on the preset byte sorting rule, and use the sorted array as the slave station security address.

[0020] Preferably, if the slave station security address is different from each historical security address, write the slave station security address into the master station, including:

[0021] If the slave station security address is different from each historical security address, write the slave station security address into the corresponding object dictionary; wherein, the object dictionary includes: the slave station security address, configuration parameters, and configuration variables;

[0022] Write the object dictionary into the master station.

[0023] Preferably, after writing the slave station security address into the master station, it further includes:

[0024] Perform an address read-back on the slave station security address, and control the slave station display target indication signal corresponding to the slave station security address during the address read-back phase.

[0025] On the other hand, a security address allocation method provided by the present application, applied to a slave station, includes:

[0026] Obtain the object dictionary written by the master station by the host computer based on the preset network protocol;

[0027] Obtain the slave station security address in the object dictionary;

[0028] Perform an address verification on the slave station security address to obtain a verification result;

[0029] If the verification result indicates that the verification is correct, send the verification result to the master station and communicate with the master station through the slave station security address.

[0030] Preferably, it further includes:

[0031] If the verification result indicates a verification error, the master station sends the verification result to the host computer so that the host computer can display the verification result.

[0032] On the other hand, the present application also provides a secure address allocation device, which is applied to the host computer and includes:

[0033] An acquisition module, configured to acquire the configuration range of the secure address;

[0034] An address generation module, configured to generate a slave station secure address based on the configuration range;

[0035] A judgment module, configured to judge whether the slave station secure address is the same as each historical secure address stored by itself; if the slave station secure address is the same as any one of the historical secure addresses, return to the step of generating the slave station secure address based on the configuration range; if the slave station secure address is different from each historical secure address, write the slave station secure address into the master station so that the master station and the corresponding slave station can communicate according to the slave station secure address.

[0036] On the other hand, the present application also provides an electronic device, including a memory for storing a computer program;

[0037] A processor, configured to implement the steps of the above-mentioned secure address allocation method when executing the computer program.

[0038] On the other hand, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned secure address allocation method are implemented.

[0039] A secure address allocation method provided by the present application, which is applied to the host computer and includes: acquiring the configuration range of the secure address; generating a slave station secure address based on the configuration range; judging whether the slave station secure address is the same as each historical secure address stored by itself; if the slave station secure address is the same as any one of the historical secure addresses, return to the step of generating the slave station secure address based on the configuration range; if the slave station secure address is different from each historical secure address, write the slave station secure address into the master station so that the master station and the corresponding slave station can communicate according to the slave station secure address. It can be seen that the present application uses a software method to configure and generate the slave station secure address, which not only reduces the hardware design cost of the slave station secure address configuration, but also simplifies the actual application complexity and is convenient for maintenance. Description of the Drawings

[0040] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0041] Figure 1 Flow chart of a secure address allocation method provided by an embodiment of the present application;

[0042] Figure 2 Hardware schematic diagram provided by an embodiment of the present application;

[0043] Figure 3 Flow chart of a secure address allocation method provided by another embodiment of the present application;

[0044] Figure 4 Module diagram of a secure address allocation device provided by another embodiment of the present application;

[0045] Figure 5 Structural diagram of an electronic device provided by another embodiment of the present application. Detailed implementation manners

[0046] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0047] The core of the present application is to provide a secure address allocation method, device, electronic device and medium.

[0048] In order to enable those skilled in the art to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0049] Figure 1 Flow chart of a secure address allocation method provided by an embodiment of the present application, including the following steps:

[0050] S10: Obtain the configuration range of the secure address.

[0051] S11: Generate the slave secure address based on the configuration range.

[0052] In a specific embodiment, the security address allocation method is applied to the master computer. That is, the software in the master computer first obtains the configuration range of the security address, specifying an initial range for generating the slave security addresses subsequently. The reason is as follows: The security address specifically includes 16 bytes, and the characters at different byte positions can be numbers, letters, etc. Therefore, each different byte corresponds to a relatively large range. If a corresponding slave security address is generated for each slave within such a range, there is no pattern, and it is also relatively complex to determine whether the currently generated slave security address is repeated. Therefore, in this application, before generating the slave security address, the configuration range of the security address is obtained, and then the slave security address is generated based on the configuration range. The multiple slave security addresses generated in this way are convenient for management, with simple operations, and it is also convenient to determine whether the currently generated slave security address is repeated with the previously generated slave security addresses.

[0053] Among them, the specific steps for obtaining the configuration range of the security address can be: The specific implementation method for obtaining the configuration range of the security address is: Obtain each historical security address stored in itself; Determine each address data range based on each security historical address; Determine the corresponding said configuration range based on each address data range.

[0054] And the specific steps for generating the slave security address based on the configuration range can be: The specific implementation method for generating the slave security address based on the configuration range is: Determine the byte range corresponding to each different byte according to the configuration range; Determine the characters corresponding to different bytes based on the corresponding byte range according to the preset numerical selection rule; Sort the characters corresponding to different bytes based on the preset byte sorting rule, and use the sorted array as the slave security address.

[0055] S12: Determine whether the slave security address is the same as each historical security address stored in itself.

[0056] S13: If the slave security address is the same as any one of the historical security addresses, return to the step of generating the slave security address based on the configuration range; if the slave security address is not the same as the historical security addresses, write the slave security address into the master station so that the master station and the corresponding slave can communicate according to the slave security address.

[0057] In a specific embodiment, since the purpose of the master station generating the slave station security address is to configure the slave station security address to the slave station through the master station, but one master station is connected to multiple slave stations. Therefore, during the process of the master station generating the slave station security address, actually multiple slave station security addresses are generated, and each of them is specifically configured for each slave station so that the master station can communicate with the corresponding slave station according to the current slave station security address in the future. Therefore, it is necessary to ensure that each slave station security address is unique and will not be repeated with other slave station security addresses. At the initial stage of configuration, it is required that the master station determines whether the slave station security address is the same as each historical security address stored in itself. If the slave station security address is the same as any one of the historical security addresses, it means that the currently generated slave station security address does not meet the requirements, and the step of generating the slave station security address based on the configuration range needs to be returned, that is, a unique slave station security address is regenerated; if the slave station security address is different from all the historical security addresses, it means that the currently generated slave station security address meets the requirements and is unique. At this time, the master station sends the slave station security address to the master station, and then the master station configures it to a slave station without an address so that the current and subsequent master stations and slave stations can communicate through the slave station security address.

[0058] The communication between the master station and the slave station includes the following steps:

[0059] Step 1: The master station and the slave station are powered on respectively. If the power-on fails.

[0060] Step 2: The master station needs to send communication instructions to each connected slave station. (The communication instructions include the address corresponding to the slave station that needs to communicate).

[0061] Step 3: Each slave station makes its own judgment according to the slave station security address in the communication instruction. If the slave station security address corresponding to itself is the same as the address in the communication instruction, communication with the master station is achieved; if the slave station security address corresponding to itself is different from the address in the communication instruction, communication with the master station is achieved.

[0062] Step 4: After the master station and the slave station communicate through the slave station security address, they can transmit security communication and application parameters through the current communication channel, which specifically includes the watchdog interval, application parameter length, and application data.

[0063] It should be noted that the specific steps for obtaining the configuration range of the security address and the specific steps for the slave station security address based on the configuration range provided in the embodiments of the present application are only one possible implementation method, but not limited to only this implementation method, and can be set by the user according to needs.

[0064] A secure address allocation method provided by the present application is applied to a master computer and includes: obtaining a configuration range of secure addresses; generating a slave secure address based on the configuration range; determining whether the slave secure address is the same as each historical secure address stored by itself; if the slave secure address is the same as any one of the historical secure addresses, returning to the step of generating the slave secure address based on the configuration range; if the slave secure address is different from each historical secure address, writing the slave secure address into the master computer so that the master computer and the corresponding slave can communicate according to the slave secure address. It can be seen that the present application uses a software method to configure and generate the slave secure address, which not only reduces the hardware design cost of configuring the slave secure address, but also simplifies the actual application complexity and is convenient for maintenance.

[0065] On the basis of the above embodiment, as a preferred embodiment, the specific implementation manner of the above S10 step: obtaining the configuration range of the secure address is: obtaining each historical secure address stored by itself; determining each address data range based on each secure historical address; determining the corresponding configuration range based on each address data range.

[0066] In a specific embodiment, whenever the master computer generates a slave secure address, that is, stores a slave secure address, then the slave secure address at this time will be used as the historical secure address of the next slave secure address. In order to avoid the newly generated slave secure address from being repeated with the previously generated slave secure address and simplify the process of determining whether the currently generated slave secure address is repeated with the previously generated slave secure address, it is necessary to obtain each historical secure address stored by itself, then determine each address data range according to each secure historical address, and finally fuse each address data range to finally obtain a configuration range.

[0067] Among them, the master computer is connected to multiple slaves, but not all slaves have slave secure addresses. Therefore, the secure slave addresses corresponding to some slaves will be stored in the master computer as each historical secure address stored by itself. Or all slaves do not have corresponding slave secure addresses, then a part of each historical secure address that meets the address specification can be stored in the master computer in advance as the basis for the master computer to generate the slave secure address.

[0068] The specific implementation manner of the above S11 step: generating a slave secure address based on the configuration range is: determining the byte range corresponding to different bytes according to the configuration range; determining the characters corresponding to different bytes based on the corresponding byte range according to a preset value selection rule; sorting the characters corresponding to different bytes based on a preset byte sorting rule, and using the sorted array as the slave secure address.

[0069] In a specific embodiment, the number of bytes of the slave security address is 16 bytes, and the initial configuration range of the 16-byte slave security address is: 0000 0000 0000 0000 - 0000 0000 0000 FFFF. According to each historical security address, a relatively smaller configuration range can be further divided on the basis of the initial configuration range. Specifically, the byte ranges corresponding to different position bytes are determined within the configuration range, and then characters (such as 0, 1, F, etc.) corresponding to different bytes are determined based on the corresponding byte ranges according to a preset value selection rule (for example: random selection rule or sequential selection rule). Then, the characters corresponding to different bytes are sorted based on a preset byte sorting rule, which can also be understood as re-sorting according to the original byte positions. The sorted array is used as the slave security address. For example: 0000 0000 0010 0100.

[0070] Based on the above embodiment, as a preferred embodiment, for the above S14 step: If the slave security address is different from each historical security address, the specific implementation of writing the slave security address into the master station is as follows: If the slave security address is different from each historical security address, write the slave security address into the corresponding object dictionary; where the object dictionary includes: slave security address, configuration parameters, and configuration variables; write the object dictionary into the master station.

[0071] After writing the slave security address into the master station, it further includes: performing an address read-back on the slave security address, and controlling the slave display target indication signal corresponding to the slave security address during the address read-back phase.

[0072] In a specific embodiment, the present application uses an object dictionary to write the slave security address into the master station. That is to say, the host computer generates a unique slave security address through software, then writes the slave security address into the object dictionary, and then writes the object dictionary into the master station, so that the master station writes the object dictionary into the slave station through the EtherCAT protocol to implement the address configuration process.

[0073] During this process, after the host computer configures the slave security address through the configuration interface, it is also necessary to read back the configured slave security address through the software of the host computer. Each time the slave security address corresponding to the slave is read back, it controls the corresponding slave display target indication signal (for example: controlling the LED indicator in the slave to blink for about 3 - 5 seconds) to indicate the specific position of the currently read-back slave, so that the operation can be detected arbitrarily.

[0074] Among them, it should be noted that after the host computer writes the object into the master station, the master station writes the object dictionary into the slave station through the EtherCAT protocol. Then, the micro control unit in the slave station stores the slave station security address in the object dictionary into the memory in the micro control unit. The controller of the slave station then loads the slave station security address from the memory and verifies it. If the verification is correct, the security protocol stack configured with the correct slave station security address is used, and the correct slave station security address is used each time communicating with the station. After verification, the slave station downloads the verification result (which can also be understood as the configuration result) to the master station again; the master station parses the slave station security address again and uses the configured slave station security address to communicate with the slave station during communication.

[0075] Therefore, the hardware schematic diagram corresponding to the current security address allocation method is as shown in Figure 2 Figure 5, which includes a host computer 1, a master station 2, and two slave stations 3. The master station includes a controller 401, a master station central processing unit 402, and a master station network configuration file 403; the slave module in the slave station 3 includes a slave station central controller 301 and a slave station network configuration file 302, and the slave station security address is included in the slave station network configuration file 302 and the master station network configuration file 203. The host computer 1 is connected to the master station 2 through Ethernet, and the master station 2 is connected to the first slave station 3 through the EtherCAT protocol. At the same time, the first slave station 3 and the second slave station 3 are also connected through the EtherCAT protocol. The host computer 1 generates the slave station security address through software and configures it to the corresponding slave station 3 through the master station 2 to realize the communication between the master station 2 and the slave station 3.

[0076] Among them, it should be noted that the embodiment provided in this application is only one implementable way, but it is not limited to only this implementable way and can be set by oneself according to the needs of users.

[0077] It can be seen that this application uses a software method to configure and generate the slave station security address, which not only reduces the hardware design cost of the slave station security address configuration, but also simplifies the actual application complexity and is convenient for maintenance.

[0078] Figure 3 The flowchart of a security address allocation method provided in another embodiment of this application is as shown in Figure 3 Figure 6, and includes the following steps:

[0079] S20: Obtain the object dictionary written by the host computer to the master station based on a preset network protocol.

[0080] S21: Obtain the slave station security address in the object dictionary.

[0081] S22: Perform an address check on the slave station security address to obtain a check result.

[0082] S23: If the verification result indicates correct verification, send the verification result to the master station and communicate with the master station through the slave station security address.

[0083] S24: If the verification result indicates incorrect verification, send the verification result to the host computer through the master station so that the host computer can display the verification result.

[0084] In a specific embodiment, Figure 3 The method flow shown is applied to the slave station. The host computer first sends the generated slave station security address to the master station in the form of an object dictionary, and then the master station and the corresponding slave station are connected using a preset network protocol (for example: EtherCAT protocol) for transmitting the object dictionary. The slave station obtains the slave station security address in the object dictionary and then verifies it. If the verification is correct, the verification result is sent to the master station so that the current or subsequent master station can communicate with the corresponding slave station through the slave station security address; if the verification result indicates incorrect verification, the verification result is sent to the host computer through the master station so that the host computer can display the verification result and at the same time so that the operator can determine which slave station is communicating with the master station currently.

[0085] A security address allocation method provided by the present application is applied to the slave station and includes: obtaining the object dictionary written by the host computer to the master station based on a preset network protocol; obtaining the slave station security address in the object dictionary; performing address verification on the slave station security address to obtain a verification result; if the verification result indicates correct verification, send the verification result to the master station and communicate with the master station through the slave station security address. It can be seen that in the present application, the host computer configures and generates the slave station security address in a software manner and distributes the configured slave station security address through the object dictionary of the EtherCAT protocol, which not only reduces the hardware design cost of configuring the slave station security address, but also simplifies the actual application complexity and is convenient for maintenance.

[0086] In the above embodiment, the security address allocation method is described in detail. The present application also provides an embodiment corresponding to the security address allocation device. It should be noted that the present application describes the embodiment of the device part from two perspectives, one is from the perspective of functional modules and the other is from the perspective of hardware.

[0087] Figure 4 For another embodiment of the present application, a module diagram of a security address allocation device is shown in Figure 4 as follows and includes:

[0088] An obtaining module 11, configured to obtain the configuration range of the security address;

[0089] An address generation module 12, configured to generate a slave station security address based on the configuration range;

[0090] A judgment module 13 is configured to determine whether the slave station security address is the same as each historical security address stored therein. If the slave station security address is the same as any one of the historical security addresses, the step of generating the slave station security address based on the configured range is returned. If the slave station security address is different from each historical security address, the slave station security address is written into the master station so that the master station and the corresponding slave station can communicate according to the slave station security address.

[0091] Since the embodiments of the apparatus part correspond to those of the method part, for the embodiments of the apparatus part, please refer to the description of the embodiments of the method part, which will not be elaborated here.

[0092] Figure 5 The structure diagram of the electronic device provided by another embodiment of the present application is shown as Figure 5 As shown, the electronic device includes: a memory 20 for storing a computer program;

[0093] A processor 21 for implementing the steps of the security address allocation method mentioned in the above embodiments when executing the computer program.

[0094] The electronic device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer, etc.

[0095] Wherein, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), or a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an artificial intelligence (AI) processor for processing computational operations related to machine learning.

[0096] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, the relevant steps of the secure address allocation method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc.

[0097] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0098] Those skilled in the art can understand that Figure 5 the structure shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown in the figure.

[0099] The electronic device provided by the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the above-mentioned secure address allocation method and has the same beneficial effects.

[0100] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0101] It can be understood that if the method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0102] The above has introduced in detail a secure address allocation method, apparatus, electronic device, and medium provided by the present application. The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0103] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the said element.

Claims

1. A secure address allocation method, characterized in that: Applied to the host computer, including: Get the configured range of secure addresses; generating a slave station security address based on the configuration range; Determine whether the slave station security address is the same as each historical security address stored in the slave station; If the slave station security address is the same as any one of the historical security addresses, returning to the step of generating the slave station security address based on the configuration range; If the slave station safety address is different from each of the historical safety addresses, the slave station safety address is written into the master station so that the master station and the corresponding slave station can communicate according to the slave station safety address.

2. The secure address allocation method according to claim 1, characterized in that: The configuration range for obtaining the secure address includes: Obtaining each of the historical security addresses stored in itself; Determine the data range of each address based on each of the security history addresses; The corresponding configuration range is determined based on each of the address data ranges.

3. The secure address allocation method according to claim 1, characterized in that: The generating a slave station security address based on the configuration range includes: Determine byte ranges corresponding to different bytes according to the configuration range; Determine the characters determined by the different bytes based on the corresponding byte range according to the preset value selection rule; The characters corresponding to the different bytes are sorted based on a preset byte sorting rule, and the sorted array is used as the slave station security address.

4. The secure address allocation method according to claim 1, characterized in that: If the slave station security address is different from each of the historical security addresses, writing the slave station security address into the master station comprises: If the slave station security address is different from each of the historical security addresses, the slave station security address is written into a corresponding object dictionary; wherein the object dictionary includes: the slave station security address, configuration parameters and configuration variables; The object dictionary is written to the master station.

5. The secure address allocation method according to claim 1, characterized in that: After writing the slave station security address into the master station, it also includes: The slave station safety address is read back, and during the address read back stage, the slave station corresponding to the slave station safety address is controlled to display a target indication signal.

6. A secure address allocation method, characterized in that: Applicable to slave stations, including: Obtain the object dictionary written by the host computer to the master station based on the preset network protocol; Obtaining a slave station security address in the object dictionary; Performing address verification on the slave station security address to obtain a verification result; If the verification result indicates that the verification is correct, the verification result is sent to the master station, and the slave station communicates with the master station through the secure address of the slave station.

7. The secure address allocation method according to claim 6, characterized in that: Also includes: If the verification result indicates a verification error, the verification result is sent to the host computer through the master station so that the host computer displays the verification result.

8. A secure address allocation device, characterized in that: Applied to the host computer, including: The acquisition module is used to obtain the configuration range of the security address; An address generation module, used for generating a slave station security address based on the configuration range; A judgment module is used to judge whether the slave station security address is the same as the historical security addresses stored in the slave station; if the slave station security address is the same as any one of the historical security addresses, return to the step of generating the slave station security address based on the configuration range; if the slave station security address is different from the historical security addresses, write the slave station security address into the master station so that the master station and the corresponding slave station can communicate according to the slave station security address.

9. An electronic device, characterized in that: comprising a memory for storing a computer program; A processor, configured to implement the steps of the secure address allocation method as described in any one of claims 1 to 5 or 6-7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the secure address allocation method according to any one of claims 1 to 5 or 6-7 are implemented.