Video sharing method and device, electronic equipment and storage medium
By generating web links between the video client and the cloud server, users can watch the camera's real-time video stream without downloading a specific client, solving the problems of cumbersome and inefficient operations in the prior art, and achieving simplified video sharing and improved video streaming quality and security.
Patent Information
- Application Number
- CN202510466150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-05-27
AI Technical Summary
The prior art has cumbersome operations and low efficiency in the short-term sharing of real-time videos of cameras. The sharers need to download specific APPs and perform complex sharing and cancel sharing operations.
Send video sharing commands to the cloud server through the video client to generate web page links. Users can directly watch the camera's live video stream by clicking on the sharing link, without downloading a specific client. At the same time, an intelligent scheduling strategy is adopted to dynamically regulate the video stream, monitor the link status in real time and trigger the destruction mechanism.
The video sharing process is simplified, and users can easily watch real-time videos of the camera through web links, which are simple and safe to operate; at the same time, the quality and security of video streams are improved through intelligent scheduling strategies.
Smart Images

Figure CN120050492A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of video sharing, and particularly relates to a video sharing method, apparatus, electronic device, and storage medium. Background Art
[0002] Generally, to view the real-time video of a camera, the corresponding APP of the camera is required. If a camera is shared for multiple people to view, usually the binder of the camera shares it to other users in the APP. If the owner of the camera only temporarily allows other users to view it, there are the following inconveniences: (1) The shared user needs to download the APP corresponding to the camera; (2) The owner of the camera needs to invite the other party, and the shared user needs to accept the sharing; (3) If it is only a temporary video viewing, after viewing, the other party needs to delete it, or the device owner needs to cancel the sharing. The steps are cumbersome and complex; (4) The shared user also needs to be familiar with the process of using the APP, and needs to know where to receive the sharing and where to view the video in the APP, etc.
[0003] The above sharing process is time-consuming and the operation is cumbersome, with low efficiency. If the real-time video of the camera is viewed for a short time, the above solution is not a good solution. Summary of the Invention
[0004] In view of this, this application aims to propose a video sharing method, apparatus, electronic device, and storage medium to solve at least one of the above problems.
[0005] To achieve the above object, the technical solution of this application is realized as follows: In a first aspect, this application provides a video sharing method, including: Receiving a first command from a first user to view the real-time video of a camera, and generating a web page link according to the first command, where the web page link is generated after the video client sends a first command to view the real-time video of the camera to the cloud server, and the first command is a video sharing command; Sharing the generated web page link to a second user, and the second user opens the web page link to view the real-time video of the camera; the web page front-end requests link parameter configuration from the cloud server, and links to the camera according to the parameter configuration. The camera verifies the video client, and in response to meeting the verification conditions, pushes the stream to the web page front-end through the link channel; Dynamically regulate the second user's viewing of the live video shared by the camera through a preset intelligent scheduling strategy, where the intelligent scheduling strategy is constructed based on the real-time monitoring video stream speed, user viewing time, and user permission level; Real-time monitor the video link status, and trigger a destruction mechanism according to the video link status to stop the video streaming.
[0006] In a second aspect, based on the same inventive concept, the present application further provides a video sharing device, including: A web link generation module, configured to receive a first command from the first user to view the live video of the camera, and generate a web link according to the first command, where the web link is generated after the video client sends a first command to view the live video of the camera to the cloud server, and the first command is a video sharing command; A web link sharing module, configured to share the generated web link with a second user, and the second user opens the web link to view the live video of the camera; the web front-end requests link parameter configuration from the cloud server, and links to the camera according to the parameter configuration, and the camera verifies the video client, and in response to meeting the verification conditions, pushes the stream to the web front-end through the link channel; A dynamic regulation module, configured to dynamically regulate the second user's viewing of the live video shared by the camera through a preset intelligent scheduling strategy, where the intelligent scheduling strategy is constructed based on the real-time monitoring video stream speed, user viewing time, and user permission level; A destruction trigger module, configured to real-time monitor the video link status, and trigger a destruction mechanism according to the video link status to stop the video streaming.
[0007] In a third aspect, based on the same inventive concept, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the method described in the first aspect.
[0008] In a fourth aspect, based on the same inventive concept, the present application further provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the method described in the first aspect.
[0009] Compared with the prior art, the video sharing method, device, electronic device, and storage medium described in the present application have the following beneficial effects: A video sharing method, device, electronic device and storage medium according to the present application. The method can output a sharing link with a time limit for watching the real-time video of the camera at the client side. This sharing link can be distributed to other users who do not have this client. Users can directly watch the real-time video stream of the camera by clicking on the sharing link, without the need for a series of complex operations such as downloading a specific client. The operation is convenient and the transmission is secure. At the same time, the method adjusts the viewing quality of the viewing users through an intelligent scheduling strategy, thereby improving the viewing quality of the users. In addition, based on the destruction mechanism, the method has strong security and privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings: Figure 1 It is a flowchart of a video sharing method according to an embodiment of the present application; Figure 2 It is a schematic diagram of the cloud architecture according to an embodiment of the present application; Figure 3 It is a schematic diagram of the structure of a video sharing device according to an embodiment of the present application; Figure 4 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0011] To make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to specific embodiments and the accompanying drawings.
[0012] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the generally understood meanings by those with ordinary skills in the field to which the present application belongs. The "first", "second" and similar terms used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this term cover the elements or objects listed after this term and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left", "right" are only used to represent relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0013] This application outputs a time-limited sharing link on the video client (i.e., the APP side) that can be used to watch the real-time video of the camera. This sharing link can be distributed to other users who do not have the APP. Users can directly watch the real-time video stream of the camera through this sharing link without a series of complex operations such as downloading the APP.
[0014] WebRTC: Web Real-Time Communications, which is web real-time communication. WebRTC is also a peer-to-peer communication solution that enables the transmission of real-time video streams between the camera device and the front-end web page.
[0015] This embodiment consists of four parts, including: Camera: Verify WebRTC, generate a real-time video stream, and transmit the real-time video stream to the web page in the way of WebRTC.
[0016] Web page: Receive the real-time video stream of the camera through WebRTC and play the audio and video.
[0017] Cloud server: Authenticate the camera for WebRTC. Only the authenticated devices can use the WebRTC function; generate the WebRTC web page link and provide it to the APP side; verify the requests from the web side and return the WebRTC parameter configuration for the web side to link the camera; the APP side controls functions such as the start and end of the WebRTC link through the cloud server; APP: The APP provides a user operation interface. Users can obtain the WebRTC link, stop the link, etc. through the APP side.
[0018] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0019] Please refer to Figure 1 As shown, this embodiment provides a video sharing method, which specifically includes the following steps: Step S101: Receive the first command from the first user to watch the real-time video of the camera, and generate a web page link according to the first command. Among them, the web page link is generated after the video client sends the first command to watch the real-time video of the camera to the cloud server, and the first command is a video sharing command.
[0020] In some embodiments, the first user selects the camera and clicks to generate a web page link to be shared. The video client requests to obtain the interface of web real-time communication. The cloud server authenticates the relationship between the first user logged in to the video client and the camera according to the request. After the authentication is successful, it returns the network link; The cloud server notifies the camera to start the web real-time communication service to listen for channel access from the web front-end.
[0021] Specifically, in this embodiment, after the camera is started, it will establish an Iot connection with the cloud server, report status changes through Iot and receive Iot messages sent by the cloud server. The first user will send a web page link request to watch the real-time video of a specific camera to the cloud server through the video APP, and set the time of this viewing link at the same time. It is possible to select whether to configure a password for this web page link. After the cloud server authenticates the relationship between the user logged in to the video APP and the device, it returns the web page link, and the cloud server notifies this camera to turn on the webrtc function.
[0022] After receiving the Iot message to turn on webrtc sent by the cloud server, the camera requests the webrtc configuration information from the cloud server. After the cloud server authenticates the camera, it issues the webrtc configuration. After receiving the webrtc configuration, the camera starts the webrtc service and simultaneously listens for the access of the webrtc channel on the web front-end.
[0023] On the video APP side, the first user shares the generated web page link with the second user.
[0024] It should be noted that in this embodiment, the first user refers to the main user, that is, the user who binds the camera, and the second user refers to the shared user.
[0025] Step S102: Share the generated web page link with the second user. The second user opens the web page link to watch the real-time video of the camera; the web front-end requests link parameter configuration from the cloud server and links to the camera according to the parameter configuration. The camera verifies the video client, and in response to meeting the verification conditions, it streams to the web front-end through the link channel.
[0026] The user operation is simple. On the APP, directly select to share the video, and a video link will directly appear. After the user copies the link, they can directly watch it on the web page of the mobile phone or computer.
[0027] In some embodiments, when the second user opens the web page link, the web front-end requests the link parameter configuration for web real-time communication from the cloud server. After receiving the link parameter configuration returned by the cloud server, the web front-end links to the camera and sends the verified video client ID to the camera through the link method of web real-time communication; After receiving the verified video client ID, the camera requests the interface of the cloud server to verify the legality of the video client ID and obtain the link duration of the video client ID; After the camera verifies that the video client ID is legal and the link duration is within the valid period, it streams to the web front-end through the web real-time communication channel; After the web front-end receives the real-time video from the camera, it is displayed on the web page.
[0028] In some embodiments, in response to the link parameter being configured with a password, a password verification is displayed on the web page, and the link parameter configuration of the camera, the client ID for video client verification, and the expiration time of the web link are requested to be returned.
[0029] In response to the configuration with a password and the password verification being valid, it is determined whether the number of links for the current web real-time communication has reached the maximum value. If the maximum value is reached, it is prompted that the second user has reached the maximum number of links; if the maximum value is not reached, the web front-end directly connects to the camera through web real-time communication, and then watches the real-time video of the camera.
[0030] Specifically, in this embodiment, the shared user opens the web link on the mobile phone or computer. The web front-end requests the link parameter configuration of webrtc from the cloud server. If a password is required, it notifies the web page that password verification is required. After the user enters the password, it requests again to return the webrtc parameter configuration of this camera, the client ID for client verification, and the expiration time of this link. Without a password, the relevant information of this camera is directly returned.
[0031] After the web front-end obtains the webrtc link parameter configuration returned by the cloud server, it links to the camera and sends the client ID for verification to the camera through the webrtc link method. After the camera receives the client ID for verification, it requests the interface of the cloud server to verify the legitimacy of the client ID and obtain the connectable duration of the client ID. After the camera verifies that the client is valid and the link duration is still within the valid period, it pushes the stream to the web front-end through the webrtc channel. After the web front-end receives the real-time audio and video data of the camera, it is displayed on the web page.
[0032] In some embodiments, it further includes: the first user clicks to stop sharing the web link on the video client, the video client notifies the cloud server that the sharing link has expired, the cloud server sends a stop push stream instruction to the camera, and after the camera receives the stop push stream instruction, it stops the transmission of the real-time video and closes the web real-time communication service.
[0033] This method operates in real time to generate a link, and the real-time video can be watched immediately when the link is generated. If the sharing is stopped, the real-time video stream of the camera will also stop immediately, which is convenient and controllable in real time.
[0034] Specifically, in this embodiment, the main user can choose to stop sharing the link. The APP notifies the cloud server that the sharing link has expired, and the cloud server sends an Iot instruction to the camera. After the camera receives the instruction, it immediately stops the transmission of the real-time video and closes the webrtc service.
[0035] If the primary user does not stop sharing the link and the time detected by the camera for the client ID of the current link has reached the time set by the primary user, the camera stops pushing the stream; at the same time, the web side will also detect the expiration time of the current video duration. When it detects that the current link has expired, it will actively prompt the user that the sharing time has ended, close the video page and disconnect the WebRTC link.
[0036] In this step, the shared video link can be set with a time limit, up to 30 minutes at most, and all link processes go through cloud authentication. Without passing the authentication method, the video cannot be viewed. If the user stops sharing, the real-time video stream of the camera will stop immediately.
[0037] This step enables the camera device side, the APP side operated by the user, and the web side to all be verified with the server. Only after passing the verification can the video be shared, and the APP side can control the transmission of the real-time video stream of the device side through the cloud and can stop the sharing of the video stream at any time.
[0038] Step S103: Dynamically regulate the second user's viewing of the real-time video shared by the camera through a preset intelligent scheduling strategy, where the intelligent scheduling strategy is constructed based on the real-time monitoring of the video stream speed, the user's viewing time, and the user privilege level.
[0039] Specifically, in this embodiment, the device supports a maximum of 4 video streams. This application regulates which users can access and view the camera through the intelligent scheduling strategy. The following specifically describes the three factors affecting the results of the intelligent scheduling strategy: 1) Dynamic monitoring and adjustment of the video stream speed The server side detects the WebRTC link status of each user and obtains the network bandwidth of the video stream in real time (such as the upload rate and the reception rate). When multiple users are watching simultaneously, the system dynamically allocates traffic according to the total bandwidth capacity based on the priority score.
[0040] For example, a high-privilege user (such as the primary user) is allocated a higher bandwidth to maintain a higher-resolution video stream; when the bandwidth is insufficient, a low-privilege user's stream quality is preferentially degraded.
[0041] 2) Dynamic priority adjustment of the user's viewing time The system records the cumulative viewing time of each user. When the maximum limit of simultaneous viewers is reached (such as 4 people), the following rules are used to preferentially limit the users with longer viewing times: If a user's viewing time has exceeded the preset upper limit (e.g., 30 minutes), the system will prompt the user that the viewing time has expired and actively disconnect the connection. Newly joined users can access the system with priority and be allocated bandwidth. When the bandwidth occupancy is too high, the system can dynamically adjust the allowed upper limit of the viewing time, for example, from 30 minutes to 20 minutes, to release more resources for other users.
[0042] 3) Dynamic priority allocation of user permission levels User permission levels are divided into ordinary users and primary users. The system dynamically adjusts the access priority according to the user's permission level: High-privilege users can access with priority and enjoy the best viewing experience even when the system reaches the upper limit of the number of concurrent viewers.
[0043] For ordinary users, when the bandwidth resources are tight, the system can reduce the quality of their video streams or limit the viewing duration.
[0044] Dynamically adjust the viewing permissions. In the scenario of multiple users watching simultaneously, the system can adjust the viewing quality of each user according to the real-time bandwidth load and the user's permission level. For example: Ordinary users: 360p video stream; Primary users: 1440p video stream.
[0045] Among them, the intelligent scheduling strategy includes: ; In the formula, represents the network speed of the user's current video stream, represents the cumulative viewing time of the user, represents the user permission level, 、 、 represent weight coefficients, represents the user's priority score; Dynamically regulate the quality of the video stream viewed by the second user according to the user's priority score.
[0046] When the number of connected cameras reaches the upper limit and new user viewing links are accessed, the cloud calculates through intelligent algorithms which users' viewing can be stopped and whether new users can join the viewing. After the cloud calculates the results, it issues iot instructions to the firmware to stop the viewing of this user.
[0047] Step S104, Monitor the status of the video link in real time and trigger a destruction mechanism according to the video link status to stop the video streaming.
[0048] Specifically, in this embodiment, the core working process of the destruction mechanism can be divided into the following stages: 1.1 Monitor the status of the video link Link validity period monitoring: The system regularly checks the validity of video sharing links according to the duration set by the user (such as 30 minutes) or other limiting conditions. It uses a timer or a background job scheduler to periodically check the remaining valid time of the link. When the preset expiration time is reached, the destruction process is automatically triggered.
[0049] Real-time link status detection: By monitoring the user's connection status, the system can determine in real time whether there are any abnormal connections (such as illegal access, permission overstepping, etc.), and trigger the destruction process as needed. The WebRTC ICE protocol can be used to detect the stability and anomalies of network connections, and immediately interrupt the video stream when an anomaly occurs.
[0050] 1.2 Triggering of destruction conditions Expiration of duration: When the validity period of the video sharing link set by the user ends, the system automatically triggers the destruction process. The expiration status of the link can be detected through background scheduled tasks or event listening.
[0051] User-initiated termination: When the primary user chooses to end the sharing, the system notifies the device side to stop the video stream transmission through the App or cloud control command, and clears the data related to the link. The App side or the cloud server sends a stop push stream command to the device and requests to destroy all caches or temporary data related to this link.
[0052] Permission change or security issue: If a security risk or permission anomaly is detected during the sharing process (such as detecting abnormal video stream data), the system should immediately stop the video stream and destroy all related data.
[0053] 1.3 Resource and data destruction process Stop video stream push: After receiving the stop push stream instruction sent by the cloud server or the App, the device side immediately terminates the transmission of the WebRTC video stream, closes the WebRTC connection, releases all bandwidth and resources related to the video stream transmission, and ensures that the video content is no longer transmitted to any client.
[0054] Delete shared link information: Delete the stored link information on the cloud side and the device side to ensure that the link cannot be accessed continuously. This operation includes deleting the validity period of the link, password, client ID, and other related configuration information. The sharing link information stored in the cloud database (such as DynamoDB or Redis) will be marked as expired and deleted from the storage during destruction.
[0055] 1.4 Secure destruction of the terminal client Automatic logout of the front-end page: When the video stream stops, the front-end page should disconnect from the device end through the WebRTC interface, prompt the user that the video has ended, clear all video caches on the front-end, and close all WebRTC connections related to the video stream.
[0056] If the link requires password verification, the password information should also be cleared to prevent users from reusing expired passwords.
[0057] Forced logout mechanism: If a security risk occurs (such as detecting illegal access), the system should actively terminate all connections, forcibly interrupt the video stream, and clear any temporary data stored on the client side.
[0058] This embodiment will elaborate on each component in detail: I. The entire operation process of the APP, including: 1. When the user selects a certain camera and clicks to generate a shared device video link, the APP will first request the interface to obtain the webrtc link. After the server receives the APP's request, it will first verify the user's operation permissions, and then read data from redis. According to the data stored in redis, it will judge whether there is a video link. If there is, it will directly return the link of this camera device; finally, the server will also send a command to the device end, requiring the device end to open the webrtc link channel.
[0059] Authentication operation: All operations are based on the permissions of the primary user. Only the primary user (i.e., the user bound to the device) of each device can perform the operation of sharing the video link, and the APP side will also restrict the permissions.
[0060] 2. When the user selects a certain camera and clicks to generate a shared video link, after the server receives the request, it will first perform authentication, and then check if there is no video link for this device in redis. If not, the server will generate the video link for this device and send it to the APP side; finally, the server will also send a command to the device end (i.e., the camera end), requiring the camera to open the webrtc channel and wait for the access of the webrtc channel on the web page side.
[0061] Configure the validity period of the link, whether the viewing link requires a password, and what the password is; the password is configured by the user on the APP side; the APP side will encrypt the password with double md5 and upload it to the server, and the password passed in by the web front-end web page is also encrypted with double md5 for verification to ensure that the user's password is invisible to the server.
[0062] 3. When the user selects to stop the previous shared link, first the server checks the user's operation permissions for the device, and then issues an instruction to notify the device to close the webrtc channel and clear all link records of the currently stopped device.
[0063] II. Request Process of Camera Devices: 1. The device records and marks the operations of WebRTC, and requests the cloud server to send down the marking records of upload records for the statistics of subsequent WebRTC usage behavior.
[0064] 2. After the device is powered on and successfully bound, it checks whether its WebRTC switch is turned on. If the switch is in the on state, it requests the server interface to obtain the configuration of the WebRTC connection. After the server receives the request and successfully authenticates the device, it returns the configuration information of the device's WebRTC. After the device receives the configuration information and passes the WebRTC authentication, it is in a state of waiting for the client to access.
[0065] Device Authentication: Check whether it is in the bound state; Check whether the device belongs to the permission group of WebRTC.
[0066] 3. After the device side receives the WebRTC connection of the web page and receives the client ID for verification, it verifies the client ID on the cloud server. After receiving the return of successful verification from the server, the device side pushes the video stream to the front end of the web page.
[0067] III. Web Request Process: 1. The user opens the web front-end web page link and requests the cloud server interface for the information of the WebRTC channel according to the key in the user link; 2. After the cloud server receives the interface request, it first checks whether the key is valid, and then checks whether the request requires a viewing password. If a viewing password is required, it returns that the web front end needs to provide a viewing password; 3. When the cloud server checks that the key is valid and there is a viewing password and the viewing password provided by the web front end is valid, it checks whether the current number of WebRTC connections has reached the maximum. Currently, due to bandwidth limitations and the viewing experience of device videos, the WebRTC connection only supports 4 web pages to watch simultaneously. It checks whether the current number of WebRTC connections of the device has reached the maximum. If it has reached the maximum, it returns that the maximum number of connections has been reached, and the web front end prompts the user after receiving the reply; 4. If the number of users has not reached the maximum, it returns the relevant information of the WebRTC link channel and the verified client ID. The web front end directly connects to the device side through WebRTC to watch the video stream of the device side; 5. After the web front end connects to the device side through WebRTC, it sends the client ID for verification to the device side through the WebRTC channel; 6. The device end receives the client ID sent from the web end, verifies the validity of the client ID through the cloud server. After the server returns a verification pass, the device end then performs streaming, and the web front-end can receive the information of the audio and video stream.
[0068] IV. As Figure 2 shown, the description of the cloud architecture is as follows: 1. This service includes three microservices, for the mobile APP application, for the front-end web application, and for the camera device end application. Each service is independent of each other and does not affect each other.
[0069] 2. The configurations of all applications are stored in DynamoDB, including the configurations related to the WebRTC channels. When the program starts, it uses the server role of AWS to obtain the configuration information of the program from DynamoDB and then apply it to the program.
[0070] 3. The keys required for users to watch are stored in Redis. The time configured by users on the APP side is configured in Redis and will be automatically cleared after expiration, and web viewing will not be accessible.
[0071] 4. The WebRTC viewing data of the device is stored in the MySQL database.
[0072] 5. The logs of interface access are uploaded to the S3 bucket, retaining the interface access records for 14 days and the relevant information of WebRTC logging.
[0073] The method described in this embodiment can output a share link with a time limit for watching the real-time video of the camera at the client side. This share link can be distributed to other users who do not have this client. Users can directly watch the real-time video stream of the camera by clicking the share link without a series of complex operations such as downloading a specific client. The operation is convenient and the transmission is secure. This method can facilitate user operation, the video sharing is safe and reliable, and has an instant function, being convenient, controllable in real time; at the same time, this method adjusts the viewing quality of viewing users through an intelligent scheduling strategy, thereby improving the viewing quality of users. In addition, based on the destruction mechanism, this method has strong security and privacy.
[0074] It should be noted that some embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the above embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0075] Based on the same inventive concept, corresponding to the method of any of the above embodiments, an embodiment of the present application further provides a video sharing device.
[0076] As Figure 3 shown, the video sharing device includes: A web link generation module 11, configured to receive a first command for a first user to watch a real-time video of a camera, and generate a web link according to the first command, where the web link is generated after the video client sends a first command for watching a real-time video of the camera to a cloud server, and the first command is a video sharing command; A web link sharing module 12, configured to share the generated web link with a second user, and the second user opens the web link to watch the real-time video of the camera; the web front-end requests link parameter configuration from the cloud server and links to the camera according to the parameters. The camera verifies the video client, and in response to meeting the verification conditions, pushes the stream to the web front-end through a link channel; A dynamic regulation module 13, configured to dynamically regulate the real-time video shared by the second user watching the camera through a preset intelligent scheduling strategy, where the intelligent scheduling strategy is constructed based on the real-time monitoring video stream speed, user viewing time, and user privilege level; A destruction trigger module 14, configured to monitor the video link status in real time and trigger a destruction mechanism according to the video link status to stop video streaming.
[0077] For the convenience of description, when describing the above device, it is divided into various modules according to functions and described separately. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0078] The device of the above embodiment is used to implement the corresponding method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0079] Based on the same inventive concept, corresponding to the method of any of the above embodiments, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method described in any of the above embodiments.
[0080] Figure 4Fig. 0 shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.
[0081] The processor 1010 may be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0082] The memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0083] The input / output interface 1030 is used to connect to an input / output module to implement information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0084] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module may implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0085] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0086] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0087] The electronic device in the above embodiment is used to implement the corresponding method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0088] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the method described in any of the foregoing embodiments.
[0089] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0090] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the method described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0091] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.
[0092] Additionally, for simplicity of explanation and discussion, and so as not to make the embodiments of the present application difficult to understand, well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that details regarding the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In cases where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application may be practiced without these specific details or with variations of these specific details. Accordingly, these descriptions should be considered illustrative rather than restrictive.
[0093] Although the present application has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0094] Embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the present application.
Claims
1. A video sharing method, characterized in that: include: Receiving a first command from a first user to watch a real-time video from a camera, and generating a webpage link according to the first command, wherein the webpage link is generated after a video client sends the first command to a cloud server to watch a real-time video from a camera, and the first command is a video sharing command; The generated web link is shared with a second user, and the second user opens the web link to watch the real-time video of the camera; the web front end requests the cloud server for link parameter configuration, and links to the camera according to the parameter configuration, and the camera verifies the video client, and in response to meeting the verification conditions, pushes the web front end through the link channel; Dynamically regulating the second user to watch the real-time video shared by the camera through a preset intelligent scheduling strategy, wherein the intelligent scheduling strategy is constructed based on the real-time monitoring video stream speed, user viewing time and user authority level; Monitor the video link status in real time, and trigger the destruction mechanism according to the video link status to stop video streaming.
2. The method according to claim 1, characterized in that The receiving a first command from a first user to watch a real-time video from a camera, and generating a webpage link according to the first command, comprises: The first user selects the camera and clicks to generate a web link to be shared, the video client requests to obtain an interface for real-time communication of the web page, and the cloud server authenticates the relationship between the first user logged in by the video client and the camera according to the request, and returns the network link after successful authentication and verification; The cloud server notifies the camera to start a web real-time communication service to monitor channel access from the web front end.
3. The method according to claim 2, characterized in that Also includes: The viewing time of the web page link is set through the video client, and a viewing password is configured for the web page link.
4. The method according to claim 1, characterized in that: The step of sharing the generated webpage link with a second user, and the second user opening the webpage link to watch the real-time video of the camera, comprises: The second user opens the web link, and the web front end requests the cloud server for link parameter configuration of web real-time communication. After receiving the link parameter configuration returned by the cloud server, the web front end links to the camera, and sends the verified video client ID to the camera through the link mode of web real-time communication; After receiving the verified video client ID, the camera requests the interface of the cloud server to verify the legitimacy of the video client ID and obtain the link duration of the video client ID; After the camera verifies that the video client ID is legitimate and the link duration is within the validity period, it pushes the stream to the web page front end through the web page real-time communication channel; After the web page front end receives the real-time video from the camera, it is displayed on the web page.
5. The method according to claim 4, characterized in that: In response to the link parameter configuration having a password, the password verification is displayed on the web page, and a request is made to return the link parameter configuration of the camera, the client ID used for the video client verification, and the expiration time of the web link.
6. The method according to claim 5, characterized in that: In response to the password being configured and the password verification being valid, determining whether the number of links for the current web page real-time communication has reached a maximum value, and if so, prompting the second user that the maximum number of links has been reached; If the maximum value is not reached, the web front end is directly connected to the camera through real-time web communication to watch the real-time video of the camera.
7. The method according to claim 1, characterized in that Also includes: The first user clicks on the video client to stop sharing the web link, and the video client notifies the cloud server that the sharing link is invalid. The cloud server sends a stop streaming instruction to the camera. After receiving the stop streaming instruction, the camera stops transmitting the real-time video and closes the web real-time communication service.
8. The method according to claim 1, characterized in that The intelligent scheduling strategy includes: ; In the formula, Indicates the network speed of the user's current video stream. Indicates the user's cumulative viewing time. Indicates the user permission level. , , represents the weight coefficient, Indicates the priority score of the user; The quality of the video stream viewed by the second user is dynamically regulated according to the user's priority score.
9. The method according to claim 8, characterized in that Also includes: In response to the number of connections of the camera reaching an upper limit and a new second user viewing link being connected, the cloud server issues a stop streaming instruction according to the result of the intelligent scheduling strategy to notify the camera to stop sharing the viewing with the user.
10. The method according to claim 1, characterized in that The real-time monitoring of the video link status and triggering of the destruction mechanism according to the video link status to stop the video streaming include: Regularly check the remaining validity time of the link and monitor the user's connection status. The client or cloud server sends a stop streaming command to the camera and destroys all cached or temporary data related to the link.