Equipment discovery method, description method, related equipment and storage medium

Through the device discovery method, the device description language is used to scan and connect the control device to obtain the device description file, which solves the problems of labor consumption and low efficiency during the maintenance of the control device, and achieves rapid and safe improvement in equipment information acquisition and maintenance efficiency.

CN119814637APending Publication Date: 2025-04-11CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311307733.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing control equipment requires a lot of manpower and is very inefficient in maintenance, mainly because it requires manual disassembly, review manuals and connects terminal equipment to obtain board information.

Method used

Provided is a device discovery method, by obtaining device discovery instructions, scanning all control devices in the Ethernet, establishing a communication connection, and sending device discovery messages based on the device description language to obtain device description files of the control device. This file contains device attributes, card slot attributes and board attributes. The device display information is obtained through decryption and inverse conversion for viewing by terminal device users.

Benefits of technology

Through this method, the terminal device can safely and quickly obtain the device description files of all control devices in the same network, improving maintenance efficiency and saving a lot of manpower.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814637A_ABST
    Figure CN119814637A_ABST
Patent Text Reader

Abstract

The invention provides an equipment discovery method, a description method, related equipment and a storage medium. The method comprises the following steps: acquiring an equipment discovery instruction; responding to the equipment discovery instruction to scan all control equipment in the Ethernet, and establishing communication connection with all the control equipment; sending a device discovery message to all the control devices based on the device description language according to the device discovery instruction; receiving an encrypted description file sent by the control equipment for identifying the response equipment discovery message; selecting a corresponding target file decryption method according to the file length of the encryption description file; decrypting the encrypted description file through a target file decryption method to obtain an equipment description file of the control equipment; and inversely converting the equipment description file into equipment display information based on the equipment description language, and displaying the equipment display information to a user of the terminal equipment. The method has the effect of quickly acquiring the equipment related information of the control equipment so as to improve the equipment maintenance efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of device discovery, and in particular relates to a device discovery method, a description method, related devices and a storage medium. Background Art

[0002] In some large projects, there will be a large number of control devices, such as integrated train control projects, air transport control projects, etc. The control devices can control multiple basic devices at the same time by receiving instructions from the control console, and can also collect real-time device information of multiple basic devices. Therefore, the control devices play a vital role in the operation of the entire project.

[0003] Among the existing control devices, plug-in control devices are widely used. Their outer shell is a tightly sealed chassis, which can provide good protection for the core components inside. The plug-in control device adopts a card slot design inside. Each functional module is installed in the form of a card by inserting it into the card slot, which can effectively save the space occupied by the device. Different cards can provide different functions, such as input and output modules, communication modules, control modules, etc. The corresponding function expansion can be achieved by inserting different cards into the card slot.

[0004] Although plug-in control devices can achieve functional expansion and customization by inserting different card slots, providing flexibility and reliability. However, there are great troubles in the process of equipment maintenance and repair, because large projects usually configure multiple control devices, and each control device has a large number of boards inside. If you need to obtain the board information of a certain board during maintenance, you need to manually disassemble the chassis shell of the corresponding control device, and then find the board to be tested by consulting the pre-recorded equipment maintenance manual, and connect the terminal device used for maintenance to the control device to obtain the board information of the target board. Therefore, the entire maintenance process requires a lot of manpower and the maintenance efficiency is very low. Summary of the invention

[0005] The present invention provides a device discovery method, a description method, related devices and a storage medium to solve the problem that a large amount of manpower is consumed and the maintenance efficiency is very low during the maintenance of control equipment.

[0006] In a first aspect, the present invention provides a device discovery method, the method comprising the following steps:

[0007] Get device discovery instructions;

[0008] Responding to the device discovery instruction to scan all control devices in the Ethernet, and establishing communication connections with all the control devices;

[0009] Sending a device discovery message to all the control devices based on a device description language and according to the device discovery instruction;

[0010] receiving an encrypted description file sent by the control device in response to the device discovery message;

[0011] Selecting a corresponding target file decryption method according to the file length of the encryption description file;

[0012] Decrypting the encrypted description file by the target file decryption method to obtain a device description file of the control device, wherein the device description file includes device attributes of the control device, card slot attributes of the device card slot of the control device, and board attributes of the device card inserted in the device card slot;

[0013] The device description file is reversely converted into device display information based on the device description language, and the device display information is displayed to a user of the terminal device.

[0014] Optionally, the sending of a device discovery message to all the control devices based on the device description language and according to the device discovery instruction comprises the following steps:

[0015] Generate a message identification code based on a device description language;

[0016] Identifying a request type instruction in the device discovery instruction;

[0017] Generate a request type key character according to the request type instruction and using the device description language;

[0018] generating a device discovery message in combination with the message identification code and the request type key character;

[0019] The device discovery message is sent to all the control devices.

[0020] Optionally, the method for selecting a corresponding target file decryption method according to the file length of the encrypted description file comprises the following steps:

[0021] Convert the encrypted description file into an encrypted file character string by text conversion;

[0022] Obtaining the string length of the encrypted file string as the file length;

[0023] Determining whether the length of the file exceeds a preset first text length threshold;

[0024] If the file length does not exceed the first text length threshold, selecting a first file decryption method from a preset decryption algorithm library as a target file decryption method;

[0025] If the file length exceeds the first text length threshold, determining whether the file length exceeds a preset second text length threshold, the second text length threshold being greater than the first text length threshold;

[0026] If the file length does not exceed the second text length threshold, selecting a second file decryption method from the decryption algorithm library as the target file decryption method;

[0027] If the file length exceeds the second text length threshold, a third file decryption method is selected from the decryption algorithm library as the target file decryption method.

[0028] In a second aspect, the present invention further provides a device description method, characterized in that it is applied to a control device, and the device description method comprises the following steps:

[0029] Obtaining device properties of the control device;

[0030] Scan all device card slots of the control device and obtain card slot attributes of all the device card slots;

[0031] Identify the device card inserted in the device card slot based on the card slot attribute, and read the card attributes of all the device cards;

[0032] Generating a device description file of the control device by combining the device attributes, the card slot attributes and the board attributes;

[0033] A target encryption method is selected according to the card slot attribute, and the device description file is encrypted into an encrypted description file using the target encryption method.

[0034] Optionally, the card slot attributes include a card slot plug-in state and a card slot position number, and the combining the device attributes, the card slot attributes and the board attributes to generate a device description file for the control device includes the following steps:

[0035] Counting the number of card slots in which the device board is plugged according to the card slot plugging status;

[0036] Parsing all the board attributes, and classifying all the board attributes into faulty board attributes and real board attributes, wherein the faulty board attributes are board attributes assigned with null values, and the real board attributes are board attributes assigned with non-null values;

[0037] Counting the number of boards whose real board attributes correspond to target device boards;

[0038] Determining whether the number of the card slots is the same as the number of the boards;

[0039] If the number of the card slots is the same as the number of the boards, generating a device description file for the control device based on a device description language and in combination with the device attributes, the card slot attributes and the board attributes;

[0040] If the number of card slots is different from the number of boards, a card slot fault code is generated, and the card slot position number corresponding to the faulty board attribute is bound to the card slot fault code to generate a card slot fault attribute;

[0041] The device description file is generated based on a device description language and in combination with the device attributes, the card slot attributes, the card slot fault attributes and the board attributes.

[0042] Optionally, the step of selecting a target encryption method according to the card slot attribute and encrypting the device description file into an encrypted description file by using the target encryption method comprises the following steps:

[0043] Counting the number of faulty boards whose board attributes are the faulty board attributes among all the equipment boards;

[0044] Determine whether the number of faulty boards exceeds a preset fault number threshold;

[0045] If the number of faulty boards exceeds the fault number threshold, a first file encryption method is selected from the three preset file encryption methods as a target encryption method, and a first file decryption method corresponding to the target encryption method is stored in a preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method;

[0046] If the number of the faulty boards does not exceed the fault number threshold, determining whether the number of the faulty boards is 0;

[0047] If the number of faulty boards is not 0, a second file encryption method is selected from the three preset file encryption methods as a target encryption method, and a second file decryption method corresponding to the target encryption method is stored in a preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method, wherein the encryption complexity of the second file encryption method is less than that of the first file encryption method;

[0048] If the number of faulty boards is 0, the third file encryption method is selected from the three preset file encryption methods as the target encryption method, and the third file decryption method corresponding to the target encryption method is stored in the preset decryption algorithm library. The device description file is encrypted into an encrypted description file through the target encryption method, and the encryption complexity of the third file encryption method is less than that of the second file encryption method.

[0049] Optionally, the board attributes include board name, board drawing number, board network card information and board connector information, the board network card information includes board IP address, board MAC address and board subnet mask, and the board connector information includes board analog input and output signals and board digital input and output signals.

[0050] In a third aspect, the present invention further provides a device discovery system, the system comprising a terminal device and a plurality of control devices, the terminal device being connected to the plurality of control devices via Ethernet;

[0051] The terminal device is configured to execute the device discovery method described in the first aspect;

[0052] The several control devices are configured to execute the device description method described in the second aspect.

[0053] In a fourth aspect, the present invention further provides a computer-readable storage medium having instructions stored thereon, the instructions being used to enable a computer to execute the device discovery method described in the first aspect and the device description method described in the second aspect.

[0054] The beneficial effects of the present invention are:

[0055] The device discovery method adopted by the present invention includes the following steps: obtaining a device discovery instruction; responding to the device discovery instruction to scan all control devices in the Ethernet and establishing a communication connection with all control devices; sending a device discovery message to all control devices based on a device description language and according to the device discovery instruction; receiving an encrypted description file sent by the control device in response to the device discovery message; selecting a corresponding target file decryption method according to the file length of the encrypted description file; decrypting the encrypted description file by the target file decryption method to obtain a device description file of the control device, the device description file including device attributes of the control device, slot attributes of a device card slot of the control device and board attributes of a device board inserted in the device card slot; based on the device description language, reversely converting the device description file into device display information, and displaying the device display information to a user of a terminal device. Through the above steps, when maintaining the control device, the device description files of all control devices in the same network can be directly obtained through the terminal device safely and quickly. Since the device description file includes device attributes, card slot attributes and board attributes, after the device description file is converted into device display information, the user of the terminal device can obtain the device information of the control device and the board information of all boards, thereby improving the efficiency of the control device maintenance process and saving a lot of manpower. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flowchart of the device discovery method in the present invention.

[0057] Figure 2 It is a flow chart of the device description method in the present invention.

[0058] Figure 3 It is a system structure diagram of the device discovery system in the present invention. DETAILED DESCRIPTION

[0059] The present invention discloses a device discovery method, which is applied to a terminal device, which may be a computer, an industrial computer or other device that can be connected to a control device via Ethernet. The terminal device is used to carry maintenance software to maintain the control device after connecting to the control device.

[0060] Reference Figure 1 , the device discovery method specifically includes the following steps:

[0061] S101. Obtain a device discovery instruction.

[0062] The user sends a device discovery instruction to the control device through the system or application in the terminal device.

[0063] S102 . Respond to the device discovery instruction to scan all control devices in the Ethernet and establish communication connections with all control devices.

[0064] S103. Send a device discovery message to all control devices based on the device description language and according to the device discovery instruction.

[0065] Among them, the terminal device uses a device description language (such as XML or JSON) to construct a device discovery message. The device discovery message contains the basic information and identifier of the device and is formatted according to the requirements of the device discovery instruction. The terminal device sends the device discovery message to all scanned control devices through the established communication connection. After receiving the device discovery message, the control device will feedback a device description file also constructed using the device description language, which contains the device properties, slot properties and board properties of the control device. The device description language stipulates that it is carried out in a "request-response" mechanism and provides a variety of request services. The device discovery message includes a device discovery message identification code, a type keyword and a request service. The device discovery message identification code can be used as the beginning of the device discovery message, and the request service represents the attribute type requested by the device discovery message. The request service includes a device attribute acquisition request DEVICE_REQUEST, a slot attribute acquisition request SLOT_REQUEST and a board attribute acquisition request BOARD_REQUEST.

[0066] The terminal device parses the device discovery command to obtain the command for requesting device attributes, and instantiates the command through the device description language as follows:

[0067] Device_Discovery\r\n

[0068] SEARCH:DEVICE_REQUEST_REQUEST\r\n\r\n

[0069] Device_Discovery is the device discovery message identification code, SEARCH is the type keyword in the device discovery message, and DEVICE_REQUEST indicates the device attribute request. "\r\n" is the end identifier of each line of information. When the entire message information ends, it is indicated by "\r\n\r\n". Therefore, the device description language can be described by "type keyword +: + attribute value + \r\n". If a new attribute request needs to be added, only the type keyword needs to be added without affecting the parsing of existing attributes. The description language has good compatibility and versatility.

[0070] S104. The receiving control device identifies the encrypted description file sent by the response device discovery message.

[0071] Among them, when the control device receives the device discovery message, it will parse the device discovery message, generate a device description file based on the parsed device discovery message and the device description language, and send the device description file to the terminal device, and the encrypted description file is the encrypted device description file. For example: Assume that the device attributes of a control device are shown in Table 1.

[0072] Table 1 Device attributes of control devices

[0073] Device properties Data Types Remark Property Description DeviceName String Device Name TEC4000S DeviceFN String Device Code TEB162000000

[0074] If the device discovery message received by the control device is as follows:

[0075] Device_Discovery\r\n

[0076] SEARCH:DEVICE_REQUEST_REQUEST\r\n\r\n

[0077] The device description file fed back by the control device is as follows:

[0078] Device_Discovery\r\n

[0079] REPLY:DEVICE_REQUEST\r\n

[0080] DeviceName:TEC4000S\r\n

[0081] DeviceFN:TEB162000000

[0082] Device_Discovery is the identification code of the device discovery message; REPLY is the type keyword of the feedback, and the type keyword is a specific identification code of the information content of each line of the message.

[0083] S105. Select a corresponding target file decryption method according to the file length of the encrypted description file.

[0084] The longer the file length is, the more complex the encryption method used when encrypting the device description file is.

[0085] S106. Decrypt the encrypted description file using the target file decryption method to obtain a device description file for the control device.

[0086] Among them, the device description file includes the device attributes of the control device, the card slot attributes of the device card slot of the control device, and the board attributes of the device card inserted in the device card slot. The card slot attributes include the card slot address and the card slot name, etc., and the device attributes include the device name, device code, etc. The board attributes include the board name, board drawing number, board network card information, and board connector information. The board network card information includes the board IP address, board MAC address, and board subnet mask. The board connector information includes the board analog input and output signals and the board digital input and output signals.

[0087] S107. Reversely convert the device description file into device display information based on the device description language, and display the device display information to the user of the terminal device.

[0088] In order to facilitate the user of the terminal device to better view the relevant information of the device that needs maintenance and inspection, the decrypted device description file needs to be reversely converted according to the device description language and converted into device display information. For example, in the specific description of step S104, in one implementation, the device description file in code form can be converted into device display information in a table form as shown in Table 1.

[0089] The implementation principle of this embodiment is:

[0090] Obtain a device discovery instruction; respond to the device discovery instruction to scan all control devices in the Ethernet and establish a communication connection with all control devices; send a device discovery message to all control devices based on a device description language and according to the device discovery instruction; receive the encrypted description file sent by the control device in response to the device discovery message; select the corresponding target file decryption method according to the file length of the encrypted description file; decrypt the encrypted description file by the target file decryption method to obtain a device description file of the control device, the device description file includes the device attributes of the control device, the card slot attributes of the device card slot of the control device, and the board attributes of the device board inserted in the device card slot; reversely convert the device description file into device display information based on the device description language, and display the device display information to the user of the terminal device. Through the above steps, when maintaining the control device, the device description files of all control devices in the same network can be directly obtained through the terminal device safely and quickly. Since the device description file includes device attributes, card slot attributes and board attributes, after converting the device description file into device display information, the user of the terminal device can obtain the device information of the control device and the board information of all boards, thereby improving the efficiency of the control device maintenance process and saving a lot of manpower.

[0091] In one implementation manner, step S103, namely sending a device discovery message to all control devices based on the device description language and according to the device discovery instruction, specifically comprises the following steps:

[0092] Generate a message identification code based on a device description language;

[0093] Identify request type instructions in device discovery instructions;

[0094] Generate a request type key character according to the request type instruction and using a device description language;

[0095] Generate a device discovery message by combining the message identification code and the request type key character;

[0096] Send device discovery messages to all control devices.

[0097] In this embodiment, the device description language (such as XML or JSON) contains detailed information and functional descriptions of the device. A unique message identification code can be generated based on the device description language and through a hash algorithm. The message identification code can be used to identify the uniqueness of the device discovery message. The device discovery instruction contains a request type instruction, which is used to indicate the attribute type of the control device that needs to be obtained. By parsing the device discovery instruction, the request type instruction is identified, and further based on the request type instruction and using the device description language, a request type key character is generated. The key character can be a field or tag in the device description language, which is used to indicate the request type. Finally, the message identification code and the request type key character are combined to generate a device discovery message.

[0098] In one embodiment, step S105, i.e. selecting a corresponding target file decryption method according to the file length of the encrypted description file, specifically comprises the following steps:

[0099] Convert the encrypted description file into an encrypted file string by text conversion;

[0100] Get the string length of the encrypted file string as the file length;

[0101] Determine whether the file length exceeds a preset first text length threshold;

[0102] If the file length does not exceed the first text length threshold, a first file decryption method is selected from a preset decryption algorithm library as a target file decryption method;

[0103] If the file length exceeds the first text length threshold, determining whether the file length exceeds a preset second text length threshold, the second text length threshold being greater than the first text length threshold;

[0104] If the file length does not exceed the second text length threshold, selecting a second file decryption method from the decryption algorithm library as the target file decryption method;

[0105] If the file length exceeds the second text length threshold, a third file decryption method is selected from the decryption algorithm library as the target file decryption method.

[0106] In this embodiment, first, the content of the encrypted description file is converted into a text string. The length of the encrypted file string is calculated using the string length function provided by the programming language to obtain the file length. The preset first text length threshold is compared with the file length. If the file length does not exceed the first text length threshold, the first file decryption method is selected from the preset decryption algorithm library as the target file decryption method, and the preset decryption algorithm library contains multiple decryption methods. If the file length exceeds the first text length threshold, it is determined whether the file length exceeds the preset second text length threshold, and the second text length threshold is greater than the first text length threshold. If the file length does not exceed the second text length threshold, the second file decryption method is selected from the decryption algorithm library as the target file decryption method. If the file length exceeds the second text length threshold, the third file decryption method is selected from the decryption algorithm library as the target file decryption method.

[0107] The first file decryption method in the decryption algorithm library is used to decrypt files encrypted by the first file encryption method, the second file decryption method is used to decrypt files encrypted by the second file encryption method, and the third file decryption method is used to decrypt files encrypted by the third file encryption method. The encryption complexity of the second file encryption method is less than that of the first file encryption method, and the encryption complexity of the third file encryption method is less than that of the second file encryption method. AES-256 algorithm can be selected as the first file encryption method, AES-192 algorithm can be selected as the second file encryption method, and AES-128 algorithm can be selected as the third file encryption method.

[0108] The present invention also discloses a device description method, which is applied to a control device that needs to be maintained and repaired. The control device can be connected to the terminal device through Ethernet, Bluetooth, etc.

[0109] Reference Figure 2 , the device description method specifically includes the following steps:

[0110] S201. Obtain device properties of the control device.

[0111] Among them, device attributes include device name, device code, etc.

[0112] S202. Scan all device card slots of the control device and obtain card slot attributes of all device card slots.

[0113] S203. Identify the device card inserted in the device card slot based on the card slot attributes, and read the card attributes of all device cards.

[0114] Among them, the board attributes include the board name, board drawing number, board network card information and board connector information. The board network card information includes the board IP address, board MAC address and board subnet mask. The board connector information includes the board analog input and output signals and the board digital input and output signals.

[0115] S204. Generate a device description file for the control device by combining the device attributes, the card slot attributes and the board attributes.

[0116] S205. Select a target encryption method according to the card slot attribute, and encrypt the device description file into an encrypted description file using the target encryption method.

[0117] In this embodiment, the device attribute information is obtained by controlling the device system of the device using a suitable interface or protocol. The device attributes include the device name, device code, etc. All card slots of the device are scanned according to the specifications and interface standards of the control device. The card slot attribute information is obtained by reading the information and status register of the card slot, and the card slot attribute includes the card slot number, card slot type, card slot status, etc. According to the card slot attribute and the hardware connection rules of the device, the device board inserted in the device card slot is identified. The board attribute information is obtained by reading the information and register of the board. The device attributes, card slot attributes and board attributes are integrated together to generate a device description file.

[0118] For example: Assume that the attribute information of a control device is as shown in Table 2.

[0119] Table 2 Attribute information of control equipment

[0120] Property Type Data Types Remark Property Description DeviceName String Device Name TEC4000S DeviceFN String Device Code TEB162000000 SlotFN String Slot number S0001 BoardName String Board Name BOARD1

[0121] The device description file of the control device is as follows:

[0122] Device_Discovery\r\n

[0123] DeviceName:TEC4000S\r\n

[0124] DeviceFN:TEB162000000\r\n

[0125] SlotFN:S0001\r\n

[0126] BoardName:BOARD1

[0127] Device_Discovery is the device discovery message identification code, "\r\n" is the identifier for the end of each line of information, DeviceName and DeviceFN are device attributes, SlotFN is the card slot attribute, and BoardName is the board attribute.

[0128] Finally, according to the card slot attributes, the selection rule of the encryption method is determined. According to the selected encryption method, the device description file is encrypted using the corresponding encryption algorithm and key. The encrypted description file can be represented using a specific encoding or format, such as Base64 encoding.

[0129] In one embodiment, the card slot attributes include the card slot plugging state and the card slot position number. Step S204, i.e., combining the device attributes, the card slot attributes, and the board attributes to generate a device description file for the control device, specifically includes the following steps:

[0130] Count the number of device card slots in which device boards are inserted according to the card slot insertion status;

[0131] Parse all board attributes and classify them into faulty board attributes and real board attributes. Faulty board attributes are board attributes assigned with null values, and real board attributes are board attributes assigned with non-null values.

[0132] Count the number of boards whose real board attributes correspond to the target device boards;

[0133] Determine whether the number of card slots and the number of boards are the same;

[0134] If the number of card slots is the same as the number of boards, a device description file for the control device is generated based on the device description language and in combination with the device attributes, the card slot attributes, and the board attributes;

[0135] If the number of card slots is different from the number of boards, a card slot fault code is generated, and the card slot position number corresponding to the faulty board attribute is bound to the card slot fault code to generate a card slot fault attribute;

[0136] A device description file is generated based on a device description language and in combination with device attributes, card slot attributes, card slot fault attributes and board attributes.

[0137] In this embodiment, the card slot plug-in state is the physical plug-in state of the card slot, and the state information can be obtained by a pressure sensor or an infrared sensor arranged at the card slot, that is, when a board card is inserted into the target card slot, the card slot plug-in state of the target card slot is the inserted state. If the board card inserted into the target card slot is faulty, the board card properties of the board card cannot be read through the card slot. At this time, the acquired board card properties are null values, so they can be classified as faulty board card properties. If the board card inserted into the target card slot is not faulty, the board card properties can be correctly read. The board card properties include a large amount of information data such as the board card name, board card drawing number, board card network card information, and board card connector information. At this time, the board card properties can be classified as real board card properties.

[0138] To summarize, the number of card slots counted is actually the number of card slots with boards inserted in the physical state, and the number of boards is actually the number of boards whose real board properties can be correctly read. If the number of card slots is 5 and the number of boards is 4, it means that although one of the boards is inserted into the corresponding card slot, the read board properties are null values, indicating that the board is a faulty board. At this time, the slot position number corresponding to the faulty board properties can be bound to the slot fault code to generate the slot fault properties, and the device description file can be generated by combining the device properties, slot properties, slot fault properties and board properties.

[0139] In one embodiment, step S205, i.e. selecting a target encryption method according to the card slot attribute, and encrypting the device description file into an encrypted description file by the target encryption method, specifically comprises the following steps:

[0140] Count the number of faulty boards whose board attributes are faulty board attributes among all equipment boards;

[0141] Determine whether the number of faulty boards exceeds a preset fault number threshold;

[0142] If the number of faulty boards exceeds the fault number threshold, a first file encryption method is selected from the three preset file encryption methods as a target encryption method, and the first file decryption method corresponding to the target encryption method is stored in a preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method;

[0143] If the number of faulty boards does not exceed the fault number threshold, determine whether the number of faulty boards is 0;

[0144] If the number of faulty boards is not 0, the second file encryption method is selected from the three preset file encryption methods as the target encryption method, and the second file decryption method corresponding to the target encryption method is stored in the preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method, and the encryption complexity of the second file encryption method is less than that of the first file encryption method;

[0145] If the number of faulty boards is 0, the third file encryption method is selected from the three preset file encryption methods as the target encryption method, and the third file decryption method corresponding to the target encryption method is stored in the preset decryption algorithm library. The device description file is encrypted into an encrypted description file through the target encryption method. The encryption complexity of the third file encryption method is less than that of the second file encryption method.

[0146] In this embodiment, the first file decryption method in the decryption algorithm library is used to decrypt the file encrypted by the first file encryption method, the second file decryption method is used to decrypt the file encrypted by the second file encryption method, and the third file decryption method is used to decrypt the file encrypted by the third file encryption method. Since the real board attributes contain a large amount of information data, if the device description file containing multiple real board attributes is encrypted at the same time, it takes a long encryption time and occupies a large proportion of computer memory. Therefore, when the number of faulty boards is 0, that is, when the number of real board attributes is the largest, the file encryption method with the smallest encryption complexity is adopted, such as the AES-128 algorithm. It not only ensures the security of the description file, but also improves the encryption efficiency, thereby further improving the system operation efficiency. On the contrary, if the number of faulty boards is large and exceeds the preset fault number threshold, there are a large number of null values ​​in the device description file containing more faulty board attributes. At this time, the data length is short, and the first file encryption method with the highest encryption complexity can be adopted to further improve the security of the description file while ensuring the encryption efficiency. Therefore, the use of this embodiment can balance the encryption efficiency and security in the encryption process of the device description file.

[0147] The present invention also discloses a device discovery system, referring to Figure 3 The system includes a terminal device and several control devices, wherein the terminal device is connected to the several control devices via Ethernet. The terminal device is configured to execute the device discovery method in any of the above embodiments. The several control devices are configured to execute the device description method in any of the above embodiments.

[0148] The present invention also discloses a computer-readable storage medium, on which instructions are stored, and the instructions are used to enable a computer to execute the device discovery method in any one of the above-mentioned implementation modes and the device description method in any one of the above-mentioned implementation modes.

[0149] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of protection of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as above, which are not provided in detail for the sake of simplicity.

[0150] One or more embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A device discovery method, characterized in that: Applied to a terminal device, the device discovery method comprises the following steps: Get device discovery instructions; Responding to the device discovery instruction to scan all control devices in the Ethernet, and establishing communication connections with all the control devices; Sending a device discovery message to all the control devices based on a device description language and according to the device discovery instruction; receiving an encrypted description file sent by the control device in response to the device discovery message; Selecting a corresponding target file decryption method according to the file length of the encryption description file; Decrypting the encrypted description file by the target file decryption method to obtain a device description file of the control device, wherein the device description file includes device attributes of the control device, card slot attributes of the device card slot of the control device, and board attributes of the device card inserted in the device card slot; The device description file is reversely converted into device display information based on the device description language, and the device display information is displayed to a user of the terminal device.

2. The device discovery method according to claim 1, characterized in that: The sending of device discovery messages to all the control devices based on the device description language and according to the device discovery instruction comprises the following steps: Generate a message identification code based on a device description language; Identifying a request type instruction in the device discovery instruction; Generate a request type key character according to the request type instruction and using the device description language; generating a device discovery message in combination with the message identification code and the request type key character; The device discovery message is sent to all the control devices.

3. The device discovery method according to claim 1, characterized in that: The method for selecting a corresponding target file decryption method according to the file length of the encrypted description file comprises the following steps: Convert the encrypted description file into an encrypted file character string by text conversion; Obtaining the string length of the encrypted file string as the file length; Determining whether the length of the file exceeds a preset first text length threshold; If the file length does not exceed the first text length threshold, selecting a first file decryption method from a preset decryption algorithm library as a target file decryption method; If the file length exceeds the first text length threshold, determining whether the file length exceeds a preset second text length threshold, the second text length threshold being greater than the first text length threshold; If the file length does not exceed the second text length threshold, selecting a second file decryption method from the decryption algorithm library as the target file decryption method; If the file length exceeds the second text length threshold, a third file decryption method is selected from the decryption algorithm library as the target file decryption method.

4. A device description method, characterized in that: Applied to a control device, the device description method comprises the following steps: Obtaining device properties of the control device; Scan all device card slots of the control device and obtain card slot attributes of all the device card slots; Identify the device card inserted in the device card slot based on the card slot attribute, and read the card attributes of all the device cards; Generating a device description file of the control device by combining the device attributes, the card slot attributes and the board attributes; A target encryption method is selected according to the card slot attribute, and the device description file is encrypted into an encrypted description file using the target encryption method.

5. The device description method according to claim 4, characterized in that: The card slot attributes include a card slot plug-in state and a card slot position number, and the combining of the device attributes, the card slot attributes and the board attributes to generate a device description file for the control device includes the following steps: Counting the number of card slots in which the device board is plugged according to the card slot plugging status; Parsing all the board attributes, and classifying all the board attributes into faulty board attributes and real board attributes, wherein the faulty board attributes are board attributes assigned with null values, and the real board attributes are board attributes assigned with non-null values; Counting the number of boards whose real board attributes correspond to target device boards; Determining whether the number of the card slots is the same as the number of the boards; If the number of the card slots is the same as the number of the boards, generating a device description file for the control device based on a device description language and in combination with the device attributes, the card slot attributes and the board attributes; If the number of card slots is different from the number of boards, a card slot fault code is generated, and the card slot position number corresponding to the faulty board attribute is bound to the card slot fault code to generate a card slot fault attribute; The device description file is generated based on a device description language and in combination with the device attributes, the card slot attributes, the card slot fault attributes and the board attributes.

6. The device description method according to claim 5, characterized in that: The step of selecting a target encryption method according to the card slot attribute and encrypting the device description file into an encrypted description file by using the target encryption method comprises the following steps: Counting the number of faulty boards whose board attributes are the faulty board attributes among all the equipment boards; Determine whether the number of faulty boards exceeds a preset fault number threshold; If the number of faulty boards exceeds the fault number threshold, a first file encryption method is selected from the three preset file encryption methods as a target encryption method, and a first file decryption method corresponding to the target encryption method is stored in a preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method; If the number of the faulty boards does not exceed the fault number threshold, determining whether the number of the faulty boards is 0; If the number of faulty boards is not 0, a second file encryption method is selected from the three preset file encryption methods as a target encryption method, and a second file decryption method corresponding to the target encryption method is stored in a preset decryption algorithm library, and the device description file is encrypted into an encrypted description file by the target encryption method, wherein the encryption complexity of the second file encryption method is less than that of the first file encryption method; If the number of faulty boards is 0, the third file encryption method is selected from the three preset file encryption methods as the target encryption method, and the third file decryption method corresponding to the target encryption method is stored in the preset decryption algorithm library. The device description file is encrypted into an encrypted description file through the target encryption method, and the encryption complexity of the third file encryption method is less than that of the second file encryption method.

7. The device description method according to claim 4, characterized in that: The board attributes include the board name, board drawing number, board network card information and board connector information. The board network card information includes the board IP address, board MAC address and board subnet mask. The board connector information includes the board analog input and output signals and the board digital input and output signals.

8. A device discovery system, characterized in that: The system includes a terminal device and several control devices, wherein the terminal device is connected to the several control devices via Ethernet; The terminal device is configured to execute the device discovery method according to any one of claims 1 to 3; The plurality of control devices are configured to execute the device description method according to any one of claims 4 to 7.

9. A computer device processor, characterized in that: Used to run a program, wherein the program is used to execute any one of the device discovery method according to any one of claims 1 to 3 and the device description method according to any one of claims 4 to 7 when the program is run.

10. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions for causing a computer to execute the device discovery method described in any one of claims 1 to 3 and the device description method described in any one of claims 4 to 7.