Video stream address request method and device and processing equipment
Through the hash algorithm verification of device fingerprint information, the problem of a third party bypassing the live broadcast platform to obtain the video stream address is solved, the safe distribution of the video stream address and information security are achieved, and the interests of the live broadcast platform are protected.
Patent Information
- Application Number
- CN202410734872.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
In the video live broadcast platform, third parties bypass the live broadcast platform to directly obtain the video stream address and play the video, resulting in reduced user traffic and information security issues, and harming the interests of the live broadcast platform.
By collecting device fingerprint information and using a hash algorithm for verification, the video stream address is only issued when the device fingerprint matches, bypassing browser permission control, ensuring that device fingerprint information is not lost, and realizing safe distribution of video stream addresses.
It effectively protects the interests of normal users and live broadcast platforms, ensures the information security of video streaming addresses, and prevents illegal acquisition and playback.
Smart Images

Figure CN118764653A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video, and in particular to a method, device and processing equipment for requesting a video stream address. Background Art
[0002] Live video streaming is a form of live broadcasting that uses the Internet and streaming media technology. On a technical level, it is based on the distribution of video content. The client can obtain the video stream address of the video content from the server and request the corresponding video stream data to be sent for playback.
[0003] However, the inventors of the present application have discovered that in today's network ecology, some third parties (individual users or other live broadcast platforms) lack copyright awareness. After obtaining the video stream address, they bypass the live broadcast platform and directly watch the video. For example, any third-party video playback software can obtain the video stream data and play the corresponding video through the obtained video stream address, bypassing the video playback service provided by the video player of the live broadcast website (usually built into the client). For the live broadcast platform as the producer of video content, this situation obviously means a reduction in the platform's user traffic, and there are problems with information security and loss of virtual assets, resulting in damage to the interests of both normal users and the live broadcast platform. Summary of the invention
[0004] The present application provides a video stream address request method, apparatus and processing equipment for distributing and processing video stream addresses for a video live broadcast platform, and implements a novel video stream address issuance mechanism based on device fingerprint information for verification. Only the current user can normally obtain the available video stream address from the server, and the setting of the preset storage address can also bypass the browser's permission control, so that the device fingerprint information used will not be deleted or lost, and can stably serve the present application solution, ultimately promoting the effect of issuing video stream addresses with high information security, which can effectively protect the interests of both normal users and the live broadcast platform.
[0005] In a first aspect, the present application provides a method for requesting a video stream address, the method comprising:
[0006] Collecting the first device fingerprint information of itself, and storing the first device fingerprint information in a preset storage address other than cookies used by the browser;
[0007] Calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at a preset storage address;
[0008] Report a request for sending the target video stream address to the server, so that the server calculates a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried in the request for sending the target video stream address, and compares the second hash result with the first hash result carried in the request for sending the target video stream address; if the first hash result and the second hash result are the same, send the target video stream address requested by the request for sending the target video stream address to the client.
[0009] In a second aspect, the present application provides a method for requesting a video stream address, the method comprising:
[0010] Receive the target video stream address reported by the client and send a request;
[0011] Extract the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the request for sending the target video stream address, wherein the first hash result is calculated by the client through the first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than cookies used by the browser;
[0012] Based on the second device fingerprint information and the second other client information required for authentication, calculate a second hash result under the first hash algorithm;
[0013] comparing the second hash result to the first hash result;
[0014] If the second hash result is the same as the first hash result, the target video stream address requested by the target video stream sending request is sent to the client.
[0015] In a third aspect, the present application provides a video stream address request device, the device comprising:
[0016] A collection unit, used to collect the first device fingerprint information of itself, and store the first device fingerprint information in a preset storage address other than cookies used by the browser;
[0017] A calculation unit, configured to calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at a preset storage address;
[0018] A reporting unit is used to report a target video stream address sending request to a server, so that the server calculates a second hash result under a first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried in the target video stream address sending request, and compares the second hash result with the first hash result carried in the target video stream address sending request. If the first hash result and the second hash result are the same, the target video stream address requested by the target video stream address sending request is sent to the client.
[0019] In a fourth aspect, the present application provides a video stream address request device, the device comprising:
[0020] A receiving unit, used to receive a request for sending a target video stream address reported by a client;
[0021] An extraction unit is used to extract the second device fingerprint information, the second other client information required for authentication and the first hash result carried by the target video stream address sending request, wherein the first hash result is calculated by the client through a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than a cookie used by the browser;
[0022] A calculation unit, configured to calculate a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication;
[0023] a comparing unit, configured to compare the second hash result with the first hash result;
[0024] The sending unit is used to send the target video stream address requested by the target video stream sending request to the client if the second hash result is the same as the first hash result.
[0025] In a fifth aspect, the present application provides a processing device, including a processor and a memory, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, it executes the method provided by the first aspect of the present application, any possible implementation of the first aspect of the present application, the second aspect of the present application, or any possible implementation of the second aspect of the present application.
[0026] In a sixth aspect, the present application provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the method provided by the first aspect of the present application, any possible implementation of the first aspect of the present application, the second aspect of the present application, or any possible implementation of the second aspect of the present application.
[0027] From the above content, it can be concluded that the present application has the following beneficial effects:
[0028] For the distribution processing of the video stream address of the live video platform, the client side collects its own first device fingerprint information, and stores the first device fingerprint information in a preset storage address other than cookies used by the browser, and then calculates the first hash result under the first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at the preset storage address. At this time, the target video stream address is reported to the server for sending a request. The server side can calculate the second hash result under the first hash algorithm based on the second device fingerprint information carried in the request sent by the target video stream address and the client information required for the second other authentication, and compares the second hash result with the target video stream address sent by the request. The first hash result carried is compared with the second hash result. If the first hash result is the same as the second hash result, the target video stream address requested by the target video stream address issuance request is sent to the client through verification. In this way, a novel video stream address issuance mechanism is implemented based on the device fingerprint information used for verification. Only the current user can normally obtain the available video stream address from the server, and the setting of the preset storage address can also bypass the browser's permission control, so that the device fingerprint information used will not be deleted or lost, and can stably serve the present application scheme, and ultimately promote the effect of issuing the video stream address with high information security, which can effectively protect the interests of both normal users and the live broadcast platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 A flowchart of a method for requesting a video stream address in this application;
[0031] Figure 2 This is another flowchart of the video stream address request method of the present application;
[0032] Figure 3 A schematic diagram of the structure of a video stream address request device of the present application;
[0033] Figure 4 This is another structural diagram of the video stream address request device of the present application;
[0034] Figure 5 A schematic diagram of the structure of the processing equipment of this application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0036] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0037] The division of modules in this application is a logical division. There may be other division methods when it is implemented in actual applications. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in this application. In addition, the modules or submodules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present application.
[0038] Before introducing the video stream address request method provided by the present application, the background content involved in the present application is first introduced.
[0039] The video stream address request method, device and computer-readable storage medium provided in the present application can be applied to a processing device for distributing and processing video stream addresses for a video live broadcast platform, and implements a novel video stream address issuance mechanism based on device fingerprint information for verification. Only the current user can normally obtain the available video stream address from the server, and the setting of the preset storage address can also bypass the browser's permission control, so that the device fingerprint information used will not be deleted or lost, and can stably serve the solution of the present application, ultimately promoting the effect of issuing video stream addresses with high information security, which can effectively protect the interests of both normal users and the live broadcast platform.
[0040] The video stream address request method mentioned in the present application may be executed by a video stream address request device, or a server or client that integrates the video stream address request, wherein the client may be specifically understood as a user equipment (UE), and the video stream address request device may be implemented in hardware or software. The UE is installed with a client application / service, and may specifically be a user-side terminal device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, or a personal digital assistant (PDA).
[0041] It can be understood that the original intention of the solution of this application involves a video live broadcast application scenario, in which the server is a server of a video live broadcast platform, and the client is a device for users or viewers to access the video live broadcast platform to watch video live content.
[0042] In addition, it is easy to understand that the overall solution of the present application involves request processing of video stream addresses. Thus, in addition to the live video application scenario, in actual situations, other types of application scenarios may also be involved, and the specific configuration may be based on actual conditions.
[0043] Next, we will introduce the video stream address request method provided by this application.
[0044] First, see Figure 1 , Figure 1 A schematic diagram of a process of requesting a video stream address of the present application is shown. The video stream address requesting method provided by the present application may specifically include the following steps S101 to S103:
[0045] Step S101, collecting the first device fingerprint information of itself, and storing the first device fingerprint information in a preset storage address other than cookies used by the browser;
[0046] It can be understood that for the client side watching live broadcasts through the browser, under the authentication requirement, the device fingerprint information in the existing technology is stored in the cookie stored in the browser. However, if we go deep into the browser technology, we can find that there is a problem, that is, the current browser permission management, once the incognito mode is started, the browser cookies will be cleared. In this case, the device fingerprint information that has been processed in advance will obviously be deleted and lost, affecting the promotion and application of the authentication mechanism based on the device fingerprint information. In addition, the settings of automatically clearing or manually clearing cookies in other cases will obviously cause this problem.
[0047] In this regard, the present application configures the browser to store the device fingerprint information involved in the present application scheme at a preset storage address other than cookies, thereby bypassing the current browser permission control for cookies, so that the device fingerprint information is stored inside the browser, which can effectively avoid deletion and loss, and can stably serve the present application scheme.
[0048] For example, in specific operations, the present application can be based on the open source Chrome browser kernel (also known as the Chromium kernel) for secondary research and development, and a custom browser can be configured to implement the configuration. The titrator browser can be easily configured to have a high degree of authority to constrain the viewing of video content through the present application solution. If the device fingerprint information required by this application cannot be generated, it will obviously directly lead to authentication failure. If the target video stream address cannot be successfully initiated, it will obviously directly lead to the inability to watch the video content.
[0049] In addition, it is easy to understand that in actual situations, existing browsers on the market can also be optimized twice to achieve this configuration.
[0050] Under this condition, after the client side collects the corresponding device fingerprint information through the device fingerprint information collection strategy pre-configured in this application, it can be stored in a preset storage address other than cookies used by the browser for subsequent use.
[0051] Among them, the device fingerprint information is easy to understand, and is a related identifier or a unique identifier for identifying the client-side device. The concept is relatively mature, and any type of device fingerprint information configuration strategy can also be used for configuration.
[0052] As an example, the present application can obtain hardware information based on an application in a Windows environment, and therefore has permissions to easily obtain a series of information related to hardware and software, such as CPU, memory, graphics card, sound card, browser identification (User Agent, UA), operating system, font library, language, IP address, network card MAC address, time zone longitude and latitude positioning, etc. In addition, it can also include an element Canvas based on HTML5, which is used to draw graphics on a web page. By requiring the browser to draw a graphic and analyzing the result, the website can generate an almost unique identifier. Because the graphics rendering on each device is slightly different, the element Canvas generated on each device is different.
[0053] What can also be seen from this example is that device fingerprint information usually includes several different types of information, not just one.
[0054] In addition, it is worth mentioning that in order to facilitate the distinction of device fingerprint information involved in different situations, this application uses qualifiers such as "first" and "second" to distinguish them. For example, the device fingerprint information stored by the client here is recorded as the first device fingerprint information. Similarly, the client information required for authentication involved later is also set in the same way.
[0055] Step S102, calculating a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at a preset storage address;
[0056] It can be understood that when it is necessary to report the video stream address to the server and send a request, the present application may involve the use of device fingerprint information, thereby cooperating with the server side for authentication, so that only normal users can obtain a valid video stream address for video viewing.
[0057] In this regard, when it is necessary to report the target video stream address and send a request, the client can perform a hash operation in combination with the first other client information required for authentication other than the first device fingerprint information to obtain a first hash result that can be carried in the target video stream address and send a request.
[0058] The first device fingerprint information corresponds to the client's software and hardware, and the first other client information required for authentication corresponds to the conditions involved when the client initiates a request to send a video stream address. Therefore, these two aspects of information are highly adaptable to the current video stream address sending scenario, and even uniquely adaptable. They are not easy to forge and can also help in subsequent backtracking. After hashing, they are highly uniquely identifiable.
[0059] Among them, it is easy to understand that the focus of the present application is not on the configuration of the hash algorithm. In specific operations, different types of hash algorithms commonly used on the market can be adopted, which can be flexibly configured according to actual needs. Of course, it is not ruled out that when the present application is applied in actual situations, the existing hash algorithm can be further optimized and improved or even a new hash algorithm can be configured.
[0060] Step S103, reporting the target video stream address sending request to the server, so that the server calculates the second hash result under the first hash algorithm based on the second device fingerprint information carried in the target video stream address sending request and the second other client information required for authentication, and compares the second hash result with the first hash result carried in the target video stream address sending request; if the first hash result and the second hash result are the same, the target video stream address requested by the target video stream address sending request is sent to the client.
[0061] In the scheme design of the present application, when the server performs authentication, it is necessary to compare two aspects of hash results. One aspect of the hash result is the first hash result calculated autonomously by the client in the above step S102, and the second aspect of the hash result is the second hash result calculated again by the server according to the agreed and same first hash algorithm based on the information collected by the client (mainly or even directly from the request to send the target video stream address). Under the characteristic of the hash algorithm that the same input will lead to the same output in theory, if the two are the same, it means that the client that reports the request to send the target video stream corresponds to a normal user, and the video content can be allowed to play normally, so the requested target video stream address can be sent; on the contrary, if the two are not the same, it means that the user has cheated or spread the video stream address, or that a third party has stolen / disguised the fingerprint information of a normal user to obtain the target video stream address, and it is necessary to respond according to the preset countermeasures such as ignoring the request, returning a rejection message or punishing the account.
[0062] Therefore, from Figure 1It can be seen from the illustrated embodiment that, for the distribution processing of the video stream address of the live video broadcast platform, the client side collects its own first device fingerprint information, and stores the first device fingerprint information in a preset storage address other than the cookie used by the browser, and then calculates the first hash result under the first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at the preset storage address. At this time, a request is sent to the server to report the target video stream address. The server side can calculate the second hash result under the first hash algorithm based on the second device fingerprint information carried in the request to send the target video stream address and the second other client information required for authentication, and compares the second hash result with the target video stream address. The first hash result carried in the request is compared with the first hash result carried in the request. If the first hash result and the second hash result are the same, the target video stream address is sent to the client through verification. In this way, a novel video stream address sending mechanism is implemented based on the device fingerprint information used for verification. Only the current user can normally obtain the available video stream address from the server, and the setting of the preset storage address can also bypass the browser's permission control, so that the device fingerprint information used will not be deleted or lost, and can stably serve the present application scheme, and finally promote the effect of sending the video stream address with high information security, which can effectively protect the interests of both normal users and the live broadcast platform.
[0063] Continue to the above Figure 1 Each step of the illustrated embodiment and possible implementation methods thereof in practical applications are described in detail.
[0064] For the preset storage address in the previous step S101, that is, the preset storage address used by the present application for storing the first device fingerprint information, as an exemplary embodiment of the present application, the preset storage address can specifically be localStorage or IndexedDB.
[0065] Specifically, with the introduction of HTML5, Web Storage may include localStorage and sessionStorage in the storage address that can be used by the browser, among which localStorage is used to store persistent data. Unless the user manually deletes it, the data will always be stored in the browser. Therefore, the first device fingerprint information involved in this application can be stored in localStorage.
[0066] In addition, IndexedDB is a database used to store a large amount of structured data. It allows applications to store a large amount of data on the client and access this data without a network connection. Therefore, the first device fingerprint information involved in this application can also be stored in IndexedDB. In specific operations, IndexedDB can be stored in a file in the browser installation directory. A file can be created in the browser installation directory and the first device fingerprint information can be written into the file for storage. At the same time, the first device fingerprint information can also be stored in the device's registry to avoid the loss of the data when the browser is uninstalled.
[0067] In addition, for the original cookie, it is a small text file exchanged between the browser and the server, which is used to store user status information. It is stored in the form of key-value pairs, each key-value pair is associated with a specific domain name, and can be shared in multiple requests under the same domain name, but each request will carry the same cookie. In this case, the present application can also focus on the convenience of application. In addition to storing the first device fingerprint information in the preset storage address, the first device fingerprint information that has been stored in the preset storage address can continue to be stored in the cookie, which has the effect of convenient calling. If the first device fingerprint information in the cookie is deleted and lost, it can be called from the preset storage address, or copied from the preset storage address to the cookie for calling.
[0068] Furthermore, when the present application uses the first device fingerprint information to initiate a request to send the target video stream address, it can also be processed twice. Specifically, based on privacy considerations, the present application can consider transforming the original first device fingerprint information instead of directly reporting it to the server side, so as to encrypt it and achieve higher information security. In this process, hash operations can be used to perform hidden transformations to achieve this purpose. In this way, when storing the first device fingerprint information, hash operations can also be involved.
[0069] In this regard, as another exemplary embodiment of the present application, step S101 stores the first device fingerprint information in a preset storage address other than cookies used by the browser, which may specifically include:
[0070] Based on the first device fingerprint information and the random seed information, calculate a target hash result under a second preset hash algorithm, wherein the second hash algorithm includes at least one hash algorithm, and when the second hash algorithm includes at least two hash algorithms, a hash result of a previous hash algorithm is used as an input of a next hash algorithm;
[0071] The target hash result is stored in a preset storage address for use in generating the first hash result and for use in reporting the target video stream address and sending a request.
[0072] It should be understood that the second hash algorithm used here is not necessarily the same as the first hash algorithm agreed upon by the client and the server. Whether to use the same hash algorithm can be adjusted according to actual needs.
[0073] In addition, it can be seen from the embodiments here that in order to further increase the complexity of information and thereby improve the information security of the fingerprint information of the first device, the present application can also introduce the application of random seeds to avoid the possibility of conflicts (same) in hash results of different types of information in extreme cases, and to avoid the possibility of conflicts (same) in hash results of the same type of information in extreme cases.
[0074] Furthermore, in the process of processing the fingerprint information of the first device, multiple rounds of hash operations may be involved to further increase the complexity of the information.
[0075] Taking the IP address that may be involved in the fingerprint information of the first device as an example, first generate a random seed corresponding to the IP address, then use the SHA256 algorithm to perform a hash operation on the random seed and the IP address to obtain a hash result, and then continue to use the MD5 algorithm to perform a hash operation on the first hash result and the random seed to obtain a second hash result, thus obtaining the final hash operation result of the IP address.
[0076] In addition, it is understandable that the first device fingerprint information may usually involve multiple or more device fingerprint information. In this case, when performing a hash operation, each device fingerprint information may be spliced first, and then a subsequent hash operation may be performed based on the splicing result. Alternatively, a hash operation may be performed on each device fingerprint information separately, and then the hash results of each device fingerprint information may be spliced. Both methods are possible.
[0077] In addition, the random seed information involved in each hash operation, when the content of the random seed information itself is randomly generated, can also be configured with different random seed information for each hash operation instead of using the same random seed information.
[0078] Taking the latter as an example, as another exemplary embodiment, when the first device fingerprint information includes multiple device fingerprint information, calculating the target hash result under the second hash algorithm based on the first device fingerprint information and the random seed information includes:
[0079] Calculate a hash result under the second hash algorithm based on each device fingerprint information and each corresponding random seed information, wherein each random seed information corresponds to each device fingerprint information one by one, or each random seed information is the same for each device fingerprint information;
[0080] Concatenate each hash result and each random seed information to get the target hash result.
[0081] It can be understood that the splicing method involved in this application (including the embodiments herein) can be flexibly adjusted in order, for example, it can be randomly spliced, or it can be sorted in alphabetical order or numerical order according to the first character of the string.
[0082] In this way, by combining random hash operations, random seed information and splicing settings, a better privacy transformation effect is achieved, and the first device fingerprint information with high information security is obtained, laying a good information security foundation for subsequent information use.
[0083] Furthermore, for the carrier that carries the first device fingerprint information in the request to send the target video stream address, that is, the first hash result, as introduced earlier, in the generation process, in addition to the first device fingerprint information, the first other client information required for authentication is also involved, which corresponds to the conditions involved when the client initiates the request to send the video stream address.
[0084] In this regard, as another exemplary embodiment, the first other client information required for authentication specifically includes user UID, live broadcast room RoomID, token information issued during login, device DeviceID, client version number Version, timestamp and random value.
[0085] It can be understood that in specific applications, the present application hopes to use more data to participate in the calculation of the first hash result, and any change in input data will eventually affect the change in the result, thereby improving randomness. In this regard, the present application can be specifically designed to involve the following client information required for the first other authentication:
[0086] 1. User UID (User Unique Identifier), which is used to indicate which user is currently viewing the video content, so the calculation results of different user UIDs are inconsistent;
[0087] 2. The RoomID of the live broadcast room is used to indicate which live broadcast room the video content is currently being watched in, so the calculation results of the RoomID of different live broadcast rooms are also different;
[0088] 3. Token data (login verification data), which is used to indicate the login verification issued by the server after logging in to the server, to ensure that only the logged-in user can watch the video content;
[0089] 4. Device ID (device unique ID), which is used to indicate which device / client is currently watching the video content, so as to ensure that even if it is the same user in the same live broadcast room, different devices will lead to inconsistent calculation results;
[0090] 5. The client version number Version is used to indicate which version of the client is currently viewing the video content, so the calculation results of different client versions are inconsistent;
[0091] 6. The timestamp information of the current request, TimeStamp, to ensure that the results calculated at different times are also inconsistent.
[0092] In this way, after obtaining the above information and the first device fingerprint information, you can participate in the calculation and processing of the first hash result.
[0093] As an example, in the process of calculating the first hash result of the present application, the first hash algorithm involved can specifically adopt the SHA256 algorithm, specifically:
[0094] First, define a SHA256 object;
[0095] SHA256 sha;
[0096] Then call the sha interface to calculate the authentication KEY value.
[0097] auth=update(char*buffer,uint length);
[0098] Its interface is the update function;
[0099] Among them, the first parameter char*buffer indicates the input string to be calculated, and the second parameter uintlength indicates the length of the input string to be calculated.
[0100] The information required for calculation in this application has been introduced above, including UID+RoomId, Token, DeviceId, Version, TimeStamp and random value RandData. The calculation functions based on auth1 (first hash result) are:
[0101] Update(UID+RoomId+Token+DeviceId+Version+TimeStamp+RandData+browser fingerprint information, length);
[0102] After obtaining auth1 (the first hash result), it can be carried in the request to send the target video stream address. On the one hand, it informs the server to request the corresponding target video stream address to be sent to the client itself so that the client can play the corresponding video content. On the other hand, it also provides auth1 (the first hash result) for the server to use for comparison. On the other hand, it also provides the relevant information required by the server to independently calculate auth2 (the second hash result) and involved when the client calculates auth1 (the first hash result). Therefore, after receiving the request to send the target video stream address, the server can trigger the calculation of auth2 (the second hash result) and compare it with auth1 (the first hash result) to carry out authentication and determine whether the target video stream address is sent normally or whether a counter response is made.
[0103] In addition, it is understandable that after receiving the request to send the target video stream address, the server side can also record the second device fingerprint information of the current client (if passed, the second device fingerprint information is the first device fingerprint information) and other information. If the corresponding account has abnormalities in the future, it can also be tracked based on the information recorded on the server for corresponding processing.
[0104] For example, if other clients subsequently impersonate the current client to initiate a video stream address sending request or a video stream sending request, and the request carries information such as the device fingerprint information of the current client, then obviously, the current client can be prompted that there is an abnormality in the account, someone is impersonating its account, etc., or the current client can be checked for abnormalities, etc., or the current client's account can be directly punished, etc. In this way, based on the device fingerprint information, it is convenient for the live broadcast platform to control the copyright of the video content.
[0105] At the same time, after obtaining the target video stream address corresponding to the target video stream from the server side by sending a request through the target video stream address, based on the user's demand for watching the corresponding video content, it is also necessary to send a corresponding target video stream sending request to the server side based on the target video stream address to obtain the target video stream from the server side for playback.
[0106] It is easy to understand that another round of verification processing may be involved.
[0107] Correspondingly, as another exemplary embodiment, after receiving the target video stream address sent by the server, the method of the present application may further include:
[0108] Based on the target video stream address, a target video stream sending request is reported to the server, so that the server calculates a third hash result under the first hash algorithm based on the third device fingerprint information and the third other client information required for authentication carried in the target video stream address sending request, and compares the third hash result with the first hash result carried in the target video stream sending request. If the first hash result and the third hash result are the same, the target video stream requested by the target video stream sending request is sent to the client.
[0109] It can be understood that the verification process triggered by the target video stream sending request here can refer to the previous description of the verification process triggered by the target video stream address sending request, and the details will not be repeated here.
[0110] In addition, the above embodiments obviously introduce the solution of the present application from the perspective of the client. Correspondingly, the present application can also provide another method for requesting a video stream address from the perspective of the server.
[0111] See also Figure 2 , Figure 2 Another flow chart of the method for requesting a video stream address of the present application is shown. The method for requesting a video stream address provided by the present application may specifically include the following steps S201 to S205:
[0112] Step S201, receiving a request for sending a target video stream address reported by a client;
[0113] Step S202, extracting the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the request for sending the target video stream address, wherein the first hash result is calculated by the client through a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than cookies used by the browser;
[0114] Step S203, calculating a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication;
[0115] Step S204, comparing the second hash result with the first hash result;
[0116] Step S205: If the second hash result is the same as the first hash result, the target video stream address requested by the target video stream sending request is sent to the client.
[0117] As an exemplary embodiment, the first device fingerprint information is specifically calculated by the client based on the first device fingerprint information and the random seed information, and the target hash result is stored in a preset storage address for use in generating the first hash result and for use in reporting the target video stream address and sending a request, wherein the second preset hash algorithm includes at least one hash algorithm. When the second preset hash algorithm includes at least two hash algorithms, the hash result of the previous hash algorithm is used as the input of the next hash algorithm.
[0118] As another exemplary embodiment, when the first device fingerprint information includes multiple device fingerprint information, the target hash result is specifically obtained by the client respectively calculating the hash result under the second preset hash algorithm based on each device fingerprint information and each corresponding random seed information, and then concatenating each hash result and each random seed information, wherein each random seed information corresponds one-to-one to each device fingerprint information, or each random seed information is the same for each device fingerprint information.
[0119] As another exemplary embodiment, the first other client information required for authentication specifically includes user UID, live broadcast room RoomID, token information issued during login, device DeviceID, client version number Version, timestamp and random value.
[0120] As another exemplary embodiment, after sending the target video stream address requested by the target video stream sending request to the client, the method further includes:
[0121] Receive a request from the client to send a target video stream based on the target video stream address;
[0122] Extract the third device fingerprint information, the third other client information required for authentication, and the first hash result carried in the request to send the target video stream address;
[0123] Calculate a third hash result under the first hash algorithm based on the third device fingerprint information and the third other client information required for authentication;
[0124] comparing the third hash result to the first hash result;
[0125] If the first hash result and the third hash result are the same, the target video stream requested by the target video stream sending request is sent to the client.
[0126] The above is an introduction to the video stream address request method provided by the present application. To facilitate better implementation of the video stream address request method provided by the present application, the present application also provides a video stream address request device from the perspective of a functional module.
[0127] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the video stream address request device of the present application. In the present application, the video stream address request device 300 may specifically include the following structure:
[0128] The collection unit 301 is used to collect the first device fingerprint information of itself and store the first device fingerprint information in a preset storage address other than cookies used by the browser;
[0129] A calculation unit 302, configured to calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at a preset storage address;
[0130] The reporting unit 303 is used to report the target video stream address sending request to the server, so that the server calculates the second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried by the target video stream address sending request, and compares the second hash result with the first hash result carried by the target video stream address sending request. If the first hash result and the second hash result are the same, the target video stream address requested by the target video stream address sending request is sent to the client.
[0131] As an exemplary embodiment, the collection unit 301 is specifically configured to:
[0132] Based on the first device fingerprint information and the random seed information, calculate a target hash result under a second hash algorithm, wherein the second hash algorithm includes at least one hash algorithm, and when the second hash algorithm includes at least two hash algorithms, a hash result of a previous hash algorithm is used as an input of a next hash algorithm;
[0133] The target hash result is stored in a preset storage address for use in generating the first hash result and for use in reporting the target video stream address and sending a request.
[0134] As another exemplary embodiment, when the first device fingerprint information includes multiple device fingerprint information, the collection unit 301 is specifically configured to:
[0135] Calculate a hash result under the second hash algorithm based on each device fingerprint information and each corresponding random seed information, wherein each random seed information corresponds to each device fingerprint information one by one, or each random seed information is the same for each device fingerprint information;
[0136] Concatenate each hash result and each random seed information to get the target hash result.
[0137] As another exemplary embodiment, the first other client information required for authentication specifically includes user UID, live broadcast room RoomID, token information issued during login, device DeviceID, client version number Version, timestamp and random value.
[0138] As another exemplary embodiment, after receiving the target video stream address sent by the server, the reporting unit 303 is further configured to:
[0139] Based on the target video stream address, a target video stream sending request is reported to the server, so that the server calculates a third hash result under the first hash algorithm based on the third device fingerprint information and the third other client information required for authentication carried in the target video stream address sending request, and compares the third hash result with the first hash result carried in the target video stream sending request. If the first hash result and the third hash result are the same, the target video stream requested by the target video stream sending request is sent to the client.
[0140] In addition, the present application also provides another video stream address request device, see Figure 4 , Figure 4 This is another structural diagram of the video stream address request device of the present application. In the present application, the video stream address request device 400 may specifically include the following structure:
[0141] The receiving unit 401 is used to receive a request for sending a target video stream address reported by a client;
[0142] The extraction unit 402 is used to extract the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the target video stream address sending request, wherein the first hash result is calculated by the client through the first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than the cookie used by the browser;
[0143] A calculation unit 403 is used to calculate a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication;
[0144] A comparison unit 404, configured to compare the second hash result with the first hash result;
[0145] The sending unit 405 is configured to send the target video stream address requested by the target video stream sending request to the client if the second hash result is the same as the first hash result.
[0146] As an exemplary embodiment, the first device fingerprint information is specifically calculated by the client based on the first device fingerprint information and the random seed information, and the target hash result is stored in a preset storage address for use in generating the first hash result and for use in reporting the target video stream address and sending a request, wherein the second preset hash algorithm includes at least one hash algorithm. When the second preset hash algorithm includes at least two hash algorithms, the hash result of the previous hash algorithm is used as the input of the next hash algorithm.
[0147] As another exemplary embodiment, when the first device fingerprint information includes multiple device fingerprint information, the target hash result is specifically obtained by the client respectively calculating the hash result under the second preset hash algorithm based on each device fingerprint information and each corresponding random seed information, and then concatenating each hash result and each random seed information, wherein each random seed information corresponds one-to-one to each device fingerprint information, or each random seed information is the same for each device fingerprint information.
[0148] As another exemplary embodiment, the first other client information required for authentication specifically includes user UID, live broadcast room RoomID, token information issued during login, device DeviceID, client version number Version, timestamp and random value.
[0149] As another exemplary embodiment, after sending the target video stream address requested by the target video stream sending request to the client, the receiving unit 401 is further used to:
[0150] Receive a request from the client to send a target video stream based on the target video stream address;
[0151] The extraction unit 402 is further configured to:
[0152] Extract the third device fingerprint information, the third other client information required for authentication, and the first hash result carried in the request to send the target video stream address;
[0153] The computing unit 403 is further configured to:
[0154] Calculate a third hash result under the first hash algorithm based on the third device fingerprint information and the third other client information required for authentication;
[0155] The comparison unit 404 is further configured to:
[0156] comparing the third hash result to the first hash result;
[0157] The sending unit 405 is further used for:
[0158] If the first hash result and the third hash result are the same, the target video stream requested by the target video stream sending request is sent to the client.
[0159] The present application also provides a processing device from the perspective of hardware structure. The processing device can be a client or server involved in the solution of the present application. Figure 5 , Figure 5 501, a memory 502, and an input / output device 503. The processor 501 is used to execute the computer program stored in the memory 502 to implement the following Figure 1 or Figure 2 The steps of the video stream address request method in the corresponding embodiment; or, the processor 501 is used to execute the computer program stored in the memory 502 to implement the following Figure 3 or Figure 4 Corresponding to the functions of each unit in the embodiment, the memory 502 is used to store the processor 501 executing the above Figure 1 or Figure 2 The computer program required by the video stream address request method in the corresponding embodiment.
[0160] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502, and executed by the processor 501 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device.
[0161] The processing device may include, but is not limited to, a processor 501, a memory 502, and an input / output device 503. Those skilled in the art will appreciate that the illustration is merely an example of a processing device and does not constitute a limitation on the processing device, and may include more or fewer components than shown in the illustration, or a combination of certain components, or different components. For example, the processing device may also include a network access device, a bus, etc., and the processor 501, the memory 502, the input / output device 503, etc. are connected via a bus.
[0162] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the processing device, and uses various interfaces and lines to connect various parts of the entire device.
[0163] The memory 502 can be used to store computer programs and / or modules. The processor 501 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 502 and calling the data stored in the memory 502. The memory 502 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the processing device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0164] When the processor 501 is used to execute the computer program stored in the memory 502, the following functions can be implemented:
[0165] Collecting the first device fingerprint information of itself, and storing the first device fingerprint information in a preset storage address other than cookies used by the browser;
[0166] Calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at a preset storage address;
[0167] Report a request for sending the target video stream address to the server, so that the server calculates a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried in the request for sending the target video stream address, and compares the second hash result with the first hash result carried in the request for sending the target video stream address; if the first hash result and the second hash result are the same, send the target video stream address requested by the request for sending the target video stream address to the client.
[0168] Alternatively, when the processor 501 is used to execute the computer program stored in the memory 502, the following functions may be implemented:
[0169] Receive the target video stream address reported by the client and send a request;
[0170] Extract the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the request for sending the target video stream address, wherein the first hash result is calculated by the client through the first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than cookies used by the browser;
[0171] Based on the second device fingerprint information and the second other client information required for authentication, calculate a second hash result under the first hash algorithm;
[0172] comparing the second hash result to the first hash result;
[0173] If the second hash result is the same as the first hash result, the target video stream address requested by the target video stream sending request is sent to the client.
[0174] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the video stream address request device, processing device and its corresponding units described above can refer to the following. Figure 1 or Figure 2 The description of the video stream address request method in the corresponding embodiment will not be repeated here.
[0175] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0176] To this end, the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the present application as follows: Figure 1 or Figure 2The steps of the video stream address request method in the corresponding embodiment, the specific operation can refer to the following Figure 1 or Figure 2 The description of the video stream address request method in the corresponding embodiment will not be repeated here.
[0177] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0178] Due to the instructions stored in the computer-readable storage medium, the present application can be executed. Figure 1 or Figure 2 The steps of the video stream address request method in the corresponding embodiment, therefore, the present application can be implemented as follows Figure 1 or Figure 2 The beneficial effects that can be achieved by the video stream address request method in the corresponding embodiment are detailed in the previous description and will not be repeated here.
[0179] The video stream address request method, device, processing equipment and computer-readable storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A video stream address request method, characterized in that: The method comprises: Collecting the first device fingerprint information of the device, and storing the first device fingerprint information in a preset storage address other than cookies used by the browser; Calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at the preset storage address; Report a request for sending the target video stream address to the server, so that the server calculates a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried by the request for sending the target video stream address, and compares the second hash result with the first hash result carried by the request for sending the target video stream address; if the first hash result and the second hash result are the same, send the target video stream address requested by the request for sending the target video stream address to the client.
2. The method according to claim 1, characterized in that The storing the first device fingerprint information in a preset storage address other than cookies used by the browser includes: Based on the first device fingerprint information and the random seed information, calculate a target hash result under a second hash algorithm, wherein the second hash algorithm includes at least one hash algorithm, and when the second hash algorithm includes at least two hash algorithms, a hash result of a previous hash algorithm is used as an input of a next hash algorithm; The target hash result is stored in the preset storage address for use in generating the first hash result and for use in reporting the target video stream address and sending a request.
3. The method according to claim 2, characterized in that When the first device fingerprint information includes a plurality of device fingerprint information, the step of calculating a target hash result under a second hash algorithm based on the first device fingerprint information and the random seed information includes: Calculate a hash result under the second hash algorithm based on each device fingerprint information and each corresponding random seed information, wherein each random seed information corresponds to each device fingerprint information one by one, or each random seed information is the same for each device fingerprint information; Each of the hash results and each of the random seed information are concatenated to obtain the target hash result.
4. The method according to claim 1, characterized in that: The first other client information required for authentication specifically includes user UID, live broadcast room RoomID, token information issued during login, device DeviceID, client version number Version, timestamp and random value.
5. The method according to claim 1, characterized in that After receiving the target video stream address sent by the server, the method further includes: Based on the target video stream address, a target video stream sending request is reported to the server, so that the server calculates a third hash result under the first hash algorithm based on the third device fingerprint information and the third other client information required for authentication carried in the target video stream address sending request, and compares the third hash result with the first hash result carried by the target video stream sending request. If the first hash result and the third hash result are the same, the target video stream requested by the target video stream sending request is sent to the client.
6. A video stream address request method, characterized in that: The method comprises: Receive the target video stream address reported by the client and send a request; Extracting the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the request for sending the target video stream address, wherein the first hash result is calculated by the client through a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than cookies used by the browser; Calculate a second hash result using the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication; comparing the second hash result with the first hash result; If the second hash result is the same as the first hash result, the target video stream address requested by the target video stream sending request is sent to the client.
7. A video stream address request device, characterized in that: The device comprises: A collection unit, used to collect its own first device fingerprint information, and store the first device fingerprint information in a preset storage address other than cookies used by the browser; A calculation unit, configured to calculate a first hash result under a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored at the preset storage address; A reporting unit is used to report a target video stream address sending request to the server, so that the server calculates a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication carried by the target video stream address sending request, and compares the second hash result with the first hash result carried by the target video stream address sending request; if the first hash result and the second hash result are the same, the target video stream address requested by the target video stream address sending request is sent to the client.
8. A video stream address request device, characterized in that: The device comprises: A receiving unit, used to receive a request for sending a target video stream address reported by a client; An extraction unit, used to extract the second device fingerprint information, the second other client information required for authentication, and the first hash result carried by the request for sending the target video stream address, wherein the first hash result is calculated by the client through a first hash algorithm based on the first other client information required for authentication and the first device fingerprint information stored in a preset storage address other than a cookie used by the browser; A calculation unit, configured to calculate a second hash result under the first hash algorithm based on the second device fingerprint information and the second other client information required for authentication; a comparing unit, configured to compare the second hash result with the first hash result; A sending unit is used to send the target video stream address requested by the target video stream sending request to the client if the second hash result is the same as the first hash result.
9. A processing device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the method according to any one of claims 1 to 6 is executed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the method according to any one of claims 1 to 6.
Citation Information
Cited By
Browser fingerprint storage method and fingerprint acquisition method based on storage method
CN119476202A
