Network switching method and device, electronic equipment and storage medium
By receiving the network switching request of the camera device, filtering and switching to a network with better performance, the problem of low automation of network switching of the camera device in the existing technology is solved, and a more stable and automatic network switching is achieved.
Patent Information
- Application Number
- CN202410852511.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-17
AI Technical Summary
Existing network-based camera equipment requires manual network switching when the network is poor. The degree of automation is low, resulting in untimely and unstable network switching.
By receiving the network switching request of the target camera, the selected camera is selected from the camera cluster based on the target address information and network speed test data, and a switching instruction is generated based on the network connection information of the selected camera to automatically switch the network.
It improves the automation of network switching of camera equipment, reduces manual intervention, and ensures the stability and timeliness of image transmission.
Smart Images

Figure CN118660002A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network switching method and device, an electronic device, and a storage medium. Background Art
[0002] A network-based camera device is a device that can upload real-time images captured by the camera to a server via the network. In camera devices, multiple optional networks are usually configured. When one of the networks of the camera device is not good, the staff needs to switch the network to ensure that the captured images can be sent out completely. However, this method requires staff to be on duty and has a low degree of automation. Therefore, how to improve the degree of automation of network switching of camera devices has become an urgent problem to be solved. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide a network switching method and device, an electronic device and a storage medium, aiming to improve the automation level of network switching of camera devices.
[0004] To achieve the above object, a first aspect of an embodiment of the present application proposes a network switching method, which is applied to a server. The method includes:
[0005] Receive a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and the network switching request includes: the target address information of the target camera and the target network speed test data;
[0006] Filtering a selected camera from a camera cluster based on the target address information and the target network speed test data;
[0007] Obtaining network connection information of the selected camera;
[0008] A network switching instruction is generated according to the network connection information, and the network of the target camera is switched according to the network switching instruction.
[0009] In some embodiments, the step of selecting a selected camera from a camera cluster based on the target address information and the target network speed test data includes:
[0010] Acquire address information of each camera in the camera cluster to obtain candidate address information;
[0011] Screening the camera cluster based on the target address information and the candidate address information to obtain candidate cameras;
[0012] The selected camera is screened out from the candidate cameras based on the target network speed test data.
[0013] In some embodiments, the step of selecting the selected camera from the candidate cameras based on the target network speed test data includes:
[0014] Obtaining candidate network speed test data of the candidate camera;
[0015] The candidate camera whose candidate network speed test data is greater than the target network speed test data is used as the selected camera.
[0016] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a network switching method, which is applied to a target camera. The method includes:
[0017] Obtain target network speed test data; wherein the target network speed test data represents the network speed of the target camera;
[0018] If the target network speed test data is lower than a preset network speed threshold, a network switching request is generated according to the target network speed test data and the target address information of the target camera;
[0019] Sending the network switching request to the server, and receiving the network switching instruction returned by the server; wherein the network switching instruction is generated by the server by selecting a selected camera from the camera cluster based on the target address information and the target network speed test data, and according to the network connection information of the selected camera;
[0020] The network switching is performed according to the network switching instruction.
[0021] In some embodiments, obtaining target network speed test data includes:
[0022] Acquire target delay data; wherein the target delay data represents the delay of the target camera;
[0023] If the target delay data is greater than a preset delay threshold, a network speed test is performed through the server and a preset network data packet to obtain the target network speed test data.
[0024] In some embodiments, performing a network speed test through the server and a preset network data packet to obtain the target network speed test data includes:
[0025] Uploading the network data packet to the server and obtaining the uploading time of the network data packet;
[0026] The data volume of the network data packet is obtained, and the target network speed test data is obtained by performing aggregation calculation based on the data volume and the upload time.
[0027] In some embodiments, performing network switching according to the network switching instruction includes:
[0028] Obtaining target network information of the network switching instruction;
[0029] The network is switched according to the target network information.
[0030] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a network switching device, which is applied to a server, and the device includes:
[0031] A receiving module, configured to receive a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and the network switching request includes: target address information of the target camera and target network speed test data;
[0032] A screening module, screening selected cameras from a camera cluster based on the target address information and the target network speed test data;
[0033] An acquisition module, used to acquire the network connection information of the selected camera;
[0034] A generating module is used to generate a network switching instruction according to the network connection information, and perform network switching on the target camera according to the network switching instruction.
[0035] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented, or when the processor executes the computer program, the method described in the second aspect is implemented.
[0036] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect above, or when the computer program is executed by a processor, it implements the method described in the second aspect above.
[0037] The present application proposes a network switching method and device, an electronic device and a storage medium, which receive a network switching request generated when the target network speed test data of a target camera is lower than a preset network speed threshold, and screen out a selected camera from a camera cluster based on the target address information and the target network speed test data included in the network switching request, thereby obtaining a selected camera with a similar address to the target camera; further, a network switching instruction is generated according to the network connection information of the selected camera, and the network of the target camera is switched according to the network switching instruction, so that the network of the target camera is automatically switched to the network of the selected camera, without the need for manual switching of the network of the target camera, thereby improving the automation level of network switching of the camera device. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flow chart of a network switching method provided in an embodiment of the present application;
[0039] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0040] Figure 3 yes Figure 2 Flow chart of step S203 in FIG.
[0041] Figure 4 is a flow chart of a network switching method provided by another embodiment of the present application;
[0042] Figure 5 yes Figure 4 Flow chart of step S401 in FIG.
[0043] Figure 6 yes Figure 5 Flow chart of step S502 in FIG.
[0044] Figure 7 yes Figure 4 Flow chart of step S404 in FIG.
[0045] Figure 8 is a schematic diagram of the structure of a network switching device provided in an embodiment of the present application;
[0046] Fig. 9 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0047] Fig.10 is a schematic diagram of the interaction between the target camera and the server provided in an embodiment of the present application;
[0048] Fig.11 is a schematic diagram of interaction between a target camera and a server provided in another embodiment of the present application;
[0049] Fig.12 This is a schematic diagram of reconnecting a target camera after it is disconnected provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] First, some nouns involved in this application are analyzed:
[0054] Camera Cluster (CC): refers to a system composed of multiple camera devices that work together to cover a specific area or achieve a specific function. Camera clusters are widely used in monitoring, security, traffic management, smart home and other fields. Through the collaboration of multiple cameras, wider coverage, higher resolution and more complex functions can be achieved.
[0055] A network-based camera device is a device that can upload real-time images captured by the camera to a server via the network. In camera devices, multiple optional networks are usually configured. When one of the networks of the camera device is not good, the staff needs to switch the network to ensure that the captured images can be sent out completely. However, this method requires staff to be on duty and has a low degree of automation. Therefore, how to improve the degree of automation of network switching of camera devices has become an urgent problem to be solved.
[0056] Based on this, the embodiments of the present application provide a network switching method and device, an electronic device and a storage medium, aiming to improve the degree of automation of network switching of camera devices.
[0057] A network switching method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the network switching method in the embodiments of the present application is described.
[0058] The network switching method provided in the embodiment of the present application relates to the field of communication technology. The network switching method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the network switching method, etc., but is not limited to the above forms.
[0059] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0060] Figure 1 is an optional flow chart of the network switching method provided in the embodiment of the present application, which is applied to the server. Figure 1 The method may include but is not limited to steps S101 to S104.
[0061] Step S101, receiving a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and the network switching request includes: target address information of the target camera and target network speed test data;
[0062] Step S102, selecting a selected camera from the camera cluster based on the target address information and the target network speed test data;
[0063] Step S103, obtaining the network connection information of the selected camera;
[0064] Step S104, generating a network switching instruction according to the network connection information, and performing network switching on the target camera according to the network switching instruction.
[0065] Steps S101 to S104 shown in the embodiment of the present application receive a network switching request generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and select a selected camera from the camera cluster based on the target address information and the target network speed test data included in the network switching request, thereby obtaining a selected camera with a close address to the target camera; further, a network switching instruction is generated according to the network connection information of the selected camera, and the network of the target camera is switched according to the network switching instruction, so that the network of the target camera is automatically switched to the network of the selected camera, without the need to manually switch the network of the target camera, thereby improving the degree of automation of network switching of the camera device.
[0066] In step S101 of some embodiments, the network switching request is a network request that can be sent via a wired network or a wireless network. The network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold. The target camera is a camera in the camera cluster. When the target camera detects that its own network performance is poor, that is, when the target network speed test data is lower than the preset network speed threshold, the target address information and the target network speed test data are packaged to generate a network switching request and sent to the server.
[0067] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S203:
[0068] Step S201, obtaining the address information of each camera in the camera cluster to obtain candidate address information;
[0069] Step S202, screening the camera cluster based on the target address information and the candidate address information to obtain candidate cameras;
[0070] Step S203: Screening out a selected camera from candidate cameras based on the target network speed test data.
[0071] In steps S201 to S203 shown in the embodiment of the present application, the address information of each camera in the camera cluster is obtained to obtain the candidate address information, and the camera cluster is screened based on the target address information and the candidate address information to obtain the candidate cameras at the same address as the target camera. Finally, the candidate cameras are screened based on the target network speed test data to obtain the selected camera whose network performance is better than the target camera.
[0072] In step S201 of some embodiments, the camera cluster is a cluster composed of multiple cameras and servers, and the multiple cameras respectively establish communication with the servers, and the cameras will upload their own network speed data and real-time image data to the servers in real time. It should be noted that the number of servers can be multiple or one, and this application does not make specific restrictions. The candidate address information is the address of all cameras in the camera cluster except the address of the target camera. The acquisition method can be server push address request, camera active push and address pre-registration, and this application does not make specific restrictions.
[0073] In step S202 of some embodiments, the camera cluster is screened based on the target address information and the candidate address information. The screening method is to use the target address information as a benchmark, obtain the candidate address information within the range according to a preset address range threshold, and obtain the corresponding camera based on the candidate address information within the preset address range threshold, so as to obtain the candidate camera.
[0074] See also Figure 3 In some embodiments, step S203 may include but is not limited to steps S301 to S302:
[0075] Step S301, obtaining candidate network speed test data of candidate cameras;
[0076] Step S302: select the candidate camera whose candidate network speed test data is greater than the target network speed test data as the selected camera.
[0077] In steps S301 to S302 shown in the embodiment of the present application, candidate network speed test data of candidate cameras are obtained, and candidate cameras whose network speed test data are greater than target network speed test data are selected as selected cameras, thereby obtaining a selected camera with better network performance than the target camera.
[0078] In step S301 of some embodiments, the candidate network speed test data is the network speed of the candidate camera, and the candidate network speed test information is obtained by performing a network speed test on the candidate camera according to the server to obtain the candidate network speed test data.
[0079] In step S302 of some embodiments, the candidate network speed test data is compared with the target network speed test data, and a camera whose network speed test data is greater than the target network speed test data is selected as the selected camera.
[0080] In step S103 of some embodiments, the network connection information is the network to which the selected camera is connected, which may be a wired network or a wireless network, wherein the wireless network may be a Wi-Fi network or a carrier network.
[0081] In one embodiment, the network to which the selected camera is connected is an operator network, and the network connection information is information of a target operator connected to the selected camera.
[0082] In step S104 of some embodiments, the network switching instruction is a network request for performing network switching on the target camera. The network switching instruction includes target network information. The target camera is switched to the target network through the target connection information in the network switching instruction, thereby realizing automatic network switching of the target camera and switching the target camera to a target network with better network performance, thereby improving the network transmission capacity of the target camera.
[0083] Figure 4 is an optional flow chart of a network switching method provided by another embodiment of the present application, which is applied to a target camera. Figure 4 The method may include but is not limited to steps S401 to S404.
[0084] Step S401, obtaining target network speed test data; wherein the target network speed test data represents the network speed of the target camera;
[0085] Step S402, if the target network speed test data is lower than the preset network speed threshold, a network switching request is generated according to the target network speed test data and the target address information of the target camera;
[0086] Step S403, sending a network switching request to the server, and receiving a network switching instruction returned by the server; wherein the network switching instruction is generated by the server based on the target address information and the target network speed test data to select a selected camera from the camera cluster, and according to the network connection information of the selected camera;
[0087] Step S404: Perform network switching according to the network switching instruction.
[0088] In steps S401 to S404 shown in the embodiment of the present application, by obtaining target network speed test data, when the target network speed test data is lower than a preset network speed threshold, a network switching request is generated according to the target network speed test data and the target address information of the target camera, and then the network switching request is sent to the server, and the network switching instruction returned by the server is received, and finally the network switching is performed according to the network switching instruction, thereby realizing automatic network switching when the target camera network is poor, thereby improving the degree of automation of switching the target camera network.
[0089] See also Figure 5 In some embodiments, step S401 includes but is not limited to steps S501 to S502:
[0090] Step S501, obtaining target delay data; wherein the target delay data represents the delay of the target camera;
[0091] Step S502, if the target delay data is greater than a preset delay threshold, a network speed test is performed through a server and a preset network data packet to obtain target network speed test data.
[0092] Steps S501 to S502 shown in the embodiment of the present application obtain target delay data. When the target delay data is greater than a preset delay threshold, a network speed test is performed through a server and a preset network data packet to obtain target network speed test data, thereby accurately determining the network transmission performance of the target camera and accurately obtaining the target network speed test data.
[0093] In step S501 of some embodiments, the target delay data is the network delay data of the target camera, and is obtained by the target camera initiating a delay test request to the server to obtain the target delay data.
[0094] In one embodiment, the target camera initiates a network bandwidth test on the server to obtain the network transmission performance between the target camera and the server. Further, the shooting bit rate of the target camera is obtained, and the network transmission performance and the shooting bit rate are compared. When the network transmission performance is less than the shooting bit rate, transmission delay occurs, and the difference between the network transmission performance and the shooting bit rate is obtained to obtain the target delay data.
[0095] In one embodiment, the target camera initiates a network loan test on the server to obtain the network transmission performance between the target camera and the server. Further, according to the preset transmission performance threshold and the network transmission performance, when the transmission performance threshold is greater than the network transmission performance, the difference between the transmission performance threshold and the network transmission performance is obtained, thereby obtaining the target delay data.
[0096] See also Figure 6 In some embodiments, step S502 includes but is not limited to steps S601 to S602:
[0097] Step S601, uploading the network data packet to the server and obtaining the uploading time of the network data packet;
[0098] Step S602, obtaining the data volume of the network data packet, and performing aggregation calculation based on the data volume and upload time to obtain target network speed test data.
[0099] Steps S601 to S602 shown in the embodiment of the present application upload a network data packet to a server, obtain the upload time of the network data packet, and then perform aggregation calculation based on the data volume and upload time of the network data packet to obtain the target network speed test data, thereby calculating the average network transmission performance of the target camera within the upload time, and accurately obtaining the target network speed test data of the target camera.
[0100] In step S601 of some embodiments, the network data packet is a binary file, and the specific format of the network data packet is not limited. The network data packet is uploaded to the server, and the time consumed by the network server to upload to the server is recorded to obtain the upload time.
[0101] In step S602 of some embodiments, the data volume of the network data packet is the total number of bytes occupied by the network data packet during the transmission process. The target network speed test data is obtained by performing an aggregate calculation based on the data volume and the upload time. The aggregate calculation is shown in formula (1):
[0102]
[0103] Among them, V is the target network speed test data, MB is the data volume of the network data packet, and T is the upload time.
[0104] In step S402 of some embodiments, the preset network speed threshold is the average video bit rate of the target camera within a preset time period before the network switching request is generated. When the target network speed test data is lower than the preset network speed threshold, it indicates that the network speed transmission performance of the target camera has been unable to support the network transmission demand for a period of time and the network needs to be switched. Then, a network switching request is generated according to the target network speed test data and the target address information of the target camera. The network switching request is a network request, which includes the target network speed test data and the target address information of the target camera.
[0105] In step S403 of some embodiments, the network switching request is a network request including the target network speed test data and target address information of the target camera, which is sent by the target camera to the server. After obtaining the network switching request, the server filters out the selected cameras with the same address as the target camera according to the target address information, obtains the network with the best network performance among the selected cameras, and generates a network switching request based on the best network and returns it to the target camera, thereby automatically switching the target camera to the network with the best network performance, improving the automation level of the target camera's network switching, and improving the network transmission performance of the target camera.
[0106] See also Figure 7 In some embodiments, step S404 may include but is not limited to steps S701 to S702:
[0107] Step S701, obtaining target network information of a network switching instruction;
[0108] Step S702: Perform network switching according to target network information.
[0109] In steps S701 to S702 shown in the embodiment of the present application, the target network information of the network switching instruction is obtained, and the network switching is performed according to the target network information, so that the target camera is automatically switched to the target network with better network transmission performance.
[0110] In step S701 of some embodiments, the network switching instruction is a return result of the server in response to the network switching request of the target camera, including target network information. The target network information is the network with the best network performance in the address where the target camera is located. The network switching instruction is used to make the target camera connect to the target network according to the target network information.
[0111] In step S702 of some embodiments, the network switch is for the target camera to disconnect the historical connection network and connect to the target network according to the target network information, so that the target camera automatically switches to the target network with better network transmission performance.
[0112] See also Fig.10 , the target camera detects the network speed regularly and obtains the target delay data. When the target delay data is greater than the preset delay threshold, the network speed test is performed through the server and the preset network data packet to obtain the target network speed test data, and then the average video bit rate of the target camera in the previous hour is calculated to obtain the preset network speed threshold. When the target network speed test data is greater than the preset network speed threshold, a network switching request is generated according to the target network speed test data and the target address information, and the network switching request is sent to the server. The server receives the network switching request, which includes the target address information and the target test data, and then selects the candidate cameras from the camera cluster based on the target address information, and selects the selected camera with the best network performance from the candidate cameras to select the network connection information of the camera and generate a network switching instruction according to the network connection information, and finally sends the network switching instruction to the target camera to make the target camera perform network switching. The target camera receives the network switching instruction and switches the network according to the network switching instruction, thereby realizing automatic network switching of the target camera, thereby improving the automation of network switching of the camera device.
[0113] See also Fig.11The condition for the target camera to generate a network switching request can also be that the target camera records the signal strength every minute to obtain the current signal strength. When the current signal strength is lower than the standard signal strength, a network switching request is generated according to the target network speed test data and the target address information. The server receives the network switching request, which includes the target address information and the target test data. Then, based on the target address information, the server selects candidate cameras from the camera cluster, and selects the camera with the best network performance from the candidate cameras to select the network connection information of the camera and generate a network switching instruction according to the network connection information. Finally, the server sends the network switching instruction to the target camera to switch the network. The target camera receives the network switching instruction and switches the network according to the network switching instruction, thereby automatically switching the network of the target camera and improving the degree of automation of the network switching of the camera device.
[0114] See also Fig.12 ,When the target camera fails in sending the network switching request to the server, the ,disconnection information is sent to the cameras near the target camera in the form of ,sonar, and the disconnection information is sent to the server through the ,nearby cameras, thus avoiding the complete inability to connect to the server in the ,disconnection situation, thereby improving the reliability of the network connection of the target ,camera.
[0115] See also Figure 8 The embodiment of the present application further provides a network switching device, which is applied to a server and can implement the above network switching method. The device includes:
[0116] The receiving module 801 is used to receive a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than the preset network speed threshold, and the network switching request includes: target address information of the target camera and target network speed test data;
[0117] A screening module 802, screening selected cameras from the camera cluster based on target address information and target network speed test data;
[0118] The acquisition module 803 is used to acquire the network connection information of the selected camera;
[0119] The generating module 804 is used to generate a network switching instruction according to the network connection information, and perform network switching on the target camera according to the network switching instruction.
[0120] The specific implementation of the network switching device is basically the same as the specific implementation of the above-mentioned network switching method, and will not be repeated here.
[0121] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above network switching method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0122] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0123] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0124] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the network switching method of the embodiment of the present application;
[0125] Input / output interface 903, used to implement information input and output;
[0126] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0127] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0128] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0129] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned network switching method is implemented.
[0130] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] The network switching method, network switching device, electronic device and storage medium provided by the embodiments of the present application receive a network switching request generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and screen out a selected camera from a camera cluster based on the target address information and the target network speed test data included in the network switching request, thereby obtaining a selected camera with a close address to the target camera; further, a network switching instruction is generated according to the network connection information of the selected camera, and the network of the target camera is switched according to the network switching instruction, so that the network of the target camera is automatically switched to the network of the selected camera, without the need to manually switch the network of the target camera, thereby improving the automation level of network switching of the camera device.
[0132] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0133] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0134] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0136] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0137] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0142] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A network switching method, It is characterized in that Applied to a server, the method comprises: Receive a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and the network switching request includes: the target address information of the target camera and the target network speed test data; Filtering a selected camera from a camera cluster based on the target address information and the target network speed test data; Obtaining network connection information of the selected camera; A network switching instruction is generated according to the network connection information, and the network of the target camera is switched according to the network switching instruction.
2. The method according to claim 1, It is characterized in that The selecting a selected camera from the camera cluster based on the target address information and the target network speed test data includes: Acquire address information of each camera in the camera cluster to obtain candidate address information; Screening the camera cluster based on the target address information and the candidate address information to obtain candidate cameras; The selected camera is screened out from the candidate cameras based on the target network speed test data.
3. The method according to claim 2, It is characterized in that The step of selecting the selected camera from the candidate cameras based on the target network speed test data includes: Obtaining candidate network speed test data of the candidate camera; The candidate camera whose candidate network speed test data is greater than the target network speed test data is used as the selected camera.
4. A network switching method, It is characterized in that Applied to a target camera, the method comprises: Obtain target network speed test data; wherein the target network speed test data represents the network speed of the target camera; If the target network speed test data is lower than a preset network speed threshold, a network switching request is generated according to the target network speed test data and the target address information of the target camera; Sending the network switching request to the server, and receiving the network switching instruction returned by the server; wherein the network switching instruction is generated by the server by selecting a selected camera from the camera cluster based on the target address information and the target network speed test data, and according to the network connection information of the selected camera; The network switching is performed according to the network switching instruction.
5. The method according to claim 4, It is characterized in that The obtaining of target network speed test data includes: Acquire target delay data; wherein the target delay data represents the delay of the target camera; If the target delay data is greater than a preset delay threshold, a network speed test is performed through the server and a preset network data packet to obtain the target network speed test data.
6. The method according to claim 5, It is characterized in that The network speed test is performed through the server and a preset network data packet to obtain the target network speed test data, including: Uploading the network data packet to the server and obtaining the uploading time of the network data packet; The data volume of the network data packet is obtained, and the target network speed test data is obtained by performing aggregation calculation based on the data volume and the upload time.
7. The method according to claim 4, It is characterized in that The performing network switching according to the network switching instruction includes: Obtaining target network information of the network switching instruction; The network is switched according to the target network information.
8. A network switching device, It is characterized in that Applied to a server, the device comprises: A receiving module, configured to receive a network switching request; wherein the network switching request is generated when the target network speed test data of the target camera is lower than a preset network speed threshold, and the network switching request includes: target address information of the target camera and target network speed test data; A screening module, screening selected cameras from a camera cluster based on the target address information and the target network speed test data; An acquisition module, used to acquire the network connection information of the selected camera; A generating module is used to generate a network switching instruction according to the network connection information, and perform network switching on the target camera according to the network switching instruction.
9. An electronic device, It is characterized in that The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the network switching method described in any one of claims 1 to 3 is implemented, or when the processor executes the computer program, the network switching method described in any one of claims 4 to 7 is implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the network switching method described in any one of claims 1 to 3 is implemented, or when the computer program is executed by a processor, the network switching method described in any one of claims 4 to 7 is implemented.
