Device configuration method
Patent Information
- Application Number
- CN202510058685.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2041-09-18
AI Technical Summary
[0004]然而,传统IPC配置方案中,当IPC由于版本升级等原因增加了新的功能时,NVR端需要进行配套升级,需要消耗较多资源实现新增功能的配置
[0016]本申请实施例的设备配置方法,通过在视频控制设备中运行嵌入式浏览器,并通过嵌入式浏览器访问待配置设备的Web页面,对待配置设备进行配置操作,提高了视频控制设备对不同版本的设备的适配性,节约了视频控制设备为适配不同版本的设备的开发成本。
Smart Images

Figure CN119987875B_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese application No. 202111101113.7, filed on September 18, 2021, entitled "Equipment Configuration Method, Apparatus, Electronic Device and Machine-Readable Storage Medium". Technical Field
[0002] This application relates to the field of security technology, and in particular to a device configuration method. Background Technology
[0003] In recent years, network cameras (Internet Protocol Cameras, or IPCs) have supported increasingly richer functions. Network video recorders (NVRs), as the integrated control center of IPCs, require the NVR to configure the IPCs.
[0004] However, in traditional IPC configuration schemes, when the IPC adds new functions due to version upgrades or other reasons, the NVR needs to be upgraded accordingly, which requires a lot of resources to configure the new functions. Summary of the Invention
[0005] In view of the above, this application provides a device configuration method, apparatus, electronic device, and machine-readable storage medium.
[0006] According to a first aspect of the embodiments of this application, a device configuration method is provided, applied to a video control device, including:
[0007] When a first control command is detected, the embedded browser is run; wherein, the first control command is used to control the video control device to enter browser mode;
[0008] The embedded browser accesses the web page of the device to be configured and performs configuration operations on the device, which is a device equipped with web services.
[0009] According to a second aspect of the embodiments of this application, a device configuration apparatus is provided, applied to a video control device, comprising:
[0010] The detection unit is used to detect control commands;
[0011] The running unit is configured to run an embedded browser when the detection unit detects a first control instruction; wherein the first control instruction is configured to control the video control device to enter browser mode.
[0012] The configuration unit is used to access the Web page of the device to be configured through the embedded browser and perform configuration operations on the device to be configured, wherein the device to be configured is a device equipped with Web services.
[0013] According to a third aspect of the present application, an electronic device is provided, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being configured to execute the machine-executable instructions to implement the method provided in the first aspect.
[0014] According to a fourth aspect of the embodiments of this application, a machine-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the method provided in the first aspect.
[0015] According to a fifth aspect of the embodiments of this application, a computer program is provided, which is stored in a machine-readable storage medium, and when a processor executes the computer program, causes the processor to perform the method provided in the first aspect.
[0016] The device configuration method of this application improves the compatibility of the video control device with different versions of the device by running an embedded browser in the video control device and accessing the web page of the device to be configured through the embedded browser to perform configuration operations on the device to be configured, thereby saving the development cost of the video control device to adapt to different versions of the device. Attached Figure Description
[0017] Figure 1 This is a schematic flowchart of a device configuration method provided in an embodiment of this application;
[0018] Figure 2 This is a schematic diagram of a module of an overall device configuration architecture provided in an embodiment of this application;
[0019] Figure 3 This is a schematic diagram of an NVR architecture provided in an embodiment of this application;
[0020] Figure 4 This is a schematic diagram of a webpage rendering process provided in an embodiment of this application;
[0021] Figure 5 This is a schematic diagram of a process for configuring an IPC provided in an embodiment of this application;
[0022] Figure 6 This is a schematic diagram of a mutual exclusion design for a decoding process provided in an embodiment of this application;
[0023] Figure 7This is a schematic diagram illustrating an expanded access to IPC via an external search list, as provided in an embodiment of this application.
[0024] Figure 8A This is a schematic diagram of an intelligent event arming configuration interface provided in an embodiment of this application;
[0025] Figure 8B This is a schematic diagram of an event type configuration interface provided in an embodiment of this application;
[0026] Figure 8C This is a schematic diagram of an intelligent event arming configuration interface provided in an embodiment of this application;
[0027] Figure 8D This is a schematic diagram of a deployment area configuration interface provided in an embodiment of this application;
[0028] Figure 9 This is a schematic diagram of the structure of a device configuration apparatus provided in an embodiment of this application;
[0029] Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0031] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0032] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0033] Please see Figure 1 This is a flowchart illustrating a device configuration method provided in an embodiment of this application. This device configuration method can be applied to video control devices, such as... Figure 1 As shown, the device configuration method may include:
[0034] Step S100: When the first control command is detected, the embedded browser is run; wherein, the first control command is used to control the video control device to enter browser mode.
[0035] In this embodiment of the application, in order to improve the adaptability of the video control device to different devices (such as IPCs), the video control device can access the device through an embedded browser and configure the device through the embedded browser.
[0036] It should be noted that, unless otherwise specified, the devices mentioned in this application embodiment refer to devices equipped with Web services.
[0037] In this embodiment of the application, when the video control device detects a control instruction (referred to herein as the first control instruction) for controlling the device to enter browser mode, the video control device can run an embedded browser.
[0038] Step S110: Access the web page of the device to be configured through an embedded browser and perform configuration operations on the device.
[0039] In this embodiment of the application, the video control device can access the device to be configured (such as an IPC) through an embedded browser and perform configuration operations on the device to be configured.
[0040] For example, the configuration operation may include, but is not limited to, one or more of the following configurations: network parameters, image and audio / video stream parameters, intelligent event arming, and storage management.
[0041] For example, network parameter configuration may include, but is not limited to, IP address, gateway, and other configurations.
[0042] Image and audio / video stream parameters can include, but are not limited to, resolution, bitrate, and other configurations.
[0043] The configuration of intelligent event arming can include, but is not limited to, event type (such as motion detection, occlusion alarm, etc.), arming area, arming time, and linkage method.
[0044] Storage management configuration includes, but is not limited to, configurations for storage partitioning, storage space allocation, and reclamation.
[0045] It can be seen that, in Figure 1 In this method, an embedded browser is run in the video control device, and the web page of the device to be configured is accessed through the embedded browser to perform configuration operations on the device. This improves the compatibility of the video control device with different versions of the device and saves the development cost of adapting the video control device to different versions of the device.
[0046] In some embodiments, in step S110, the device to be configured is a video device to be configured, and the configuration operation includes a smart event arming configuration operation.
[0047] The intelligent event arming configuration operation for the device to be configured may include:
[0048] When a second control command is detected, the embedded browser's display interface is switched to the intelligent event arming configuration interface;
[0049] Based on the configuration instructions detected through the intelligent event arming configuration interface, the corresponding intelligent event arming configuration instructions are sent to the video device to be configured, so that the video device to be configured can perform intelligent event arming configuration operations according to the received intelligent event arming configuration instructions.
[0050] For example, the video control device can access the web page of the video device to be configured through an embedded browser, and can control the display interface of the embedded browser to switch to the intelligent event arming configuration interface according to the received instructions.
[0051] For example, when the video control device detects a control instruction (referred to herein as the second control instruction) that instructs the device to switch the display interface of the embedded browser to the smart event arming configuration interface, the video control device may switch the display interface of the embedded browser to the smart event arming configuration interface.
[0052] For example, a video control device can determine that a second control command has been detected when it detects a selection instruction for an "event" function button in a display interface for an embedded browser.
[0053] For example, when the embedded browser's display interface is the smart event arming configuration interface, the video control device detects the configuration command input through the smart event arming configuration interface, and sends the corresponding smart event arming configuration command to the video device to be configured based on the configuration command detected through the smart event arming configuration interface, so that the video device to be configured performs the smart event arming configuration operation according to the received smart event arming configuration command.
[0054] For example, smart event arming configuration operations may include, but are not limited to, one or more of the following:
[0055] Configure event type, deployment area, deployment time, and linkage method.
[0056] For example, such as Figure 8AAs shown, the intelligent event arming configuration interface includes "Event Type," "Arrest Area," "Arrest Time," and "Linkage Method" buttons. Users can perform corresponding configuration operations by clicking the function buttons in the intelligent event arming configuration interface.
[0057] For example, when a user clicks the "Event Type" function button in the smart event arming configuration interface, it can trigger the video control device to switch the embedded browser's display interface to the event type configuration interface. A diagram can be shown below. Figure 8B As shown. The video control device can determine the event type to be configured for intelligent event arming based on the detected event type selection command, such as motion detection, occlusion alarm, etc.
[0058] It should be noted that in practical applications, the event type options can also be displayed as function buttons on the smart event arming configuration interface, allowing users to select according to their needs. An example of this can be seen in the following diagram. Figure 8C As shown.
[0059] In one example, the above configuration instructions include arming zone configuration instructions;
[0060] When the embedded browser's display interface is switched to the intelligent event arming configuration interface, the video device configuration method provided in this application embodiment may further include:
[0061] The video area is overlaid at a specified position on the display interface of the embedded browser, and the decoded bitstream of the video device to be configured is played in the video area;
[0062] Based on the configuration commands detected through the intelligent event arming configuration interface, the above-mentioned intelligent event arming configuration commands are sent to the video devices to be configured, which may include:
[0063] Based on the intelligent rule box parameter configuration instructions detected in the video area, the corresponding intelligent event arming area configuration instructions are sent to the video device to be configured, so that the video device to be configured can perform intelligent event arming area configuration operations according to the received intelligent event arming area configuration instructions.
[0064] For example, consider the configuration of the deployment area.
[0065] In this embodiment, the deployment area configuration can be achieved by drawing intelligent rule boxes in the preview screen of the video device to be configured.
[0066] Accordingly, when the video control device switches the display interface of the embedded browser to the intelligent event arming configuration interface, a video area can be overlaid at a specified position on the display interface of the embedded browser to decode the bitstream of the video device to be configured, and the decoded video data can be played in the video area to achieve a preview of the video screen of the video device to be configured.
[0067] Users can define the deployment area of the video device to be configured by drawing smart rule boxes on the preview screen, thus configuring the deployment area of the video device to be configured.
[0068] For example, the video control device can send corresponding smart event arming area configuration instructions to the video device to be configured based on the smart rule box parameter configuration instructions detected in the video area.
[0069] For example, smart rule box parameters may include, but are not limited to, the size and location of the deployment area.
[0070] When the video device to be configured receives the intelligent event arming area configuration instruction, it can determine the arming area based on the received instruction and perform intelligent detection on the arming area, such as motion detection.
[0071] In one example, displaying a video area overlaid at a specified location on the embedded browser's display interface, and playing the decoded bitstream of the video device to be configured within the video area, may include:
[0072] The embedded browser process sends a video region overlay request to the UI (User Interface) process of the video control device through a socket communication connection between the embedded browser process and the UI process of the video control device. This allows the UI process of the video control device to allocate a matching video region to the embedded browser process based on the video region overlay position and video region size carried in the video region overlay request.
[0073] In addition, the UI process controlling the video control device sends a decoding resource request to the decoding process, so that the decoding process allocates decoding resources to the embedded browser process according to the channel parameters of the video device to be configured carried in the decoding resource request;
[0074] The UI process controlling the video control device overlays a video area at a specified position on the embedded browser's display interface, and plays the decoded bitstream of the video device to be configured within the video area; the specified position is the position that matches the overlay position.
[0075] For example, considering that embedded browsers do not support plugins for video decoding and intelligent rule box acquisition, in order to enable intelligent event arming configuration of the video device to be configured through the embedded browser, a virtual network communication model can be established between the embedded browser process and the UI process of the video control device to realize communication between the embedded browser process and the UI process of the video control device.
[0076] For example, the embedded browser process and the UI process of the video control device can interact through inter-process communication.
[0077] In one example, a socket communication connection can be established between the embedded browser process and the UI process of the video control device, through which the embedded browser process communicates with the UI process of the video control device.
[0078] Accordingly, the video control device can control the socket communication connection between the embedded browser process and the UI process of the video control device, and send a video region overlay request to the UI process of the video control device. The video region overlay request can carry the video region overlay position and the size of the video region.
[0079] When the UI process of the video control device receives a video region overlay request, it can allocate a video region matching the size of the video region to the embedded browser process based on the video region overlay position and video region size carried in the video region overlay request, that is, allocate the display resources corresponding to the video region.
[0080] In addition, the UI process of the video control device can also send a decoding resource request to the decoding process, which can carry the channel parameters of the video device to be configured.
[0081] When the decoding process receives the decoding resource request, it can allocate decoding resources to the embedded browser process based on the channel parameters of the video device to be configured.
[0082] Furthermore, the UI process of the video control device can overlay the video area at a position (which can be called the specified position) that matches the overlay position of the video area in the display interface of the embedded browser, and play the decoded bitstream of the video device to be configured in the video area.
[0083] In one example, the layer for playing the video stream from the configured video device can be the video layer below the layer corresponding to the embedded browser (which may include the menu frame layer and the web canvas layer). The video area can be overlaid in the embedded browser's display interface by setting a specified transparency for the area in the menu frame layer and web canvas layer that matches the overlay position of the video area. For example, 100% transparency is considered completely transparent; the specified transparency can be 100%, 90%, or 80%, etc. Therefore, when the video control device plays the decoded video stream in the area of the video layer that matches the overlay position of the video area, the video preview is visible to the user. The user can configure smart rule boxes on the video preview as needed. These smart rule boxes are displayed on the graphics component layer, which is overlaid on the web canvas layer. For example, when the NVR is in browser mode, the visual layers from top to bottom include:
[0084] Graphic component layers, web canvas layers, menu frame layers, and video layers;
[0085] For example, a graphic component layer is used to draw and modify basic graphics, such as rectangles, triangles or other irregular shapes, and overlay them on top of the web page canvas layer.
[0086] The webpage canvas layer is used to display the webpage rendering image obtained after the embedded browser parses and renders the acquired webpage resources;
[0087] The menu frame layer is used to display the menu selection list corresponding to the functions supported by the embedded browser, and overlays the web canvas layer on a preset area outside the area where the menu selection list is located; wherein, the display interface corresponding to the selected function in the menu selection list is displayed on the web canvas layer as a web page rendering;
[0088] The video layer is used to display a video preview from the front-end device.
[0089] In some embodiments, after overlaying a video area at a specified location on the display interface of the embedded browser and decoding and playing the decoded bitstream of the video device to be configured in the video area, the method may further include:
[0090] When a third control command is detected, the display resources corresponding to the video area and the decoding resources corresponding to the video device to be configured are released; the third control command is used to control the video control device to exit the intelligent event arming configuration interface.
[0091] For example, if the video control device exits the smart event arming configuration interface and enters another interface, it would lead to a waste of resources if the video area is still overlaid and the bitstream of the video device to be configured is decoded and played.
[0092] Therefore, when the video control device detects a control command (referred to as the third control command in this article) that controls the device to exit the intelligent event arming configuration interface, the video control device can release the display resources corresponding to the video area and the decoding resources corresponding to the video device to be configured, so as to save display resources and decoding resources and avoid resource waste.
[0093] It should be noted that when configuring smart event arming by setting a specified transparency for the area in the menu frame layer and web canvas layer that matches the overlapping position of the video area, the transparency setting for the area in the menu frame layer and web canvas layer that matches the overlapping position of the video area can be canceled when the video control device exits the smart event arming configuration interface.
[0094] In some embodiments, after overlaying a video area at a specified location on the display interface of the embedded browser and playing the decoded video stream in the video area, the method may further include:
[0095] Obtain the current smart rule box parameters of the video device to be configured;
[0096] When the current smart rule box parameters of the video device to be configured are obtained, the smart rule box is superimposed and displayed at the corresponding position in the video area according to the current smart rule box parameters of the video device to be configured;
[0097] The above-mentioned configuration instructions for the intelligent rule box parameters in video region detection may include:
[0098] The video region detects modification instructions for the current smart rule box parameters of the video device to be configured.
[0099] For example, smart rule box parameters may include, but are not limited to, the size and location of the deployment area.
[0100] For example, the configuration instructions for the smart rule box parameters of the video device to be configured may include instructions for modifying the current smart rule box parameters of the video device to be configured.
[0101] Accordingly, after displaying the video area overlaid at a specified position on the embedded browser's display interface in the manner described above, and playing the decoded bitstream of the video device to be configured in the video area, the current smart rule box parameters of the video device to be configured can also be obtained.
[0102] When the video control device obtains the current smart rule box parameters of the video device to be configured, it can overlay and display the smart rule box at the corresponding position in the video area based on the current smart rule box parameters of the video device to be configured.
[0103] For example, the superposition position of the smart rule box can be determined based on the location of the deployment area, and the size of the smart rule box can be determined based on the size of the deployment area.
[0104] For example, a modification instruction for the current smart rule box parameters of the video device to be configured can be detected in the video area. Based on the modification instruction, the modified smart rule box parameters can be determined. Then, based on the modified smart rule box parameters, a corresponding configuration instruction can be sent to the video device to be configured so that the video device to be configured can perform a configuration operation according to the received configuration instruction.
[0105] In one example, the above-mentioned intelligent rule box parameter configuration instructions for video region detection may also include:
[0106] When the current smart rule box parameters of the video device to be configured are not obtained, the drawing instructions for the smart rule box parameters of the video device to be configured are detected in the video area.
[0107] For example, when the video control device does not obtain the current smart rule box parameters of the video device to be configured, the video control device can detect the smart rule box parameter drawing instruction for the video device to be configured in the video area, determine the smart rule box parameter configuration instruction for the video device to be configured based on the parameter drawing instruction, and send the corresponding configuration instruction to the video device to be configured based on the configuration instruction, so that the video device to be configured can perform the configuration operation according to the received configuration instruction.
[0108] In some embodiments, decoding resources in normal mode and browser mode are mutually exclusive;
[0109] When the video control device is in normal mode, the browser mode has no decoding resources occupied;
[0110] When the video control device is in browser mode, the decoding resources in normal mode are empty.
[0111] For example, considering that video control devices typically do not need to decode and play the video front-end device's bitstream in conventional mode (i.e., the mode without running the embedded browser) and in browser mode (i.e., the mode with running the embedded browser), decoding resources in conventional mode and browser mode are mutually exclusive in order to avoid wasting decoding resources and improve resource utilization.
[0112] When the video control device is in normal mode, the browser mode has no decoding resources occupied;
[0113] When the video control device is in browser mode, the decoding resources in normal mode are empty.
[0114] For example, decoding resources may include decoder resources and memory resources for storing the bitstream.
[0115] In some embodiments, step S110, accessing the web page of the device to be configured via an embedded browser, may include:
[0116] Based on the address information of the device to be configured, access the web page of the device to be configured; wherein, the device to be configured is a device not in the access list of video control devices, and the address information of the device to be configured is obtained by searching.
[0117] For example, due to the dynamic nature of browser configuration, different address information (such as IP address) can be selected to access the web page of the video device. Therefore, users can also select a device that is not in the access list of the video control device and configure the device by accessing its web page.
[0118] For example, a video control device can obtain the address information (such as IP address) of a device outside its access list (referred to as the device to be configured in this document) by searching, and access the web page of the device to be configured based on the address information of the device to be configured.
[0119] As can be seen, by using an embedded browser to configure the device, it is no longer limited to configuring devices in the access list, thus expanding the configuration control of the video control device.
[0120] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below with reference to specific examples.
[0121] In this embodiment, the video control device is an NVR and the device to be configured is an IPC.
[0122] Please see Figure 2 This is a schematic diagram of the overall architecture of a device configuration provided in an embodiment of this application. In this embodiment, considering that the embedded browser does not support plugins for video decoding and rule box acquisition, an embedded browser combined with a local service solution can be adopted.
[0123] like Figure 2As shown, after the user enables browser mode, they select the smart event arming configuration and enter the smart event arming configuration interface. Relying on the preview live stream, the embedded browser process can request a valid area rectangle as a "container" (i.e., the aforementioned video area) from the NVR's UI process through a virtual network communication model to carry the bitstream display. Simultaneously, the embedded browser process requests the corresponding IPC decoding channel from the decoding process to decode the IPC's real-time bitstream and overlay it onto the embedded browser for display.
[0124] For example, the browser's display interface may include two layers: a menu frame layer and a web page canvas layer, but the display effect is a single entity. Users can configure smart rule box parameters for IPCs through an embedded browser and distribute them to IPCs via a virtual network communication model.
[0125] For example, when the embedded browser exits the smart event arming configuration page, the "container" can be removed and decoding channel resources can be released through the virtual network communication model.
[0126] Please see Figure 3 This is a schematic diagram of an NVR architecture provided in an embodiment of this application, as shown below. Figure 3 As shown, when configuring IPC, the NVR communicates with the NVR's UI process through the WebKit process (i.e., the embedded browser process). The WebKit process can send the coordinate information of the "container (also known as the video window)" to the NVR's UI process. The GUI (Graphical User Interface) module in the NVR's UI process allocates a video window for it, overlays the video window on the corresponding position of the browser interface, and the DSP process (i.e., the decoding process) decodes the video stream and plays the decoded video data in the video window.
[0127] For example, the local service can act as a client in the virtual network communication model, and the WebSocket service module can act as a server in the virtual network communication model. Thus, the WebKit process and the NVR's UI process can interact through the virtual network communication model.
[0128] For example, the NVR's UI process can also receive the embedded browser's page coordinate information. The video window is superimposed on the blank area in the embedded browser's display interface (this area does not display the embedded browser's own information), and changes with the position of the blank area in the embedded browser's interface.
[0129] For example, the position of the "white space" in the display interface of an embedded browser can be changed, and its size can be adjusted by code or mouse.
[0130] The NVR's UI process can obtain the currently configured smart rule box parameters (such as the size and location of the deployment area), and obtain the currently configured smart rule box parameters during the configuration process. Based on the currently configured smart rule box parameters, the corresponding smart rule box is overlaid and displayed in the video window, and the currently configured smart rule box parameters can be modified as needed to realize the deployment area configuration.
[0131] The following is about Figure 2 The implementation of each process is explained in detail.
[0132] 1. NVR UI process
[0133] The NVR's UI process can allocate a frame buffer for the embedded browser process, which the embedded browser process can use to display the menu selection list and web page rendering, forming a menu frame layer and a web page canvas layer.
[0134] The size of the "container" that holds the video is determined by the embedded browser process, which then instructs the decoding process to overlay the video layer.
[0135] When you exit browser mode, release the frame buffer space.
[0136] 2. Embedded browser process
[0137] Embedded browsers are implemented based on the WebKit engine. Considering memory usage limitations and device limitations, they can adopt the browser's software rendering mode.
[0138] When a user controls the NVR to switch from normal mode to browser mode, a segment of shared memory is pre-allocated for webpage rendering.
[0139] For example, the embedded browser process can render the resource data of the web page of the video device to be configured, obtain the web page rendering image, and store it in shared memory. The NVR's UI process then reads the web page rendering image from the shared memory and fills it into the web page layer of the embedded browser's window.
[0140] For example, when a page change requirement is detected, i.e., the web page needs to be updated, such as URL update or page switching, a bitmap memory (referred to as the first bitmap memory in this article) can be created according to the size of the web page. The web page rendering data corresponding to the current web page is stored in the first bitmap memory, and the web page rendering data in the first bitmap memory is traversed to update the data of the area that needs to be updated.
[0141] On the other hand, a canvas of the same size can be generated in another graph memory (referred to as the second bitmap memory in this article) based on the size of the web page.
[0142] Then, the data in the first image memory is copied to the canvas, and the web page is refreshed based on the web page rendering image data in the canvas.
[0143] like Figure 4 As shown, during the rendering process, when a page change requirement is detected, the embedded browser process can create a shared bitmap memory (i.e., the first bitmap memory mentioned above) based on the size of the web page, and store the web page rendering graph data corresponding to the current web page in the bitmap memory; the embedded browser process can traverse the bitmap memory and update the data of the areas that need to be updated.
[0144] When the embedded browser process completes data updates, it can notify the NVR's UI process to update the bitmap memory of the BackingStore.
[0145] The NVR's UI process generates a canvas of the same size as the web page, copies the web page rendering data in the first-view memory to the canvas, and refreshes the web page based on the web page rendering data in the canvas.
[0146] 3. Virtual Network Communication Model
[0147] The virtual network communication model refers to the communication model between the embedded browser process and the NVR's UI process.
[0148] For example, a communication connection between the embedded browser process and the NVR's UI process can be established via a local address (e.g., 127.0.0.1), requiring good real-time performance and persistence.
[0149] For example, the WebSocket protocol can be used to establish a communication connection between the embedded browser process and the NVR's UI process.
[0150] Since embedded browsers do not support plugin functionality, the display and drawing of smart rule boxes corresponding to smart event deployment areas rely on the NVR's UI process.
[0151] like Figure 5As shown, when a user enters the embedded browser interface and specifies a certain channel IPC, internal authentication bypasses the user login requirement. Once the user enters the video-related page, a WebSocket connection is promptly established between the NVR's UI process and the embedded browser process. The embedded browser process then sends a video region overlay request, carrying the video region's location and size, to the NVR's UI process through this WebSocket connection. The NVR's UI process can also request a decoding channel from the DSP process through the WebSocket connection between the NVR's UI process and the DSP process. Thus, the video region can be overlaid on the embedded browser's display interface, and the decoded video stream can be played.
[0152] For example, the NVR can obtain the current smart rule box parameters of the IPC, display the corresponding smart rule box in the video preview screen of the IPC, and modify the smart rule box parameters according to the detected configuration instructions.
[0153] For example, when the NVR does not obtain the current smart rule box parameters of the IPC, a smart rule box can be drawn on the video preview screen of the IPC.
[0154] For example, the smart rule box is not part of the browser's drawing content. It is drawn or modified by the NVR's UI process based on the detected smart rule box parameter configuration instructions and displayed in the IPC's video preview screen.
[0155] For example, when a user exits the smart event arming configuration page, a WebSocket protocol removal command is executed. The WebSocket connection remains active and is not destroyed when entering browser mode. However, the request and release of decoding resources and display resources corresponding to the video area are accompanied by the user switching between different browser modes. That is, when entering the smart event arming configuration interface, the user requests decoding resources and display resources corresponding to the video area; when exiting the smart event arming configuration interface, the user releases decoding resources and display resources corresponding to the video area.
[0156] 4. Decoding process
[0157] Considering the efficiency and low cost of NVR device memory usage, two usage scenarios are designed for regular mode and browser mode: in regular mode, the NVR can support preview and playback of multiple specifications, and in browser mode, it supports single-channel IPC preview for video-related configuration.
[0158] When a video preview needs to be displayed in browser mode, the embedded browser process initiates a request to obtain a video area for displaying the video preview. The NVR's UI process needs to send the decoding channel parameters to the DSP process, which then decodes the currently configured IPC channel and plays the decoded video stream in the video area.
[0159] For example, when the NVR is in browser mode, the decoding memory of the DSP process is available for use by the embedded browser process. When the embedded browser starts, it needs to borrow memory from the DSP process. The memory for the current rendering part can be borrowed from the DSP process. When borrowing memory, the NVR's UI process establishes an inter-process connection with the DSP process to obtain it. When the embedded browser process exits, it releases the borrowed memory and returns to the normal menu interaction page (i.e., enters the normal mode).
[0160] like Figure 6 As shown, a mutual exclusion scheme is designed for the decoding interaction process: First, when entering browser mode, the dynamic library (the resource library that the browser depends on) is loaded into memory through the hard disk (HDD). That is, in normal mode, the dynamic library that the embedded browser process depends on is stored in the hard disk, so as to avoid the dynamic library occupying memory space when it is not used.
[0161] When the NVR runs an embedded browser, the NVR's UI process can borrow memory from the DSP process for storing web page rendering data and for requesting decoding channel resources.
[0162] Furthermore, the memory mutual exclusion scheme for the decoding interaction process further expands the configuration options for IPC. When the NVR is in normal mode, the decoding resources in browser mode are empty; when the NVR is in browser mode, the decoding resources in normal mode are empty.
[0163] Due to the dynamic nature of browser configuration, different IP addresses can be selected to access the IPC's web page. Therefore, users can also select IPCs that are not in the NVR's access list (IPCs that can be configured and managed in the NVR's normal mode) for configuration.
[0164] like Figure 7 As shown, the access IPC configuration can be extended through the external search list.
[0165] 5. Overall effect display
[0166] For configuration of intelligent event arming in embedded browsers, please refer to [link / reference]. Figure 8A and 8D When a user enters the smart event arming configuration interface in browser mode, it can display... Figure 8A The interface shown.
[0167] like Figure 8A As shown, the intelligent event arming configuration interface may include an "Event Type" function button, a "Arrest Area" function button, a "Arrest Time" function button, and a "Linkage Method" function button.
[0168] Users can click the "Event Type" function button to configure the event type for smart event arming, that is, to configure what types of smart events the IPC should alarm for, such as motion detection, obstruction alarm, etc.
[0169] Users can configure the deployment area by clicking the "Defense Area" function button (i.e., the configuration of the smart rule box parameters mentioned above), that is, configure which areas the IPC will perform smart event detection in.
[0170] Users can click the "Arming Time" button to configure the arming time, that is, to configure when the IPC will perform intelligent event detection.
[0171] Users can click the "Linkage Method" button to configure the linkage method, that is, how the IPC should link up when it detects a specific intelligent event, such as image acquisition.
[0172] For example, such as Figure 8D As shown, when a user clicks the "Arming Zone" function button in the intelligent event arming configuration interface, it can trigger the video control device to switch the embedded browser's display interface to the arming zone configuration interface. A schematic diagram can be seen as follows: Figure 8D As shown.
[0173] like Figure 8D As shown, the NVR can overlay the video preview of the IPC to be configured in the blank area of the embedded browser's display interface, and display the current smart rule box of the IPC (if it exists) in the video preview. Users can modify the position and size of the smart rule box (i.e., modify the position and size of the deployment area).
[0174] When the current smart rule frame of the IPC is not obtained, the user can draw a smart rule frame in the video preview screen of the IPC. The NVR can determine the corresponding smart rule frame parameters based on the smart rule frame drawn by the user and send the corresponding smart event arming configuration command to the IPC.
[0175] The method provided in this application has been described above. The apparatus provided in this application is described below:
[0176] Please see Figure 9 This is a schematic diagram of the structure of a device configuration apparatus provided in an embodiment of this application, as shown below. Figure 9 As shown, the device configuration apparatus may include:
[0177] Detection unit 910 is used to detect control commands;
[0178] The running unit 920 is configured to run an embedded browser when the detection unit 910 detects a first control command; wherein the first control command is used to control the video control device to enter browser mode;
[0179] Configuration unit 930 is used to access the Web page of the device to be configured through the embedded browser and perform configuration operations on the device to be configured, wherein the device to be configured is a device equipped with Web services.
[0180] In some embodiments, the device to be configured is a video device to be configured, and the configuration operation includes a smart event arming configuration operation;
[0181] The configuration unit 930 performs intelligent event arming configuration operations on the device to be configured, including:
[0182] When the detection unit 910 detects the second control command, it switches the display interface of the embedded browser to the intelligent event arming configuration interface.
[0183] Based on the configuration command detected by the detection unit 910 through the intelligent event arming configuration interface, the corresponding intelligent event arming configuration command is sent to the video device to be configured, so that the video device to be configured can perform intelligent event arming configuration operation according to the received intelligent event arming configuration command;
[0184] The intelligent event arming configuration operation includes one or more of the following:
[0185] Configure event type, deployment area, deployment time, and linkage method.
[0186] In some embodiments, the configuration instructions include deployment area configuration instructions;
[0187] The configuration unit 930 is also used to overlay a video area at a specified position on the display interface of the embedded browser, and to play the decoded bitstream of the video device to be configured in the video area.
[0188] The configuration unit 930, based on the configuration instructions detected by the detection unit through the intelligent event arming configuration interface, sends corresponding intelligent event arming configuration instructions to the video device to be configured, including:
[0189] Based on the intelligent rule box parameter configuration instruction detected by the detection unit in the video area, a corresponding intelligent event arming area configuration instruction is sent to the video device to be configured, so that the video device to be configured can perform intelligent event arming area configuration operation according to the received intelligent event arming area configuration instruction.
[0190] In some embodiments, the configuration unit 930 overlays a video area at a designated location on the display interface of the embedded browser, and plays the decoded bitstream of the video device to be configured in the video area, including:
[0191] The embedded browser process sends a video region overlay request to the UI process of the video control device through a websocket connection between the embedded browser process and the UI process of the video control device. This allows the UI process of the video control device to allocate a matching video region to the embedded browser process based on the video region overlay position and video region size carried in the video region overlay request.
[0192] In addition, the UI process controlling the video control device sends a decoding resource request to the decoding process, so that the decoding process allocates decoding resources to the embedded browser process according to the channel parameters of the video device to be configured carried in the decoding resource request;
[0193] The UI process of the video control device is controlled to overlay the video area at a specified position on the display interface of the embedded browser, and the decoded bitstream of the video device to be configured is played in the video area; the specified position is a position that matches the overlay position of the video area.
[0194] In some embodiments, the configuration unit 930 is further configured to release the display resources corresponding to the video area and the decoding resources corresponding to the video device to be configured when the detection unit 910 detects a third control instruction; wherein the third control instruction is used to control the video control device to exit the intelligent event arming configuration interface.
[0195] In some embodiments, the configuration unit 930 is further configured to obtain the current smart rule box parameters of the video device to be configured;
[0196] When the current smart rule box parameters of the video device to be configured are obtained, the smart rule box is superimposed and displayed at the corresponding position in the video area according to the current smart rule box parameters of the video device to be configured;
[0197] The detection unit 910 detects intelligent rule box parameter configuration instructions in the video region, including:
[0198] The video region detects modification instructions for the current smart rule box parameters of the video device to be configured.
[0199] In some embodiments, the detection unit 910 is further configured to detect a smart rule box drawing instruction for the video device to be configured in the video area when the current smart box rule parameters of the video device to be configured are not obtained.
[0200] In some embodiments, decoding resources in normal mode and browser mode are mutually exclusive;
[0201] When the video control device is in normal mode, the decoding resources in browser mode are empty;
[0202] When the video control device is in browser mode, the decoding resources in normal mode are empty.
[0203] In some embodiments, the configuration unit 930 accesses the web page of the device to be configured through the embedded browser, including:
[0204] Based on the address information of the device to be configured, access the web page of the device to be configured; wherein, the device to be configured is a device not included in the access list of the video control device, and the address information of the device to be configured is obtained by searching.
[0205] In some embodiments, the configuration unit 930 accesses the web page of the device to be configured through the embedded browser, including:
[0206] When it is determined that the Web page needs to be updated, a first-order graph memory is created according to the size of the Web page, and the web page rendering graph data corresponding to the current Web page is stored in the first-order graph memory;
[0207] Iterate through the webpage rendering image data in the memory of the first bitmap and update the data in the areas that need to be updated;
[0208] Generate a canvas of the same size in the second bitmap memory according to the size of the web page;
[0209] The data in the memory of the first bitmap is copied to the canvas, and the web page is refreshed based on the web page rendering data in the canvas.
[0210] This application provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the device configuration method described above.
[0211] Please see Figure 10This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 1001 and a memory 1002 storing machine-executable instructions. The processor 1001 and the memory 1002 can communicate via a system bus 1003. Furthermore, by reading and executing the machine-executable instructions in the memory 1002 corresponding to the device configuration logic, the processor 1001 can execute the device configuration method described above.
[0212] The memory 1002 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0213] In some embodiments, a machine-readable storage medium, such as Figure 10 The memory 1002 in the device is a machine-readable storage medium that stores machine-executable instructions, which, when executed by a processor, implement the device configuration method described above. For example, the storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0214] This application also provides a computer program stored in a read storage medium, such as... Figure 10 The memory 1002 in the memory, and when the processor executes the computer program, it causes the processor 1001 to execute the device configuration method described above.
[0215] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0216] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for configuring a device, characterized in that, The method is applied to a video control device, and the method includes: Run an embedded browser; Accessing the Web page of the device to be configured through the embedded browser, wherein the Web page of the device to be configured is accessed based on the address information of the device to be configured; When switching from the normal mode to the browser mode, a segment of shared memory is pre-allocated for webpage rendering. The embedded browser process renders the resource data of the web page of the device to be configured, obtains a webpage rendering image, and stores it in the shared memory. The UI process then reads the webpage rendering image from the shared memory and fills it into the webpage layer within the embedded browser's window. The browser mode refers to the mode when the embedded browser is running, while the normal mode is the mode when the embedded browser is not running. The UI process is the UI process of the video control device.
2. The method according to claim 1, characterized in that, A video area is overlaid at a designated location on the display interface of the embedded browser. The video area is used to play the decoded bitstream of the device to be configured.
3. The method according to claim 2, characterized in that, The layer used to play the bitstream from the device being configured is the video layer below the layer corresponding to the embedded browser.
4. The method according to claim 3, characterized in that, By setting a specified transparency for the area in the embedded browser's layer that matches the overlapping position of the video area, the video preview is visible to the user when the decoded video stream is played in the area of the video layer that matches the overlapping position of the video area.
5. The method according to any one of claims 2 to 4, characterized in that, A smart rule box is displayed on the graphic component layer. The smart rule box is based on the configuration made by the user on the video preview screen. The graphic component layer is superimposed on the video layer, which is the layer for playing the bitstream of the device to be configured.
6. The method according to claim 1, characterized in that, The step of accessing the web page of the device to be configured through the embedded browser, wherein accessing the web page of the device to be configured based on the address information of the device to be configured includes: Based on the address information of the device to be configured, access the web page of the device to be configured; wherein, if the device to be configured is not a device in the access list of the video control device, the address information of the device to be configured is obtained by searching.
7. The method according to claim 1, characterized in that, When a first control command is detected, the embedded browser is run; wherein, the first control command is used to control the video control device to enter browser mode, and the browser mode refers to the mode when the embedded browser is running.
8. The method according to claim 1 or 7, characterized in that, Access the web page of the device to be configured through an embedded browser to perform configuration operations on the device.
9. The method according to claim 8, characterized in that, The configuration operations include one or more of the following: network parameters, image and audio / video stream parameters, intelligent event arming, and storage management.
10. The method according to claim 1, characterized in that, When a second control command is detected, the display interface of the embedded browser is switched to the intelligent event arming configuration interface.
11. The method according to claim 10, characterized in that, When the embedded browser displays the smart event arming configuration interface, it detects the configuration commands input through the smart event arming configuration interface and sends the corresponding smart event arming configuration commands to the device to be configured based on the configuration commands detected through the smart event arming configuration interface, so that the device to be configured can perform the smart event arming configuration operation according to the received smart event arming configuration commands.
12. The method according to claim 10 or 11, characterized in that, When the embedded browser's display interface is switched to the intelligent event arming configuration interface, a video area is overlaid at a designated position on the embedded browser's display interface, and the decoded bitstream of the device to be configured is played in the video area.
13. The method according to claim 11, characterized in that, The step of sending corresponding smart event arming configuration instructions to the device to be configured based on the configuration instructions detected through the smart event arming configuration interface includes: Based on the intelligent rule box parameter configuration instructions detected in the video area, the corresponding intelligent event arming area configuration instructions are sent to the device to be configured, so that the device to be configured can perform intelligent event arming area configuration operations according to the received intelligent event arming area configuration instructions.
14. The method according to claim 11, characterized in that, The intelligent event arming configuration operation includes one or more of the following: event type configuration, arming area configuration, arming time configuration, and linkage method configuration.
15. The method according to claim 2, characterized in that, The embedded browser process sends a video region overlay request to the UI process through the inter-process communication connection between the embedded browser process and the UI process. This allows the UI process to allocate a matching video region to the embedded browser process based on the video region overlay position and size carried in the video region overlay request.
16. The method according to claim 15, characterized in that, A virtual network communication model is established between the embedded browser process and the UI process to enable communication between them.
17. The method according to claim 2 or 15, characterized in that, The UI process sends a decoding resource request to the decoding process, which carries the channel parameters of the device to be configured. When the decoding process receives the decoding resource request, it allocates decoding resources to the embedded browser process according to the channel parameters of the device to be configured.
18. The method according to claim 13, characterized in that, Configure the smart rule box on the video preview screen. The smart rule box is displayed on the graphics component layer, which is superimposed on the video layer. The video layer is the layer on which the bitstream of the device to be configured is played.
19. The method according to claim 2, characterized in that, The embedded browser displays a video area overlaid at a specified location on the display interface. After decoding and playing the decoded bitstream of the device to be configured in the video area, the browser also releases the display resources corresponding to the video area and the decoding resources corresponding to the device to be configured when a third control command is detected.
20. The method according to claim 7, characterized in that, Decoding resources is mutually exclusive in normal mode and browser mode; the normal mode is the mode when the embedded browser is not running.
21. The method according to claim 7, characterized in that, When entering browser mode, the dynamic libraries that the embedded browser process depends on are loaded into memory from the hard drive during dynamic library loading; in normal mode, the dynamic libraries that the embedded browser process depends on are stored on the hard drive; the normal mode is the mode when the embedded browser is not running.
22. The method according to claim 1, 2, 3, or 4, characterized in that, After the embedded browser is running, in response to the user entering the embedded browser interface and specifying a device to be configured, the user is exempted from logging into the device to be configured through internal authentication.
23. The method according to claim 1, characterized in that, When a change in page requirements is detected, the web page is updated.
24. The method according to claim 23, characterized in that, The updating of the web page includes: A first-order image memory is created based on the size of the web page, and the web page rendering image data corresponding to the current web page is stored in the first-order image memory. The web page rendering image data in the first-order image memory is then traversed, and the data in the areas that need to be updated is updated. Generate a canvas of the same size in the second bitmap memory according to the dimensions of the web page; Copy the data from the first image in memory to the canvas, and refresh the web page based on the web page rendering data in the canvas.
25. The method according to claim 2, characterized in that, The video area window is overlaid on the white space in the embedded browser's display interface. The position of the white space in the embedded browser's display interface is variable and can be adjusted in size via code or mouse.
26. The method according to claim 16, characterized in that, A communication connection between the embedded browser process and the UI process can be established using the local address; alternatively, the WebSocket protocol can be used to establish the communication connection between the embedded browser process and the UI process.
27. The method according to claim 7, characterized in that, The device to be configured is an IPC. The embedded browser runs on the NVR. In normal mode, the NVR supports previewing and playback of multiple channels. In browser mode, the NVR supports previewing of a single IPC. The normal mode is the mode when the embedded browser is not running.
Citation Information
Patent Citations
Drawing method and device based on multi-process browser, equipment and storage medium
CN110083348A
Interface display method and device, electronic equipment and storage medium
CN111752661A