Identifier generation method, video resource verification method and device, equipment and medium

By generating and verifying the initial identifier containing multiple characters, the problem of low validation efficiency of video resource legality and timeliness in video playback platforms is solved, and fast and accurate verification of video resource legality and timeliness is achieved, improving user experience .

CN119299742APending Publication Date: 2025-01-10BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411302283.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In video playback platforms, users cannot effectively verify the legitimacy of video resources, resulting in the video resources issued by malicious platforms affecting the user experience. For example, the use of UUID verification is inefficient and difficult to ensure the timeliness of video resources.

Method used

By generating an initial identifier containing multiple characters, converting the correspondence between preset numbers and letters into letters, combining the snowflake algorithm to generate a binary representation, forming an exposure identifier, and verifying the legality and timeliness of video resources through the specified splicing method. Verify according to the exposure mark to avoid matching with the database.

Benefits of technology

It improves the efficiency of verification of the legality and timeliness of video resources, reduces verification time and storage costs, enhances the uniqueness and inverse resolution of the identification, and ensures the accuracy of the legality and timeliness of video resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299742A_ABST
    Figure CN119299742A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an identifier generation method, a video resource verification method and device, equipment and a medium, and relates to the field of data processing. The identifier generation method comprises the following steps: generating an identifier containing a plurality of characters as an initial identifier of a to-be-played video resource; according to a preset corresponding relationship between numbers and letters, a specified number in a first identifier obtained based on the initial identifier is converted into a corresponding letter, and a second identifier is obtained; obtaining a verification identifier based on the characters of the first specified bit order in the second identifier; and according to a specified splicing mode, splicing the initial identifier and the verification identifier to obtain an exposure identifier of the to-be-played video resource. Therefore, when the legality of the video resource needs to be verified, the legality of the to-be-verified video resource can be verified according to the exposure identifier of the video resource and the generation mode of the exposure identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an identification generation method, a video resource verification method, a device, a equipment and a medium. Background Art

[0002] Currently, on video playback platforms, users can watch a certain length of designated video resources to unlock specific benefits. For example, users can watch a certain length of advertisements to unlock membership benefits. However, there may be some other platforms that maliciously send other video resources, causing the designated video resources to fail to play normally. In order to avoid the above situation and affect the user's experience of using the video playback platform, it is necessary to verify whether the currently playing video resource is the designated video resource, that is, to verify the legitimacy of the video resource. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method for generating an identifier, a method, device, equipment and medium for verifying video resources, so as to verify the legitimacy of video resources. The specific technical solution is as follows:

[0004] In a first aspect of the implementation of the present application, a method for generating an identifier is first provided, the method comprising:

[0005] Generate an identifier containing multiple characters as the initial identifier of the video resource to be played;

[0006] According to a preset correspondence between numbers and letters, the specified numbers in the first identifier obtained based on the initial identifier are converted into corresponding letters to obtain a second identifier;

[0007] Obtaining a verification mark based on the characters of the first specified sequence in the second mark;

[0008] The initial identifier and the verification identifier are concatenated in a specified concatenation manner to obtain an exposure identifier of the video resource to be played.

[0009] Optionally, the initial identifier includes characters indicating a timestamp of its generation.

[0010] Optionally, generating an identifier including multiple characters as an initial identifier of the video resource to be played includes:

[0011] Generate an identifier including multiple characters represented in binary based on a snowflake algorithm as a third identifier of the video resource to be played;

[0012] The third identifier is converted into a decimal representation to obtain the initial identifier of the video resource to be played.

[0013] Optionally, the first identifier is: the initial identifier, or an identifier obtained by encrypting the initial identifier using a preset encryption algorithm.

[0014] Optionally, converting a specified number in the first identifier obtained based on the initial identifier into a corresponding letter according to a preset correspondence between numbers and letters to obtain the second identifier includes:

[0015] According to a preset correspondence between numbers and letters, the specified numbers in the first identifier obtained based on the initial identifier are converted into corresponding letters to obtain a fourth identifier;

[0016] The characters other than letters in the fourth identifier are removed to obtain a second identifier.

[0017] Optionally, obtaining a verification identifier based on characters in a first specified sequence in the second identifier includes:

[0018] Obtaining the characters of the first specified sequence in the second identifier to obtain the characters to be used;

[0019] If the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a verification mark;

[0020] If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted to lowercase letters to obtain a verification mark.

[0021] Optionally, the first designated sequence includes:

[0022] The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

[0023] Optionally, in the server, after splicing the initial identifier and the verification identifier according to the specified splicing method to obtain the exposure identifier of the video resource to be played, the method further includes:

[0024] The video resource to be played and the exposure identifier are sent to a client for playing the video resource to be played, so that the client verifies the video resource to be played based on the exposure identifier.

[0025] In a second aspect of the implementation of the present application, a method for verifying a video resource is also provided, the method comprising:

[0026] Obtain the exposure identifier of the video resource to be verified as the exposure identifier to be verified;

[0027] According to the specified splicing method used when generating the exposure mark, determine the part of the exposure mark to be verified that belongs to the verification mark to obtain a first mark to be verified, and determine the part of the exposure mark to be verified that belongs to the initial mark to obtain a second mark to be verified;

[0028] According to a preset correspondence between numbers and letters, the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a fourth identifier to be verified;

[0029] Obtaining a fifth identification to be verified based on the characters in the first specified sequence in the fourth identification to be verified;

[0030] When the fifth identifier to be verified is consistent with the first identifier to be verified, it is determined that the legitimacy of the video resource to be verified has passed the verification.

[0031] Optionally, when the fifth identifier to be verified is consistent with the first identifier to be verified, the second identifier to be verified is generated based on a snowflake algorithm;

[0032] After determining that the legitimacy of the video resource to be verified has passed the verification, the method further includes:

[0033] Determining a generation timestamp of the second identifier to be verified based on a character representing a generation timestamp of the second identifier to be verified in binary format;

[0034] When the current moment belongs to the valid time range after the generated timestamp, it is determined that the timeliness of the video resource to be verified passes the verification.

[0035] Optionally, the determining the generation timestamp of the second identifier to be verified based on the character representing the generation timestamp of the second identifier to be verified in binary representation includes:

[0036] Convert the second identifier to be verified, which is represented in decimal, into binary representation to obtain a sixth identifier to be verified;

[0037] The generation timestamp of the second identifier to be verified is determined based on the characters representing the generation timestamp of the sixth identifier to be verified.

[0038] Optionally, the third identifier to be verified is: the second identifier to be verified, or an identifier obtained by encrypting the second identifier to be verified by a preset encryption algorithm.

[0039] Optionally, converting the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified into corresponding letters according to a preset correspondence between numbers and letters to obtain the fourth identifier to be verified includes:

[0040] According to a preset correspondence between numbers and letters, the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a seventh identifier to be verified;

[0041] The characters other than letters in the seventh identifier to be verified are removed to obtain a fourth identifier to be verified.

[0042] Optionally, obtaining a fifth identifier to be verified based on the characters in the first specified sequence in the fourth identifier to be verified includes:

[0043] Obtaining the characters in the first specified sequence in the fourth identifier to be verified to obtain the characters to be used;

[0044] If the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a fifth identification to be verified;

[0045] If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted into lowercase letters to obtain a fifth identification to be verified.

[0046] Optionally, the first designated sequence includes:

[0047] The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

[0048] In a third aspect of the implementation of the present application, there is also provided an identification generation device, the device comprising:

[0049] An identification generation module, used to generate an identification containing multiple characters as an initial identification of a video resource to be played;

[0050] An identification conversion module, used for converting a specified number in the first identification obtained based on the initial identification into a corresponding letter according to a preset correspondence between numbers and letters, so as to obtain a second identification;

[0051] An identification determination module, used to obtain a verification identification based on characters of a first specified sequence in the second identification;

[0052] The identification splicing module is used to splice the initial identification and the verification identification according to a specified splicing method to obtain the exposure identification of the video resource to be played.

[0053] In a fourth aspect of the implementation of the present application, a video resource verification device is also provided, the device comprising:

[0054] An identification acquisition module, used to acquire the exposure identification of the video resource to be verified as the exposure identification to be verified;

[0055] A first determination module is used to determine the part of the exposure mark to be verified that belongs to the verification mark according to the specified splicing method used when generating the exposure mark, to obtain the first mark to be verified, and to determine the part of the exposure mark to be verified that belongs to the initial mark, to obtain the second mark to be verified;

[0056] a to-be-verified identifier conversion module, configured to convert a specified number in a third to-be-verified identifier obtained based on the second to-be-verified identifier into a corresponding letter according to a preset correspondence between numbers and letters, so as to obtain a fourth to-be-verified identifier;

[0057] A second determination module, configured to obtain a fifth identification to be verified based on the characters in the first specified sequence in the fourth identification to be verified;

[0058] The legality verification module is used to determine that the legality of the video resource to be verified has passed the verification when the fifth identifier to be verified is consistent with the first identifier to be verified.

[0059] In another aspect of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0060] Memory, used to store computer programs;

[0061] The processor is used to implement any of the above-mentioned identification generation methods or video resource verification methods when executing the program stored in the memory.

[0062] In another aspect of the implementation of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned identification generation methods or video resource verification methods is implemented.

[0063] In another aspect of the implementation of the present application, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned identification generation methods or video resource verification methods.

[0064] An identifier generation method provided in an embodiment of the present application can generate an identifier containing multiple characters as an initial identifier of a video resource to be played; according to a preset correspondence between numbers and letters, a specified number in a first identifier obtained based on the initial identifier is converted into a corresponding letter to obtain a second identifier; based on the characters in a first specified sequence in the second identifier, a verification identifier is obtained; according to a specified splicing method, the initial identifier and the verification identifier are spliced ​​to obtain an exposure identifier of the video resource to be played.

[0065] Based on the above processing, if a video resource is legitimate, the exposure mark of the video resource is generated by the mark generation method provided by the embodiment of the present application. It is also possible to determine the verification mark and the initial mark in the exposure mark of the video resource according to the specified splicing method. And according to the step of obtaining the verification mark in the mark generation method, the result obtained by processing the determined initial mark is consistent with the determined verification mark. Correspondingly, when it is necessary to verify the legitimacy of the video resource that currently needs to be verified (which can be called the video resource to be verified), the verification mark (which can be called the first mark to be verified) and the initial mark (which can be called the second mark to be verified) in the exposure mark of the video resource to be verified can be determined according to the specified splicing method. Furthermore, according to the step of obtaining the verification mark in the mark generation method, the second mark to be verified can be processed, and it is determined whether the result obtained is consistent with the first mark to be verified.

[0066] If the result obtained is consistent with the first identification to be verified, it means that the legality of the video resource to be verified has been verified, that is, the video resource to be verified is legal. If the result obtained is inconsistent with the first identification to be verified, it means that the legality of the video resource to be verified has not been verified, that is, the video resource to be verified is not legal. In this way, an exposure identification of the video resource to be played can be generated. Later, when the legality of the video resource to be verified needs to be verified, the legality of the video resource to be verified can be verified based on the exposure identification of the video resource to be verified and the generation method of the exposure identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0068] Figure 1 A schematic diagram of a first flow chart of a method for generating an identifier provided in an embodiment of the present application;

[0069] Figure 2 A second flow chart of the identification generation method provided in the embodiment of the present application;

[0070] Figure 3A third flow chart of the identification generation method provided in the embodiment of the present application;

[0071] Figure 4 A fourth flow chart of the identification generation method provided in the embodiment of the present application;

[0072] Figure 5 A fifth flow chart of the identification generation method provided in the embodiment of the present application;

[0073] Figure 6 A flowchart of a method for verifying video resources provided in an embodiment of the present application;

[0074] Figure 7 A schematic diagram of the structure of an identification generating device provided in an embodiment of the present application;

[0075] Figure 8 A schematic diagram of the structure of a video resource verification device provided in an embodiment of the present application;

[0076] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0078] Currently, on video playback platforms, users can watch a certain length of designated video resources to unlock specific benefits. For example, users can watch a certain length of advertisements to unlock membership benefits. However, there may be some other platforms that maliciously send other video resources, causing the designated video resources to fail to play normally. In order to avoid the above situation and affect the user's experience of using the video playback platform, it is necessary to verify whether the currently playing video resource is the designated video resource, that is, to verify the legitimacy of the video resource.

[0079] In order to verify the legitimacy of video resources, the present application embodiment provides a method for generating an identifier, see Figure 1 , Figure 1 A first flow chart of the identification generation method provided in the embodiment of the present application. The method includes:

[0080] Step S101: Generate an identifier containing multiple characters as an initial identifier of a video resource to be played.

[0081] Step S102: According to the preset correspondence between numbers and letters, the specified numbers in the first identification obtained based on the initial identification are converted into corresponding letters to obtain the second identification.

[0082] Step S103: obtaining a verification mark based on the characters of the first specified sequence in the second mark.

[0083] Step S104: splicing the initial identifier and the verification identifier according to a specified splicing method to obtain an exposure identifier of the video resource to be played.

[0084] Based on the above processing, if a video resource is legitimate, the exposure mark of the video resource is generated by the mark generation method provided by the embodiment of the present application. It is also possible to determine the verification mark and the initial mark in the exposure mark of the video resource according to the specified splicing method. And according to the step of obtaining the verification mark in the mark generation method, the result obtained by processing the determined initial mark is consistent with the determined verification mark. Correspondingly, when it is necessary to verify the legitimacy of the video resource that currently needs to be verified (which can be called the video resource to be verified), the verification mark (which can be called the first mark to be verified) and the initial mark (which can be called the second mark to be verified) in the exposure mark of the video resource to be verified can be determined according to the specified splicing method. Furthermore, according to the step of obtaining the verification mark in the mark generation method, the second mark to be verified can be processed, and it is determined whether the result obtained is consistent with the first mark to be verified.

[0085] If the result obtained is consistent with the first identification to be verified, it means that the legality of the video resource to be verified has been verified, that is, the video resource to be verified is legal. If the result obtained is inconsistent with the first identification to be verified, it means that the legality of the video resource to be verified has not been verified, that is, the video resource to be verified is not legal. In this way, an exposure identification of the video resource to be played can be generated. Later, when the legality of the video resource to be verified needs to be verified, the legality of the video resource to be verified can be verified based on the exposure identification of the video resource to be verified and the generation method of the exposure identification.

[0086] In addition, in the related art, UUID is used as the exposure identifier of a specified video resource. Since the randomness of UUID generation is high, it is difficult to verify the legitimacy of a video resource only through the UUID of the video resource, and other data is required to verify the legitimacy of the video resource, for example, matching the UUID of the video resource with the UUID in the database to verify the legitimacy of the video resource. Since the number of UUIDs in the database is often large, it often takes a lot of time to match the UUID of the video resource with the UUID in the database, that is, the efficiency of verifying the legitimacy of the video resource is low.

[0087] Compared with the above method, the identification generation method provided by the embodiment of the present application can verify the legitimacy of the video resource according to the exposure identification of the video resource and the generation method of the exposure identification. There is no need to match the exposure identification of the video resource with the massive exposure identification in the database, and the time required to process the exposure identification according to the generation method is often less. In this way, the time required to verify the legitimacy of the video resource can be reduced, and the efficiency of verifying the legitimacy of the video resource can be improved.

[0088] With respect to step S101, the identification generation method provided in the embodiment of the present application can be applied to a server, and the server can send video resources to a client for video playback so that the client can play the video resources. The video resources to be played can be video resources that currently need to be played in the client, and the server can send the video resources to be played to the client. Accordingly, the user can watch the video resources to be played for a certain length of time through the client to unlock specific rights. For example, the video resources to be played can be advertisements.

[0089] According to the preset identifier generation algorithm, an identifier containing a third number of characters can be generated as the initial identifier of the video resource to be played. For example, the first specified position in the initial identifier obtained according to the preset identifier generation algorithm is a character representing its generation timestamp, and the other parts except the first specified position are randomly generated numbers. For example, the third number can be 50, and the number of characters at the first specified position can be 32; or, the preset identifier generation algorithm can be a snowflake algorithm, and an identifier containing a third number of numbers can be generated according to the snowflake algorithm. For example, the third number can be 64, that is, an identifier containing 64 binary digits can be generated according to the snowflake algorithm to determine the initial identifier of the video resource to be played. The second specified position in the binary identifier generated by the snowflake algorithm is a character representing its generation timestamp. For example, the character at the second specified position can represent the difference between the generation timestamp and the preset timestamp. The preset timestamp can be the timestamp at which the identifier generation method provided in the embodiment of the present application starts to be applied.

[0090] For step S102 to step S103, the initial identifier may be processed according to a preset verification code generation algorithm to obtain a verification identifier (also referred to as a verification code). The preset verification code generation algorithm may include steps S102 to step S103. Specifically, according to a preset correspondence between numbers and letters (which may be referred to as a number-to-letter code table), the specified numbers in the first identifier obtained based on the initial identifier may be converted into corresponding letters to obtain the second identifier.

[0091] In one implementation, the first identifier may be an initial identifier. Accordingly, the specified numbers in the initial identifier may be converted into corresponding letters according to a number-to-letter code table to obtain the second identifier.

[0092] In another implementation, the initial identifier may be encrypted by a preset encryption algorithm to obtain a first identifier. For example, the preset encryption algorithm may be an AES (Advanced Encryption Standard)-128 algorithm, where 128 indicates that the key length is 128 bits; or, the preset encryption algorithm may also be a DES (Data Encryption Standard) algorithm or an RC5 algorithm (block cipher algorithm). For example, the initial identifier may be 1322715709442097153, and the first identifier obtained by encrypting the initial identifier with the AES-128 algorithm may be fUlvRsKMRAZ7uYWNSuuwbg YXUG96yJV_RPDs_UVnp0A.

[0093] Based on the above encryption processing, the step of processing the initial identifier to obtain the verification identifier can be added to increase the complexity of generating the verification identifier, thereby reducing the risk of the verification identifier generation process being cracked, and also reducing the risk of other platforms cracking the identifier generation method to forge the exposure identifier. That is, the security of the generated exposure identifier can be improved, and the effectiveness of verifying the video resource based on the exposure identifier can be guaranteed.

[0094] The designated numbers and the number-to-letter code table can be set as needed without specific limitation. For example, the designated numbers can be 0, 2, 4, 5, 7, 8, 9, and the number-to-letter code table can be 0-d, 2-k, 4-p, 5-d, 7-k, 8-e and 9-w. Taking 0-d as an example, it means that the number 0 corresponds to the letter d, and the number 0 in the first identifier can be converted to the letter d according to the number-to-letter code table. For example, according to this number-to-letter code table, the first identifier fUlvRsKMRAZ7uYWNSuuwbgYXUG96yJV_RPDs_UVnp0A is converted, and the obtained second identifier can be fUlvRsKMRAZkuYWNSuuwbgYXUGw6yJV_RPDs_UvnpdA. Alternatively, the designated numbers can also be 1, 3, 5, 6, 8, and the number-to-letter code table can be 1-a, 3-r, 5-p, 6-v and 8-x.

[0095] After obtaining the second identifier, the characters of the first specified sequence in the second identifier (which may be referred to as the characters to be used) may be determined to obtain a check identifier based on the characters to be used. The number of positions represented by the first specified sequence is fixed and may be a fourth number, that is, the number of characters to be used is the fourth number. Correspondingly, the number of characters included in the check identifier is the fourth number. For example, the fourth number may be 8 or 10. The specific process of determining the characters to be used and the check identifier may refer to the description in the subsequent embodiments.

[0096] For step S104, a splicing method of the initial mark and the verification mark (i.e., a specified splicing method) may be preset. For example, the specified splicing method may be to splice the initial mark before the verification mark, or the specified splicing method may be to splice the verification mark after the initial mark. For example, the initial mark may be 1322715709442097153, the verification mark may be flrkrrdund, and the exposure mark (also referred to as ID) obtained by splicing may be 1322715709442097153flrkrrdund.

[0097] By splicing the initial identifier and the verification identifier in accordance with the specified splicing method, the exposure identifier of the video resource to be played can be obtained. Later, when the legitimacy of the video resource to be verified needs to be verified, the client can verify the legitimacy of the video resource to be verified based on the exposure identifier of the video resource to be verified and the method of generating the exposure identifier. That is, the exposure identifier of the video resource to be played can be used to verify the legitimacy of the video resource to be played.

[0098] In the scenario of the present application, there may be some other platforms that maliciously steal the exposure identification of specified video resources as the identification of other video resources. In this case, other video resources can pass the legality verification and still affect the playback of the specified video resources. Since it often takes a certain amount of time for other platforms to steal identification, an effective time range can be set for the specified video resources. Accordingly, the client can verify whether the currently playing video resource is within the effective time range, that is, verify the timeliness of the video resource. For example, the client can verify whether the current moment is within the effective time range after the generation time of the exposure identification of the video resource to verify the timeliness of the video resource. For example, the duration of the effective time range can be 1 hour or 2 hours.

[0099] In this way, even if other platforms subsequently steal the exposure mark of the specified video resource, they will not be able to pass the timeliness verification.

[0100] In the related art, UUID is used as the exposure identifier of a specified video resource. Due to the high randomness of UUID generation, it is difficult to determine the generation time of a video resource only through its UUID, and it is impossible to verify the timeliness of the video resource. It is often necessary to use other data to verify the timeliness of the video resource. For example, it is necessary to additionally store the generation timestamp of the UUID to verify the timeliness of the video resource. This also requires more storage resources and is costly.

[0101] In the identifier generation method provided in the embodiment of the present application, the initial identifier includes a character indicating its generation timestamp. For example, the character indicating its generation timestamp is at a specified position in the initial identifier, such as the first specified position or the second specified position in the above embodiment. Correspondingly, when it is necessary to verify the timeliness of the video resource to be verified, the verification identifier (which may be referred to as the first identifier to be verified) and the initial identifier (which may be referred to as the second identifier to be verified) in the exposure identifier of the video resource to be verified can be determined according to the specified splicing method. Furthermore, the generation timestamp of the second identifier to be verified can be determined based on the character indicating its generation timestamp contained in the second identifier to be verified. Since the time for generating the verification identifier and splicing the initial identifier and the verification identifier is often short and can be ignored, the generation timestamp of the initial identifier can represent the generation time of the exposure identifier.

[0102] Accordingly, it can be determined whether the current time is within the valid time range after the generation time of the exposure mark. If the current time is within the valid time range after the generation time of the exposure mark, it means that the video resource to be verified sent by the server is valid, that is, the timeliness of the video resource to be verified has been verified, and the video resource to be verified has timeliness. If the current time is not within the valid time range after the generation time of the exposure mark, it means that the video resource to be verified sent by the server is invalid, that is, the timeliness of the video resource to be verified has not been verified, and the video resource to be verified has no timeliness.

[0103] In this way, the timeliness of the video resource can be verified according to the exposure identifier of the video resource without additionally storing the generation timestamp of the exposure identifier of the video resource, thus saving storage resources and reducing costs.

[0104] It can be seen that the part of the exposure identification generated by the identification generation method provided in the embodiment of the present application that belongs to the initial identification can ensure that the exposure identification has the characteristics of uniqueness and reverse decomposable generation time, and the part of the exposure identification that belongs to the verification identification can ensure that the exposure identification has the characteristics of verifiable legality. That is, the embodiment of the present application provides a method for generating a distributed unique ID (identifier) ​​with verifiable legality and reverse decomposable generation time. The generated identifier has the characteristics of uniqueness, reverse decomposable generation time (that is, timeliness can be verified), and legality can be verified. Subsequently, there is no need to rely on other data, and the legality and timeliness of the video resource can be verified only based on the exposure identification itself. It can save storage space, reduce system complexity and reduce performance consumption.

[0105] In the present application, the initial identifier of the video resource to be played can be obtained based on the snowflake algorithm. In one implementation, an identifier containing multiple characters represented in binary can be generated based on the snowflake algorithm as the initial identifier of the video resource to be played. For example, the initial identifier can be an identifier containing 64 binary digits generated according to the snowflake algorithm.

[0106] In another implementation, Figure 1 Based on Figure 2 , Figure 2 A second flow chart of the identification generation method provided in the embodiment of the present application. Step S101 includes:

[0107] Step S1011: Generate an identifier containing multiple characters in binary representation based on the snowflake algorithm as the third identifier of the video resource to be played.

[0108] Step S1012: convert the third identifier into a decimal representation to obtain an initial identifier of the video resource to be played.

[0109] In the embodiment of the present application, the binary identifier (i.e., the third identifier) ​​generated based on the snowflake algorithm can also be converted into a decimal representation to obtain the initial identifier of the video resource to be played. The third identifier generated based on the snowflake algorithm often has a large number of characters, and converting it into a decimal identifier can also reduce the number of characters in the initial identifier. Furthermore, the number of characters of the exposure identifier obtained by splicing the initial identifier and the verification identifier can be reduced, and the storage resources required to store the exposure identifier can also be reduced, that is, storage resources can be saved.

[0110] In addition, the complexity of processing the initial identifier can be reduced, and the efficiency of identifier generation can be improved to a certain extent. Later, when verifying the exposure identifier of the video resource, the complexity of processing the second identifier to be verified can be reduced to a certain extent, and the time required for processing the second identifier to be verified can be reduced, that is, the time required for verifying the legitimacy of the video resource can be reduced, and the efficiency of verifying the legitimacy of the video resource can be further improved.

[0111] In one embodiment, Figure 1 Based on Figure 3 , Figure 3 This is a schematic diagram of a third flow chart of the identification generation method provided in the embodiment of the present application. Step S102 includes:

[0112] Step S1021: According to the preset correspondence between numbers and letters, the specified numbers in the first identification obtained based on the initial identification are converted into corresponding letters to obtain a fourth identification.

[0113] Step S1022: remove characters other than letters in the fourth identifier to obtain a second identifier.

[0114] In the embodiment of the present application, since the number of digits in the exposure mark is limited, the initial mark is often represented by digits. In order to ensure the integrity of the information indicating the timestamp of its generation carried by the initial mark, the digits are often reserved for the initial mark. Therefore, the verification mark may not contain digits. And in order to ensure the simplicity of the exposure mark, the verification mark may also not contain other characters except letters, such as underscores.

[0115] Based on the above processing, after converting the first identifier to obtain the fourth identifier according to the preset correspondence between numbers and letters, other characters except letters in the fourth identifier can be removed to obtain the second identifier. For example, the first identifier fUlvRsKMRAZ7uYWNSuuwbgYXUG96yJV_RPDs_UVnp0A is converted to obtain the fourth identifier fUlvRsKMRAZkuYWNSuuwbgY XUGw6yJV_RPDs_UvnpdA, and then other characters except letters (including numbers and underscores) in the fourth identifier are removed to obtain the second identifier fUlvRsKMRAZkuYWNSuuwbgYXUGwyJVRPDsUVnpdA.

[0116] Subsequently, the verification mark obtained based on the characters in the first specified sequence in the second mark may not contain any characters other than letters. In this way, the simplicity of the exposure mark can be ensured, and the complexity of processing the exposure mark when verifying based on the exposure mark can be reduced to a certain extent. That is, the time required for verifying the legitimacy of the video resource can be reduced, and the efficiency of verifying the legitimacy of the video resource can be further improved.

[0117] In one embodiment, Figure 1 Based on Figure 4 , Figure 4 This is a fourth flow chart of the identification generation method provided in the embodiment of the present application. Step S103 includes:

[0118] Step S1031: Obtain the characters of the first specified sequence in the second identifier to obtain the characters to be used.

[0119] Step S1032: if the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a verification mark;

[0120] Step S1033: If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted to lowercase letters to obtain a verification mark.

[0121] In an embodiment of the present application, the current modification mode can be preset, including a first mode for changing lowercase to uppercase, and a second mode for changing uppercase to lowercase. If the modification mode is the first mode, the lowercase letters in the characters of the first specified position sequence in the acquired second identifier (i.e., the characters to be used) can be converted to uppercase letters to obtain a verification identifier. If the modification mode is the second mode, the uppercase letters in the characters to be used can be converted to lowercase letters to obtain a verification identifier. The modification mode for subsequent verification based on the exposure identifier is consistent with the modification mode set when determining the verification identifier in the process of generating the exposure identifier.

[0122] The first designated bit sequence can be set as needed without specific limitation. For example, the first designated bit sequence may include the first fourth number of bit sequences in the order from the highest bit to the lowest bit; or, the first designated bit sequence may include the first fourth number of bit sequences in the order from the lowest bit to the highest bit; or, the first designated bit sequence may include: the first first number of bit sequences determined by sampling at the first interval in the order from the highest bit to the lowest bit, and / or, the first second number of bit sequences determined by sampling at the second interval in the order from the lowest bit to the highest bit. The first interval, the second interval, the first number and the second number may be set as needed. The first interval and the second interval may be consistent, the first number and the second number may also be consistent, and the sum of the first number and the second number may be the fourth number.

[0123] For example, the first interval and the second interval can be 1, the first number and the second number can be 5, and the fourth number can be 10, that is, the characters of the 1st, 3rd, 5th, 7th, and 9th positions in the second identifier can be obtained in the order from the highest position to the lowest position (also referred to as from front to back), and the characters of the 2nd, 4th, 6th, 8th, and 10th positions in the second identifier can be obtained in the order from the lowest position to the highest position (also referred to as from back to front). For example, the second character is fUlvRsKMRAZkuYWNSuuwbgYXUGwyJVRPDsUVnpdA, and the obtained character to be used is flRKRRDUnd. If the modification mode is the second mode at this time, the verification identifier flrkrrdund can be obtained.

[0124] Based on the above processing, the characters to be used can be obtained according to the preset rules, that is, the characters of the first specified position sequence in the second identifier are obtained, and the case of the characters to be used can be modified. In this way, the step of processing the initial identifier to obtain the verification identifier can be added to increase the complexity of generating the verification identifier, which can reduce the risk of the process of generating the verification identifier being cracked, and also reduce the risk of other platforms cracking the identifier generation method to forge the exposure identifier. That is, the security of the generated exposure identifier can be improved, and the effectiveness of verifying the video resource based on the exposure identifier can be guaranteed.

[0125] In one embodiment, Figure 1 Based on Figure 5 , Figure 5 The fifth flow chart of the identification generation method provided in the embodiment of the present application is as follows. The method is applied to the server, and after step S104, the method further includes:

[0126] Step S105: sending the video resource to be played and the exposure identifier to a client for playing the video resource to be played, so that the client verifies the video resource to be played based on the exposure identifier.

[0127] In an embodiment of the present application, after generating an exposure identifier of a video resource to be played, the server may send the video resource to be played and the exposure identifier to a client for playing the video resource to be played, so that the client can verify the video resource to be played based on the exposure identifier. Specifically, the legitimacy and / or timeliness of the video resource to be played may be verified. For the specific verification process, reference may be made to the relevant descriptions of steps S601-S605 and steps 1-2 in the subsequent embodiments.

[0128] Based on the above processing, the client can verify the video resource to be verified according to the exposure identifier of the video resource to be verified, without matching the exposure identifier of the video resource to be verified with the massive exposure identifiers in the database, and without storing additional data, which can reduce the time required for verifying the video resource, improve the efficiency of verifying the video resource, and save storage resources.

[0129] Based on the same inventive concept, the present application embodiment also provides a method for verifying video resources, see Figure 6 , Figure 6 A flowchart of a method for verifying video resources provided in an embodiment of the present application. The method includes:

[0130] Step S601: Acquire the exposure identifier of the video resource to be verified as the exposure identifier to be verified.

[0131] Step S602: according to the specified splicing method used when generating the exposure mark, determine the part of the exposure mark to be verified that belongs to the verification mark to obtain the first mark to be verified, and determine the part of the exposure mark to be verified that belongs to the initial mark to obtain the second mark to be verified.

[0132] Step S603: according to the preset correspondence between numbers and letters, the designated numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a fourth identifier to be verified.

[0133] Step S604: obtaining a fifth identifier to be verified based on the characters in the first specified sequence in the fourth identifier to be verified.

[0134] Step S605: when the fifth identifier to be verified is consistent with the first identifier to be verified, it is determined that the legitimacy of the video resource to be verified has passed the verification.

[0135] In an embodiment of the present application, the method for verifying video resources can be applied to a client. The client can verify the legitimacy of the video resource to be verified based on the exposure identifier of the video resource to be verified. Specifically, the exposure identifier of the video resource currently to be verified (i.e., the video resource to be verified) can be obtained as the exposure identifier to be verified.

[0136] Since if a video resource is legitimate, the exposure mark of the video resource is generated by the mark generation method provided in the embodiment of the present application. It is also possible to determine the verification mark and the initial mark in the exposure mark of the video resource according to the specified splicing method. And according to the steps of obtaining the verification mark in the mark generation method, the result obtained by processing the determined initial mark is consistent with the determined verification mark.

[0137] Therefore, according to the designated splicing method used when generating the exposure identifier, the part of the exposure identifier to be verified that belongs to the verification identifier can be determined to obtain the first identifier to be verified, and the part of the exposure identifier to be verified that belongs to the initial identifier can be determined to obtain the second identifier to be verified. For example, if the designated splicing method is to splice the verification identifier after the initial identifier, and the fourth number is 10, the last 10 digits of the exposure identifier to be verified can be intercepted to obtain the first identifier to be verified, and the remaining part of the exposure identifier to be verified is the second identifier to be verified. For example, if the exposure identifier to be verified is 1322715709442097153flrkrrdund, the last 10 digits can be intercepted to obtain the first identifier to be verified flrkrrdund, and the remaining part 1322715709442097153 is the second identifier to be verified.

[0138] Furthermore, the second identifier to be verified can be processed according to the step of obtaining the verification identifier in the identifier generation method, and it is determined whether the obtained result is consistent with the first identifier to be verified. If the obtained result is consistent with the first identifier to be verified, it means that the legitimacy of the video resource to be verified has been verified, that is, the video resource to be verified has legitimacy. That is, the second identifier to be verified can be processed and a verification code can be generated again by the preset verification code generation algorithm (i.e., step S102-step S103) in the above embodiment. Comparing the newly generated verification code (i.e., the fifth identifier to be verified) with the first identifier to be verified, if they are consistent, it means that the exposure identifier to be verified has passed the legitimacy check, that is, the legitimacy of the video resource to be verified has passed the verification. If they are inconsistent, it means that the legitimacy of the video resource to be verified has not been verified. In this way, the client can verify the legitimacy of the video resource to be verified based on the exposure identifier of the video resource to be verified and the generation method of the exposure identifier.

[0139] In one embodiment, when the fifth identifier to be verified is consistent with the first identifier to be verified, the second identifier to be verified is generated based on a snowflake algorithm.

[0140] After step S605, the method further includes:

[0141] Step 1: Determine the generation timestamp of the second identifier to be verified based on the characters representing the generation timestamp of the second identifier to be verified in binary representation.

[0142] Step 2: When the current time is within a valid time range after the timestamp is generated, it is determined that the timeliness of the video resource to be verified has passed the verification.

[0143] In an embodiment of the present application, the second identifier to be verified generated based on the snowflake algorithm may carry information indicating its generation timestamp. The second identifier to be verified may be an identifier represented in binary by the snowflake algorithm; or, the second identifier to be verified may be obtained by converting the identifier represented in binary by the snowflake algorithm into a decimal representation, in which case the second identifier to be verified represented in decimal may be converted into a binary representation. Since the second designated position in the identifier represented in binary by the snowflake algorithm is a character indicating the generation timestamp, for example, the character at the second designated position may indicate the difference between the generation timestamp and the preset timestamp, and the preset timestamp may be the timestamp at which the identifier generation method provided in the embodiment of the present application starts to be applied. Therefore, the generation timestamp of the second identifier to be verified may be determined based on the character indicating its generation timestamp in the second identifier represented in binary.

[0144] Furthermore, it can be determined whether the current moment is within the valid time range after the generation time of the exposure mark. If the current moment is within the valid time range after the generation time of the exposure mark, it means that the video resource to be verified sent by the server is valid, that is, the timeliness of the video resource to be verified has been verified, and the video resource to be verified has timeliness. If the current moment is not within the valid time range after the generation time of the exposure mark, it means that the video resource to be verified sent by the server is invalid, that is, the timeliness of the video resource to be verified has not been verified, and the video resource to be verified has no timeliness.

[0145] That is, the second identification to be verified can be inversely solved according to the snowflake algorithm to obtain the timestamp of generating the second identification to be verified. By comparing it with the current timestamp, it can be determined whether the exposure identification to be verified meets the timeliness requirement.

[0146] Based on the above processing, the client can also verify the timeliness of the video resource to be verified according to the exposure identifier of the video resource to be verified, without additionally storing the generation timestamp of the exposure identifier of the video resource to be verified, thus saving storage resources and reducing costs.

[0147] In one embodiment, step 1 includes:

[0148] Convert the second identifier to be verified, which is represented in decimal, into binary representation to obtain a sixth identifier to be verified;

[0149] The generation timestamp of the second identifier to be verified is determined based on the characters representing the generation timestamp of the sixth identifier to be verified.

[0150] In one embodiment, the third identifier to be verified is: the second identifier to be verified, or an identifier obtained by encrypting the second identifier to be verified by a preset encryption algorithm.

[0151] In the embodiment of the present application, if the initial identifier is directly processed according to the digital-to-alphabet code table during the identifier generation process, the third identifier to be verified is the second identifier to be verified. If the initial identifier is encrypted to obtain the first identifier during the identifier generation process, and the encrypted first identifier is processed according to the digital-to-alphabet code table, the second identifier to be verified can be encrypted according to the preset encryption algorithm to obtain the third identifier to be verified.

[0152] In one embodiment, step S603 includes:

[0153] According to a preset correspondence between numbers and letters, the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a seventh identifier to be verified;

[0154] The characters other than letters in the seventh identifier to be verified are removed to obtain a fourth identifier to be verified.

[0155] In one embodiment, step S604 includes:

[0156] Obtaining the characters in the first specified sequence in the fourth identifier to be verified to obtain the characters to be used;

[0157] If the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a fifth identification to be verified;

[0158] If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted into lowercase letters to obtain a fifth identification to be verified.

[0159] In one embodiment, the first specified sequence includes:

[0160] The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

[0161] Based on the same inventive concept, the present application also provides an identification generating device, see Figure 7 , Figure 7 A schematic diagram of a structure of an identification generation device provided in an embodiment of the present application, the device comprising:

[0162] The identification generation module 701 is used to generate an identification including multiple characters as an initial identification of the video resource to be played;

[0163] The identification conversion module 702 is used to convert the specified numbers in the first identification obtained based on the initial identification into corresponding letters according to the preset correspondence between numbers and letters to obtain a second identification;

[0164] The identification determination module 703 is used to obtain a verification identification based on the characters of the first specified sequence in the second identification;

[0165] The identification splicing module 704 is used to splice the initial identification and the verification identification according to a specified splicing method to obtain the exposure identification of the video resource to be played.

[0166] Based on the identification generation device provided in the embodiment of the present application, if a video resource is legitimate, the exposure identification of the video resource is generated by the identification generation device provided in the embodiment of the present application. It is also possible to determine the verification identification and the initial identification in the exposure identification of the video resource according to the specified splicing method. And according to the process of obtaining the verification identification in the identification generation device, the result obtained by processing the determined initial identification is consistent with the determined verification identification. Correspondingly, when it is necessary to verify the legitimacy of the video resource that currently needs to be verified (which can be referred to as the video resource to be verified), the verification identification (which can be referred to as the first identification to be verified) and the initial identification (which can be referred to as the second identification to be verified) in the exposure identification of the video resource to be verified can be determined according to the specified splicing method. Furthermore, according to the process of obtaining the verification identification in the identification generation device, the second identification to be verified can be processed, and it is determined whether the result obtained is consistent with the first identification to be verified.

[0167] If the result obtained is consistent with the first identification to be verified, it means that the legality of the video resource to be verified has been verified, that is, the video resource to be verified is legal. If the result obtained is inconsistent with the first identification to be verified, it means that the legality of the video resource to be verified has not been verified, that is, the video resource to be verified is not legal. In this way, an exposure identification of the video resource to be played can be generated. Later, when the legality of the video resource to be verified needs to be verified, the legality of the video resource to be verified can be verified based on the exposure identification of the video resource to be verified and the generation method of the exposure identification.

[0168] In one embodiment, the initial identifier includes characters indicating a timestamp of its generation.

[0169] In one embodiment, the identifier generation module 701 is specifically used to generate an identifier containing multiple characters in binary representation based on a snowflake algorithm as a third identifier of the video resource to be played; convert the third identifier into a decimal representation to obtain an initial identifier of the video resource to be played.

[0170] In one embodiment, the first identifier is: the initial identifier, or an identifier obtained by encrypting the initial identifier using a preset encryption algorithm.

[0171] In one embodiment, the identification conversion module 702 is specifically used to convert the specified numbers in the first identification obtained based on the initial identification into corresponding letters according to the preset correspondence between numbers and letters to obtain a fourth identification; and remove other characters except letters in the fourth identification to obtain a second identification.

[0172] In one embodiment, the identification determination module 703 is specifically used to obtain the characters in the first specified position sequence in the second identification to obtain the characters to be used; if the preset modification mode indicates changing the lowercase to uppercase, the lowercase letters in the characters to be used are converted to uppercase letters to obtain a verification identification; if the preset modification mode indicates changing the uppercase to lowercase, the uppercase letters in the characters to be used are converted to lowercase letters to obtain a verification identification.

[0173] In one embodiment, the first specified sequence includes:

[0174] The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

[0175] In one embodiment, applied to a server, the device further includes:

[0176] A data sending module is used to send the video resource to be played and the exposure identifier to a client used to play the video resource to be played, after splicing the initial identifier and the verification identifier according to the specified splicing method to obtain the exposure identifier of the video resource to be played, so that the client can verify the video resource to be played based on the exposure identifier.

[0177] Based on the same inventive concept, the present application embodiment also provides a video resource verification device, see Figure 8 , Figure 8 A schematic diagram of the structure of a video resource verification device provided in an embodiment of the present application, the device comprising:

[0178] The identification acquisition module 801 is used to acquire the exposure identification of the video resource to be verified as the exposure identification to be verified;

[0179] A first determination module 802 is used to determine the part of the exposure mark to be verified that belongs to the verification mark according to the specified splicing method used when generating the exposure mark, to obtain a first mark to be verified, and to determine the part of the exposure mark to be verified that belongs to the initial mark, to obtain a second mark to be verified;

[0180] The identification conversion module 803 is used to convert the specified numbers in the third identification to be verified obtained based on the second identification to be verified into corresponding letters according to the preset correspondence between numbers and letters, so as to obtain a fourth identification to be verified;

[0181] A second determination module 804 is used to obtain a fifth identification to be verified based on the characters in the first specified sequence in the fourth identification to be verified;

[0182] The legality verification module 805 is used to determine that the legality of the video resource to be verified has passed the verification when the fifth identifier to be verified is consistent with the first identifier to be verified.

[0183] Based on the video resource verification device provided by the embodiment of the present application, if a video resource is legitimate, the exposure mark of the video resource is generated by the mark generation device provided by the embodiment of the present application. It is also possible to determine the verification mark and the initial mark in the exposure mark of the video resource according to the specified splicing method. And according to the process of obtaining the verification mark in the mark generation device, the result obtained by processing the determined initial mark is consistent with the determined verification mark. Correspondingly, when it is necessary to verify the legitimacy of the video resource that currently needs to be verified (which can be called the video resource to be verified), the verification mark (which can be called the first mark to be verified) and the initial mark (which can be called the second mark to be verified) in the exposure mark of the video resource to be verified can be determined according to the specified splicing method. Furthermore, according to the process of obtaining the verification mark in the mark generation device, the second mark to be verified can be processed, and it is determined whether the result obtained is consistent with the first mark to be verified.

[0184] If the result obtained is consistent with the first identification to be verified, it means that the legality of the video resource to be verified has been verified, that is, the video resource to be verified is legal. If the result obtained is inconsistent with the first identification to be verified, it means that the legality of the video resource to be verified has not been verified, that is, the video resource to be verified is not legal. In this way, when it is necessary to verify the legality of the video resource to be verified, the legality of the video resource to be verified can be verified according to the exposure identification of the video resource to be verified and the generation method of the exposure identification.

[0185] In one embodiment, when the fifth identifier to be verified is consistent with the first identifier to be verified, the second identifier to be verified is generated based on a snowflake algorithm;

[0186] The device also includes:

[0187] A generation timestamp determination module, configured to determine the generation timestamp of the second identification to be verified based on the characters representing the generation timestamp of the second identification to be verified represented in binary after determining that the legitimacy of the video resource to be verified has passed the verification;

[0188] The timeliness verification module is used to determine that the timeliness of the video resource to be verified passes the verification when the current time belongs to the valid time range after the generated timestamp.

[0189] In one embodiment, the generation timestamp determination module is specifically used to convert the second identifier to be verified, which is represented in decimal, into binary representation to obtain a sixth identifier to be verified; and determine the generation timestamp of the second identifier to be verified based on the character representing its generation timestamp in the sixth identifier to be verified.

[0190] In one embodiment, the third identifier to be verified is: the second identifier to be verified, or an identifier obtained by encrypting the second identifier to be verified by a preset encryption algorithm.

[0191] In one embodiment, the identification conversion module 803 is specifically used to convert the specified numbers in the third identification to be verified obtained based on the second identification to be verified into corresponding letters according to the preset correspondence between numbers and letters, so as to obtain the seventh identification to be verified; and remove all characters except letters in the seventh identification to be verified, so as to obtain the fourth identification to be verified.

[0192] In one embodiment, the second determination module 804 is specifically used to obtain the characters in the first specified sequence in the fourth identifier to be verified, and obtain the characters to be used; if the preset modification mode indicates changing the lowercase to uppercase, the lowercase letters in the characters to be used are converted to uppercase letters to obtain the fifth identifier to be verified; if the preset modification mode indicates changing the uppercase to lowercase, the uppercase letters in the characters to be used are converted to lowercase letters to obtain the fifth identifier to be verified.

[0193] In one embodiment, the first specified sequence includes:

[0194] The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

[0195] The present application also provides an electronic device, such as Fig. 9As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0196] Memory 903, used for storing computer programs;

[0197] The processor 901 is configured to implement any of the identification generation methods or video resource verification methods described in the above embodiments when executing the program stored in the memory 903 .

[0198] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0199] The communication interface is used for communication between the above terminal and other devices.

[0200] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0201] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0202] In another embodiment provided in the present application, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the identification generation method or the video resource verification method described in any of the above embodiments is implemented.

[0203] In another embodiment provided by the present application, a computer program product including instructions is also provided. When the computer program product is executed on a computer, the computer executes the identification generation method or the video resource verification method described in any one of the above embodiments.

[0204] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0205] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0206] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the video resource verification method, identification generation device, video resource verification device, electronic device, storage medium and computer program product embodiments, since they are basically similar to the identification generation method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the identification generation method embodiment.

[0207] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for generating an identifier, characterized in that: The method comprises: Generate an identifier containing multiple characters as the initial identifier of the video resource to be played; According to a preset correspondence between numbers and letters, the specified numbers in the first identifier obtained based on the initial identifier are converted into corresponding letters to obtain a second identifier; Obtaining a verification mark based on the characters of the first specified sequence in the second mark; The initial identifier and the verification identifier are concatenated in a specified concatenation manner to obtain an exposure identifier of the video resource to be played.

2. The method according to claim 1, characterized in that: The initial identification includes characters indicating a timestamp of its generation.

3. The method according to claim 2, characterized in that The step of generating an identifier including multiple characters as an initial identifier of a video resource to be played includes: Generate an identifier including multiple characters represented in binary based on a snowflake algorithm as a third identifier of the video resource to be played; The third identifier is converted into a decimal representation to obtain the initial identifier of the video resource to be played.

4. The method according to claim 1, characterized in that The first identifier is: the initial identifier, or an identifier obtained by encrypting the initial identifier using a preset encryption algorithm.

5. The method according to claim 1, characterized in that The step of converting the designated numbers in the first identifier obtained based on the initial identifier into corresponding letters according to the preset correspondence between numbers and letters to obtain the second identifier includes: According to a preset correspondence between numbers and letters, the specified numbers in the first identifier obtained based on the initial identifier are converted into corresponding letters to obtain a fourth identifier; The characters other than letters in the fourth identifier are removed to obtain a second identifier.

6. The method according to claim 1, characterized in that Obtaining a verification mark based on the characters of the first specified sequence in the second mark includes: Obtaining the characters of the first specified sequence in the second identifier to obtain the characters to be used; If the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a verification mark; If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted to lowercase letters to obtain a verification mark.

7. The method according to claim 1, characterized in that The first designated sequence includes: The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

8. The method according to any one of claims 1 to 7, characterized in that: Applied to the server, after splicing the initial identifier and the verification identifier according to the specified splicing method to obtain the exposure identifier of the video resource to be played, the method further includes: The video resource to be played and the exposure identifier are sent to a client for playing the video resource to be played, so that the client verifies the video resource to be played based on the exposure identifier.

9. A method for verifying video resources, characterized in that: The method comprises: Obtain the exposure identifier of the video resource to be verified as the exposure identifier to be verified; According to the specified splicing method used when generating the exposure mark, determine the part of the exposure mark to be verified that belongs to the verification mark to obtain a first mark to be verified, and determine the part of the exposure mark to be verified that belongs to the initial mark to obtain a second mark to be verified; According to a preset correspondence between numbers and letters, the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a fourth identifier to be verified; Obtaining a fifth identification to be verified based on the characters in the first specified sequence in the fourth identification to be verified; When the fifth identifier to be verified is consistent with the first identifier to be verified, it is determined that the legitimacy of the video resource to be verified has passed the verification.

10. The method according to claim 9, characterized in that When the fifth identifier to be verified is consistent with the first identifier to be verified, the second identifier to be verified is generated based on a snowflake algorithm; After determining that the legitimacy of the video resource to be verified has passed the verification, the method further includes: Determining a generation timestamp of the second identifier to be verified based on a character representing a generation timestamp of the second identifier to be verified in binary format; When the current moment belongs to the valid time range after the generated timestamp, it is determined that the timeliness of the video resource to be verified passes the verification.

11. The method according to claim 10, characterized in that The determining the generation timestamp of the second identifier to be verified based on the character representing the generation timestamp of the second identifier to be verified in binary representation includes: Convert the second identifier to be verified, which is represented in decimal, into binary representation to obtain a sixth identifier to be verified; The generation timestamp of the second identifier to be verified is determined based on the characters representing the generation timestamp of the sixth identifier to be verified.

12. The method according to claim 9, characterized in that The third identifier to be verified is: the second identifier to be verified, or an identifier obtained by encrypting the second identifier to be verified by a preset encryption algorithm.

13. The method according to claim 9, characterized in that The step of converting the designated numbers in the third identifier to be verified obtained based on the second identifier to be verified into corresponding letters according to the preset correspondence between numbers and letters to obtain the fourth identifier to be verified includes: According to a preset correspondence between numbers and letters, the specified numbers in the third identifier to be verified obtained based on the second identifier to be verified are converted into corresponding letters to obtain a seventh identifier to be verified; The characters other than letters in the seventh identifier to be verified are removed to obtain a fourth identifier to be verified.

14. The method according to claim 9, characterized in that Based on the characters in the first specified sequence in the fourth identifier to be verified, a fifth identifier to be verified is obtained, including: Obtaining the characters in the first specified sequence in the fourth identifier to be verified to obtain the characters to be used; If the preset modification mode indicates changing lowercase letters to uppercase letters, convert the lowercase letters in the characters to be used to uppercase letters to obtain a fifth identification to be verified; If the preset modification mode indicates changing uppercase letters to lowercase letters, the uppercase letters in the characters to be used are converted into lowercase letters to obtain a fifth identification to be verified.

15. The method according to claim 9, characterized in that The first designated sequence includes: The first first number of bits are sampled at a first interval in order from the most significant bit to the least significant bit, and / or the first second number of bits are sampled at a second interval in order from the least significant bit to the most significant bit.

16. A device for generating an identification, characterized in that: The device comprises: An identification generation module, used to generate an identification containing multiple characters as an initial identification of a video resource to be played; An identification conversion module, used for converting a specified number in the first identification obtained based on the initial identification into a corresponding letter according to a preset correspondence between numbers and letters, so as to obtain a second identification; An identification determination module, used to obtain a verification identification based on characters of a first specified sequence in the second identification; The identification splicing module is used to splice the initial identification and the verification identification according to a specified splicing method to obtain the exposure identification of the video resource to be played.

17. A video resource verification device, characterized in that: The device comprises: An identification acquisition module, used to acquire the exposure identification of the video resource to be verified as the exposure identification to be verified; A first determination module is used to determine the part of the exposure mark to be verified that belongs to the verification mark according to the specified splicing method used when generating the exposure mark, to obtain the first mark to be verified, and to determine the part of the exposure mark to be verified that belongs to the initial mark, to obtain the second mark to be verified; a to-be-verified identifier conversion module, configured to convert a specified number in a third to-be-verified identifier obtained based on the second to-be-verified identifier into a corresponding letter according to a preset correspondence between numbers and letters, so as to obtain a fourth to-be-verified identifier; A second determination module, configured to obtain a fifth identification to be verified based on the characters in the first specified sequence in the fourth identification to be verified; The legality verification module is used to determine that the legality of the video resource to be verified has passed the verification when the fifth identifier to be verified is consistent with the first identifier to be verified.

18. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method described in any one of claims 1-8 or any one of claims 9-15 when executing a program stored in a memory.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1-8 or any one of claims 9-15 is implemented.

20. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 8 or any one of claims 9 to 15.