Video query method and device, electronic equipment and storage medium
By assigning the matching mechanism of the user's permission duration and video permission tags, a legal video query request is determined and the target video is sent, the video leakage problem in the video surveillance system is solved, and the security and rationality of video query is achieved.
Patent Information
- Application Number
- CN202311576694.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In a video surveillance system, giving all users who surveillance video query permissions may lead to video leakage problems, especially in user scenarios where short-term videos need to be queried.
By assigning the corresponding user permission time to each user and carrying the video permission tag in the video query request, matching the preset video permission tag to determine a legitimate video query request. The target video that the user can query is determined based on the user's permission duration, the request query date, and the current date, and send the video to the terminal device, rather than all the videos.
It effectively prevents the leakage of other videos besides legal target videos, ensures the security and rationality of video queries, and is suitable for the short-term video query needs of different users.
Smart Images

Figure CN120030190A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video technology, and in particular to a video query method, device, electronic equipment and storage medium. Background Art
[0002] Video surveillance technology has gradually been used in an increasingly wide range of fields. For example, video surveillance is carried out in various public places such as streets, shopping malls, and stations, so that relevant personnel can later view the recorded surveillance videos.
[0003] In the related art, video query permissions are usually granted to certain users. When a user has the video query permission, he or she can query all recorded surveillance videos.
[0004] However, in some specific user scenarios, for example, non-operating departments of airports only need to query short-term surveillance videos to meet their needs. If permissions for all surveillance videos are granted, it will cause surveillance video leaks. Summary of the invention
[0005] In view of the problems existing in the prior art, embodiments of the present invention provide a video query method, device, electronic device and storage medium.
[0006] The present invention provides a video query method, comprising:
[0007] Receiving a video query request sent by a terminal device; the video query request includes a video permission tag and a query request date, and the video permission tag includes a user permission duration;
[0008] In the case where the video permission tag matches a preset video permission tag, determining the first target video based on the user permission duration, the request query date and the current date; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0009] The first target video is sent to the terminal device.
[0010] According to a video query method provided by the present invention, the video permission tag includes a user code, the user code includes a preset number of characters, the characters corresponding to preset positions in the preset number of characters are used to represent the user permission duration, and the user code is a unique identifier of the user identity.
[0011] According to a video query method provided by the present invention, the method further includes:
[0012] Receiving a video playback request sent by the terminal device; the video playback request includes the video permission tag and a requested playback date, the video permission tag also includes a target date, and the target date is the date when the electronic device generates the video permission tag;
[0013] In a case where the video permission tag matches the preset video permission tag, determining a second target video based on the user permission duration, the requested playback date, and the target date;
[0014] The second target video is sent to the terminal device.
[0015] According to a video query method provided by the present invention, before receiving the video playback request sent by the terminal device, the method further includes:
[0016] Receiving a verification request sent by the terminal device; the verification request includes a video permission tag;
[0017] When the target date in the video permission tag is different from the current date, the video permission tag is updated based on the current date and the user permission duration, the preset video permission tag is replaced based on the updated video permission tag, and the updated video permission tag is sent to the terminal device.
[0018] According to a video query method provided by the present invention, the method further includes:
[0019] Receiving a request for obtaining a video permission tag sent by the terminal device; the request for obtaining the video permission tag includes user login information;
[0020] When the user login information is verified, obtaining the user permission duration corresponding to the user login information;
[0021] The video permission tag is generated based on the user permission duration and the target date, and the video permission tag is sent to the terminal device.
[0022] According to a video query method provided by the present invention, the method further includes:
[0023] Receiving a duration change request sent by the terminal device; the duration change request is used to request to change the user permission duration; the duration change request includes a target permission duration;
[0024] Changing the user permission duration based on the target permission duration, and generating a new video permission tag based on the changed user permission duration;
[0025] The new video permission tag is sent to the terminal device.
[0026] The present invention also provides a video query device, comprising:
[0027] A first receiving unit is used to receive a video query request sent by a terminal device; the video query request includes a video permission tag and a query request date, and the video permission tag includes a user permission duration;
[0028] A first determining unit is used to determine a first target video based on the user permission duration, the request query date and the current date when the video permission tag matches the preset video permission tag; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0029] The first sending unit is used to send the first target video to the terminal device.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned video query methods is implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the video query method described above is implemented.
[0032] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the video query method described above is implemented.
[0033] The video query method, device, electronic device and storage medium provided by the present invention receive a video query request including a video permission tag and a query request date sent by a terminal device. When the video permission tag matches a preset video permission tag, the first target video that the user can query is determined based on the query request date, the current date and the user permission duration in the video permission tag, and the first target video is sent to the terminal device. It can be seen that the present invention assigns a corresponding user permission duration to each user, and carries the user permission duration in the video permission tag. When the video permission tag carried in the video query request matches the preset video permission tag, it indicates that the user's video query request is legal. At this time, the first target video is determined based on the user permission duration, the query request date and the current date, and the first target video is sent to the user's terminal device, instead of sending all videos to the terminal device, thereby preventing the leakage of other videos except the first target video. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 This is one of the flow charts of the video query method provided by the embodiment of the present invention;
[0036] Figure 2 This is a second flow chart of the video query method provided by an embodiment of the present invention;
[0037] Figure 3 This is a third flow chart of the video query method provided by an embodiment of the present invention;
[0038] Figure 4 This is a fourth flow chart of the video query method provided by an embodiment of the present invention;
[0039] Figure 5 is a structural diagram of a video query system provided by an embodiment of the present invention;
[0040] Figure 6 is a schematic diagram of the structure of a video query device provided by an embodiment of the present invention;
[0041] Figure 7 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] In the actual application of video surveillance, for example, in the scenario of airport video surveillance, different users belong to different departments, and the length of time users in different departments need to view videos also varies. For example, the non-operating department of the airport is mainly responsible for the logistics and support work of the airport, including administrative management, security, technical maintenance, environmental protection, etc. The non-operating department provides the necessary conditions and resources for the operating department by providing support and services to ensure the normal operation of the airport. Therefore, the non-operating department only needs to query short-term surveillance videos to meet its needs. If permission to all surveillance videos is given, it will cause the leakage of surveillance videos.
[0044] In view of this, the present invention provides a video query method, which allocates a corresponding user permission duration to each user, and carries the user permission duration in a video permission tag. When the video permission tag carried in the video query request matches the preset video permission tag, it indicates that the user's video query request is legal. At this time, the first target video is determined based on the user permission duration, the requested query date and the current date, and the first target video is sent to the user's terminal device, instead of sending all videos to the terminal device, thereby preventing the leakage of other videos except the first target video.
[0045] Combine the following Figure 1-Figure 4 The video query method of the present invention is described. The execution subject of the video query method can be an electronic device such as a computer, a server or a server cluster, or a video query device set in the electronic device, and the video query device can be implemented by software, hardware or a combination of the two.
[0046] Figure 1 FIG. 1 is a flow chart of a video query method provided by an embodiment of the present invention. Figure 1 As shown, the video query method includes the following steps:
[0047] Step 101: Receive a video query request sent by a terminal device; the video query request includes a video permission tag and a query request date, and the video permission tag includes a user permission duration.
[0048] The electronic device may pre-configure the number of video cameras that each user can query and the identification of each video camera that can be queried, and pre-configure the user authority duration for each user to query videos.
[0049] For example, when a user needs to query a video, the user can enter a request query date on the terminal device, where the request query date includes a request query start date to a request query end date. When the terminal device receives the request query date entered by the user, it obtains the video permission tag including the user permission duration that is pre-issued by the electronic device, and generates a video query request based on the video permission tag and the request query date, and sends the video query request to the electronic device, so that the electronic device receives the video query request sent by the terminal device.
[0050] Step 102: When the video permission tag matches a preset video permission tag, determine the first target video based on the user permission duration, the request query date and the current date; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating user permissions.
[0051] Among them, when the electronic device generates a preset video permission tag based on the user permission duration allocated to the user, the preset video permission tag is stored in a database, which includes a user list and an online user list, etc., and the preset video permission tag is sent to the terminal device; the preset video permission tag can be represented by Querylimit, which is used for unique verification of user query video permissions.
[0052] For example, when a video query request sent by a terminal device is received, the video query request is parsed to obtain a video permission tag and a requested query date, and the parsed video permission tag is matched with a preset video permission tag stored in a database. When the video permission tag matches the preset video permission tag, it indicates that the video query request sent by the terminal device is a legitimate request. The real query date is then calculated based on the current date, the parsed user permission duration, and the requested query date. The purpose of determining the real query date is to prevent the requested query date input by the user from exceeding the user permission duration. The first target video corresponding to the real query date is further determined, that is, the video storage database stores the correspondence between the video and the date. When determining the real query date, the first target video corresponding to the real query date is searched in the video storage database. If the real query date is multiple days, the videos corresponding to the multiple days can all be used as the first target video.
[0053] Optionally, determining the actual query date based on the user permission duration, the query request date and the current date can be achieved in the following manner:
[0054] The current date is advanced by the user permission duration to obtain a first date; the first date is pushed back by one day to obtain a second date; the second date, the current date, and all dates between the second date and the current date are determined as a date set; and the intersection of the date set and the requested query date is determined to obtain the actual query date.
[0055] Among them, the actual query date can be represented by S, the requested query date can be represented by S1, and the user permission duration can be represented by S2, then S1 = requested query start date to requested query end date, S2 = (current date - user permission duration + 1 day) to current date, S = S1∩S2, ∩ represents the intersection, and the date can be accurate to the day; for example, the requested query start date is September 3, the requested query end date is September 5, the user permission duration is 6 days, and the current date is September 7, then S1 = September 3, September 4 and September 5, S2 = (September 7-6 + 1 day) to September 7 = September 2, September 3, September 4, September 5, September 6 and September 7, then S1∩S2 = September 3, September 4 and September 5, that is, the actual query dates are September 3, September 4 and September 5.
[0056] It should be noted that when determining the actual query date based on the user authority duration, the requested query date and the current date, the electronic device can also calculate the difference between the current date and the requested query start date. When the difference is less than the user authority duration, the requested query date is determined as the actual query date. The present invention does not limit this.
[0057] It should be noted that the video query request may also include the identification information of the camera device corresponding to the video that the user needs to view, and the video storage database stores the corresponding relationship between the identification information of the camera device, the video, and the date. In this way, when determining the actual query date, the first target video corresponding to the actual query date and the identification information of the camera device can be searched in the video storage database, so that the first target video better meets the user's needs. In addition, the file name corresponding to the video can also be stored in the video storage database, so that the file name corresponding to the first target video can be found. When sending the first target video to the terminal device, the file name corresponding to the first target video can also be sent to the terminal device. The present invention does not limit this.
[0058] Step 103: Send the first target video to the terminal device.
[0059] For example, when the first target video is found, the first target video can be sent to the terminal device. When the terminal device receives the first target video, it can directly play the first target video for the user to view.
[0060] It should be noted that when the first target video is obtained, the start time and end time corresponding to the first target video can also be sent to the terminal device. The terminal device displays a progress bar of the corresponding video based on the start time and the end time, so that the user can view the video between the start time and the end time, while the user has no right to view videos other than the start time and the end time.
[0061] The video query method provided by the present invention receives a video query request including a video permission tag and a query request date sent by a terminal device. When the video permission tag matches a preset video permission tag, the method determines the first target video that the user can query based on the query request date, the current date, and the user permission duration in the video permission tag, and sends the first target video to the terminal device. It can be seen that the present invention allocates a corresponding user permission duration to each user, and carries the user permission duration in the video permission tag. When the video permission tag carried in the video query request matches the preset video permission tag, it indicates that the user's video query request is legal. At this time, the first target video is determined based on the user permission duration, the query request date, and the current date, and the first target video is sent to the user's terminal device, instead of sending all videos to the terminal device, thereby preventing the leakage of other videos except the first target video.
[0062] In one embodiment, the video permission tag includes a user code, the user code includes a preset number of characters, the characters corresponding to preset positions in the preset number of characters are used to represent the user permission duration, and the user code is a unique identifier of the user identity.
[0063] For example, the user permission duration can be carried in the user code, each user corresponds to a unique user code, the user code can be composed of a preset number of characters, for example, the preset number is 20, then the user code is composed of 20 characters, and the characters corresponding to the preset positions in the 20 characters can be used as the user permission duration. For example, the preset position includes the 11th to the 13th characters, then the values of the 11th to the 13th characters in the 20 characters are used as the user permission duration, then the user permission duration ranges from 0 to 999 days, and the values of the 11th to the 13th characters can be numbers; for example, the user code is "x If the user code is "xxxxxxxxx000xxxxxxx", it means that the number of days that the user can query videos is 0 days, that is, the user permission duration is 0 days, and the user cannot query videos; if the user code is "xxxxxxxxxx060xxxxxxx", it means that the number of days that the user can query videos is 60 days, that is, the user permission duration is 60 days, and the user can query videos within 60 days from now; if the user code is "xxxxxxxxxx999xxxxxxx", it means that the number of days that the user can query videos is 999 days, that is, the user permission duration is 999 days, and the user can query videos within 999 days from now.
[0064] In this embodiment, the video permission tag includes a user code, and the user permission duration is configured in the user code. The user identity can be uniquely identified by the user code, and the user's video query permission can be accurately controlled by the user permission duration configured in the user code.
[0065] In one embodiment, Figure 2 FIG. 2 is a flow chart of a video query method provided by an embodiment of the present invention. Figure 2 As shown, the video query method also includes the following steps:
[0066] Step 104, receiving a video playback request sent by the terminal device; the video playback request includes the video permission tag and a requested playback date, and the video permission tag also includes a target date, which is the date when the electronic device generates the video permission tag.
[0067] For example, when a user needs to replay a video that has been queried, the user can enter a requested playback date on the terminal device, where the requested playback date includes a requested playback start date to a requested playback end date. When the terminal device receives the requested playback date entered by the user, it obtains the video permission tag that includes the user permission duration and the target date and is pre-issued by the electronic device, generates a video playback request based on the video permission tag and the requested playback date, and sends the video playback request to the electronic device, so that the electronic device receives the video playback request sent by the terminal device.
[0068] Step 105: When the video permission tag matches the preset video permission tag, determine a second target video based on the user permission duration, the requested playback date, and the target date.
[0069] For example, when a video playback request sent by a terminal device is received, the video playback request is parsed to obtain a video permission tag, a requested playback date, and a target date, and the parsed video permission tag is matched with a preset video permission tag stored in a database. When the video permission tag matches the preset video permission tag, it indicates that the video playback request sent by the terminal device is a legitimate request. The real playback date is then calculated based on the parsed user permission duration, the requested playback date, and the target date. The purpose of determining the real playback date is to prevent the requested playback date input by the user from exceeding the user permission duration. The second target video corresponding to the real playback date is further determined, that is, the video storage database stores the correspondence between videos and dates. When determining the real playback date, the video storage database is searched for the second target video corresponding to the real playback date. If the real playback date is multiple days, the videos corresponding to the multiple days can all be used as the second target video.
[0070] Optionally, based on the user permission duration, requested playback date and target date, the actual playback date can be determined by:
[0071] The target date is advanced by the user permission duration to obtain a third date; the third date is pushed back by one day to obtain a fourth date; the fourth date, the target date, and all dates between the fourth date and the target date are determined as a playback date set; and the intersection of the playback date set and the requested playback date is determined to obtain a real playback date.
[0072] The actual playback date can be represented by S', the requested playback date can be represented by S1', and the user permission duration can be represented by S2, then S1' = requested playback start date to requested playback end date, S2 = (target date - user permission duration + 1 day) to target date, S' = S1' ∩ S2, ∩ represents the intersection, and the date can be accurate to the day; for example, the requested playback start date is September 3, and the requested playback end date is September 3. The date is September 5th, the user permission duration is 6 days, and the target date is September 7th, then S1'=September 3rd, September 4th and September 5th, S2=(September 7th-6th+1st) to September 7th=September 2nd, September 3rd, September 4th, September 5th, September 6th and September 7th, then S1'∩S2=September 3rd, September 4th and September 5th, that is, the actual playback dates are September 3rd, September 4th and September 5th.
[0073] It should be noted that the video playback request may also include the identification information of the camera device corresponding to the video that the user needs to play back and the file name of the video that needs to be played back. The video storage database stores the correspondence between the identification information of the camera device, the file name, the video and the date. In this way, when determining the actual playback date, the second target video corresponding to the identification information of the camera device, the actual playback date and the file name can be searched in the video storage database, so that the second target video can better meet the user's needs. The present invention is not limited to this.
[0074] It should be noted that the video storage database can also store the correspondence between video addresses and dates. When determining the actual playback date, the target video address corresponding to the actual playback date is searched in the video storage database, and the target video address is sent to the terminal device, so that when the terminal device receives the target video address sent by the electronic device, it obtains the corresponding second target video from the electronic device based on the target video address; in addition, the target video address can be a Uniform Resource Locator (URL) storing the second target video.
[0075] Step 106: Send the second target video to the terminal device.
[0076] For example, when the second target video is found, the second target video can be sent to the terminal device. When the terminal device receives the second target video, it directly plays the second target video for the user to view the replayed video.
[0077] In this embodiment, a video playback request including a video permission tag and a requested playback date is received from a terminal device, and a second target video is determined based on the requested playback date, the target date included in the video permission tag, and the user permission duration, and the second target video is sent to the terminal device, rather than all videos are sent to the terminal device, thereby preventing leakage of videos other than the second target video.
[0078] In one embodiment, Figure 3 FIG. 3 is a flow chart of a video query method provided by an embodiment of the present invention. Figure 3 As shown, before step 104, the video query method further includes the following steps:
[0079] Step 107: Receive a verification request sent by the terminal device; the verification request includes a video permission tag.
[0080] For example, taking the target date as September 7, the user permission duration as 6 days, and the actual query dates as September 3, September 4, and September 5 as an example, after the user views the first target videos corresponding to September 3, September 4, and September 5, when he wants to replay the first target video after N days, N is an integer greater than or equal to 1, for example, N=3, and the current date is September 10, that is, on September 10, the user wants to view the first target videos corresponding to September 3, September 4, and September 5, but the videos corresponding to September 3 and September 4 have exceeded the user permission duration, so it is unreasonable to allow the user to view the videos corresponding to September 3 and September 4. For example, some non-operating departments of the airport only need to watch short-term videos, and viewing videos for a long time may cause video leaks. As time goes by, the dates within the user permission duration will also change, so the videos that were previously viewed with permission will also become videos that are not viewed with permission. Therefore, when the user requests to replay the video, the electronic device also needs to control the playback duration. Specifically, the terminal device needs to send a verification request including a video permission tag to the electronic device, so that the electronic device receives the verification request sent by the terminal device.
[0081] Step 108: When the target date in the video permission tag is different from the current date, the video permission tag is updated based on the current date and the user permission duration, the preset video permission tag is replaced based on the updated video permission tag, and the updated video permission tag is sent to the terminal device.
[0082] For example, when receiving a verification request sent by a terminal device, the verification request is parsed to obtain a video permission tag, and the target date is obtained from the video permission tag, and the target date is compared with the current date. When the target date is the same as the current date, that is, the difference between the target date and the current date is 0, indicating that the video permission tag is a tag created on the same day, the electronic device verifies that the video permission tag is successful, and can send the video permission tag to the terminal device again, or send a message to the terminal device that the video permission tag does not need to be updated; when the target date is different from the current date, that is, the difference between the current date and the target date is greater than or equal to 1, it means that the video permission tag is not. The currently created tag will have an error when determining the actual playback date, so the electronic device fails to verify the video permission tag, and generates a new video permission tag based on the current date and user permission duration, and updates the previous video permission tag based on the new video permission tag, that is, replaces the previous video permission tag with the new video permission tag, and then updates the preset video permission tag stored in the database to the updated video permission tag, and sends the updated video permission tag to the terminal device for synchronization to ensure that the video permission tag in the video playback request sent by the terminal device to the electronic device is the updated video permission tag, that is, the latest video permission tag.
[0083] Assume that the target date included in the updated video permission label is September 10, the user permission duration is 6 days, and the actual query dates are September 3, September 4, and September 5. After the user views the first target videos corresponding to September 3, September 4, and September 5, when he wants to replay the first target video after N = 3 days, that is, on September 10, the user wants to view the first target videos corresponding to September 3, September 4, and September 5, then S1' = September 3, September 4, and September 5, S2 = (September 10-6 + 1) to September 10 = September 5, September 6, September 7, September 8, September 9, and September 10, then S1'∩S2 = September 5, that is, the actual playback date is September 5, not September 3, September 4, and September 5, thereby realizing permission control over the actual playback date.
[0084] It should be noted that when the terminal device receives the video permission tag sent by the electronic device, it can start timing. When the timing time is greater than or equal to 24 hours, it can actively send a verification request to the electronic device, or when the user needs to play back the video, the terminal device can control the terminal device to send a verification request to the electronic device. The present invention is not limited to this.
[0085] In this embodiment, the terminal device can send a verification request including a video permission tag to the electronic device. When the electronic device determines that the target date in the video permission tag is different from the current date, it promptly updates the video permission tag based on the current date and the user permission duration, and synchronizes the updated video permission tag to the terminal device, so that the video playback request sent by the terminal device to the electronic device carries the updated video permission tag, which facilitates the electronic device to determine the actual playback date based on the updated video permission tag, thereby realizing permission control of the actual playback date and ensuring the accuracy of the playback video.
[0086] In one embodiment, Figure 4 FIG. 4 is a flow chart of a video query method provided by an embodiment of the present invention. Figure 4 As shown, before step 101, the video query method further includes the following steps:
[0087] Step 109: Receive a request for obtaining a video permission tag sent by the terminal device; the request for obtaining the video permission tag includes user login information.
[0088] For example, a user can send a request for obtaining a video permission tag including user login information through a terminal device, where the user login information includes a user name and a password. When the electronic device receives the request for obtaining sent by the terminal device, it parses the request to obtain the user login information, and then searches the user list for the user login information. If the user login information is found in the user list, it means that the user login information verification has passed; if the user login information is not found in the user list, it means that the user login information is illegal, and a prompt message can be returned to the terminal device, where the prompt message is used to prompt the user to enter the correct user login information.
[0089] It should be noted that a token may be generated based on user login information, and then carried in a verification request and sent to an electronic device, and the present invention is not limited to this.
[0090] Step 110: When the user login information is verified, the user permission duration corresponding to the user login information is obtained.
[0091] For example, Table 1 is an example of the table structure of the user list. As shown in Table 1, the table structure includes a column name field, a type field, and a constraint field. The value of the column name field includes a user name, a user password, and a user code. The maximum number of characters for the user name, the user password, and the user code is 64 bits, and the user code is the primary key. Table 2 is an example of table data in the user list. As shown in Table 2, the table data includes the field values corresponding to the user name field, the user password field, and the user code field, and the table data stores the corresponding relationship between the user name, the user password, and the user code. Therefore, when the user login information is verified, the user code corresponding to the user login information can be found in the user list, and the user permission duration can be obtained from the corresponding user code.
[0092] Table 1
[0093] Column Name type constraint User Code varchar(64) Primary Key username varchar(64) User Password varchar(64)
[0094] Table 2
[0095] User Code username User Password XXXXXXXXXX000XXXXXXX Zhang San XXXXXXXX XXXXXXXXXX060XXXXXXX Li Si XXXXXXXX XXXXXXXXXX999XXXXXXX Wang Wu XXXXXXXX … … …
[0096] In addition, Table 3 is an example of the table structure of the online user table. As shown in Table 3, the table structure includes a column name field, a type field, and a constraint field. The value of the column name field includes the user code, the user address, and the user login time. The maximum number of characters of the user code and the user login time is 64 bits. The user address is a 32-bit integer, and the user code is a foreign key. Table 4 is an example of table data in the online user table. As shown in Table 4, the table data includes the field values corresponding to the user code field, the user address field, and the user login time field. The table data stores the corresponding relationship between the user code field, the user address field, and the user login time field.
[0097] Table 3
[0098]
[0099]
[0100] Table 4
[0101]
[0102] Among them, the user address in Table 3 and Table 4 is the IP address of the terminal device corresponding to the user, the user login time is the time when the user logs into the electronic device, and the video query request, video playback request, verification request and acquisition request sent by the terminal device to the electronic device can carry the IP address of the terminal device corresponding to the user, so that the electronic device can return corresponding information to the terminal device based on the IP address of the terminal device. In addition, the electronic device can know the user login time when each user logs into the electronic device, so as to manage each user.
[0103] Step 111: Generate the video permission tag based on the user permission duration and the target date, and send the video permission tag to the terminal device.
[0104] For example, when the user permission duration corresponding to the user login information is obtained, the user permission duration and the current date can be used to generate a video permission tag. The current date here is the target date, that is, the date when the video permission tag is created. After the video permission tag is generated, the video permission tag is stored in a database and sent to the terminal device, so that the terminal device can carry the video permission tag when sending video query requests and video playback requests to the electronic device, so that the electronic device can verify the video permission tag sent by the terminal device.
[0105] It should be noted that the user permission duration and the current date can also be encrypted using a message digest algorithm to obtain a video permission tag to improve the security of the video permission tag. The video permission tag is used to query the unique verification of the video. For example, the message digest algorithm is the MD5 algorithm.
[0106] It should be noted that the video permission tag can also be obtained by encrypting using a message digest algorithm based on the user code, the user permission duration and the current date, and the present invention does not limit this.
[0107] It should be noted that after generating a video permission tag, the electronic device may also set the effective duration of the video permission tag and record the generation time of the video permission tag. When the electronic device receives a video query request or a video playback request sent by a terminal device, it determines the time difference between the reception time of the video query request or the video playback request and the generation time of the video permission tag. When the time difference is greater than the effective duration, it indicates that the video permission tag has expired, and it is necessary to re-execute steps 109 to 111 to re-apply for a new video permission tag; when the time difference is less than or equal to the effective duration, it indicates that the video permission tag has not expired, and it is not necessary to re-execute steps 109 to 111.
[0108] In this embodiment, when a request to obtain a video permission tag sent by a terminal device is received, a video permission tag can be generated based on the user permission duration and the target date, and the video permission tag can be sent to the terminal device, so that the terminal device can carry the video permission tag when sending video query requests and video playback requests to the electronic device, so that the electronic device can verify the video permission tag sent by the terminal device.
[0109] In one embodiment, the video query method further includes the following steps:
[0110] Receive a duration change request sent by the terminal device; the duration change request is used to request a change in the user permission duration; the duration change request includes a target permission duration; change the user permission duration based on the target permission duration, and generate a new video permission tag based on the changed user permission duration, and send the new video permission tag to the terminal device.
[0111] For example, if the user needs to change the permission duration for querying videos based on demand, the user can enter the target permission duration on the terminal device. When the terminal device receives the target permission duration entered by the user, it generates a duration change request based on the target permission duration, and sends the duration change request to the electronic device. When the electronic device receives the duration change request, it changes the previously configured user permission duration to the target permission duration, that is, the changed user permission duration is the target permission duration, and regenerates a new video permission tag based on the changed user permission duration, stores the regenerated new video permission tag in the database, and sends it to the terminal device.
[0112] It should be noted that when a duration change request is received from a terminal device, the value of the number of digits representing the user authority duration in the user code can be modified based on the target authority duration to achieve the change of the user code. The replaced user authority duration can be obtained from the changed user code. The present invention does not limit this.
[0113] In this embodiment, when a duration change request is received from a terminal device, the user permission duration is replaced based on the target permission duration in the duration change request, and the video permission tag regenerated based on the replaced user permission duration is sent to the terminal device and stored in a database, thereby achieving flexible configuration of the user permission duration and facilitating the terminal device to carry the video permission tag regenerated based on the target permission duration when sending a video query request and a video playback request to the electronic device, so that the electronic device can verify the video permission tag sent by the terminal device.
[0114] In one embodiment, when the video permission tag included in the video query request includes the user permission duration and the target date, the video query method includes the following steps:
[0115] The electronic device receives a verification request sent by a terminal device; the verification request includes a video permission tag; when the target date in the video permission tag is different from the current date, the video permission tag is updated based on the current date and the user permission duration, the preset video permission tag is replaced based on the updated video permission tag, and the updated video permission tag is sent to the terminal device, so that the target date included in the video permission tag stored in the terminal device is always the same as the current date; thereafter, when the electronic device receives a video query request sent by the terminal device, when the video permission tag matches the preset video permission tag, the real query date is determined based on the user permission duration, the request query date and the target date, and the first target video corresponding to the real query date is determined, and the first target video is sent to the terminal device. In this way, the target date in the video permission tag is always the same as the current date, so the real query date can be directly determined based on the user permission duration, the request query date and the target date, and the first target video corresponding to the real query date is determined.
[0116] It should be noted that the specific implementation method of determining the actual query date based on the user authority duration, the requested query date and the target date can refer to the above-mentioned specific implementation method of determining the actual query date based on the user authority duration, the requested query date and the current date, and the present invention will not repeat it here.
[0117] In one embodiment, when the video permission tag included in the video playback request only includes the user permission duration, the video query method includes the following steps:
[0118] When the electronic device receives a video playback request sent by a terminal device, when the video permission tag matches the preset video permission tag, it determines the actual playback date based on the user permission duration, the requested playback date and the current date. When it is determined that the actual playback date is empty, it sends a message of no permission for playback to the terminal device. When it is determined that the actual playback date is not empty, it determines a second target video corresponding to the actual playback date and sends the second target video to the terminal device.
[0119] It should be noted that the specific implementation method of determining the actual playback date based on the user authority duration, the requested playback date and the current date can refer to the above-mentioned specific implementation method of determining the actual playback date based on the user authority duration, the requested playback date and the target date, and the present invention will not be repeated here.
[0120] Figure 5 is a schematic diagram of the structure of a video query system provided by an embodiment of the present invention. Figure 5As shown, the video query system includes a terminal device and an electronic device, the electronic device includes a video center service module, a video query service module, a video playback service module and a database, the user can log in to the video center service module through the browser on the terminal device, configure the user code on the browser, the user code includes the user permission duration, etc., the video center service module is used to allocate and coordinate the video query service module, the video playback service module and the database, the video query service module is used to manage the user's video query behavior, the video playback service module is used to manage the video that the user needs to play, and the database is used to store video permission tags, etc.
[0121] Specifically, the video center service module is used to receive a request for obtaining a video permission tag sent by a terminal device; the request includes user login information; when the user login information is verified, the user permission duration corresponding to the user login information is obtained; a video permission tag is generated based on the user permission duration and the target date, and the video permission tag is sent to the terminal device, and the video permission tag is stored in a database.
[0122] The video query service module is used to receive a video query request sent by a terminal device. When the video permission tag matches the preset video permission tag, the video query service module determines the first target video based on the user permission duration, the requested query date and the current date, and sends the first target video to the terminal device.
[0123] The video playback service module is used to receive a video playback request sent by a terminal device; the video playback request includes a video permission tag and a requested playback date, and the video permission tag also includes a target date, which is the date when the electronic device generates the video permission tag; when the video permission tag matches the preset video permission tag, a second target video is determined based on the user permission duration, the requested playback date and the target date, and the second target video is sent to the terminal device.
[0124] The video playback service module can also search for the target video address corresponding to the actual playback date in the video storage database, and send the target video address to the terminal device, so that when the terminal device receives the target video address sent by the electronic device, it obtains the corresponding second target video from the video playback service module based on the target video address.
[0125] It should be noted that the video center service module, the video query service module, the video playback service module and the database can be set in the same electronic device or in different separate devices, and the present invention does not limit this.
[0126] The video query device provided by the present invention is described below. The video query device described below and the video query method described above can be referenced to each other.
[0127] Figure 6 is a schematic diagram of the structure of a video query device provided by an embodiment of the present invention. Figure 6 As shown, the video query device 600 includes a first receiving unit 601, a first determining unit 602 and a first sending unit 603; wherein:
[0128] The first receiving unit 601 is used to receive a video query request sent by a terminal device; the video query request includes a video permission tag and a query request date, and the video permission tag includes a user permission duration;
[0129] A first determining unit 602 is configured to determine a first target video based on the user permission duration, the request query date, and the current date when the video permission tag matches a preset video permission tag; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0130] The first sending unit 603 is configured to send the first target video to the terminal device.
[0131] The video query device provided by the present invention receives a video query request including a video permission tag and a query request date sent by a terminal device. When the video permission tag matches a preset video permission tag, the first target video that the user can query is determined based on the query request date, the current date, and the user permission duration in the video permission tag, and the first target video is sent to the terminal device. It can be seen that the present invention allocates a corresponding user permission duration to each user, and carries the user permission duration in the video permission tag. When the video permission tag carried in the video query request matches the preset video permission tag, it indicates that the user's video query request is legal. At this time, the first target video is determined based on the user permission duration, the query request date, and the current date, and the first target video is sent to the user's terminal device, instead of sending all videos to the terminal device, thereby preventing the leakage of other videos except the first target video.
[0132] Based on any of the above embodiments, the video permission tag includes a user code, the user code includes a preset number of characters, the characters corresponding to preset positions in the preset number of characters are used to represent the user permission duration, and the user code is a unique identifier of the user identity.
[0133] Based on any of the above embodiments, the video query device 600 further includes:
[0134] A second receiving unit is configured to receive a video playback request sent by the terminal device; the video playback request includes the video permission tag and a requested playback date, and the video permission tag also includes a target date, which is the date when the electronic device generates the video permission tag;
[0135] A second determining unit is configured to determine a second target video based on the user permission duration, the requested playback date, and the target date when the video permission tag matches the preset video permission tag;
[0136] The second sending unit is used to send the second target video to the terminal device.
[0137] Based on any of the above embodiments, the video query device 600 further includes:
[0138] A third receiving unit is used to receive a verification request sent by the terminal device; the verification request includes a video permission tag;
[0139] An updating unit is used to update the video permission tag based on the current date and the user permission duration when the target date in the video permission tag is different from the current date, replace the preset video permission tag based on the updated video permission tag, and send the updated video permission tag to the terminal device.
[0140] Based on any of the above embodiments, the video query device 600 further includes:
[0141] A fourth receiving unit, configured to receive a request for obtaining a video permission tag sent by the terminal device; the request for obtaining the video permission tag includes user login information;
[0142] An acquiring unit, configured to acquire the user permission duration corresponding to the user login information when the user login information is verified;
[0143] The first generating unit is used to generate the video permission tag based on the user permission duration and the target date, and send the video permission tag to the terminal device.
[0144] Based on any of the above embodiments, the video query device 600 further includes:
[0145] A fifth receiving unit, configured to receive a duration change request sent by the terminal device; the duration change request is used to request to change the user authority duration; the duration change request includes a target authority duration;
[0146] A second generating unit, configured to change the user permission duration based on the target permission duration, and generate a new video permission tag based on the changed user permission duration;
[0147] The third sending unit is used to send the new video permission tag to the terminal device.
[0148] Figure 7 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the video query method, which includes: receiving a video query request sent by a terminal device; the video query request includes a video permission tag and a request query date, and the video permission tag includes the user permission duration;
[0149] In the case where the video permission tag matches a preset video permission tag, determining the first target video based on the user permission duration, the request query date and the current date; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0150] The first target video is sent to the terminal device.
[0151] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0152] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the video query method provided by the above methods, the method comprising: receiving a video query request sent by a terminal device; the video query request includes a video permission tag and a request query date, and the video permission tag includes a user permission duration;
[0153] In the case where the video permission tag matches a preset video permission tag, determining the first target video based on the user permission duration, the request query date and the current date; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0154] The first target video is sent to the terminal device.
[0155] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the video query method provided by the above methods, the method comprising: receiving a video query request sent by a terminal device; the video query request includes a video permission tag and a request query date, and the video permission tag includes a user permission duration;
[0156] In the case where the video permission tag matches a preset video permission tag, determining the first target video based on the user permission duration, the request query date and the current date; the preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information for authenticating the user permission;
[0157] The first target video is sent to the terminal device.
[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A video query method, It is characterized in that include: Receiving a video query request sent by a terminal device; The video query request includes a video permission tag and a query request date, and the video permission tag includes a user permission duration; In a case where the video permission tag matches a preset video permission tag, determining a first target video based on the user permission duration, the request query date, and the current date; The preset video permission tag includes the user permission duration allocated by the electronic device to the user, and the preset video permission tag is unique verification information used to authenticate the user permission; The first target video is sent to the terminal device.
2. The video query method according to claim 1, It is characterized in that The video permission tag includes a user code, which includes a preset number of characters. The characters corresponding to preset positions in the preset number of characters are used to represent the user permission duration, and the user code is a unique identifier of the user identity.
3. The video query method according to claim 1, It is characterized in that The method further comprises: Receiving a video playback request sent by the terminal device; the video playback request includes the video permission tag and a requested playback date, the video permission tag also includes a target date, and the target date is the date when the electronic device generates the video permission tag; In a case where the video permission tag matches the preset video permission tag, determining a second target video based on the user permission duration, the requested playback date, and the target date; The second target video is sent to the terminal device.
4. The video query method according to claim 3, It is characterized in that Before receiving the video playback request sent by the terminal device, the method further includes: Receiving a verification request sent by the terminal device; the verification request includes a video permission tag; When the target date in the video permission tag is different from the current date, the video permission tag is updated based on the current date and the user permission duration, the preset video permission tag is replaced based on the updated video permission tag, and the updated video permission tag is sent to the terminal device.
5. The video query method according to claim 3, It is characterized in that The method further comprises: Receiving a request for obtaining a video permission tag sent by the terminal device; the request for obtaining the video permission tag includes user login information; When the user login information is verified, obtaining the user permission duration corresponding to the user login information; The video permission tag is generated based on the user permission duration and the target date, and the video permission tag is sent to the terminal device.
6. The video query method according to any one of claims 1 to 5, It is characterized in that The method further comprises: Receiving a duration change request sent by the terminal device; the duration change request is used to request to change the user permission duration; the duration change request includes a target permission duration; Change the user permission duration based on the target permission duration, and generate a new video permission label based on the changed user permission duration; Send the new video permission label to the terminal device.
7. A video query device, characterized in that, it includes: A first receiving unit, configured to receive a video query request sent by a terminal device; The video query request includes a video permission label and a request query date, and the video permission label includes a user permission duration; A first determining unit, configured to determine a first target video based on the user permission duration, the request query date, and the current date when the video permission label matches a preset video permission label; The preset video permission label includes the user permission duration assigned by the electronic device to the user, and the preset video permission label is unique verification information for authenticating the user permission; A first sending unit, configured to send the first target video to the terminal device.
8. An electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the program, it implements the video query method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, it implements the video query method according to any one of claims 1 to 6.
10. A computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the video query method according to any one of claims 1 to 6.