CN112188090B - Camera system multithread control method, device, server and storage medium - Google Patents

Camera system multithread control method, device, server and storage medium Download PDF

Info

Publication number
CN112188090B
CN112188090B CN202011004706.7A CN202011004706A CN112188090B CN 112188090 B CN112188090 B CN 112188090B CN 202011004706 A CN202011004706 A CN 202011004706A CN 112188090 B CN112188090 B CN 112188090B
Authority
CN
China
Prior art keywords
thread
module
environment monitoring
instruction
alarm monitoring
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.)
Active
Application number
CN202011004706.7A
Other languages
Chinese (zh)
Other versions
CN112188090A (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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202011004706.7A priority Critical patent/CN112188090B/en
Publication of CN112188090A publication Critical patent/CN112188090A/en
Application granted granted Critical
Publication of CN112188090B publication Critical patent/CN112188090B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The invention provides a camera system multithread control method, which is executed by a server and comprises the following steps: creating a first thread, and simultaneously creating a second thread and/or a third thread; acquiring instruction information of a client, wherein the instruction information further comprises an environment monitoring instruction and/or a trigger detection instruction; judging whether the state of the network port is normal or not in the first thread; if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism; in the second thread, the environment monitoring instruction is sent to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, the trigger detection instruction is sent to a trigger detection module to generate a trigger detection result; and acquiring the environment monitoring result and/or triggering the detection result and sending the environment monitoring result and/or triggering the detection result to the client. According to the invention, a plurality of task threads are started through the server, so that the parameters displayed in real time can run independently, the interference with other functional controls is avoided, and the task accuracy and the response speed are improved.

Description

Camera system multithread control method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the technical field of software control, in particular to a camera system multithreading control method, a camera system multithreading control device, a camera system multithreading server and a storage medium.
Background
In the ultrafast phenomenon imaging and diagnosis technology, the image converter ultrafast camera based on the photoelectric technology has important application in the fields of Inertial Confinement Fusion (ICF), Z pinch, biomedical imaging, ultrafast laser and the like. Particularly, in the diagnosis of the picosecond and subpicosecond ultrafast phenomena, ultrafast cameras such as an image converter tube stripe camera and a framing camera have an irreplaceable imaging function. The ultrafast camera comprises a client, a server and working modules for detection, photographing and the like.
When the server interacts with the client, the server program needs to control a plurality of function controls and also needs to process parameters returned by the camera system, and mutual interference is easy to occur.
Disclosure of Invention
The invention provides a camera system multithreading control method, a camera system multithreading control device, a camera system multithreading server and a storage medium.
In a first aspect, the present invention provides a multithread control method for a camera system, executed by a server, where the camera system includes an environment monitoring module and/or an alarm monitoring module, and includes:
creating a first thread, and simultaneously creating a second thread and/or a third thread, wherein the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
acquiring instruction information of a client, wherein the instruction information further comprises an environment monitoring instruction and/or an alarm monitoring instruction;
judging whether the state of the network port is normal or not in the first thread;
if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism;
in the second thread, the environment monitoring instruction is sent to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, the alarm monitoring instruction is sent to an alarm monitoring module to generate an alarm monitoring result;
and acquiring the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client.
Further, the determining, by the first thread, whether the status of the portal is normal includes:
judging whether the communication connection of the network port is normal or not;
if the camera is normal, periodically communicating with an environmental parameter control module to inquire the working environmental parameters of the camera;
if the camera is normal, trigger detection is periodically executed, and whether the camera is in a trigger state is inquired.
Further, in the second thread, the sending the environment monitoring instruction to an environment monitoring module to generate an environment monitoring result, including:
sending the environment monitoring instruction to the environment monitoring module in the second thread;
creating a first timer at the second thread, the first timer comprising a first timing period;
and periodically triggering the environment monitoring module based on a first timing period to acquire one or more environment monitoring results.
Further, in the third thread, the alarm monitoring instruction is sent to an alarm monitoring module, and an alarm monitoring result is generated, including:
sending an alarm monitoring instruction to the alarm monitoring module in the third thread;
creating a second timer at the third thread, the second timer comprising a second timing period;
and periodically triggering the alarm monitoring module based on a second timing period to obtain one or more alarm monitoring results.
Further, before the creating the first thread and simultaneously creating the second thread and/or the third thread, the method further includes:
creating a Socket communication interface;
acquiring a connection request of a client;
and establishing Socket communication connection with the client based on the connection request.
Further, the camera system further includes a working module, the instruction information further includes a working parameter adjusting instruction, and when the first thread determines whether the network port state is normal, the method further includes:
and in the first thread, the working parameter adjusting instruction is sent to the working module so as to adjust the working parameters of the working module and generate a photographed image.
In a second aspect, the present invention provides a multi-thread control apparatus for a camera system, which is executed by a server, wherein the camera system includes an environment monitoring module and/or an alarm monitoring module, and includes:
the system comprises a thread creating module, a thread setting module and a thread selecting module, wherein the thread creating module is used for creating a first thread and simultaneously creating a second thread and/or a third thread, the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
the acquisition module is used for acquiring instruction information of the client, and the instruction information further comprises an environment monitoring instruction and/or an alarm monitoring instruction;
the judging module is used for judging whether the state of the network port is normal or not in the first thread;
the mapping module is used for mapping the instruction information to the second thread and/or the third thread respectively based on a preset message mapping mechanism if the instruction information is normal;
the first sending module is used for sending the environment monitoring instruction to the environment monitoring module in the second thread to generate an environment monitoring result, and/or sending the alarm monitoring instruction to the alarm monitoring module in the third thread to generate an alarm monitoring result;
and the second sending module is used for obtaining the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client.
Further, the first sending module further includes:
the first sending unit is used for sending the environment monitoring instruction to the environment monitoring module in the second thread;
a first timing unit to create a first timer at the second thread, the first timer comprising a first timing period;
the first triggering unit is used for periodically triggering the environment monitoring module based on a first timing cycle so as to obtain one or more environment monitoring results.
In a third aspect, the present invention also provides a server, including a memory, a processor and a program stored in the memory and executable on the processor, where the processor executes the program to implement a camera system multithread control method as described in any one of the above.
In a fourth aspect, a terminal-readable storage medium has stored thereon a program which, when executed by a processor, is capable of implementing a camera system multithread control method as in any one of the above.
According to the invention, the server side starts a plurality of task threads, so that data fed back by the camera system and the network port control are operated separately, mutual interference is avoided, and the task accuracy and the response speed are improved.
Drawings
Fig. 1 is a flowchart of a camera system multithread control method according to the first embodiment.
Fig. 2 is a flowchart of a camera system multithread control method according to the second embodiment.
Fig. 3 is a flowchart of an alternative embodiment of the second embodiment.
Fig. 4 is a system block diagram of a camera system multithread control method according to the third embodiment.
Fig. 5 is a block diagram of an alternative embodiment of the third embodiment.
Fig. 6 is a block diagram of a server according to a fourth embodiment.
Detailed Description
The present invention will be described in further detail with reference to the 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.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, the first feature information may be the second feature information or the third feature information, and similarly, the second feature information and the third feature information may be the first feature information without departing from the scope of the present application. The first characteristic information, the second characteristic information and the third characteristic information are characteristic information of the distributed file system, but are not the same characteristic information. The terms "first", "second", etc. should not be construed to indicate or imply relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "plurality", "batch" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
The meaning of English words and proper nouns mentioned in this and the following examples is as follows:
socket: socket is an abstraction layer between the application layer and the transport layer that abstracts the complex operations of the TCP/IP layer into several simple interface provisioning application layer calls to enable the communication of processes in the network.
TCP/IP protocol: transmission control protocol/Internet protocol, a network communication model, consists of IP protocol at the network layer and TCP protocol at the transport layer. It defines how electronic devices connect to the internet and also defines the standard how data is transferred between them.
bind function: for unconnected datagram or stream-like sockets, the local IP address is bundled with a set of interfaces.
The listen function: it is indicated in the socket function that a socket is in a state of listening for incoming connection requests.
connect function: for creating a connection with a designated port.
Example one
The embodiment provides a multithread control method of a camera system, which is executed by a server side, wherein the camera system comprises an environment monitoring module and/or an alarm monitoring module. Illustratively, in the camera system mentioned in this embodiment and the following embodiments, a user interacts with a server through an interactive interface of a client, and remote control of the camera system is implemented through the server. As shown in fig. 1, the steps include:
s101, a first thread is created, and a second thread and/or a third thread are created at the same time, wherein the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread.
In this step, one or more threads may be created simultaneously with the creation of the first thread, the number of threads being related to the number of functional modules of the camera system.
The first thread is used for network interface control, and optionally, is further used for responding to, controlling and adjusting working parameters of the camera, such as working parameters of a main power switch, a camera switch, a working power switch, a shutter, a working gear, a gain gear and/or a delay gear of the camera system. And one or more other threads except the first thread are used for acquiring the data generated by the functional module from the camera system and feeding the data back to the client.
Illustratively, when the camera system includes an environment monitoring module, an alarm monitoring module and/or an image acquisition module, the steps may be: a first thread is created while a second thread, a third thread, and/or a fourth thread is created. The first thread is a network port control thread, the second thread is an environment monitoring thread, the third thread is an alarm monitoring thread, and the fourth thread is an image acquisition thread. The network port control, the environment monitoring data, the alarm monitoring data and other threads are processed, so that mutual interference of the data is avoided.
S102, obtaining instruction information of the client, wherein the instruction information further comprises an environment monitoring instruction and/or an alarm monitoring instruction.
In this step, the instruction information further includes an image acquisition instruction.
The environment monitoring instruction is used for controlling the environment monitoring module to monitor the air chamber humidity, the air chamber temperature, the air chamber air pressure, the cooling water flow rate, the cooling water leakage, the fluorescent screen voltage and/or the voltage, and temporarily storing the acquired air chamber humidity, the air chamber temperature, the air chamber air pressure, the cooling water flow rate, the cooling water leakage, the fluorescent screen voltage and/or the voltage at the service end and feeding back the acquired air chamber humidity, the air chamber temperature, the air chamber air pressure, the cooling water flow rate, the cooling water leakage, the fluorescent screen voltage and/or the voltage to the client.
The alarm detection instruction is used for initiating first alarm information when the humidity of the camera air chamber indicated by the air chamber humidity indicating unit is greater than 70% Relative Humidity (RH); when the temperature of the camera air chamber indicated by the air chamber temperature indicating unit is higher than 50 degrees centigrade (DEG C), initiating second alarm information; displaying a third alarm when the air pressure of the air chamber air pressure indicating unit indicating the camera air chamber is less than 900 millibars (mbar); when the flow rate of the camera CCD cooling water indicated by the cooling water flow rate indicating unit is less than 0.51 meter per minute, a fourth alarm is displayed; and displaying a fifth alarm when the cooling water leakage occurs in the camera indicated by the cooling water leakage indicating unit. When the positive high voltage value of the camera screen indicated by the screen voltage indicating unit is smaller than the first threshold value K1, a sixth alarm is displayed; and displaying a seventh alarm when the negative high voltage value of the camera focusing system indicated by the voltage indicating unit is greater than a set second threshold value K2. And sending the first alarm, the second alarm, the third alarm, the fourth alarm, the fifth alarm, the sixth alarm and/or the seventh alarm to the client.
And the image acquisition instruction is sent to the camera system and used for acquiring image data of the camera system and feeding back the image data to the server.
S103, judging whether the state of the network port is normal or not in the first thread.
In this step, determining whether the network port state is normal includes determining a network port query environment state and a network port query trigger state, and specifically, this step includes: judging whether the communication connection of the internet access is normal or not; if the camera is normal, periodically communicating with an environmental parameter control module to inquire the working environmental parameters of the camera; if the camera is normal, trigger detection is periodically executed, and whether the camera is in a trigger state is inquired.
In this step, since the first thread is used for internet access control, and optionally, is further used for responding to and controlling and adjusting operating parameters of the camera, such as operating parameters of a main power switch, a camera switch, an operating power switch, a shutter, an operating range, a gain range, and/or a delay range of the camera system, while executing step S103, the method further includes: and sending the working parameter adjusting instruction to the working module in the first thread so as to adjust the working parameters of the working module.
In this step, the working parameter adjusting instruction is mainly used for sending the working state control instruction to the camera system so as to control the camera system to adjust the working parameters of the main power switch, the camera switch, the working power switch, the shutter, the working gear, the gain gear and/or the delay gear.
And S104, if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism.
In the step, the information is mapped to the environment monitoring module, the alarm monitoring module and/or the image acquisition module according to the information mapping mechanism and the corresponding control event.
And S105, in the second thread, sending the environment monitoring instruction to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, sending the alarm monitoring instruction to an alarm monitoring module to generate an alarm monitoring result.
In this step, specifically, by setting a timer, the method for enabling the functional module to periodically report the detection data includes:
sending the environment monitoring instruction to the environment monitoring module in the second thread; creating a first timer at the second thread, the first timer comprising a first timing period; and periodically triggering the environment monitoring module based on a first timing period to acquire one or more environment monitoring results. Illustratively, the first timing period of the first timer is 2 seconds.
And/or
Sending an alarm monitoring instruction to the alarm monitoring module in the third thread; creating a second timer at the third thread, the second timer comprising a second timing period; and periodically triggering the alarm monitoring module based on a second timing period to obtain one or more alarm monitoring results. Illustratively, the second timing period of the second timer is 0.8 seconds.
In this step, optionally, as described in the foregoing step, if a fourth thread is further included, then this step further includes: and sending the image acquisition instruction to a camera system in the fourth thread so as to acquire image data of the camera system.
And S106, obtaining the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client.
According to the embodiment, the multiple threads are created at the server, so that the data displayed in real time can be independently operated, the interference with other functional controls is avoided, and the task accuracy and the response speed are improved.
Example two
As shown in fig. 2, in the present embodiment, a step of creating Socket communication is added on the basis of the above embodiment, and since the client and the server communicate using a TCP/IP protocol, a Socket communication model needs to be used in the network to support communication between the client and the server. The method comprises the following specific steps:
s201, creating a Socket communication interface.
In this step, specifically, the server uses a socket function to establish a socket, uses a bind function to bind an IP address and a port, uses a listen function to monitor, and meanwhile, the client uses the socket function to establish the socket and uses a connect function to establish a connection.
S202, obtaining a connection request of the client.
After the communication structure between the server and the client is successfully created, the following step S202 is executed, where the server may receive or send data through the read/write function, and the client may receive or send data through the receive, read and/or write function.
S203, establishing Socket communication connection with the client based on the connection request.
S204, creating a first thread, and simultaneously creating a second thread and/or a third thread, wherein the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
s205, obtaining instruction information of the client, wherein the instruction information further comprises an environment monitoring instruction and/or an alarm monitoring instruction.
And S206, judging whether the state of the network port is normal or not in the first thread.
And S207, if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism.
And S208, in the second thread, sending the environment monitoring instruction to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, sending the alarm monitoring instruction to an alarm monitoring module to generate an alarm monitoring result.
S209, obtaining the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client.
In an alternative embodiment, as shown in fig. 3, the method further includes a step of remotely closing an interactive interface of the client through the Socket communication interface to implement remote control of one or more clients, where the step is:
s210, sending a closing instruction to the client to close the visual operation interface of the client.
S211, closing the Socket communication interface.
In the step, when the interaction is completed, the server releases the Socket by calling a close function, so that the interactive interface of the client is remotely closed, and the communication connection is finished.
In the embodiment, the communication module of the Socket is created by the server and the client to support the communication between the client and the server in the TCP/IP network protocol.
EXAMPLE III
As shown in fig. 4, the present embodiment provides a camera system multithread control apparatus 3, which includes the following modules:
a thread creating module 301, configured to create a first thread, and create a second thread and/or a third thread at the same time, where the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
an obtaining module 302, configured to obtain instruction information of a client, where the instruction information further includes an environment monitoring instruction and/or an alarm monitoring instruction;
a judging module 303, configured to judge, in the first thread, whether a network port state is normal; the module is further configured to: judging whether the communication connection of the network port is normal or not; if the camera is normal, periodically communicating with an environmental parameter control module to inquire the working environmental parameters of the camera; if the camera is normal, trigger detection is periodically executed, and whether the camera is in a trigger state is inquired.
And the mapping module 304 is configured to map the instruction information to the second thread and/or the third thread, respectively, based on a preset message mapping mechanism if the instruction information is normal.
A first sending module 305, configured to send the environment monitoring instruction to an environment monitoring module in a second thread to generate an environment monitoring result, and/or send the alarm monitoring instruction to an alarm monitoring module in a third thread to generate an alarm monitoring result;
in an alternative embodiment, as shown in fig. 5, the module further comprises:
a first sending unit 3051, configured to send, in the second thread, the environment monitoring instruction to the environment monitoring module; and/or sending an alarm monitoring instruction to the alarm monitoring module in the third thread;
a first timing unit 3052, configured to create a first timer in the second thread, where the first timer includes a first timing period; and/or creating a second timer at the third thread, the second timer comprising a second timing period.
A first triggering unit 3053, configured to periodically trigger the environment monitoring module based on a first timing period to obtain one or more environment monitoring results; and/or periodically triggering the alarm monitoring module based on a second timing period to obtain one or more alarm monitoring results.
A second sending unit 3054, configured to send, in the third thread, an alarm monitoring instruction to the alarm monitoring module.
A second timing unit 3055, configured to create a second timer in the third thread, where the second timer includes a second timing period.
The second triggering unit 3056 is configured to trigger the alarm monitoring module periodically based on a second timing period to obtain one or more alarm monitoring results.
And a second sending module 306, configured to obtain the environment monitoring result and/or the alarm monitoring result, and send the environment monitoring result and/or the alarm monitoring result to the client.
In an alternative embodiment, an interface creation module 307 is further included for: creating a Socket communication interface; acquiring a connection request of a client; and establishing Socket communication connection with the client based on the connection request.
Further comprising: and the photographing module 308 is configured to send the working parameter adjusting instruction to the working module in the first thread, so as to adjust the working parameter of the working module and generate a photographed image.
The camera system multithreading control method and system provided by the embodiment of the invention can execute the camera system multithreading control method provided by any embodiment of the invention, and have corresponding execution methods and beneficial effects of functional modules.
Example four
The present embodiment provides a schematic structural diagram of a server, as shown in fig. 6, the server includes a processor 401, a memory 402, an input device 403, and an output device 404; the number of the processors 401 in the server may be one or more, and one processor 401 is taken as an example in the figure; the processor 401, memory 402, input device 403 and output device 404 in the device/terminal/server may be linked by a bus or other means, as exemplified by the linking via a bus in fig. 6.
The memory 402, which is a computer-readable storage medium, may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules (e.g., the first obtaining module 301, the policy determining module 302, etc.) corresponding to the camera system multithreading control method in the embodiments of the present invention. The processor 401 executes various functional applications of the device/terminal/server and data processing by running software programs, instructions and modules stored in the memory 402, that is, implements the camera system multithread control method described above.
The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 402 may further include memory located remotely from the processor 401, which may be linked to the device/terminal/server through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 403 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the device/terminal/server. The output device 404 may include a display device such as a display screen.
The embodiment of the invention also provides a server which can execute the camera system multithreading control method provided by any embodiment of the invention and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a camera system multithread control method according to any embodiment of the present invention:
a multithread control method of a camera system, which is executed by a server side, wherein the camera system comprises an environment monitoring module and/or an alarm monitoring module, and is characterized by comprising the following steps:
creating a first thread, and simultaneously creating a second thread and/or a third thread, wherein the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
acquiring instruction information of a client, wherein the instruction information also comprises an environment monitoring instruction and/or an alarm monitoring instruction;
judging whether the state of the network port is normal or not in the first thread;
if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism;
in the second thread, the environment monitoring instruction is sent to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, the alarm monitoring instruction is sent to an alarm monitoring module to generate an alarm monitoring result;
and acquiring the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client.
The computer-readable storage media of embodiments of the invention may take 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 link 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 storage medium may be transmitted over 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, as well as 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 terminal. In the case of a remote computer, the remote computer may be linked to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the link 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.

Claims (10)

1. A camera system multithread control method, wherein a server executes the multithread control, and the camera system includes an environment monitoring module and/or an alarm monitoring module, and the camera system multithread control method includes:
creating a first thread, and simultaneously creating a second thread and/or a third thread, wherein the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
acquiring instruction information of a client, wherein the instruction information also comprises an environment monitoring instruction and/or an alarm monitoring instruction;
judging whether the state of the network port is normal or not in the first thread; if the instruction information is normal, respectively mapping the instruction information to the second thread and/or the third thread based on a preset message mapping mechanism;
in the second thread, the environment monitoring instruction is sent to an environment monitoring module to generate an environment monitoring result, and/or in the third thread, the alarm monitoring instruction is sent to an alarm monitoring module to generate an alarm monitoring result;
acquiring the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to a client;
the first thread is also used for responding to, controlling and adjusting the working parameters of the camera.
2. The multithread control method for the camera system according to claim 1, wherein the determining whether the portal status is normal in the first thread includes:
judging whether the communication connection of the network port is normal or not;
if the camera is normal, periodically communicating with an environmental parameter control module to inquire the working environmental parameters of the camera;
if the camera is normal, trigger detection is periodically executed, and whether the camera is in a trigger state is inquired.
3. The multithread control method for the camera system according to claim 1, wherein the sending, in the second thread, the environment monitoring instruction to the environment monitoring module to generate the environment monitoring result includes:
sending the environment monitoring instruction to the environment monitoring module in the second thread;
creating a first timer at the second thread, the first timer comprising a first timing period;
and periodically triggering the environment monitoring module based on a first timing period to obtain one or more environment monitoring results.
4. The multithread control method of claim 1, wherein the sending, in the third thread, the alarm monitoring instruction to an alarm monitoring module to generate an alarm monitoring result comprises:
sending an alarm monitoring instruction to the alarm monitoring module in the third thread;
creating a second timer at the third thread, the second timer comprising a second timing period;
and periodically triggering the alarm monitoring module based on a second timing period to obtain one or more alarm monitoring results.
5. The multithread control method for a camera system according to claim 1, further comprising, before the creating the first thread and the creating the second thread and/or the third thread,:
creating a Socket communication interface;
acquiring a connection request of a client;
and establishing Socket communication connection with the client based on the connection request.
6. The multithread control method of a camera system according to claim 1, wherein the camera system further includes a work module, the instruction information further includes a work parameter adjustment instruction, and when the first thread determines whether the portal status is normal, the method further includes:
and in the first thread, sending the working parameter adjusting instruction to the working module so as to adjust the working parameters of the working module and generate a photographed image.
7. A camera system multithread control device, which is executed by a server side, comprises an environment monitoring module and/or an alarm monitoring module, and is characterized by comprising:
the system comprises a thread creating module, a thread setting module and a thread selecting module, wherein the thread creating module is used for creating a first thread and simultaneously creating a second thread and/or a third thread, the first thread is a gateway control thread, the second thread is an environment monitoring thread, and the third thread is an alarm monitoring thread;
the acquisition module is used for acquiring instruction information of the client, and the instruction information further comprises an environment monitoring instruction and/or an alarm monitoring instruction;
the judging module is used for judging whether the state of the network port is normal or not in the first thread;
the mapping module is used for mapping the instruction information to the second thread and/or the third thread respectively based on a preset message mapping mechanism if the instruction information is normal;
the first sending module is used for sending the environment monitoring instruction to the environment monitoring module in the second thread to generate an environment monitoring result, and/or sending the alarm monitoring instruction to the alarm monitoring module in the third thread to generate an alarm monitoring result;
the second sending module is used for obtaining the environment monitoring result and/or the alarm monitoring result and sending the environment monitoring result and/or the alarm monitoring result to the client;
the first thread is also used for responding to, controlling and adjusting the working parameters of the camera.
8. The camera system multi-thread control device of claim 7, wherein the first transmitting module further comprises:
the first sending unit is used for sending the environment monitoring instruction to the environment monitoring module in the second thread;
a first timing unit to create a first timer at the second thread, the first timer comprising a first timing period;
the first triggering unit is used for periodically triggering the environment monitoring module based on a first timing period so as to obtain one or more environment monitoring results.
9. A server comprising a memory, a processor and a program stored on the memory and executable on the processor, wherein the processor implements a camera system multithreading method as recited in any one of claims 1 to 6 when executing the program.
10. A terminal readable storage medium on which a program is stored, the program being capable of implementing a camera system multithread control method according to any one of claims 1 to 6 when executed by a processor.
CN202011004706.7A 2020-09-22 2020-09-22 Camera system multithread control method, device, server and storage medium Active CN112188090B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011004706.7A CN112188090B (en) 2020-09-22 2020-09-22 Camera system multithread control method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011004706.7A CN112188090B (en) 2020-09-22 2020-09-22 Camera system multithread control method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN112188090A CN112188090A (en) 2021-01-05
CN112188090B true CN112188090B (en) 2022-05-31

Family

ID=73955901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011004706.7A Active CN112188090B (en) 2020-09-22 2020-09-22 Camera system multithread control method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112188090B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010281B (en) * 2021-02-24 2024-04-02 厦门树冠科技有限公司 Thread processing method and device of multi-camera detection system, storage medium and terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067690A (en) * 2012-11-14 2013-04-24 广东中钰科技有限公司 Method and device of equalized audio-video data transmission based on intelligent monitoring platform
CN104065626A (en) * 2013-03-21 2014-09-24 杭州海康威视数字技术股份有限公司 Method for updating logging-on state of network camera and device thereof
CN111651320A (en) * 2020-05-20 2020-09-11 北京中交兴路信息科技有限公司 High-concurrency connection method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101505519B1 (en) * 2007-10-16 2015-03-25 삼성전자 주식회사 Apparatus and method for providing contents

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067690A (en) * 2012-11-14 2013-04-24 广东中钰科技有限公司 Method and device of equalized audio-video data transmission based on intelligent monitoring platform
CN104065626A (en) * 2013-03-21 2014-09-24 杭州海康威视数字技术股份有限公司 Method for updating logging-on state of network camera and device thereof
CN111651320A (en) * 2020-05-20 2020-09-11 北京中交兴路信息科技有限公司 High-concurrency connection method and system

Also Published As

Publication number Publication date
CN112188090A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
US20140277597A1 (en) System and method for managing industrial processes
US20190051147A1 (en) Remote control method, apparatus, terminal device, and computer readable storage medium
KR101727249B1 (en) Method, device, program and recording medium for testing terminal
KR20170015622A (en) User terminal apparatus and control method thereof
US20140192192A1 (en) Systems and methods for managing video data
WO2019057089A1 (en) Network card image packet capture method, terminal, and readable storage medium
CN112188090B (en) Camera system multithread control method, device, server and storage medium
KR20160030464A (en) Method and device for acquiring multimedia data stream
KR101719599B1 (en) Method, apparatus, program and recording medium for accessing network
WO2023125269A1 (en) Internet-of-things device control method, apparatus, and system
CN112671897B (en) Access method, device, storage medium, equipment and product of distributed system
CN213938119U (en) Camera remote control system
CN111010314A (en) Communication test method and device for terminal equipment, routing equipment and storage medium
US11080107B2 (en) Event notification method, server device, event notification apparatus, and medium
CN114553725B (en) Machine room monitoring alarm method and device, electronic equipment and storage medium
US10091635B2 (en) Method and apparatus for communication using IP address exchanged via NFC
CN105898596B (en) Direct broadcasting room display control method and device
JP6392373B2 (en) Method, apparatus, system, program and recording medium for accessing a plurality of servers of smart home appliance
CN112653915A (en) Television-based sensing enabling method and device, television and storage medium
CN112492034B (en) Information interaction method and device based on server
CN102281584A (en) Method and system for implementing capability of Internet of things
Wang et al. Design and Realization of Smart Home Security System Based on AWS
CN112911594A (en) Intelligent equipment configuration networking method and device
Wang et al. Design and implementation of remote control system between Android platform
CN105337778A (en) Internet of Things event-driven service management system

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