A method, device, equipment and storage medium for checking access of optical sensor
By verifying and accessing the access request of the optical sensor, the problems of low access efficiency and insufficient authentication accuracy of optical sensing equipment in the optical cable monitoring system are solved, and more efficient and accurate equipment access management is achieved, which improves detection accuracy and system management convenience.
Patent Information
- Application Number
- CN202211002886.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-08-19
AI Technical Summary
The existing optical cable monitoring system has shortcomings in the access efficiency and authentication accuracy of optical sensing equipment, and it is difficult to manage multiple optical sensor equipment uniformly, standardized and conveniently, resulting in inconsistent equipment permission management and low access authentication efficiency and accuracy.
By responding to the access request of the optical sensor, obtain its verification parameters (including serial number, authorization code and sensor information protocol) and perform legal verification of these parameters. If the verification is passed, a legal access command is sent to allow the optical sensor to be accessed; if the verification is not passed, access is refused and an alarm message is generated.
It improves the access efficiency and authentication accuracy of optical sensor equipment, ensures the compliance of the accessed optical sensor, thereby improving detection accuracy, and facilitating users to standardize the management of legal optical sensors.
Smart Images

Figure CN115361211B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical cable authority verification, and in particular to a verification access method and device for an optical sensor. Background Art
[0002] As a carrier of information transmission, optical cable plays a vital role in the information transmission process of power grid. However, as a "dumb resource", optical cable lacks the ability of real-time and effective self-monitoring. When the optical cable encounters the influence of harsh environment such as aging, degradation, external damage, etc., it will cause a series of adverse consequences, resulting in the decline or interruption of communication quality. In order to solve these problems, it is necessary to use special equipment to detect the optical cable, and automatically upload the detection results to the online monitoring system to realize real-time monitoring of optical cable resources, which can realize multi-dimensional information monitoring of optical cable. There are many types of equipment for monitoring optical cables, mainly including optical time domain reflectometry (OTDR), optical power monitoring (OPM), distributed optical fiber temperature sensing (OLMTS), optical fiber line temperature measurement (OLMTS) and other equipment types. The optical cable monitoring system is a system for unified management of optical sensing equipment, which realizes real-time monitoring of the operation status of optical cables. According to the power specification "Optical Cable Online Monitoring Equipment Network Management Protocol Specification", it realizes access authentication and information collection of optical cable monitoring equipment, completes the control of monitoring equipment, optical fiber monitoring data collection and other contents.
[0003] Since there are many manufacturers and types of optical sensing equipment, it is not convenient to manage the equipment in a standardized manner. As a result, the optical cable monitoring system cannot manage the equipment of many manufacturers in a unified, standardized and convenient manner, and it is difficult to achieve unified management of equipment permissions. The efficiency and accuracy of access authentication are low. Summary of the invention
[0004] The present invention provides a method and device for verifying access to an optical sensor, so as to solve the technical problems of low access efficiency and low authentication accuracy of optical sensor equipment in an optical cable monitoring system in the prior art.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for verifying access to an optical sensor, comprising:
[0006] In response to receiving an access request from a light sensor, obtaining verification parameters of the light sensor; the verification parameters include a serial number, an authorization code, and a sensor information protocol;
[0007] The verification parameter is subjected to a legal verification, and when the legal verification passes, a legal access instruction is sent to the optical sensor to enable the optical sensor to access.
[0008] It can be understood that compared with the prior art, the present invention can respond to the access request of the optical sensor, obtain the verification parameters of the optical sensor, and then perform legal verification on the verification parameters, thereby avoiding the problem that the existing optical cable monitoring system cannot uniformly, standardize and conveniently manage many different optical sensor devices, thereby improving the access efficiency of many optical sensor devices and the accuracy of authentication. There is no need to perform further reading operations on illegal devices, and after the legal verification is passed, the corresponding legal access instructions are sent to the optical sensor, ensuring the compliance of the accessed optical sensor, thereby improving the detection accuracy of the optical sensor, and the unified and standardized legal optical sensors are conducive to users' standardized management of them.
[0009] As a preferred solution, it also includes: when the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated.
[0010] It is understandable that when the legal verification fails, the access of the optical sensor is denied and an alarm message is generated, which avoids the impact of illegal optical sensors on the overall optical cable monitoring system. At the same time, it is not conducive to the optical cable monitoring system's monitoring of many optical sensors, and leads to low access efficiency and low authentication accuracy of other optical sensors.
[0011] As a preferred solution, the verification of the validity of the verification parameters is specifically performed as follows:
[0012] Performing a uniqueness check on the serial number, and generating a first legal instruction when the uniqueness check passes; and generating an illegal serial number instruction when the uniqueness check fails;
[0013] In response to the generated first legal instruction, the authorization code is compared with a preset white list, and when the authorization code exists in the preset white list, a second legal instruction is generated; when the authorization code does not exist in the preset white list, an illegal authorization code instruction is generated; the preset white list stores the authorization code of the legal light sensor;
[0014] In response to the generated second legal instruction, the sensor information protocol is subjected to a legal protocol check, and when the sensor information protocol is checked as a legal protocol, a legal access instruction is generated; when the sensor information protocol is checked as an illegal protocol, an illegal protocol instruction is generated.
[0015] It can be understood that by verifying the uniqueness of the serial number, comparing the authorization code and checking the legality of the sensor information protocol, the uniqueness, legality and compliance of the optical sensor can be guaranteed, and it can be verified layer by layer, so that the next step of verification can be carried out only after the previous step of verification is passed, avoiding the problem of inefficiency and affected authentication caused by verifying all information at one time. At the same time, triple authentication can improve the accuracy of authentication and further avoid the problem of affected monitoring caused by illegal devices accessing the system.
[0016] As a preferred solution, when the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated, specifically:
[0017] When any one of an illegal serial number instruction, an illegal authorization code instruction and an illegal protocol instruction is detected and generated, access to the optical sensor is denied, and an alarm message is generated according to the generated illegal serial number instruction, illegal authorization code instruction or illegal protocol instruction.
[0018] It can be understood that by directly denying access to the optical sensor when any of the generated illegal serial number instructions, illegal authorization code instructions and illegal protocol instructions is detected, the efficiency and accuracy of the inspection can be improved, and the illegal device can be prevented from measuring and transmitting invalid data for a long time. By generating an alarm message, the user can be reminded to deal with the illegal device, thereby improving the convenience of user management of the system.
[0019] As a preferred solution, the sensor information protocol is subjected to a legal protocol check, specifically:
[0020] Determine the protocol frame type and device port of the light sensor according to the sensor information protocol, and send a device command word to the light sensor so that the light sensor returns a device data structure;
[0021] After receiving the device data structure, the basic information of the frame, fan, power supply and board information in the device data structure are verified according to the preset device data structure legal rules, thereby completing the legal protocol check of the sensor information protocol; the sensor information protocol includes the protocol frame type, device port, device command word and device data structure.
[0022] It can be understood that by performing legal protocol checks on the sensor information protocol, it can ensure that the equipment complies with legal protocols such as communication, and ensure that the optical sensor can accurately and efficiently send the data information it measures to the optical cable monitoring system. At the same time, the basic frame information, fan, power supply and board information in the equipment data structure are verified to ensure the normal operation of the internal equipment of the optical sensor, and facilitate the monitoring of the working status of the optical sensor for users after subsequent legal access, thereby improving the user's management of the optical cable monitoring system and numerous optical sensors.
[0023] As a preferred solution, after the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access, specifically:
[0024] When it is detected that a legal access instruction is generated, the legal access instruction is sent to the optical sensor to enable the optical sensor to access, and the device information and monitoring data of the optical sensor are displayed.
[0025] It can be understood that through the generated legal access instructions, the optical sensor can be connected to the optical cable detection system and its equipment information and monitoring data can be displayed, so as to realize the access authentication and information collection of the optical cable monitoring equipment, complete the control of the monitoring equipment, optical fiber monitoring data collection, etc., so as to facilitate the user to manage and monitor it in a unified manner.
[0026] As a preferred solution, the serial number includes Mac address information, region code, manufacturer code and device serial number.
[0027] Accordingly, the present invention also provides a verification access device for an optical sensor, comprising: a parameter acquisition module and a legal verification module;
[0028] The parameter acquisition module is used to obtain the verification parameters of the optical sensor in response to receiving the access request of the optical sensor; the verification parameters include a serial number, an authorization code and a sensor information protocol;
[0029] The legal verification module is used to perform legal verification on the verification parameters, and when the legal verification passes, send a legal access instruction to the optical sensor to enable the optical sensor to access.
[0030] As a preferred solution, it also includes: an illegal verification module; the illegal verification module is used to reject the access of the optical sensor and generate an alarm message when the legal verification fails.
[0031] As a preferred solution, the verification of the validity of the verification parameters is specifically performed as follows:
[0032] Performing a uniqueness check on the serial number, and generating a first legal instruction when the uniqueness check passes; and generating an illegal serial number instruction when the uniqueness check fails;
[0033] In response to the generated first legal instruction, the authorization code is compared with a preset white list, and when the authorization code exists in the preset white list, a second legal instruction is generated; when the authorization code does not exist in the preset white list, an illegal authorization code instruction is generated; the preset white list stores the authorization code of the legal light sensor;
[0034] In response to the generated second legal instruction, the sensor information protocol is subjected to a legal protocol check, and when the sensor information protocol is checked as a legal protocol, a legal access instruction is generated; when the sensor information protocol is checked as an illegal protocol, an illegal protocol instruction is generated.
[0035] As a preferred solution, when the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated, specifically:
[0036] When any one of an illegal serial number instruction, an illegal authorization code instruction and an illegal protocol instruction is detected and generated, access to the optical sensor is denied, and an alarm message is generated according to the generated illegal serial number instruction, illegal authorization code instruction or illegal protocol instruction.
[0037] As a preferred solution, the sensor information protocol is subjected to a legal protocol check, specifically:
[0038] Determine the protocol frame type and device port of the light sensor according to the sensor information protocol, and send a device command word to the light sensor so that the light sensor returns a device data structure;
[0039] After receiving the device data structure, the basic information of the frame, fan, power supply and board information in the device data structure are verified according to the preset device data structure legal rules, thereby completing the legal protocol check of the sensor information protocol; the sensor information protocol includes the protocol frame type, device port, device command word and device data structure.
[0040] As a preferred solution, after the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access, specifically:
[0041] When it is detected that a legal access instruction is generated, the legal access instruction is sent to the optical sensor to enable the optical sensor to access, and the device information and monitoring data of the optical sensor are displayed.
[0042] As a preferred solution, the serial number includes Mac address information, region code, manufacturer code and device serial number.
[0043] Correspondingly, the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the verification access method of the optical sensor as described in any one of the above items is implemented.
[0044] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the verification access method of the optical sensor as described in any one of the above. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 : A flowchart of the steps of a method for verifying access to an optical sensor provided by an embodiment of the present invention;
[0046] Figure 2 : A flowchart of the steps of legal verification in a method for verifying access to an optical sensor provided in an embodiment of the present invention;
[0047] Figure 3 : A schematic diagram of the structure of a verification access device for an optical sensor provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Embodiment 1
[0050] Please refer to Figure 1 , a method for verifying access to an optical sensor provided by an embodiment of the present invention, comprising the following steps S101-S102:
[0051] S101: In response to receiving an access request from an optical sensor, obtaining verification parameters of the optical sensor; the verification parameters include a serial number, an authorization code, and a sensor information protocol.
[0052] As a preferred solution, the serial number includes Mac address information, region code, manufacturer code and device serial number.
[0053] It should be noted that the serial number is generated by the optical cable monitoring system based on information such as the Mac address information, the region code, the manufacturer code, and the device serial number. The serial number is unique, and different optical sensors correspond to a unique and different serial number. In this embodiment, illustratively, the serial number is composed of a 16-bit Mac address and a 16-bit network management allocation code, wherein the network management allocation code is composed of a 6-bit region code, a 3-bit manufacturer code, and a 7-bit device serial number. The network management allocation code is generated after the optical sensor is hard-connected to the optical cable monitoring system. If an illegal optical sensor is produced by an unauthorized manufacturer, the corresponding network management allocation code and serial number cannot be generated, thereby ensuring the accuracy of the authentication access of the optical sensor.
[0054] Furthermore, the authorization code is used to verify whether the optical sensor is a legitimate device in a preset whitelist, and the preset whitelist stores the authorization codes of legitimate optical sensors. Exemplarily, the optical cable monitoring system generates corresponding license numbers that meet the access conditions of the optical sensors in batches, and stores them in the preset whitelist as authorization codes. Each authorization code can correspond to a device or to an optical sensor produced by the same manufacturer. When the optical sensor is produced at the manufacturer's end, the corresponding authorization code is burned in, so that when the optical sensor is connected to the optical cable monitoring system, it can find the corresponding authorization code in the preset whitelist, so that the optical sensor can legally access the optical cable monitoring system.
[0055] S102: Performing a legal verification on the verification parameter, and when the legal verification passes, sending a legal access instruction to the optical sensor to enable the optical sensor to access.
[0056] As a preferred solution of this embodiment, please refer to Figure 2 The verification of the validity of the verification parameters specifically includes the following steps S201-S203:
[0057] S201: Performing a uniqueness check on the serial number, and generating a first legal instruction when the uniqueness check passes; and generating an illegal serial number instruction when the uniqueness check fails.
[0058] It should be noted that the uniqueness of the serial number is verified, that is, whether the optical sensor has the serial number or the network management allocation code in the serial number, and whether the optical sensor with the same serial number is connected to the optical cable monitoring system, so as to prevent most illegal devices and other counterfeit and shoddy devices from being connected to the optical cable monitoring system.
[0059] As a preferred solution of this embodiment, when two identical serial numbers are verified, the access of the two corresponding optical sensors is disconnected and rejected, and an alarm message is generated to enable the user to manually identify the two optical sensors with the same serial number.
[0060] S202: In response to the generated first legal instruction, the authorization code is compared with a preset whitelist. When the authorization code exists in the preset whitelist, a second legal instruction is generated; when the authorization code does not exist in the preset whitelist, an illegal authorization code instruction is generated; the preset whitelist stores the authorization codes of legal light sensors.
[0061] It should be noted that by comparing the authorization code with the preset whitelist, it can be ensured that the optical sensor is a legitimate device that can legally access the optical cable monitoring system, and it can be ensured that the system errors caused by users mistakenly accessing other optical sensors and affecting the operation of other optical sensors are avoided.
[0062] In this embodiment, the serial number and the authorization code can be understood as a dual authentication of the legal access to the optical cable detection system, and the focus of the serial number is on the authentication of the network end and counterfeit products, that is, the Mac address and the unique corresponding network management allocation code; the focus of the authorization code is whether it is possible to legally access the optical cable monitoring system. For different optical sensors, such as optical time domain reflectometry (OTDR), optical power monitoring (OPM), distributed optical fiber temperature sensing (OLMTS), optical fiber line temperature measurement (OLMTS) and other equipment types, their power consumption, monitoring conditions, etc. are different. If different equipment types all use the same managed optical cable monitoring system, it is easy to cause large errors in the monitoring data or damage to the optical sensor. Therefore, the authorization code can ensure that the legally accessed equipment can accurately and efficiently access the optical cable detection system.
[0063] S203: In response to the generated second legal instruction, perform a legal protocol check on the sensor information protocol, and when the sensor information protocol is checked as a legal protocol, generate a legal access instruction; when the sensor information protocol is checked as an illegal protocol, generate an illegal protocol instruction.
[0064] Specifically, according to the sensor information protocol, the protocol frame type and device port of the optical sensor are determined, and a device command word is sent to the optical sensor so that the optical sensor returns a device data structure; after receiving the device data structure, according to the preset device data structure legal rules, the basic information of the frame, fan, power supply and board information in the device data structure are verified, thereby completing the legal protocol verification of the sensor information protocol; the sensor information protocol includes a protocol frame type, a device port, a device command word and a device data structure.
[0065] It should be noted that the sensor information protocol is to ensure that the optical sensor can communicate with the optical cable monitoring system, that is, to avoid the difference in communication protocols causing the optical sensor to be unable to send the measured monitoring data to the optical cable monitoring system. At the same time, the optical sensor can also be further verified for compliance to ensure that the optical sensors connected to the optical cable monitoring system can operate normally and can send monitoring data.
[0066] In this embodiment, exemplarily, the optical cable monitoring system and the optical sensor communicate data through the transmission network channel, wherein, according to the sensor information protocol, the protocol frame type of the protocol frame structure is determined to be UDP, the device port is 9000, and the "0xFF00" device command word is sent to the optical sensor, so that the optical sensor returns the device data structure, and the device data structure includes but is not limited to the basic information of the frame, the fan, the power supply and the board information. Wherein, in the protocol frame structure, the node name of the command sent to the optical sensor includes: FLAG1, LEN, VER, MFLAG, COMM, TCOMM, HSUM, DATA, SUM. Wherein FLAG1 represents the command identifier 1, LEN represents the word length from VER to SUM, VER represents the protocol structure version, MFLAG represents the multi-frame identifier, COMM represents the command word, TCOMM represents the command tracking word, DATA represents data; HSUM represents the command header checksum, and SUM represents the checksum. The node name receiving the command of the optical sensor includes FLAG2, LEN, VER, MFLAG, COMM, TCOMM, HSUM, DATA, SUM. FLAG2 represents command flag 2, and the rest of the content is the same as above.
[0067] In this embodiment, the basic information of the frame, fan, power supply and board information in the device data structure (ModuleDATA) are verified by way of example, wherein the basic information of the frame includes information such as Length, SerialNumber, SoftVer, HardVer, SlotNumber, SlotCount, MacAddress, DeviceID, etc. Length represents the total length of the total data length of the SlotDATA segment of the frame data structure data information, and the data type is Integer type. SerialNumber is a relatively important type of information, representing the unique code defined by the manufacturer for the device frame, with 16 digits or characters. If the number or byte is not enough for 16 digits during definition, 0 should be added at the end to make it reach 16-bit code; in the code, 4-6 bytes represent the frame type, and the data type is also Integer type. Using SerialNumber, the running status of each device can be accurately monitored. SoftVer represents the software version, with a total of 6 bytes. HardVer represents the hardware version, with a total of 6 bytes. SlotNumber represents the total number of slots in the local frame. SlotCount represents the number of slots in place. MacAddress represents the Mac address of the device frame. DeviceID represents a unique DeviceID serial number generated by the network management based on the Mac address. In addition, there are basic information such as CPU usage, memory usage, disk usage, system running time, number of fans, number of power supplies, temperature, etc.
[0068] The fan specific information table includes information such as FanMode (fan mode), FanStatus (fan status), FanSpeed (fan speed), FanSpeedMax (maximum fan speed), FanSpeedMin (minimum fan speed), FanLife (fan life), and FanRunTime (fan running time). The data type is integer and the length is 1-4 bytes.
[0069] The fan specific information table includes PwrType (power type), PwrLoc (power location), and PwrVol (power voltage). The data type is integer and the length is 1-2 bytes.
[0070] The board information (SlotDATA) is SlotPort, Length, SN, SoftVer HardVer, IP, ModuleDATA, SUM. Among them, SlotPort represents the port number (disk address) of the board, Length represents the data length of the board ModuleDATA, SN represents the serial number, SoftVer represents the software version number, HardVer represents the hardware version number, ModuleDATA represents the specific information of the board, SUM represents the checksum, the data type is integer, and the length is 1-16 bytes. There are many types of boards, and they are distinguished by different data. 0x3C0 represents the fan power module, 0x3D0 represents the OSW board, 0x3D1 represents the OPM board, 0x3D2 represents the OS board, 0x3D3 represents the OTDR board, 0x3D4 represents the EDFA board, 0x3D5 represents the OXC board, 0x3E3 represents the OLMTS board, 0x3E4 represents the OLMVS board, and 0x3E5 represents the BOTDSS board.
[0071] In this embodiment, exemplarily, according to the requirements of the "Optical Cable Online Monitoring Equipment Network Management Protocol Specification", the basic information of the frame, fan, power supply and board information in the equipment data structure are verified. Only after the basic information of the frame, fan, power supply and board information in the above equipment data structure have been successfully verified, can a legal access instruction be generated to enable the optical sensor to access the optical cable monitoring system.
[0072] It can be understood that by verifying the uniqueness of the serial number, comparing the authorization code and checking the legality of the sensor information protocol, the uniqueness, legality and compliance of the optical sensor can be guaranteed, and it can be verified layer by layer, so that the next step of verification can be carried out only after the previous step of verification is passed, avoiding the problem of inefficiency and affected authentication caused by verifying all information at one time. At the same time, triple authentication can improve the accuracy of authentication and further avoid the problem of affected monitoring caused by illegal devices accessing the system.
[0073] Furthermore, by performing a legal protocol check on the sensor information protocol, it is possible to ensure that the equipment complies with legal protocols such as communication, and that the optical sensor can accurately and efficiently send the data information it measures to the optical cable monitoring system. At the same time, the basic frame information, fan, power supply and board information in the equipment data structure are verified to ensure the normal operation of the internal equipment of the optical sensor, and facilitate the monitoring of the working status of the optical sensor by users after subsequent legal access, thereby improving the user's management of the optical cable monitoring system and numerous optical sensors.
[0074] As a preferred solution of this embodiment, it also includes: when the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated.
[0075] Specifically, when any one of an illegal serial number instruction, an illegal authorization code instruction and an illegal protocol instruction is detected and generated, access to the optical sensor is denied, and an alarm message is generated according to the generated illegal serial number instruction, illegal authorization code instruction or illegal protocol instruction.
[0076] It is understandable that when the legal verification fails, the access of the optical sensor is denied and an alarm message is generated, which avoids the impact of illegal optical sensors on the overall optical cable monitoring system. At the same time, it is not conducive to the optical cable monitoring system's monitoring of many optical sensors, and leads to low access efficiency and low authentication accuracy of other optical sensors.
[0077] Furthermore, by directly denying access to the optical sensor when any of the generated illegal serial number instructions, illegal authorization code instructions and illegal protocol instructions is detected, the efficiency and accuracy of the inspection can be improved, and the illegal device can be prevented from measuring and transmitting invalid data for a long time. By generating an alarm message, the user can be reminded to deal with the illegal device, thereby improving the convenience of user management of the system.
[0078] As a preferred solution, after the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access, specifically:
[0079] When it is detected that a legal access instruction is generated, the legal access instruction is sent to the optical sensor to enable the optical sensor to access, and the device information and monitoring data of the optical sensor are displayed.
[0080] It should be noted that after the optical sensor is connected to the optical cable monitoring system, the monitoring data of the optical sensor will be recorded in the license information of the optical cable monitoring system. The license information includes the name, batch, serial number, manufacturer, region, status, validity period, etc. of the manufacturer's equipment. At the same time, legal devices such as optical sensors display the authorization code, device model and other information of the optical sensor in the display layer.
[0081] It can be understood that through the generated legal access instructions, the optical sensor can be connected to the optical cable detection system and its equipment information and monitoring data can be displayed, so as to realize the access authentication and information collection of the optical cable monitoring equipment, complete the control of the monitoring equipment, optical fiber monitoring data collection, etc., so as to facilitate the user to manage and monitor it in a unified manner.
[0082] Implementing the above embodiments has the following effects:
[0083] Compared with the prior art, the present invention can respond to the access request of the optical sensor, obtain the verification parameters of the optical sensor, and then perform legal verification on the verification parameters, thereby avoiding the problem that the existing optical cable monitoring system cannot uniformly, standardize and conveniently manage many different optical sensor devices, thereby improving the access efficiency of many optical sensor devices and the accuracy of authentication. There is no need to perform further reading operations on illegal devices, and after the legal verification is passed, the corresponding legal access instructions are sent to the optical sensor, ensuring the compliance of the accessed optical sensor, thereby improving the detection accuracy of the optical sensor, and the unified and standardized legal optical sensors are conducive to users' standardized management of them.
[0084] Embodiment 2
[0085] Accordingly, see Figure 3 , which is an embodiment of the present invention and provides a verification access device for an optical sensor, including: a parameter acquisition module 301 and a legal verification module 302.
[0086] The parameter acquisition module 301 is used to acquire the verification parameters of the optical sensor in response to receiving an access request from the optical sensor; the verification parameters include a serial number, an authorization code and a sensor information protocol.
[0087] The legal verification module 302 is used to perform legal verification on the verification parameters, and when the legal verification passes, send a legal access instruction to the optical sensor to enable the optical sensor to access.
[0088] As a preferred solution, it further includes: an illegality verification module 303; the illegality verification module 303 is used to reject the access of the optical sensor and generate alarm information when the legality verification fails.
[0089] As a preferred solution, the verification of the validity of the verification parameters is specifically performed as follows:
[0090] The serial number is subjected to a uniqueness check, and when the uniqueness check passes, a first legal instruction is generated; when the uniqueness check fails, an illegal serial number instruction is generated; in response to the generated first legal instruction, the authorization code is compared with a preset whitelist, and when the authorization code exists in the preset whitelist, a second legal instruction is generated; when the authorization code does not exist in the preset whitelist, an illegal authorization code instruction is generated; the preset whitelist stores authorization codes of legal optical sensors; in response to the generated second legal instruction, a legal protocol check is performed on the sensor information protocol, and when the sensor information protocol is checked as a legal protocol, a legal access instruction is generated; when the sensor information protocol is checked as an illegal protocol, an illegal protocol instruction is generated.
[0091] As a preferred solution, when the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated, specifically:
[0092] When any one of an illegal serial number instruction, an illegal authorization code instruction and an illegal protocol instruction is detected and generated, access to the optical sensor is denied, and an alarm message is generated according to the generated illegal serial number instruction, illegal authorization code instruction or illegal protocol instruction.
[0093] As a preferred solution, the sensor information protocol is subjected to a legal protocol check, specifically:
[0094] According to the sensor information protocol, the protocol frame type and device port of the optical sensor are determined, and a device command word is sent to the optical sensor so that the optical sensor returns a device data structure; after receiving the device data structure, the basic information of the frame, the fan, the power supply and the board information in the device data structure are verified according to the preset device data structure legal rules, thereby completing the legal protocol verification of the sensor information protocol; the sensor information protocol includes a protocol frame type, a device port, a device command word and a device data structure.
[0095] As a preferred solution, after the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access, specifically:
[0096] When it is detected that a legal access instruction is generated, the legal access instruction is sent to the optical sensor to enable the optical sensor to access, and the device information and monitoring data of the optical sensor are displayed.
[0097] As a preferred solution, the serial number includes Mac address information, region code, manufacturer code and device serial number.
[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0099] Implementing the above embodiments has the following effects:
[0100] Compared with the prior art, the embodiments of the present invention can respond to the access request of the optical sensor, obtain the verification parameters of the optical sensor, and then perform legal verification on the verification parameters, thereby avoiding the problem that the existing optical cable monitoring system cannot uniformly, standardize and conveniently manage many different optical sensor devices, thereby improving the access efficiency of many optical sensor devices and the accuracy of authentication. There is no need to perform further reading operations on illegal devices, and after the legal verification is passed, the corresponding legal access instructions are sent to the optical sensor, ensuring the compliance of the accessed optical sensor, thereby improving the detection accuracy of the optical sensor, and the unified and standardized legal optical sensors are conducive to users' standardized management of them.
[0101] Embodiment 3
[0102] Correspondingly, the present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the verification access method of the optical sensor as described in any one of the above embodiments is implemented.
[0103] The terminal device of this embodiment includes: a processor, a memory, and a computer program and a computer instruction stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned embodiment 1 is implemented, for example: Figure 1 Alternatively, when the processor executes the computer program, the functions of each module / unit in the above device embodiment, such as the parameter acquisition module 301, are implemented.
[0104] Exemplarily, the computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device. For example, the legal verification module 302 is used to perform a legal verification on the verification parameters, and when the legal verification passes, a legal access instruction is sent to the optical sensor to enable the optical sensor to access.
[0105] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a terminal device and does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the terminal device may also include an input / output device, a network access device, a bus, etc.
[0106] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0107] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0108] Wherein, if the module / unit integrated in the terminal device 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 present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0109] Embodiment 4
[0110] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the verification access method of the optical sensor as described in any one of the above embodiments.
[0111] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for verifying access to an optical sensor, characterized in that: include: In response to receiving an access request from a light sensor, obtaining a verification parameter of the light sensor; The verification parameters include a serial number, an authorization code, and a sensor information protocol; Performing a uniqueness check on the serial number, and generating a first legal instruction when the uniqueness check passes; and generating an illegal serial number instruction when the uniqueness check fails; In response to the generated first legal instruction, the authorization code is compared with a preset whitelist, and when the authorization code exists in the preset whitelist, a second legal instruction is generated; when the authorization code does not exist in the preset whitelist, an illegal authorization code instruction is generated; The preset whitelist stores authorization codes of legitimate light sensors; In response to the generated second legal instruction, the sensor information protocol is subjected to a legal protocol check, and when the sensor information protocol is checked as a legal protocol, a legal access instruction is generated, and it is confirmed that the optical sensor has passed the legal check; When the sensor information protocol is verified to be an illegal protocol, an illegal protocol instruction is generated; When the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access.
2. A method for checking access to an optical sensor as claimed in claim 1, characterized in that: Also includes: When the legal verification fails, the access of the optical sensor is denied and an alarm message is generated.
3. A method for checking access to an optical sensor as claimed in claim 2, characterized in that: When the legal verification fails, the access of the optical sensor is rejected and an alarm message is generated, specifically: When any one of an illegal serial number instruction, an illegal authorization code instruction and an illegal protocol instruction is detected and generated, access to the optical sensor is denied, and an alarm message is generated according to the generated illegal serial number instruction, illegal authorization code instruction or illegal protocol instruction.
4. A method for checking access to an optical sensor as claimed in claim 3, characterized in that: The sensor information protocol is subjected to a legal protocol check, specifically: Determine the protocol frame type and device port of the light sensor according to the sensor information protocol, and send a device command word to the light sensor so that the light sensor returns a device data structure; After receiving the device data structure, the basic information of the frame, the fan, the power supply and the board information in the device data structure are verified according to the preset device data structure legal rules, so as to complete the legal protocol verification of the sensor information protocol; The sensor information protocol includes a protocol frame type, a device port, a device command word and a device data structure.
5. A method for checking access to an optical sensor as claimed in claim 2, characterized in that: When the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access, specifically: When it is detected that a legal access instruction is generated, the legal access instruction is sent to the optical sensor to enable the optical sensor to access, and the device information and monitoring data of the optical sensor are displayed.
6. A method for checking access to an optical sensor as claimed in any one of claims 1 to 5, characterized in that: The serial number includes Mac address information, region code, manufacturer code and device serial number.
7. A verification access device for an optical sensor, characterized in that: include: Parameter acquisition module and legal verification module; The parameter acquisition module is used to acquire the calibration parameters of the optical sensor in response to receiving an access request from the optical sensor; The verification parameters include a serial number, an authorization code, and a sensor information protocol; The legal verification module is used to perform a uniqueness verification on the serial number, and when the uniqueness verification passes, a first legal instruction is generated; when the uniqueness verification fails, an illegal serial number instruction is generated; in response to the generated first legal instruction, the authorization code is compared with a preset white list, and when the authorization code exists in the preset white list, a second legal instruction is generated; when the authorization code does not exist in the preset white list, an illegal authorization code instruction is generated; The preset whitelist stores authorization codes of legitimate light sensors; In response to the generated second legal instruction, the sensor information protocol is subjected to a legal protocol check, and when the sensor information protocol is checked as a legal protocol, a legal access instruction is generated, and it is confirmed that the optical sensor has passed the legal check; When the sensor information protocol is verified to be an illegal protocol, an illegal protocol instruction is generated; When the legal verification is passed, a legal access instruction is sent to the optical sensor to enable the optical sensor to access.
8. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the verification access method of the optical sensor according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the verification access method for the optical sensor according to any one of claims 1 to 6.
Citation Information
Patent Citations
Sensor access detection method, device and system
CN103457786A
Method and device for detecting an access state of a sensor
CN109491870A
Data processing method and electronic equipment
CN111565218A