CN114979494A - Communication mode control method, device, camera and readable storage medium - Google Patents

Communication mode control method, device, camera and readable storage medium Download PDF

Info

Publication number
CN114979494A
CN114979494A CN202210753719.7A CN202210753719A CN114979494A CN 114979494 A CN114979494 A CN 114979494A CN 202210753719 A CN202210753719 A CN 202210753719A CN 114979494 A CN114979494 A CN 114979494A
Authority
CN
China
Prior art keywords
communication
target
optical
optical fiber
communication mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210753719.7A
Other languages
Chinese (zh)
Other versions
CN114979494B (en
Inventor
庞钧元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202210753719.7A priority Critical patent/CN114979494B/en
Publication of CN114979494A publication Critical patent/CN114979494A/en
Application granted granted Critical
Publication of CN114979494B publication Critical patent/CN114979494B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/665Control of cameras or camera modules involving internal camera communication with the image sensor, e.g. synchronising or multiplexing SSIS control signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Optical Communication System (AREA)

Abstract

The invention provides a communication mode control method, a device, a camera and a readable storage medium, wherein the method comprises the following steps: when the optical module access signal is not detected or the read communication identification information is a first set value, communicating with a target communication object through the internet access; when an optical module access signal is detected, reading communication identification information; if the communication identification information is empty, determining a target optical fiber communication mode when a network cable connection signal is detected, and communicating with a target communication object through an optical port based on the target optical fiber communication mode; and if the communication identification information is not empty and is not the first set value, communicating with the target communication object through the optical port based on the preset optical fiber communication mode corresponding to the communication identification information. The optical fiber communication mode can be not fixedly limited, the optical fiber communication mode matched with the target communication object can be adaptively switched for communication, and the problem that the optical module needs to be dismounted and replaced under the condition of abnormal communication can be solved.

Description

Communication mode control method, device, camera and readable storage medium
Technical Field
The invention relates to the technical field of network cameras, in particular to a communication mode control method and device, a camera and a readable storage medium.
Background
Most of the current network cameras are configured with an optical port network to realize the function of transmitting information to the outside.
Type, cartridge type, ball-type etc. network camera are robbed to current part, often appear customer's feedback and switch or butt-joint end equipment and can't mate the communication problem after equipment volume production, but the switch communication mode is fixed can't switch through change optic fibre communication mode and light mouth, then just needs camera generator to change the board to the camera and customize production again and accord with to match communication mode light mouth network camera, wastes time and energy.
Therefore, how to provide a communication mode control method to enable the camera to solve the defect that the optical interface network camera is fixed for hundreds of megabytes and gigabytes optical communication and cannot adapt to the switching requirement is a problem to be solved.
Disclosure of Invention
An object of the present invention is to provide a method and an apparatus for controlling a communication mode, a camera and a readable storage medium, which are used to solve the defect that an optical network camera is fixed and cannot adapt to the requirement of switching.
In a first aspect, the present invention provides a communication mode control method, including: when the optical module access signal is not detected or the read communication identification information is a first set value, communicating with a target communication object through the internet access; when the optical module access signal is detected, reading the communication identification information; if the communication identification information is empty, determining a target optical fiber communication mode when a network cable connection signal is detected, and communicating with the target communication object through an optical port based on the target optical fiber communication mode; and if the communication identification information is not empty and is not the first set value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
In a second aspect, the present invention provides a communication mode control apparatus, including: the determining module is used for communicating with a target communication object through the internet access when the optical module access signal is not detected or the read communication identification information is a first set value; the reading module is used for reading the communication identification information when the optical module access signal is detected; the determining module is further configured to determine a target optical fiber communication mode when a network cable connection signal is detected if the communication identification information is empty, and communicate with the target communication object through an optical port based on the target optical fiber communication mode; and if the communication identification information is not empty and is not a first set value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
In a third aspect, the present invention provides a camera comprising: the system comprises a master control system module, an optical port communication circuit module and a network port communication circuit module; the master control system module is respectively and electrically connected with the optical port communication circuit module and the network port communication circuit module; the main control system module is configured to execute the communication mode control method according to the first aspect, so as to implement communication with a target communication object through the optical port communication circuit module, or implement communication with the target communication object through the network port communication circuit module.
In a fourth aspect, the invention provides a readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
The invention provides a communication mode control method, a device, a camera and a readable storage medium, wherein the method comprises the following steps: when the optical module access signal is not detected or the read communication identification information is a first set value, communicating with a target communication object through the internet access; when the optical module access signal is detected, reading the communication identification information; if the communication identification information is empty, determining a target optical fiber communication mode when a network cable connection signal is detected, and communicating with the target communication object through an optical port based on the target optical fiber communication mode; and if the communication identification information is not empty and is not the first set value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information. The optical fiber communication mode can be not fixedly limited, the optical fiber communication mode matched with the target communication object can be adaptively switched for communication, and the problem that the optical module needs to be dismounted and replaced under the condition of abnormal communication can be solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic view of an optical fiber communication scenario according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of a camera provided in an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a communication mode control method provided in accordance with an embodiment of the present invention;
fig. 4 is a schematic flowchart of step S303 provided by the embodiment of the present invention;
fig. 5 is a schematic flow chart of another communication mode control method according to an embodiment of the present invention;
fig. 6 is a second schematic flowchart of another communication mode control method according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a possible implementation of a camera provided by an embodiment of the present invention;
fig. 8 is a schematic view of a scenario of a communication mode control method according to an embodiment of the present invention;
fig. 9 is a functional block diagram of a communication mode control apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. indicate an orientation or a positional relationship based on that shown in the drawings or that the product of the present invention is used as it is, this is only for convenience of description and simplification of the description, and it does not indicate or imply that the device or the element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present invention.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
The current part of the gun type, barrel type, ball type and other network cameras are externally transmitted and configured with an optical port network, the cameras are provided with an optical module and an optical port, the optical module is used for converting network electric signals into optical signals, and the optical port plays a role of fixing the optical module.
Generally, a camera is generally fixedly labeled with a hundred-megabyte optical module or a gigabit optical module, where the hundred-megabyte optical module adopts a hundred-megabyte optical fiber communication mode, and the gigabit optical module adopts a gigabit optical fiber communication mode, but since optical fiber communication does not have a hundred-megabyte adaptive switching compatibility principle, an optical module at a camera end must correspond to a switch or a docking end one to one, for example, please refer to fig. 1, fig. 1 is an optical fiber communication scene schematic diagram provided by an embodiment of the present invention, as shown in fig. 1, a gigabit optical module in a network camera can normally communicate with a gigabit optical module in a switch or a docking end, and similarly, a hundred-megabyte optical module in a network camera can normally communicate with a hundred-megabyte optical module in a switch or a docking end, otherwise, a communication abnormality occurs.
Based on the scenario diagram shown in fig. 1, it can be deduced that different configurations between the camera and the switch or the docking end affect the communication between the two as shown in table 1.
TABLE 1
Figure BDA0003719106160000041
Figure BDA0003719106160000051
As can be seen from the above fig. 1 and table 1, because the optical fiber communication mode is not adaptive and downward compatible, an optical port may be mistakenly used to cause failure in communication, and particularly, a single board test and a complete machine test may easily cause a pairing error and failure in communication during production, which wastes time and energy to replace and disassemble, and for a user at a docking end, when a certain gigabit optical fiber switch (because the switch fixes a certain optical fiber communication mode) is used at the docking end, but a camera device only supports a hundred-megabyte optical module, the device may not be communicated because of being unable to adaptively switch, which affects use experience.
Referring to fig. 2, fig. 2 is a functional block diagram of a camera according to an embodiment of the present invention, the camera 100 includes: the optical network interface comprises a main control system module 101, an optical port communication circuit module 102 and a network port communication circuit module 102, wherein the main control system module 101 is electrically connected with the optical port communication circuit module 102 and the network port communication circuit module 102 respectively.
The master control system module 101 may include: the processor and the storage module reset module are used as a core processor to play the roles of detecting logic reality, storing abnormal alarm records, resetting and clearing and the like.
The optical port communication circuit module 102 may include: an optical port chip or a configuration circuit with an optical port SWITCH, an I2C expansion chip, an optical port chip or a configuration circuit with an optical port SWITCH, an EEPROM memory circuit, an optical port and an optical module.
The optical interface communication circuit module 102 may obtain optical module information according to the 2C expansion chip, obtain optical module information of the SWITCH or the docking terminal through the network interface, SWITCH an optical interface PHY or SWITCH operating mode with the optical interface according to the detection comparison information, and have functions of power-down memory, repeated detection memory, and the like to assist in completing detection comparison processes in various complex scene modes.
It is understood that the optical port communication circuit module 102 can be directly installed in the camera as a separate circuit module, and the configured EEPROM memory circuit plays a role in storing the communication identification information and saving power.
In one possible embodiment, the EEPROM stores a relational table as shown in table 2.
TABLE 2
Figure BDA0003719106160000061
That is, IPC network camera devices such as a bolt, etc. leave the factory without an optical module, the communication identification information of the EEPROM is 3; IPC network camera devices such as a cone camera and a dome camera leave a factory, and are provided with an optical module, if the optical module is a hundred-megabyte optical module, the communication identification information of the EEPROM is 1, and if the optical module is a giga-megabyte optical module, the communication identification information of the EEPROM is 2.
It should be noted that, the numerical value of the communication identification information is only used to distinguish different communication modes, in the embodiment of the present invention, the communication identification information corresponding to the network port communication mode is denoted by 3, the communication identification corresponding to the hundred-megabyte optical fiber communication mode is denoted by 1, and the communication identification information corresponding to the giga-fiber communication mode is denoted by 2, and a user may also distinguish different communication modes by other numerical values or characters according to actual needs, which is not limited herein.
The portal communication circuit module 103 may include: network interface chip or SWITCH chip with optical port, network interface; the method comprises the steps that firstly, when the situation that an optical module is inserted and an EEPROM non-standard bit enters S4 is detected, the network port is communicated and detected with opposite-end equipment through a configuration network port, and information of the opposite-end optical port and the optical module is confirmed, so that the optical module is compared and configured to meet an optical communication mode; and the second function is to judge that the abnormal communication jumps to a corresponding processing flow mode when the abnormal communication of the optical port occurs and the repeated network cable plugging is detected under the mode of S3-S7 or S4-S7, so as to avoid abnormal dead circulation of the communication.
Remarking: the IPC network camera is fixed by the IP and passively waits for the communication of the other party, and the detection process is carried out after the IPC network camera is connected and communicated with a switch or a butt joint end. In addition, attention is paid to the fact that an isolation mechanism is needed to be arranged on the network port and the optical port, and network storms caused by direct connection of the network port and the optical port are prevented.
As can be seen from fig. 2, the camera 100 may further include other functional modules, such as an abnormal alarm circuit module, which may include a Flash storage circuit, a voice alarm circuit, a light supplement lamp alarm circuit, and a serial port circuit, and is configured to provide an abnormal alarm message for a user to prompt a user to replace an abnormal optical module, an unconnected optical fiber, or an unmatched optical module for retesting.
In combination with the camera shown in fig. 2, in order to implement flexible switching of the communication mode, the main control system module 101 may be configured to execute the communication control method in the embodiment of the present invention, so as to implement network port communication with a target communication object through the network port communication circuit module, or implement optical port communication with the target communication object through the optical port communication circuit module.
With reference to the above-mentioned camera, a communication mode control method according to an embodiment of the present invention is described below, where the camera shown in fig. 1 is taken as an execution main body of the communication mode control method, please refer to fig. 3, and fig. 3 is a schematic flowchart of the communication mode control method according to the embodiment of the present invention, where the method includes:
and S301, when the optical module access signal is not detected or the read communication identification information is a first set value, communicating with a target communication object through the internet access.
The optical module access signal refers to a signal generated when a user accesses an optical module into an optical port of a camera. When the camera is inserted into the optical module, the optical module is in place, the access signal can be detected, and when the camera is not inserted into the optical module, the optical module is not in place, and the access signal is not detected.
The target communication object may be, but is not limited to, a switch.
The communication identification information corresponds to different communication modes, the camera can communicate through a network port or an optical port, and an optical module is configured in the camera which communicates through the optical port, for example, if the camera leaves a factory and is not configured with the optical module, the camera communicates with an exchanger or a butt-joint end through the network port; if the optical module is configured, an optical port or a network port can be used for communication according to actual communication requirements.
It can be understood that different types of optical modules correspond to different optical fiber communication modes, for example, a hundred-megabyte optical module corresponds to a hundred-megabyte optical fiber communication mode, and a gigabit optical module corresponds to a gigabit optical communication model.
In the embodiment of the present invention, if the camera is self-provided with the optical module when leaving the factory, the communication identifier information of the camera is configured to be the third setting value or the second setting value, which indicates that the camera can communicate through the optical fiber communication mode, and if the communication identifier information is read to be null, it indicates that the user has triggered the reset operation module of the camera (for example, the user presses the reset key for 10 seconds, etc.), which causes the communication identifier information to be cleared, in this case, the network port communication mode may be configured, thereby ensuring that the communication is normal.
In step S301, the first setting value corresponds to an internet access communication mode, and the embodiment of the present invention further sets a second setting value and a third setting value to distinguish different optical fiber communication modes.
And S302, when the optical module access signal is detected, reading the communication identification information.
And S303, if the communication identification information is empty, when the network cable connection signal is detected, determining a target optical fiber communication mode, and communicating with a target communication object through an optical port based on the target optical fiber communication mode.
In the embodiment of the present invention, if the communication identification information is empty, the optical fiber communication cannot be performed by determining the optical fiber communication mode through the communication identification information, so that after the network cable connection signal is detected, the communication detection can be performed through the network port, thereby achieving the effect of determining the target optical fiber communication mode.
And S304, if the communication identification information is not empty and is not a first set value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
In the embodiment of the present invention, the first setting value corresponds to a network port communication mode, and the second setting value and the third setting value correspond to different optical fiber communication modes, for example, the second setting value is 1 and corresponds to a hundred-megabyte optical fiber communication mode, the third setting value is 2 and corresponds to a gigabit optical fiber communication mode, and the third setting value is 3 and corresponds to a network port communication mode.
If the communication identification information is not empty and is not the first set value, it indicates that the accessible communication identification information is the third set value or the second set value, and at this time, communication can be performed through the optical port directly according to the optical fiber communication mode corresponding to the read communication identification information.
Then, in a possible implementation, the step S304 may be performed as follows:
if the communication identification information is a second set value, the hundred-million optical module corresponding to the second set value is used for communicating with a target communication object through an optical port;
and if the communication identification information is the third set value, the communication is carried out with the target communication object through the network port based on the gigabit optical module corresponding to the third set value.
According to the communication mode control method provided by the embodiment of the invention, the optical fiber communication mode can be not fixedly limited, the optical fiber communication mode matched with the target communication object can be adaptively switched for communication, and the problem that the optical module needs to be dismounted and replaced under the condition of abnormal communication can be solved.
To understand the foregoing process of determining the target optical fiber communication mode in an aspect, the following provides a possible implementation manner, please refer to fig. 4, where fig. 4 is a schematic flowchart of step S303 provided in an embodiment of the present invention, and step S303 may include:
and S303-1, outputting network cable connection prompt information and reading preset optical module information if the communication identification information is empty.
The network cable connection prompt message can be used for indicating a user to connect the network cable at the moment so as to trigger the communication detection through the network port, and the user can carry out network cable connection according to the network cable connection prompt message.
It should be noted that after the network cable connection prompt information is output, the optical module information in the camera may be read at this time, and the optical module information may include an optical module type and a corresponding optical fiber communication mode.
And S303-2, if the network cable connection signal is detected, acquiring the optical module information of the target communication object through the network port.
In the embodiment of the present invention, if a network cable connection is detected, it is equivalent to triggering a processing procedure for determining a target optical fiber communication mode, and at this time, in a case where the network cable is normally connected, the optical module information of the target communication object may be acquired by communicating with the target object through the network port.
And S303-3, if the optical module information of the target communication object is matched with the preset optical module information, determining that the preset optical fiber communication mode is the target optical fiber communication mode, and communicating with the target communication object through an optical port based on the target optical fiber communication mode.
If the optical fiber communication mode of the target communication object is consistent with the preset optical fiber communication mode, it is indicated that the optical modules of the camera correspond to the optical modules of the target object one to one, and if the optical communication mode is consistent with the optical communication mode, the preset optical fiber communication mode (which may also be the optical fiber communication mode of the target object) can be used as the target optical fiber communication mode, and optical port communication is performed based on the target optical fiber communication mode.
S303-4, if the optical module information of the target communication object is not matched with the preset optical module information, outputting alarm prompt information, and after detecting the replacement operation of the optical module, executing the steps of determining a target optical fiber communication mode and communicating with the target communication object through an optical port based on the target optical fiber communication mode;
and the alarm prompt information is used for indicating a user to replace the optical module.
For example, assuming that the camera configuration and the target object configuration are both a hundred mega optical module, the target optical fiber communication mode may be determined to be a hundred mega optical fiber communication mode; if the hundred-megabyte optical module configured by the camera and the gigabit optical module configured by the target object are assumed, the optical modules are determined to be inconsistent at the moment, alarm information is output, and after a user obtains the alarm information, the hundred-megabyte optical module can be replaced by the gigabit optical module, and then the gigabit optical fiber communication mode is determined to be the target optical fiber communication mode.
As can be seen from the above embodiments, normal communication between both parties cannot be realized by the above embodiments without knowing both the optical communication mode and the optical module.
In an optional embodiment, because the current function differences of various types of cameras are different, multiple alarm modes need to be supported, so that the embodiment of the present invention provides the following alarm prompting modes:
the first method is as follows: the online internet access alarm is displayed on a web page of the network camera and corresponding log information is printed to prompt an alarm;
the second method comprises the following steps: sound is output to broadcast alarm information through an audio alarm circuit to prompt alarm;
the third method comprises the following steps: different light information is output to the outside through a light supplement lamp alarm to prompt an alarm;
the method is as follows: log prompt information is output externally through serial port printing information to give an alarm.
In an optional implementation manner, in the process of communication through an optical interface, communication abnormality may be caused because an optical module configured by a camera is not matched with an optical module of a target communication object.
Scene one: and performing communication based on the determined target optical fiber communication mode, wherein communication abnormity occurs.
If the first scenario occurs, after the step S303, the method shown in fig. 4 may be included, please refer to fig. 5, where fig. 5 is a schematic flowchart of another communication mode control method provided in the embodiment of the present invention, and the method further includes:
s305, if the network cable plugging signals of the preset times are detected in the preset time period or the optical fiber connection is determined to be failed, determining that the communication is abnormal, and outputting alarm prompt information.
In the embodiment of the invention, as the camera is in a state of passively waiting for communication, communication abnormity occurs, the camera cannot be adjusted in time, and an external trigger condition is needed to prompt the camera to complete the confirmation of the optical fiber communication mode and improve the abnormal communication condition.
It should be noted that the operation of plugging and unplugging the network cable in the embodiment of the present invention is only one of the trigger conditions, and the user may also set another trigger condition to trigger the camera to execute a procedure of determining the target optical fiber communication mode and communicating with the target communication object through the optical port based on the target optical fiber communication mode.
It can be seen that, in step S303, communication is performed when the optical fiber communication mode of the camera matches the optical communication mode of the target communication object, and if communication is abnormal, it indicates that the optical module of the camera is damaged or the optical fiber is not connected, but since the camera is in a passive communication state, it cannot be determined that the communication is the cause of the abnormality, the camera may be triggered to recognize the abnormality by a trigger condition, that is, a network cable plugging/unplugging signal, and then remedial measures are taken.
S307, if the optical module replacement operation instruction is not detected within a preset time period or the optical fiber access signal is not detected, stopping the communication process and updating the communication identification information to a first set value;
and S308, if an optical module replacement operation instruction is detected within a preset time period or an optical fiber access signal is detected, determining a target optical fiber communication mode, and communicating with a target communication object through an optical port based on the target optical fiber communication mode.
Scene two: and communication abnormity occurs based on the communication of the preset optical fiber communication mode corresponding to the communication identification information.
If scenario two occurs, after the step S304, the method shown in fig. 6 may be included, please refer to fig. 6, where fig. 6 is a schematic flowchart of another communication mode control method according to an embodiment of the present invention, and the method further includes:
s309, if the network cable plugging signals of preset times are detected in a preset time period or the optical fiber connection is determined to be failed, determining that the communication is abnormal;
and S310, when the network cable connection signal is detected, determining a target optical fiber communication mode, and communicating with a target communication object through an optical port based on the target optical fiber communication mode and the target optical fiber communication mode.
Through the embodiment, the camera can be triggered to quickly determine the communication abnormity, and quickly respond to the abnormal communication condition, so that the optical communication returns to normal.
In an alternative embodiment, after step S303, the method further comprises:
a1, determining a set value corresponding to a target optical fiber communication mode;
a2, setting the communication identification information as a set value corresponding to the target optical fiber communication mode;
a3, writing the communication identification information into the memory.
For example, if the target fiber optic communication mode is the hundreds of mega fiber optic communication mode, the set value may be determined as the second set value (the second set value may be, but is not limited to, 1), and similarly, if the target fiber optic communication mode is the giga fiber optic communication mode, the set value may be determined as the third set value (the third set value may be, but is not limited to, 2), and then the determined set value is written into the memory, so that it is possible to ensure that the fiber optic communication mode is determined directly from the set values before the next communication.
In an optional embodiment, in order to prevent network storm, a network port isolation mechanism can be configured in the process of communicating with a target communication object through an optical port.
With reference to the communication mode control method provided above, an embodiment of the present invention provides a possible implementation manner of a camera 100 on the basis of fig. 2, please refer to fig. 7, fig. 7 is a schematic diagram of a possible implementation manner of a camera provided in an embodiment of the present invention, as shown in fig. 7, an embodiment of the present invention provides an implementation manner of an optical port communication circuit module 102 and a network port communication circuit module, and a data interaction manner between each functional module in the camera, and with reference to fig. 7, the communication mode control method provided above may be as shown in fig. 8, fig. 8 is a scene schematic diagram of a communication mode control method provided in an embodiment of the present invention, and the communication mode control method may be performed as follows:
s1: after the system is powered on, the processor starts an internet access communication mode, reads communication identification information in an EEPROM storage circuit through an I2C bus, and detects whether an optical module access signal exists.
If the optical module access signal exists and the communication identification information is 3, executing S4; if the optical module access signal exists and the communication identification information is 1 or 2, executing steps S3 and S5; if there is an optical module access signal and the communication identification information is empty, step S2 is executed.
S2: outputting network cable connection prompt information, reading preset optical module information, waiting for network port connection, and waiting for executing the step S6;
s3: and configuring a network port isolation mechanism, configuring an optical port chip and an optical module according to the optical fiber communication mode corresponding to the communication identifier 1 or 2, and communicating with the target object through an optical port.
S4: and communicating with the target object through the internet access.
S5: whether a network cable plugging signal with preset times is detected or whether the optical fiber connection is normal within a preset time period is detected, if so, the step S7 is executed, and if not, the step S6 is executed.
S6: and when the network cable connection signal is detected, communicating with a target object through the network port to acquire the information of the target object optical module.
S7: closing the network port or configuring a network port isolation mechanism.
S8: comparing preset optical module information with target object optical module information;
s9: determining whether the optical communication mode is satisfied, if yes, performing step S11; if not, executing step S10;
s10: alarming by means of abnormal serial port alarming or sound and light, prompting to switch different types of optical modules, and returning to execute the step S8 when detecting the replacement operation of the optical modules; if the replacement operation is not detected, S15 is executed;
s11: configuring an optical interface chip and an optical interface module according to the obtained optical module information, configuring a network isolation mechanism, and communicating through an optical interface;
s12: whether a network cable plugging signal with preset times is detected or whether the optical fiber is normally connected is detected within a preset time period, and if so, the step S13 is executed; if not, executing step S14;
s13: setting communication identification information to 1 or 2;
s14: outputting an alarm prompt; if the replacement operation or the optical fiber connection signal is detected, returning to step S8; if the replacement operation or the optical fiber connection signal is not detected, S15 is executed;
s15: and stopping communication if the optical module replacement operation is detected or the optical fiber connection is not detected within the preset time, and setting 3 communication identification information.
Referring to fig. 9, fig. 9 is a functional block diagram of a communication mode control apparatus according to an embodiment of the present invention, where the communication mode control apparatus 400 includes:
a determining module 410, configured to communicate with a target communication object through a network port when an optical module access signal is not detected or the read communication identification information is a first set value;
a reading module 420, configured to read communication identifier information when an optical module access signal is detected;
the determining module 410 is further configured to determine a target optical fiber communication mode if the communication identifier information is null, and communicate with a target communication object through an optical interface based on the target optical fiber communication mode under the condition that the network cable plugging/unplugging signal is detected; and if the communication identification information is not empty, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
In alternative embodiments, the communication mode control apparatus 400 may be further configured to perform the steps of fig. 4, 5, and 6 to achieve the corresponding technical effects.
It is understood that the instructions/modules of the communication mode control apparatus 400 provided by the embodiment of the present invention may be stored in the memory of the video camera 100 in the form of software or firmware (firmware) or be fixed in an Operating System (OS) of the video camera 100, and the processor of the video camera 100 executes software programs and modules stored in the memory, so as to execute various functional applications and data processing.
An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the communication mode control method according to any one of the foregoing embodiments. The computer readable storage medium may be, but is not limited to, various media that can store program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a PROM, an EPROM, an EEPROM, a magnetic or optical disk, etc.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for communication mode control, the method comprising:
when the optical module access signal is not detected or the read communication identification information is a first set value, communicating with a target communication object through the internet access;
when the optical module access signal is detected, reading the communication identification information;
if the communication identification information is empty, determining a target optical fiber communication mode when a network cable connection signal is detected, and communicating with the target communication object through an optical port based on the target optical fiber communication mode;
and if the communication identification information is not empty and is not the first set value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
2. The communication mode control method according to claim 1, wherein when the communication identification information is empty, and when a network connection signal is detected, a target optical fiber communication mode is determined, and after communication with the target communication object through an optical port based on the target optical fiber communication mode, the method further comprises:
if the network cable plugging signals of preset times are detected within a preset time period or the optical fiber connection is determined to be failed, determining that the communication is abnormal and outputting alarm prompt information;
if the optical module replacement operation instruction is not detected within a preset time period or an optical fiber access signal is not detected, stopping a communication flow and updating the communication identification information to a first set value;
and if the optical module replacement operation instruction is detected within the preset time period or an optical fiber access signal is detected, determining a target optical fiber communication mode and communicating with the target communication object through an optical port based on the target optical fiber communication mode.
3. The method of claim 1, wherein if the communication identification information is not empty and is not the first setting value, after communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information, the method further comprises:
if the network cable plugging signals of preset times are detected in a preset time period or the optical fiber connection is determined to be failed, determining that the communication is abnormal;
and when a network cable connection signal is detected, determining a target optical fiber communication mode, and communicating with the target communication object through an optical port based on the target optical fiber communication mode.
4. The communication mode control method according to claim 1, wherein if the communication identification information is empty, when a network connection signal is detected, determining a target optical fiber communication mode, and communicating with the target communication partner through an optical port based on the target optical fiber communication mode, includes:
if the communication identification information is empty, outputting network cable connection prompt information and reading preset optical module information;
if a network cable connection signal is detected, acquiring the optical module information of the target communication object through the network port;
if the optical module information of the target communication object is matched with the preset optical module information, determining that a preset optical fiber communication mode is a target optical fiber communication mode, and communicating with the target communication object through an optical port based on the target optical fiber communication mode;
if the optical module information of the target communication object is not matched with the preset optical module information, outputting alarm prompt information, and after detecting the replacement operation of the optical module, executing the steps of determining a target optical fiber communication mode and communicating with the target communication object through an optical port based on the target optical fiber communication mode; and the alarm prompt information is used for indicating a user to replace the optical module.
5. The communication mode control method according to claim 1, wherein when the communication identification information is empty, and when a network connection signal is detected, a target optical fiber communication mode is determined, and after communication with the target communication object through an optical port based on the target optical fiber communication mode, the method further comprises:
determining a set value corresponding to the target optical fiber communication mode;
setting the communication identification information as a set value corresponding to the target optical fiber communication mode;
and writing the communication identification information into a memory.
6. The communication mode control method of claim 1, further comprising:
and configuring a network port isolation mechanism in the process of communicating with the target communication object through the optical port.
7. The communication mode control method according to claim 1, wherein if the communication identification information is not empty and is not the first setting value, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information, includes:
if the communication identification information is a second set value, based on a hundred-million optical module corresponding to the second set value, communicating with the target communication object through the optical port;
and if the communication identification information is a third set value, communicating with the target communication object through the network port based on the gigabit optical module corresponding to the third set value.
8. A communication mode control apparatus, comprising:
the determining module is used for communicating with a target communication object through the internet access when the optical module access signal is not detected or the read communication identification information is a first set value;
the reading module is used for reading the communication identification information when the optical module access signal is detected;
the determining module is further configured to determine a target optical fiber communication mode when a network cable connection signal is detected if the communication identification information is empty, and communicate with the target communication object through an optical port based on the target optical fiber communication mode; and if the communication identification information is not empty, communicating with the target communication object through the optical port based on a preset optical fiber communication mode corresponding to the communication identification information.
9. A camera, comprising: the system comprises a master control system module, an optical port communication circuit module and a network port communication circuit module; the master control system module is respectively and electrically connected with the optical port communication circuit module and the network port communication circuit module; the main control system module is configured to execute the communication mode control method according to any one of claims 1 to 7, so as to implement communication with a target communication object through the optical port communication circuit module or implement communication with the target communication object through the network port communication circuit module.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202210753719.7A 2022-06-28 2022-06-28 Communication mode control method, device, camera and readable storage medium Active CN114979494B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210753719.7A CN114979494B (en) 2022-06-28 2022-06-28 Communication mode control method, device, camera and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210753719.7A CN114979494B (en) 2022-06-28 2022-06-28 Communication mode control method, device, camera and readable storage medium

Publications (2)

Publication Number Publication Date
CN114979494A true CN114979494A (en) 2022-08-30
CN114979494B CN114979494B (en) 2023-07-21

Family

ID=82968160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210753719.7A Active CN114979494B (en) 2022-06-28 2022-06-28 Communication mode control method, device, camera and readable storage medium

Country Status (1)

Country Link
CN (1) CN114979494B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080031620A1 (en) * 2006-08-04 2008-02-07 Emcore Corporation Wireless monitoring of optoelectronic modules and network components
US20140270140A1 (en) * 2013-03-14 2014-09-18 Mattersight Corporation Methods and system for analyzing multichannel electronic communication data
CN204760868U (en) * 2015-07-01 2015-11-11 新疆特变电工自控设备有限公司 Display device is controlled to cubical switchboard video
CN205792601U (en) * 2016-05-31 2016-12-07 深圳市源拓光电技术有限公司 A kind of fiber optical transceiver of optical port self-adaptive
WO2017206954A1 (en) * 2016-06-03 2017-12-07 中兴通讯股份有限公司 Optical port implementation method and apparatus, and field programmable gate array device
CN111541956A (en) * 2020-04-20 2020-08-14 深圳市三旺通信股份有限公司 Optical port self-adaption method, device, switch and computer readable storage medium
CN111541629A (en) * 2020-04-21 2020-08-14 深圳市三旺通信股份有限公司 Mode self-adaption method, device, equipment and computer readable storage medium
JP2020174287A (en) * 2019-04-11 2020-10-22 学校法人加計学園 Visible light communication device and visible light communication method
CN112019705A (en) * 2019-05-28 2020-12-01 杭州海康威视数字技术股份有限公司 Camera and video monitoring system
CN112449148A (en) * 2019-08-30 2021-03-05 杭州海康威视数字技术股份有限公司 Camera, camera system and data transmission system
CN113727208A (en) * 2021-08-30 2021-11-30 杭州云合智网技术有限公司 Communication method, device, equipment and medium for quickly reading and writing parameter information of optical module
CN114006653A (en) * 2021-10-29 2022-02-01 锐捷网络股份有限公司 Equipment compatible with different types of optical modules, control method thereof and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080031620A1 (en) * 2006-08-04 2008-02-07 Emcore Corporation Wireless monitoring of optoelectronic modules and network components
US20140270140A1 (en) * 2013-03-14 2014-09-18 Mattersight Corporation Methods and system for analyzing multichannel electronic communication data
CN204760868U (en) * 2015-07-01 2015-11-11 新疆特变电工自控设备有限公司 Display device is controlled to cubical switchboard video
CN205792601U (en) * 2016-05-31 2016-12-07 深圳市源拓光电技术有限公司 A kind of fiber optical transceiver of optical port self-adaptive
WO2017206954A1 (en) * 2016-06-03 2017-12-07 中兴通讯股份有限公司 Optical port implementation method and apparatus, and field programmable gate array device
JP2020174287A (en) * 2019-04-11 2020-10-22 学校法人加計学園 Visible light communication device and visible light communication method
CN112019705A (en) * 2019-05-28 2020-12-01 杭州海康威视数字技术股份有限公司 Camera and video monitoring system
CN112449148A (en) * 2019-08-30 2021-03-05 杭州海康威视数字技术股份有限公司 Camera, camera system and data transmission system
CN111541956A (en) * 2020-04-20 2020-08-14 深圳市三旺通信股份有限公司 Optical port self-adaption method, device, switch and computer readable storage medium
CN111541629A (en) * 2020-04-21 2020-08-14 深圳市三旺通信股份有限公司 Mode self-adaption method, device, equipment and computer readable storage medium
CN113727208A (en) * 2021-08-30 2021-11-30 杭州云合智网技术有限公司 Communication method, device, equipment and medium for quickly reading and writing parameter information of optical module
CN114006653A (en) * 2021-10-29 2022-02-01 锐捷网络股份有限公司 Equipment compatible with different types of optical modules, control method thereof and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张文海;张春艳;孙莉萍;: "一种带SGMII的增强型小型可插拔光模块" *
李世忠;: "永武高速上杭段视频系统高清改造方案探讨" *

Also Published As

Publication number Publication date
CN114979494B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
US20070234123A1 (en) Method for detecting switching failure
US7779266B2 (en) Method for controlling pluggable port on interface board of communication device and interface board
CN202135267U (en) Television system possessing functions of error detection and report
CN108170245A (en) Control system, method and the server management system of server physical button operation
US20080147950A1 (en) Flash memory card test device with multiple interfaces
US20120137027A1 (en) System and method for monitoring input/output port status of peripheral devices
CN102880527B (en) Data recovery method of baseboard management controller
US8015321B2 (en) Computer, IO expansion device and method for recognizing connection of IO expansion device
JP7341231B2 (en) How to update settings for LED display, receiving card, LED display module, and LED display
CN109542928B (en) Error management method, device, storage medium and terminal equipment
CN109217922B (en) Method and device for reporting loss alarm of received signal by optical module
US20130166896A1 (en) Management system for network card
JP5279873B2 (en) Information processing apparatus and information processing method
US20090015204A1 (en) Method and apparatus for managing operations associated with a backup power source at a network terminal
CN109582324B (en) IC burning method and board card
CN114979494A (en) Communication mode control method, device, camera and readable storage medium
CN111726563A (en) Video storage device for train video monitoring system
CN102290866B (en) Control method and control system of intelligent releaser
CN110825640A (en) Dubal BIOS test method, test device and test system
CN114168205A (en) BIOS firmware verification system, method and device
TW202215199A (en) Master-slave interchangeable power supply device and host machine thereof, master-slave interchangeable power supply method, and computer-readable recording medium thereof for the power control module and the power supply unit to communicate with each other under the standard of the communication bus
WO2019242266A1 (en) Port connection state monitoring system and method
CN114520892B (en) Communication control method and device and optical network unit
KR100711457B1 (en) Optical module device and optical network terminal using the optical module device
TWI757923B (en) Pre-boot execution environment determination system and method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant