CN112423149B - Content identification generation method, device, equipment and storage medium - Google Patents
Content identification generation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112423149B CN112423149B CN202011299722.3A CN202011299722A CN112423149B CN 112423149 B CN112423149 B CN 112423149B CN 202011299722 A CN202011299722 A CN 202011299722A CN 112423149 B CN112423149 B CN 112423149B
- Authority
- CN
- China
- Prior art keywords
- code
- self
- incremental
- increment
- target content
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000001514 detection method Methods 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000002123 temporal effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012797 qualification Methods 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000003997 social interaction Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/835—Generation of protective data, e.g. certificates
- H04N21/8352—Generation of protective data, e.g. certificates involving content or source identification data, e.g. Unique Material Identifier [UMID]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application discloses a content identification generation method, a content identification generation device, content identification equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a timestamp corresponding to target content; acquiring a unique self-increment code of the target content under a timestamp; and generating the identification code of the target content based on the time stamp and the incremental code. According to the technical scheme, the time stamp is acquired to distinguish the contents at different moments, the unique self-increment code under the time stamp is generated to distinguish each content requesting to generate the identification code at the same moment, the unique identification code of the target content can be generated based on the time stamp and the unique self-increment code under the time stamp, and is used as the real globally unique numerical identification of the target content in the global range, and the application range of the identification code is expanded.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a content identifier.
Background
With the development of internet technology, short video service platforms are more and more popular with users, and the number of videos generated in the short video service platforms is increased. Therefore, a method for generating a unique ID (Identity Document) for mass videos in a short video service platform is needed.
In the related art, a manually labeled machine ID, a data format ID, and a time ID are typically used in combination to generate a final ID value.
The related art has a certain limitation when applied to a distributed system.
Disclosure of Invention
The embodiment of the application provides a content identifier generation method, a content identifier generation device, content identifier generation equipment and a content identifier storage medium, which can truly and globally identify a unique numerical value of target content in a global range, and enlarge the application range of identifier codes. The technical scheme is as follows:
according to an aspect of the embodiments of the present application, a method for generating a content identifier is provided, where the method includes:
acquiring a timestamp corresponding to target content;
acquiring a unique self-increment code of the target content under the timestamp, wherein the self-increment code is used for distinguishing each content which requests to generate an identification code at the same moment;
generating an identification code for the target content based on the timestamp and the incremental code.
According to an aspect of the embodiments of the present application, there is provided an apparatus for generating a content identifier, the apparatus including:
the time stamp obtaining module is used for obtaining a time stamp corresponding to the target content;
the self-increment code acquisition module is used for acquiring a unique self-increment code of the target content under the timestamp, and the self-increment code is used for distinguishing each content which requests to generate an identification code at the same moment;
and the identification code generating module is used for generating the identification code of the target content based on the time stamp and the self-increment code.
According to an aspect of the embodiments of the present application, there is provided a computer device, the device includes a processor and a memory, the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the content identification generation method.
According to an aspect of the embodiments of the present application, there is provided a computer-readable storage medium, in which a computer program is stored, the computer program being loaded and executed by a processor to implement the above-mentioned content identification generation method.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the content identification generation method.
The technical scheme provided by the embodiment of the application can bring the following beneficial effects:
the unique identification code of the target content can be generated based on the timestamp and the unique self-increment code under the timestamp, and can be used as a real globally unique numerical identification of the target content in a global range, so that the application range of the identification code is expanded.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application execution environment provided by one embodiment of the present application;
fig. 2 is a flowchart of a method for generating a content identifier according to an embodiment of the present application;
FIG. 3 illustrates a diagram of a data structure for an identification code;
FIG. 4 illustrates a schematic diagram of a video ID generation flow in a distributed system;
FIG. 5 illustrates a flow diagram for generating a content identifier;
fig. 6 is a block diagram of a device for generating a content identifier according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The background of the application of the present application is first described to facilitate the reader's understanding of the problems addressed by the present application.
At present, the creation of content on the internet can be divided into three types: UGC (User-Generated Content), PGC (professional-Generated Content), and OGC (professional-Generated Content). The UGC and PGC are distinguished in that PGC has professional knowledge, qualification, and has a certain knowledge background and work qualification in the field of shared content.
Compared with a PGC video platform, the UGC video platform has the advantages that no professional learning and background is needed for registering an account or uploading videos, so that the UGC video platform has various video sources and various video contents. Among UGC video platforms, there are high-quality videos shot by professional content producers, videos shot at will by general content producers, popular videos relating to professional knowledge such as astronomy, geography, history, and the like, and candidate videos relating to interests of daily life. For UGC video platforms, the level of video volume uploaded by content producers per day can amount to tens of millions.
Therefore, in a distributed system, in the face of the situation that the traffic of service messages is huge and the deployment area of service machines is wide, how to efficiently generate a theoretically truly globally unique numerical ID in a global scope is a relatively challenging problem, and the problem is also solved by the content identification generation method provided by the application. This is explained below.
Besides, the scheme of the present application can generate IDs for videos, and also can give other data contents, such as orders, information, dynamic messages, audio, and the like, where the videos are merely exemplary, and the form of the data contents is not limited in the embodiments of the present application.
Referring to fig. 1, a schematic diagram of an application execution environment according to an embodiment of the present application is shown. The application execution environment may include: a terminal 10 and a server 20.
The terminal 10 may be an electronic device such as a mobile phone, a tablet Computer, a game console, a multimedia playing device, a wearable device, a PC (Personal Computer), and the like. A client of the application may be installed in the terminal 10.
In the embodiment of the present application, the application may be any application capable of uploading or publishing content. Typically, the application is a video play-type application, such as a short video application or the like. Of course, besides game application programs, videos can also be played in other types of application programs on the user interface, and after a user registers an account in a client of an application program, the user can upload and watch the videos, and can also watch videos uploaded by other users. For example, the application may be a Virtual Reality (VR) application, an Augmented Reality (AR) application, a social interaction application, an interactive entertainment application, and the like, which is not limited in this embodiment.
Optionally, a client of the above application program runs in the terminal 10. Generally, one client is installed in one terminal 10, but the present embodiment does not exclude a case where a plurality of clients are installed in one terminal 10. The number of clients, that is, the number of terminals 10 is not limited in the embodiment of the present application.
The server 20 is used to provide background services for clients of applications in the terminal 10. For example, the server 20 may be a backend server for the application described above. The server 20 may be a server, a server cluster composed of a plurality of servers, or a cloud computing service center. Optionally, the server 20 provides background services for applications in multiple terminals 10 simultaneously.
Alternatively, the terminal 10 and the server 20 may communicate with each other through the network 30.
Referring to fig. 2, a flowchart of a method provided by an embodiment of the present application is shown. The method can comprise the following steps (201-203):
In an exemplary embodiment, the target content is any item of data content in the client, such as a video, a piece of comment data, a piece of like data. The Client (Client) is also called a Client and corresponds to the server, and in the embodiment of the present application, the Client may be an application program providing a video playing service, that is, the Client may provide the video playing service for the user. Alternatively, the client corresponds to a user interface, and the application program can play the video in the user interface of the client to provide the video playing service. Optionally, the user interface of the client includes some operation controls, such as buttons, sliders, icons, and the like, for the user to operate.
In response to receiving the identification generation request, a timestamp of the reception time is acquired. And the time stamp of the receiving moment is the time stamp corresponding to the target content. The identification generation request refers to an instruction for requesting generation of an identification code of the target content, and may be intuitively understood as an ID acquisition request.
Optionally, the timestamp corresponding to the target content is a timestamp of a time when the ID obtaining request for the target content is received by the server.
The user can upload or publish target content in the client, the client sends data of the target content to an application server providing background service for the client after responding to the uploading or publishing operation of the user, the application server receives and stores the data of the target content, and then sends an ID acquisition request to a management server deployed with an ID generation service for resource management so as to obtain an identification code (content ID) of the target content, the ID generation service deployed in the management server records time information of the received request as a time stamp of the target content after receiving the ID acquisition request, and finally the management server can generate a unique content ID, such as a video ID, a comment ID and a praise ID, for the target content. Optionally, in some scenarios, the ID generation service may also be deployed in an application server or a client.
In an example, a video uploading control is displayed in a user interface of the client, and a user can trigger the client to generate the ID acquisition request by clicking the video uploading control; in another example, the user may trigger the client to generate the ID retrieval request by sliding, voice, gesture, or the like, in addition to triggering the client to generate the ID retrieval request by touch operation. The content included in the ID obtaining request is not limited in the embodiment of the present application, and optionally, the content included in the video obtaining request includes, but is not limited to, at least one of the following content: an application identification code of the client, a user account logged in by the client, characteristics of the user account logged in by the client, and a Uniform Resource Locator (URL) of the target content.
And step 202, acquiring a unique self-increment code of the target content under the time stamp.
In a possible implementation manner, after receiving the ID acquisition request, the ID generation service in the management server may call the self-increment code generation service also deployed in the management server to generate a self-increment code unique to the timestamp for the target content by using the timestamp as a data key (key) in addition to recording the timestamp. The incremental code is used to distinguish between the respective contents that are requested to generate the identification code at the same time. Alternatively, the self-incrementing encoding of the content at different time stamps may be the same or different. Optionally, in some scenarios, the self-increment code generation service may be deployed in an application server. Optionally, the self-increment code generation service is provided by a Paxos KV cluster consisting of a plurality of Paxos KV nodes. In distributed storage systems, the storage of critical data is typically accomplished using a consistency algorithm, such as the Paxos algorithm. The consistency algorithm allows multiple nodes to work together as a cluster and the cluster can still work properly when several of the nodes fail. For example, the Paxos algorithm can provide consistent, self-maintaining, peer-to-peer copy based Key-Value (KV) database services and can tolerate failure of no more than half of the nodes in a cluster. Alternatively, similar effects can be achieved in Paxos KV clusters if other KV-type storage is used, such as Remote Dictionary service (Redis), etcd systems, and so forth.
In an exemplary embodiment, the above step 202 can be implemented in two ways, which are described below for the understanding of those skilled in the art.
The first method (step 2021-step 2026):
step 2021, based on the timestamp, generates a temporary self-increment code of the target content under the timestamp.
The temporary self-increment code is generated for the target content by a certain node in the self-increment code generation service.
Step 2022, performing consistency detection on the temporary self-increment codes.
Consistency detection is used to detect uniqueness of a temporal self-increment code, consistency (consensus) refers to multiple nodes reaching consistency in state. Optionally, the consistency detection is used to detect uniqueness of the temporary incremental code at each node in the incremental code generation service.
In an exemplary embodiment, proposal information carrying a temporary self-increment code is acquired; and under the condition that the proposal information accords with a preset rule, determining that the temporary self-increasing codes pass consistency detection, wherein the preset rule refers to that a plurality of nodes meeting a preset proportion condition exist in self-increasing code generation service and all agree with the proposal information, and the self-increasing code generation service comprises a plurality of nodes used for generating self-increasing codes for target contents.
It can be simply understood that a certain node in the self-increment code generation service sends the temporary self-increment code generated for the target content as a proposal to other nodes in the self-increment code generation service, and the other nodes compare the value of the temporary self-increment code in the proposal with the current code value, and then give a feedback result to indicate whether to agree with the proposal.
Step 2023, determining the temporary self-increment code as the self-increment code of the target content when the temporary self-increment code passes consistency detection.
And a certain node in the self-increment code generation service sends the proposal information carrying the temporary self-increment codes to other nodes in the self-increment code generation service. And under the condition that a plurality of nodes meeting the preset proportion condition in the self-increasing code generation service agree with the proposal information, determining that the temporary self-increasing code passes through consistency detection, and further determining that the temporary self-increasing code is the self-increasing code of the target content.
Step 2024, updating the numerical value of the temporary self-increment code to obtain the updated temporary self-increment code when the temporary self-increment code does not pass the consistency detection.
Alternatively, the value of the temporary incrementation code is updated by an accumulation operation, for example, the current temporary incrementation code is 01 (binary), and then the incrementation code after one update may be 10 (binary).
Step 2025, performing consistency detection on the updated temporary self-increment codes.
The process of performing consistency detection on the updated temporary self-increment codes is the same as the process of performing consistency detection on the non-updated temporary self-increment codes, and only changes on detection values are detected, which is not described herein again.
Step 2026, in case that the updated temporary self-increment code passes the consistency detection, determining that the updated temporary self-increment code is the self-increment code of the target content.
The above way is to guarantee that the generated self-increment code (self-increment ID) is unique under a certain timestamp by executing Paxos algorithm in each node in the self-increment code generation service.
Mode two (step 202 a-step 202 d):
step 202a, distributing the target self-increment codes in the self-increment code library to the target content based on the time stamp to serve as the self-increment codes of the target content.
The self-increment code library comprises a preset number of unallocated self-increment codes, and the target self-increment code refers to any unallocated self-increment code in the self-increment code library. The selfjoin code library is generated in advance for use in allocation calling.
Optionally, the incremental codes in the incremental code library are sequentially distributed from small to large according to the size of the incremental codes.
Step 202b, removing the target incremental code from the incremental code library.
And removing the self-increment codes which are allocated to be used from the self-increment code library.
Step 202c, obtaining the coding margin of the self-increment coding library.
The coding margin refers to the number of the self-increment codes remaining in the self-increment code library.
And step 202d, generating a preset number of auto-increment codes to fill the auto-increment code library under the condition that the coding margin of the auto-increment code library is lower than a threshold value.
By monitoring the coding margin in the self-increment coding library, the self-increment codes are supplemented to the self-increment coding library in time, and the distribution process of the self-increment codes is ensured not to be interrupted.
Alternatively, the auto-increment code library is filled by generating the target number of auto-increment codes according to the code size sequence, and the auto-increment codes of the target number of continuous codes can be generated after the maximum code value in the auto-increment codes generated last time. For example, the last generated incrementation code is 0-100, then the incrementation code generated this time can be generated from 101.
Optionally, the target number of the incremental codes and the remaining incremental codes in the incremental code library are a plurality of codes in succession. For example, the number of the remaining incremental codes in the incremental code library is 80-100, and the target number of incremental codes generated this time may be 101-180.
And step 203, generating an identification code of the target content based on the time stamp and the incremental code.
The timestamp corresponding to the target content and the unique self-increment code under the timestamp are combined to obtain the identification code of the target content, and the timestamp can represent the time information of the target content, so that the target content can be distinguished from the data content at other moments. For the data content with the same time stamp as the target content, the identification code of the target content has a unique self-increment code under the time stamp, so that the target content and the data content with the same time stamp as the target content can be distinguished, and the uniqueness of the identification code is ensured.
In an exemplary embodiment, the timestamp, the incremental coding, the application identification coding and the region coding are subjected to data splicing processing to obtain the identification coding of the target content.
The application identification code refers to an identification code of an application service that processes the target content. Optionally, the application identification code is obtained at the same time or after the time stamp corresponding to the target data content is obtained. The application identification code can be carried by the ID acquisition request, and further the application identification code can be acquired from the ID acquisition request. Optionally, the application identification code is set for the application service in advance.
The region code is an identification code of a region where the application service is located. Alternatively, the region is divided into continents on a global basis, and each continent on the earth is assigned with a region code. The ID generation service in the management server can acquire the corresponding area code according to the area where the ID generation service is located, and finally adds the area code to the identification code of the target content.
In an exemplary embodiment, the identification encoding of the target content is a 64-bit binary encoding; the time stamp occupies 32 bits, the area code occupies 4 bits, the application identification code occupies 8 bits, and the self-increment code occupies 20 bits. In one example, as shown in FIG. 3, a diagram illustrating a data structure for an identification code is shown. Wherein, the identification code is 64-bit binary code; the second-level time stamp occupies 32 bits, the area code occupies 4 bits after the time stamp, the application identification code occupies 8 bits after the area code, and the self-increment code occupies 20 bits after the application identification code, and the total number of the self-increment codes is 64 bits.
Optionally, if the incremental coding takes the second-level timestamp as the key, the incremental coding increases from 0 in sequence every second, and the incremental coding occupies 20 bits, so the scheme can support generating 100w content identifiers per large area every second, which is sufficient to meet the service requirement in the scenario of content identifier generation.
And the timestamp does not depend on clock synchronization among machines, the requirement on the system is low, even if the condition of server clock callback occurs, as long as the key in the Paxos KV cluster exists, the generation of the content identification is not influenced, and the uniqueness of the generated content identification can still be ensured.
The content identification generation method provided by the embodiment of the present application is briefly described here by way of an example from the perspective of a distributed system. As shown in fig. 4, a schematic diagram of a video ID generation flow in a distributed system is exemplarily shown. In the figure, a client of an application program installed in a terminal 41, a short video service platform 42 is an application server providing a background service for the client of the application program installed in the terminal 41, and an ID generation service and a self-increment code generation service are deployed in a management server 43 for providing a unique video ID for a video stored in the application server.
A user may execute a corresponding operation on the terminal 41, and after responding to a video uploading or publishing operation of the user, the client uploads a video to the short video service platform 42, and after receiving and storing data of the video in the short video service platform 42, in order to facilitate resource management, the client sends an ID acquisition request, which carries an application identification code, to the management server 43 where the ID generation service is deployed. After receiving the ID acquisition request, the ID generation service deployed in the management server 43 records time information of the received request as a timestamp of the target content, acquires an application identification code carried in the ID acquisition request, and uses the timestamp as a data key (key), invokes a self-increment code generation service deployed in the management server 43 as well to generate a unique self-increment code under the timestamp for the target content, and a plurality of Paxos KV nodes in the self-increment code generation service generate a unique self-increment ID of the video under the timestamp through a Paxos algorithm and return the generated self-increment ID to the ID generation service. After receiving the self-increment ID, the ID generation service concatenates the timestamp, the self-increment code, the application identification code, and the area code to obtain the video ID of the video and sends the video ID to the short video service platform 42. The short video service platform 42 assigns the video ID to the video via the URL of the video. Optionally, a set of management servers 43 is deployed in each district (continent), including a group of Paxos KV clusters and a group of ID generation service clusters, and video IDs between different continents are distinguished by a district ID in the video IDs.
The generation flow of the content identifier is briefly described by another example, as shown in fig. 5, which schematically illustrates a flow chart of generating the content identifier. Firstly, step 51 is executed to obtain a second-level time stamp, an application identification code and a region code; then, executing step 52, requesting the Paxos KV cluster to acquire the self-increment code; finally, step 53 is performed to assemble the data in order to generate the content id. The above flow is only a brief description for facilitating understanding of the technical solutions provided in the present application, and does not represent an actual processing procedure.
In summary, according to the embodiments provided by the present application, the time stamps are obtained to distinguish the contents at different times, the unique self-increment codes under the time stamps are generated to distinguish the contents that are requested to generate the identification codes at the same time, based on the time stamps and the unique self-increment codes under the time stamps, the unique identification codes of the target contents can be generated to serve as the real globally unique numerical identification of the target contents in the global scope, the time consistency among the machines is not required, and the application range of the identification codes is expanded.
In addition, the video ID is generated based on the Paxos KV cluster, and the generation of the global unique ID which does not depend on time synchronization among machines can be conveniently realized. Because Paxos KV has very high write performance (10 ten thousand times/second), large-scale identification code generation can be supported without difficulty, and by using some pre-allocation methods, very high identification code generation performance can be achieved. The method also has the characteristic of high availability due to the realization of service clustering distributed deployment.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 6, a block diagram of a device for generating a content identifier according to an embodiment of the present application is shown. The device has the function of realizing the method for generating the content identification. The apparatus 600 may include: a timestamp acquisition module 601, an incremental code acquisition module 602, and an identification code generation module 603.
The timestamp obtaining module 601 is configured to obtain a timestamp corresponding to the target content.
A self-increment code obtaining module 602, configured to obtain a unique self-increment code of the target content under the timestamp, where the self-increment code is used to distinguish each content that is requested to generate an identification code at the same time.
An identification code generating module 603, configured to generate an identification code of the target content based on the timestamp and the incremental code.
In an exemplary embodiment, the autoincrement code obtaining module 602 is configured to:
generating a temporary self-increment code of the target content under the time stamp based on the time stamp;
performing consistency detection on the temporary self-increment codes, wherein the consistency detection is used for detecting the uniqueness of the temporary self-increment codes;
determining that the temporal incremental code is an incremental code of the target content if the temporal incremental code passes the consistency detection.
In an exemplary embodiment, the autoincrement code obtaining module 602 is configured to:
acquiring proposal information carrying the temporary self-increment code;
and under the condition that the proposal information conforms to a preset rule, determining that the temporary self-increment code passes the consistency detection, wherein the preset rule means that a plurality of nodes with the number meeting a preset proportion condition in self-increment code generating service all agree with the proposal information, and the self-increment code generating service comprises a plurality of nodes used for generating the self-increment code for the target content.
In an exemplary embodiment, the incremental code acquisition module 602 is configured to:
under the condition that the temporary self-increment code does not pass the consistency detection, updating the numerical value of the temporary self-increment code to obtain an updated temporary self-increment code;
carrying out consistency detection on the updated temporary self-increasing codes;
determining that the updated temporary self-increment code is a self-increment code of the target content if the updated temporary self-increment code passes the consistency detection.
In an exemplary embodiment, the incremental code obtaining module 602 is further configured to:
distributing target incremental coding in an incremental coding library to the target content based on the timestamp to serve as the incremental coding of the target content, wherein the incremental coding library comprises a preset number of unassigned incremental coding, and the target incremental coding refers to any unassigned incremental coding in the incremental coding library;
removing the target surcharge code from the surcharge code library.
In an exemplary embodiment, the autonomy code obtaining module 602 is further configured to:
acquiring coding margin of the self-increment coding library, wherein the coding margin refers to the number of the self-increment codes remained in the self-increment coding library;
and generating a preset number of auto-increment codes to fill the auto-increment code library under the condition that the coding margin of the auto-increment code library is lower than a threshold value.
In an exemplary embodiment, the identification code generating module 603 is configured to:
performing data splicing processing on the time stamp, the self-increasing codes, the application identification codes and the region codes to obtain identification codes of the target content;
the application identification content code refers to an identification code of an application service for processing the target content, and the region code refers to an identification code of a region where the application service is located.
In an exemplary embodiment, the identification encoding of the target content is a 64-bit binary encoding; the time stamp occupies 32 bits, the area code occupies 4 bits, the application identification code occupies 8 bits, and the self-increment code occupies 20 bits.
In summary, according to the technical scheme provided by the embodiment of the application, the timestamps are acquired to distinguish the contents at different moments, the unique self-increment codes under the timestamps are generated to distinguish the contents which request to generate the identification codes at the same moment, and the unique identification codes of the target contents can be generated based on the timestamps and the unique self-increment codes under the timestamps, and serve as the real globally unique numerical identification of the target contents in the global range, so that the application range of the identification codes is expanded.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
In an exemplary embodiment, there is also provided a computer device, the device comprising a processor and a memory, the memory having stored therein a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned content identification generation method.
In an exemplary embodiment, a computer-readable storage medium is also provided, in which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the above-mentioned content identification generation method.
Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State drive), or optical disc. The Random Access Memory may include a ReRAM (resistive Random Access Memory) and a DRAM (Dynamic Random Access Memory).
In an exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the content identification generation method.
It should be understood that reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, the step numbers described herein only show an exemplary possible execution sequence among the steps, and in some other embodiments, the steps may also be executed out of the numbering sequence, for example, two steps with different numbers are executed simultaneously, or two steps with different numbers are executed in a reverse order to the illustrated sequence, which is not limited in this application.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (7)
1. A method for generating a content identifier, the method comprising:
acquiring a timestamp corresponding to target content;
generating a temporary self-increment code of the target content under the time stamp based on the time stamp;
acquiring proposal information carrying the temporary self-increment code;
determining that the temporary self-increment code passes consistency detection under the condition that the proposal information conforms to a preset rule, wherein the preset rule means that a plurality of nodes with the number meeting a preset proportion condition in self-increment code generating service agree with the proposal information, the self-increment code generating service comprises a plurality of nodes for generating the self-increment code for the target content, and the consistency detection is used for detecting the uniqueness of the temporary self-increment code;
determining the temporary incremental code as the incremental code of the target content when the temporary incremental code passes the consistency detection, wherein the incremental code is used for distinguishing each content which requests to generate an identification code at the same moment;
generating an identification code of the target content based on the timestamp and the incremental code;
or;
acquiring a timestamp corresponding to target content;
distributing target incremental codes in an incremental code library to the target content based on the timestamp to serve as the incremental codes of the target content, wherein the incremental codes are used for distinguishing each content which requests to generate an identification code at the same moment, the incremental code library comprises a preset number of unassigned incremental codes, and the target incremental codes refer to any unassigned incremental codes in the incremental code library;
removing the target surcharge code from the surcharge code library;
generating an identification code for the target content based on the timestamp and the incremental code.
2. The method of claim 1, further comprising:
under the condition that the temporary self-increment code does not pass the consistency detection, updating the numerical value of the temporary self-increment code to obtain an updated temporary self-increment code;
carrying out consistency detection on the updated temporary self-increment codes;
determining the updated temporary autogain encoding to be the autogain encoding of the target content if the updated temporary autogain encoding passes the consistency detection.
3. The method of any of claims 1-2, wherein generating the identification code of the target content based on the timestamp and the incremental code comprises:
performing data splicing processing on the timestamp, the self-increment code, the application identification code and the area code to obtain an identification code of the target content;
the application identification code refers to an identification code of an application service for processing the target content, and the region code refers to an identification code of a region where the application service is located.
4. The method of claim 3, wherein the identification code of the target content is a 64-bit binary code; the time stamp occupies 32 bits, the area code occupies 4 bits, the application identification code occupies 8 bits, and the incremental code occupies 20 bits.
5. An apparatus for generating a content id, the apparatus comprising:
the time stamp obtaining module is used for obtaining a time stamp corresponding to the target content;
the self-increment code acquisition module is used for generating a temporary self-increment code of the target content under the timestamp based on the timestamp; acquiring proposal information carrying the temporary self-increment code; determining that the temporary self-increment code passes consistency detection under the condition that the proposal information conforms to a preset rule, wherein the preset rule means that a plurality of nodes with the number meeting a preset proportion condition in self-increment code generating service agree with the proposal information, the self-increment code generating service comprises a plurality of nodes for generating the self-increment code for the target content, and the consistency detection is used for detecting the uniqueness of the temporary self-increment code; determining the temporary autonomy code as the autonomy code of the target content if the temporary autonomy code passes the consistency detection;
the identification code generating module is used for generating an identification code of the target content based on the timestamp and the incremental code;
or;
the time stamp obtaining module is used for obtaining a time stamp corresponding to the target content;
the incremental encoding acquisition module is used for allocating target incremental encoding in an incremental encoding library to the target content based on the timestamp to serve as the incremental encoding of the target content, the incremental encoding is used for distinguishing each content which requests to generate identification encoding at the same moment, the incremental encoding library comprises a preset number of unallocated incremental encoding, and the target incremental encoding refers to any unallocated incremental encoding in the incremental encoding library; removing the target self-increment code from the self-increment code library;
and the identification code generating module is used for generating the identification code of the target content based on the timestamp and the incremental code.
6. A computer arrangement, characterized in that the arrangement comprises a processor and a memory, in which a computer program is stored, which computer program is loaded and executed by the processor to implement the method according to any of claims 1-4.
7. A computer-readable storage medium, in which a computer program is stored which is loaded and executed by a processor to implement the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011299722.3A CN112423149B (en) | 2020-11-19 | 2020-11-19 | Content identification generation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011299722.3A CN112423149B (en) | 2020-11-19 | 2020-11-19 | Content identification generation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112423149A CN112423149A (en) | 2021-02-26 |
CN112423149B true CN112423149B (en) | 2022-11-15 |
Family
ID=74774816
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011299722.3A Active CN112423149B (en) | 2020-11-19 | 2020-11-19 | Content identification generation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112423149B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143285B (en) * | 2021-10-29 | 2023-11-28 | 青岛海尔科技有限公司 | Method, device and server for generating ID in distributed system |
CN114900497B (en) * | 2022-05-09 | 2023-09-26 | 上海极豆科技有限公司 | Identification sequence number generation method and device, electronic equipment and storage medium |
CN115510815B (en) * | 2022-11-17 | 2023-03-28 | 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) | Rule-based identification generation method and apparatus |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104252441A (en) * | 2013-06-27 | 2014-12-31 | 镇江雅迅软件有限责任公司 | Method for implementing encoding mechanism based on time stamp rule |
CN111291424A (en) * | 2020-02-19 | 2020-06-16 | 望海康信(北京)科技股份公司 | Identification number generation method and device, computer equipment and storage medium |
CN111598628A (en) * | 2020-05-26 | 2020-08-28 | 北京学之途网络科技有限公司 | Information pushing method and device based on user identification information |
CN111917897A (en) * | 2020-07-15 | 2020-11-10 | 深圳市腾讯网域计算机网络有限公司 | Identification generation method, device, equipment and storage medium |
-
2020
- 2020-11-19 CN CN202011299722.3A patent/CN112423149B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104252441A (en) * | 2013-06-27 | 2014-12-31 | 镇江雅迅软件有限责任公司 | Method for implementing encoding mechanism based on time stamp rule |
CN111291424A (en) * | 2020-02-19 | 2020-06-16 | 望海康信(北京)科技股份公司 | Identification number generation method and device, computer equipment and storage medium |
CN111598628A (en) * | 2020-05-26 | 2020-08-28 | 北京学之途网络科技有限公司 | Information pushing method and device based on user identification information |
CN111917897A (en) * | 2020-07-15 | 2020-11-10 | 深圳市腾讯网域计算机网络有限公司 | Identification generation method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112423149A (en) | 2021-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112423149B (en) | Content identification generation method, device, equipment and storage medium | |
JP7397094B2 (en) | Resource configuration method, resource configuration device, computer equipment, and computer program | |
CN114329298B (en) | Page presentation method and device, electronic equipment and storage medium | |
CN111881210A (en) | Data synchronization method, device, intranet server and medium | |
CN112910880B (en) | Virtual room creating method, system, device, equipment and medium | |
CN113254424B (en) | Data service migration method, device and equipment | |
CN113986835B (en) | FastDFS distributed file management method, fastDFS distributed file management device, fastDFS distributed file management equipment and storage medium | |
CN110888858A (en) | Database operation method and device, storage medium and electronic device | |
CN114404960A (en) | Cloud game resource data processing method and device, computer equipment and storage medium | |
CN114760240B (en) | Data transmission method and device, electronic equipment and computer readable storage medium | |
CN112860777A (en) | Data processing method, device and equipment | |
CN115756955A (en) | Data backup and data recovery method and device and computer equipment | |
CN113625936B (en) | Data processing method, device, storage medium and equipment | |
CN106686150A (en) | Backup method and system of application information, client and cloud server | |
CN115277704B (en) | Cloud playing system based on distributed preloading | |
CN104965840B (en) | Data node random allocation method and system | |
CN115374141A (en) | Virtual image updating method and device | |
US11822570B2 (en) | Database synchronization employing parallel poll threads | |
CN111966993B (en) | Equipment identification code identification and generation algorithm test method, device, equipment and medium | |
CN107305610B (en) | Access path processing method and device, and automaton identification method, device and system | |
CN114726909A (en) | Cloud service migration information processing method, device, equipment, medium and product | |
CN114491093A (en) | Multimedia resource recommendation and object representation network generation method and device | |
CN111885350A (en) | Image processing method, system, server and storage medium | |
CN117539649B (en) | Identification management method, equipment and readable storage medium of distributed cluster | |
CN118214692B (en) | Service operation detection method, device, computer equipment, storage medium and computer program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |