Detection method, device and equipment for recycled optical modem and storage medium
Technical Field
The invention relates to the technical field of optical communication, in particular to a detection method, a detection device and a storage medium for a recycled optical modem.
Background
Optical communication is rapidly developed into a main form of information transmission at present due to advantages such as a wide frequency band and a large capacity, and optical modulation and demodulation are necessary to realize optical communication, so that an optical modem is receiving more and more attention as a key device of an optical fiber communication system.
An optical modem, commonly called optical modem, is a device similar to a baseband modem (digital modem), and is different from the baseband modem in that a dedicated optical fiber line is accessed and optical signals are transmitted. The access router is used for the conversion of optical and electrical signals and the conversion of interface protocols in the wide area network, and is accessed to the wide area network.
With the development of communication technology, optical communication is widely used in home or office communication. Each home or business that uses optical communication uses an optical modem. With the upgrade of the equipment, the original optical modem is usually recovered by the operator for reuse.
The recovered optical modem needs to be tested to determine if it is functioning properly. Since the recycled optical modem involves multiple brands, it cannot be detected in an automatic manner. Detection can only be performed manually. The main functions of physical connection, registration and test need to be manually carried out, the factory is restored, and the like, so that the operation is complex and the efficiency is very low.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for detecting recycled optical modems, which aim to solve the technical problem that the batch detection of the recycled optical modems of different brands and models cannot be carried out in the prior art.
In a first aspect, an embodiment of the present invention provides a detection method for a recycled light cat, including:
reading and recovering control element information in an optical modem registration interface;
extracting control element features according to the control information, wherein the control element features comprise: the position of the control, the relative position relation of the control, the size of the control, the text input attribute, the display and hidden attribute of the control and the text attribute of the button control;
and determining the type of the optical modem according to the control element characteristics, and detecting the optical modem according to the type.
Further, the determining the type of the optical modem according to the control element feature includes:
judging whether the position of the control, the relative position relation of the control and the deviation of the size of the control and a preset reference template meet a preset deviation interval or not;
and when the preset deviation interval is met, determining whether the text input attribute is consistent with a preset reference template, and when the text input attribute is consistent with the preset reference template, determining that the type of the optical modem is the same as the type corresponding to the preset reference template.
Further, before determining whether the position of the control, the relative position relationship of the control, and the deviation between the size of the control and the preset reference template meet the preset deviation interval, the method further includes:
and selecting a preset reference template according to the text attribute and/or the text explicit-implicit attribute of the button control.
Further, the determining the type of the optical modem according to the control element feature includes:
converting the control element characteristics into parameters;
establishing a multidimensional space, and determining a space point corresponding to the recovered optical modem according to the parameters corresponding to the control element characteristics;
and determining the type of the recovery optical modem according to the distance between the spatial point and the preset spatial point of the optical modem.
Further, the detecting the optical modem according to the type includes:
writing in a user name and/or a password according to the type, and logging in or registering;
a unique identifier of the optical modem is obtained.
Further, the detecting the optical modem according to the type further includes:
and acquiring basic information of the optical modem, and detecting a port and voice service.
Still further, the method further comprises:
and generating a detection report according to the detection result.
In a second aspect, an embodiment of the present invention further provides a detection apparatus for detecting a recycled light cat, including:
the reading module is used for reading and recovering control element information in the optical modem registration interface;
an extraction module, configured to extract control element features according to the control information, where the control element features include: the position of the control, the relative position relation of the control, the size of the control, the text input attribute, the display and hidden attribute of the control and the text attribute of the button control;
and the detection module is used for determining the type of the optical modem according to the control element characteristics and detecting the optical modem according to the type.
Further, the detection module comprises:
the judging unit is used for judging whether the position of the control, the relative position relation of the control and the deviation of the size of the control and a preset reference template meet a preset deviation interval or not;
and the determining unit is used for determining whether the text input attribute is consistent with a preset reference template when the preset deviation interval is met, and determining that the type of the optical modem is the same as the type corresponding to the preset reference template when the text input attribute is consistent with the preset reference template.
Further, the detection module comprises:
and the selection module is used for selecting a preset reference template according to the text attribute and/or the text explicit-implicit attribute of the button control.
Further, the detection module includes:
the conversion unit is used for converting the control element characteristics into parameters;
the establishing unit is used for establishing a multidimensional space and determining a space point corresponding to the recovered optical modem according to the parameters corresponding to the control element characteristics;
and the determining unit is used for determining the type of the recovered optical modem according to the distance between the spatial point and the preset spatial point of the optical modem.
Further, the detection module comprises:
the writing unit is used for writing a user name and/or a password according to the type and logging in or registering;
an obtaining unit, configured to obtain a unique identifier of the optical modem.
Further, the detection module further includes:
and the detection unit is used for acquiring the basic information of the optical modem and detecting a port and a voice service.
Still further, the apparatus further comprises:
and the generating module is used for generating a detection report according to the detection result.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement any of the detection methods for recovering light cats provided by the above embodiments.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for detecting recycled optical cats as provided in any of the above embodiments.
The detection method, the device, the equipment and the storage medium for the recycled optical modem provided by the embodiment of the invention have the advantages that the control element information in the registration interface of the recycled optical modem is read; and extracting control element characteristics according to the control information, determining the type of the optical modem according to the control element characteristics, and detecting the optical modem according to the type. The type of the optical modem to be detected can be determined through the control element characteristics, and after the type is determined, the optical modem is automatically detected through an instruction corresponding to the optical modem. The method can determine the specific type of the recovered optical modem through the control element characteristics under the condition that the specific brand and model of the recovered optical modem are unknown, and detect according to the specific type of the optical modem. The batch automatic detection of a large number of recovered optical modems can be realized. Saving labor and time.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a schematic flow chart of a detection method for recycling light cats according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a detection method for recovering optical cats according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a detection apparatus for recycling light cats according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus provided in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a detection method for recovering an optical modem according to an embodiment of the present invention, where the present embodiment is applicable to a situation where an optical modem for recovery is detected, and the method can be executed by a detection device for recovering an optical modem, and can be integrated into a device for detecting an optical modem, and specifically includes the following steps:
and S110, reading and recovering control element information in the optical modem registration interface.
In this embodiment, the recovered optical modem may be detected in a stand-alone manner. And the simultaneous detection of a plurality of single machines can be realized by utilizing the C/S architecture. Meanwhile, a plurality of optical modems can be connected to the same single machine by using the SPC exchange to perform detection simultaneously, so that the detection efficiency is improved.
Since the registered interfaces in different types of optical modems of different manufacturers are limited by GUI patents and copyright, the interfaces are designed differently. Meanwhile, the functions of the optical modems of different models are different, so that the settings of various controls on the login interface are different. With this feature, the recovered optical modem can be quickly identified.
The optical modem registration interface is a web interface, and illustratively, all controls of a page can be acquired by reading html (hypertext markup language) original codes of the page, and information of control elements is read.
S120, extracting control element features according to the control information, wherein the control element features comprise: the position of the control, the relative position relation of the control, the size of the control, the text input attribute, the display and hidden attribute of the control and the text attribute of the button control.
The position of the control and the relative position relation of the control embody the overall layout relation, and the layout relation of the registration interface of the optical modem can be determined by utilizing the characteristics. The size of the control indicates the design concept of the control. The text input attribute and the button control text attribute can indicate the corresponding function attribute of the control. The text input attribute may be a control that identifies whether it is an inputtable word. For example: controls that can enter a username or password have text entry properties. Controls with function buttons, for example: the login button control has a button control text attribute. The text input attribute and the button control text attribute can indicate the corresponding function attribute of the control.
In this embodiment, after the control element information in the recovered optical modem registration interface is read, the control element features may be extracted by using the spatial element information. And the relative position relation of the control can be obtained through the position calculation of the control.
S130, determining the type of the optical modem according to the control element characteristics, and detecting the optical modem according to the type.
In this embodiment, the control element features of the existing optical modems of various types are extracted in advance to obtain the correspondence between the control element features and the models of the optical modems. In this embodiment, the control element characteristics obtained in the above steps may be compared with the prestored spatial element characteristics, and the model of the currently recycled optical modem may be determined within a range where the difference is less than the preset threshold.
Illustratively, the determining the type of the optical modem according to the control element feature includes: judging whether the position of the control, the relative position relation of the control and the deviation of the size of the control and a preset reference template meet a preset deviation interval or not; and when the preset deviation interval is met, determining whether the text input attribute is consistent with a preset reference template, and when the text input attribute is consistent with the preset reference template, determining that the type of the optical modem is the same as the type corresponding to the preset reference template.
The type of the currently detected optical modem can be obtained in the above manner.
Optionally, in this embodiment, before determining whether the position of the control, the relative position relationship of the control, and the deviation of the size of the control from the preset reference template meet the preset deviation interval, the method may further include the following steps:
and selecting a preset reference template according to the text attribute and/or the text explicit-implicit attribute of the button control. Generally, in order to meet the requirements of different customers, manufacturers of optical modems set different controls according to the needs of the customers, and often set a plurality of controls therein for convenience of debugging and production, and start some of the controls according to the needs of the customers and shield the other controls. Specifically, the text attribute in the control is hidden. Therefore, the possible types of the currently detected optical modem can be preliminarily judged according to the text explicit and implicit properties.
In addition, the possible type of the currently detected optical modem can be preliminarily judged through the text attribute of the button control alone or in combination with the text explicit-implicit attribute, and a possible reference template is selected based on the possible type. And the identification efficiency is improved.
The embodiment recovers the control element information in the optical modem registration interface by reading; and extracting control element characteristics according to the control information, determining the type of the optical modem according to the control element characteristics, and detecting the optical modem according to the type. The type of the optical modem to be detected can be determined through the control element characteristics, and after the type is determined, the optical modem is automatically detected through an instruction corresponding to the optical modem. The method can determine the specific type of the recovered optical modem through the control element characteristics under the condition that the specific brand and model of the recovered optical modem are unknown, and detect according to the specific type of the optical modem. The batch automatic detection of a large number of recovered optical modems can be realized. Saving labor and time.
In a preferred implementation manner of this embodiment, the detecting the optical modem according to the type may include: writing in a user name and/or a password according to the type, and logging in or registering; a unique identifier of the optical modem is obtained. The specific model of the detected optical modem is obtained through the steps, and the user name and/or the password are automatically filled according to the model. And a click login or registration button control is simulated to realize automatic login. Obtaining a unique identifier of the optical modem. Further, the basic information of the optical modem can be obtained, and the port and the voice service can be detected. Basic information is obtained by simulating information such as click attributes and the like, and performance detection is carried out by simulating a communication port and voice service. Optionally, a detection report may be automatically generated according to the detection result. And uploading the detection report to a server to acquire comprehensive detection information.
Example two
Fig. 2 is a schematic flow chart of a detection method for recovering optical cats according to a second embodiment of the present invention. In this embodiment, the type of the optical modem is determined according to the control element characteristics, and specifically optimized as follows: converting the control element characteristics into parameters; establishing a multidimensional space, and determining a space point corresponding to the recovered optical modem according to the parameters corresponding to the control element characteristics; and determining the type of the recovery optical modem according to the distance between the spatial point and the preset spatial point of the optical modem.
Correspondingly, the detection method for recycling the optical cats provided by the embodiment specifically includes:
and S210, reading and recovering control element information in the optical modem registration interface.
And S220, extracting control element characteristics according to the control information.
And S230, converting the control element characteristics into parameters.
In this embodiment, the type of the detected optical modem can be identified by using the spatial position relationship. Before converting into the spatial position relationship, the control element characteristics need to be converted into parameters. Illustratively, the position of the control, the relative position relationship of the control, the size of the control, the text input attribute, and the explicit/implicit attribute of the control may be converted into corresponding proportional parameters according to a preset standard position, the relative position relationship, and the size of the control. The proportion parameter is between 0 and 1, and the characteristics of the text input attribute, the control explicit and implicit attribute, the button control text attribute and the like can be converted by 0 and 1 respectively.
And S240, establishing a multidimensional space, and determining a space point corresponding to the recycled optical modem according to the parameters corresponding to the control element characteristics.
And adaptively establishing a coordinate system for the control element characteristics, taking the parameter converted by each control element characteristic as a parameter, and drawing the space point corresponding to the recovery optical modem in a multidimensional space coordinate system according to the parameter.
And S250, determining the type of the recycled optical modem according to the distance between the space point and the space point of a preset template.
In this embodiment, the spatial points of each preset template are established in the coordinate system in advance, and the corresponding type is determined according to the distance between the spatial point corresponding to the recovered optical modem and the spatial point of each preset template. For example, the distance between the spatial point corresponding to the recycled optical modem and the spatial point of each preset template may be compared with a preset distance threshold, and when the distance is smaller than the preset distance threshold, it may be determined that the recycled optical modem is the same as the preset template in type.
And S260, detecting the optical modem according to the type.
In this embodiment, the determining the type of the optical modem according to the control element features is specifically optimized as follows: converting the control element characteristics into parameters; establishing a multidimensional space, and determining a space point corresponding to the recovered optical modem according to the parameters corresponding to the control element characteristics; and determining the type of the recovery optical modem according to the distance between the spatial point and the preset spatial point of the optical modem. The detection accuracy of the recycled light cat can be further improved. The method can reduce the unrecognizable or recognition error caused by the characteristic error of the element of the single control, and can realize the quick and accurate recognition of the type of the recycled optical modem.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a detection apparatus for recycling light cats according to a third embodiment of the present invention, and as shown in fig. 3, the apparatus includes:
the reading module 310 is configured to read and recycle control element information in the optical modem registration interface;
an extracting module 320, configured to extract control element features according to the control information, where the control element features include: the position of the control, the relative position relation of the control, the size of the control, the text input attribute, the display and hidden attribute of the control and the text attribute of the button control;
the detection module 320 is configured to determine the type of the optical modem according to the control element feature, and detect the optical modem according to the type.
The detection device for the recycled optical modem provided by this embodiment reads control element information in a registration interface of the recycled optical modem; and extracting control element characteristics according to the control information, determining the type of the optical modem according to the control element characteristics, and detecting the optical modem according to the type. The type of the optical modem to be detected can be determined through the control element characteristics, and after the type is determined, the optical modem is automatically detected through an instruction corresponding to the optical modem. The method can determine the specific type of the recovered optical modem through the control element characteristics under the condition that the specific brand and model of the recovered optical modem are unknown, and detect according to the specific type of the optical modem. The batch automatic detection of a large number of recovered optical modems can be realized. Saving labor and time.
On the basis of the above embodiments, the detection module includes:
the judging unit is used for judging whether the position of the control, the relative position relation of the control and the deviation of the size of the control and a preset reference template meet a preset deviation interval or not;
and the determining unit is used for determining whether the text input attribute is consistent with a preset reference template when the preset deviation interval is met, and determining that the type of the optical modem is the same as the type corresponding to the preset reference template when the text input attribute is consistent with the preset reference template.
On the basis of the above embodiments, the detection module includes:
and the selection module is used for selecting a preset reference template according to the text attribute and/or the text explicit-implicit attribute of the button control.
On the basis of the above embodiments, the detection module includes:
the conversion unit is used for converting the control element characteristics into parameters;
the establishing unit is used for establishing a multidimensional space and determining a space point corresponding to the recovered optical modem according to the parameters corresponding to the control element characteristics;
and the determining unit is used for determining the type of the recovered optical modem according to the distance between the spatial point and the preset spatial point of the optical modem.
On the basis of the above embodiments, the detection module includes:
the writing unit is used for writing a user name and/or a password according to the type and logging in or registering;
an obtaining unit, configured to obtain a unique identifier of the optical modem.
On the basis of the above embodiments, the detection module further includes:
and the detection unit is used for acquiring the basic information of the optical modem and detecting a port and a voice service.
On the basis of the above embodiments, the apparatus further includes:
and the generating module is used for generating a detection report according to the detection result.
The detection device for the recycled optical modem provided by the embodiment of the invention can execute the detection method for the recycled optical modem provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 4, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the detection method for recycling optical cats provided by the embodiment of the present invention.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are used for executing the detection method for recovering optical cats provided by the above embodiment.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.