A message identification generation method, device, electronic device and storage medium

By using the device identification information and time identification information to generate the first message identification code and adding an identifier on the basis, the problem of low reliability in the message identification generation in the prior art is solved, and the uniqueness and efficiency of the message identification are realized.

CN116032869BActive Publication Date: 2025-05-02HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211493568.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2025-05-02
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

In the prior art, the message identification generation method is relatively low and it is impossible to effectively distinguish different messages.

Method used

By responding to the message identification request instruction of the requesting device, first information including device identification information and time identification information is obtained, the first message identification is generated based on these information, and an identifier is added thereon, and a target message identification is generated for uniquely identifying the message.

Benefits of technology

It effectively enhances the reliability of message identification generation, ensures that each message has a unique identity, and avoids the problem of duplication and innate message identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116032869B_ABST
    Figure CN116032869B_ABST
Patent Text Reader

Abstract

The present invention provides a message identifier generation method, device, electronic device and storage medium, which can obtain first information in response to a message identifier request instruction sent by a requesting device; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time; based on the time identification information and the device identification information, a first message identifier is generated; based on a predefined first identification generation method, a first identification for identifying the first message identifier is generated; at least based on the first message identifier and the first identification, a target message identifier is generated. The present invention can generate a first message identifier using the time identification information and the device identification information, add an identifier of the first message identifier, i.e., a first identification, on the basis of the first message identifier, and generate a target message identifier for uniquely identifying a message based on the first message identifier and the first identification, thereby effectively enhancing the reliability of message identifier generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a message identifier generation method, device, electronic device and storage medium. Background Art

[0002] With the development of computer science and technology, message processing technology continues to improve.

[0003] In current message processing services such as message push services, a unique message identifier can be generated for each message to be processed to distinguish different messages. The message identifier can be a string used to identify the message, and can be composed of at least one of Chinese characters, letters, numbers, and punctuation marks.

[0004] However, the existing message identifier generation method has low reliability. Summary of the invention

[0005] The present invention provides a message identifier generation method, device, electronic device and storage medium, which are used to solve the defect of low reliability of the message identifier generation method in the prior art and effectively enhance the reliability of the message identifier generation.

[0006] The present invention provides a message identifier generation method, comprising:

[0007] In response to the message identification request instruction sent by the requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time;

[0008] Generate a first message identifier based on the time identifier information and the device identifier information;

[0009] Generate a first identifier for identifying the first message identifier based on a predefined first identifier generation method;

[0010] A target message identifier is generated based at least on the first message identifier and the first identifier.

[0011] Optionally, when the message identifier request instruction is used to request N message identifiers, generating a first identifier for identifying the first message identifier based on a predefined first identifier generation method includes:

[0012] Based on the first identifier generation method, generate N different identifiers;

[0013] Determine the N mutually different identifiers as identifiers of the N message identifiers respectively;

[0014] An identifier of the N message identifiers is determined as the first identifier.

[0015] Optionally, when N is greater than 1, generating N different identifiers based on the first identifier generation method includes:

[0016] Get the initial string to be processed;

[0017] Based on the initial character string and the character string increment processing method, generate N different character strings;

[0018] The N mutually different character strings are determined as the N mutually different identifiers.

[0019] Optionally, the first information further includes: a predefined end position identifier, the end position identifier including a start position identifier and / or an end position identifier; and generating a target message identifier based at least on the first message identifier and the first identifier includes:

[0020] The end position identifier, the first message identifier and the first identifier are concatenated in a preset arrangement order to generate the target message identifier.

[0021] Optionally, before generating the target message identifier by splicing the end position identifier, the first message identifier and the first identifier in a preset arrangement order, the message identifier generating method further includes:

[0022] Determining whether the length of the character string of the first message identifier is less than a preset length value;

[0023] When it is determined that the character string length of the first message identifier is less than the preset length value, padding the first message identifier to obtain the first message identifier whose character string length is the preset length value;

[0024] The step of splicing the end position identifier, the first message identifier and the first identifier in a preset arrangement order to generate the target message identifier includes:

[0025] The target message identifier is generated by concatenating the end position identifier, the first identifier and the first message identifier whose character string length is the preset length value in a preset arrangement order.

[0026] Optionally, the first message identifier includes a timestamp bit string and a machine bit string; and generating the first message identifier based on the time identifier information and the device identifier information includes:

[0027] Based on the current time information, generate the timestamp bit string;

[0028] Based on the device identification information, the machine bit string is generated.

[0029] Optionally, when the device identification information is the IP address of the requesting device, generating the machine bit string based on the device identification information includes:

[0030] Performing integer value conversion processing on the IP address to obtain a corresponding integer value;

[0031] The integer value is encoded to generate the machine bit string.

[0032] The present invention also provides a message identifier generating device, comprising: a first obtaining unit, a first generating unit, a second generating unit and a third generating unit; wherein:

[0033] The first obtaining unit is used to obtain first information in response to a message identification request instruction sent by a requesting device; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time;

[0034] The first generating unit is used to generate a first message identifier based on the time identifier information and the device identifier information;

[0035] The second generating unit is used to generate a first identifier for identifying the first message identifier based on a predefined first identifier generation method;

[0036] The third generating unit is configured to generate a target message identifier based at least on the first message identifier and the first identifier.

[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the message identifier generation methods described above is implemented.

[0038] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the message identifier generation method described in any one of the above is implemented.

[0039] The message identifier generation method, device, electronic device and storage medium provided by the present invention can obtain first information in response to a message identifier request instruction sent by a requesting device; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time; a first message identifier is generated based on the time identification information and the device identification information; a first identifier for identifying the first message identifier is generated based on a predefined first identifier generation method; a target message identifier is generated based at least on the first message identifier and the first identifier. The present invention can generate a first message identifier using time identification information and device identification information, add an identifier of the first message identifier, i.e., a first identifier, on the basis of the first message identifier, and generate a target message identifier for uniquely identifying a message based on the first message identifier and the first identifier, thereby effectively enhancing the reliability of message identifier generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 This is one of the flow charts of the message identifier generation method provided by an embodiment of the present invention;

[0042] Figure 2 This is a second flow chart of the message identifier generation method provided by an embodiment of the present invention;

[0043] Figure 3 is a schematic diagram of the structure of a target message identifier provided by an embodiment of the present invention;

[0044] Figure 4 It is a structural schematic diagram of a message identifier generating device provided by an embodiment of the present invention;

[0045] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Combine the following Figure 1-Figure 2 The message identifier generation method of the present invention is described.

[0048] like Figure 1 As shown, the present invention proposes a first message identifier generation method, which may include the following steps:

[0049] S101, in response to a message identification request instruction sent by a requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time;

[0050] The requesting device may be a device that needs to obtain a message identifier to identify a related message.

[0051] Optionally, the requesting device may be a device deployed with a message processing service. Specifically, when the message processing service deployed in the requesting device needs to identify a message, the message processing service may request the message identifier through the requesting device, and use the obtained message identifier to identify the message. Optionally, the message processing service may be a distributed deployed service.

[0052] The message identifier request instruction may be an instruction for requesting to obtain a message identifier.

[0053] Specifically, the message identifier request instruction may be used to request to obtain one or more message identifiers.

[0054] Optionally, when the message identifier request instruction is used to request multiple message identifiers, the message identifier request instruction may be a concurrent request instruction, that is, the message identifier request instruction may include multiple request instructions for requesting message identifiers, and each request instruction may be used to request one message identifier.

[0055] Optionally, when the message identifier request instruction is used to request to obtain multiple message identifiers, the message identifier request instruction may also include only one request instruction for requesting to obtain the message identifier. In this case, the message identifier request instruction needs to carry the requested number of message identifiers;

[0056] The predefined time may be a specified time.

[0057] Optionally, the predefined time may be the time at which the present invention obtains the message identification request instruction;

[0058] Optionally, the predefined time may be the current time when the present invention starts processing the message identification request instruction;

[0059] Optionally, the predefined time may be the time at which the requesting device sends the message identification request instruction. Optionally, the message identification request instruction may carry the sending time, and the present invention may parse the sending time from the message identification request instruction.

[0060] The time identification information may be time information used to identify a predefined moment.

[0061] Optionally, the time identification information may include the date and specific time value corresponding to the predefined moment, such as 08:08:08 on October 1, 2022.

[0062] Optionally, the time identification information may be the interval length from the preset time value to the predefined time, such as the millisecond value of the interval. The preset time value may be a time value of a certain day, and the preset time value may be set by a technician according to actual conditions, and the present invention does not limit this.

[0063] The device identification information is information used to identify the device, such as the device IP address and device code, etc. Optionally, the message identification request instruction may carry the sending time, and the present invention may parse the sending time from the message identification request instruction.

[0064] Specifically, the first information may be relevant preparation information required to generate a message identifier.

[0065] Specifically, the present invention can obtain the first information in response to the message identification request instruction when obtaining the message identification request instruction sent by the requesting device.

[0066] S102, generating a first message identifier based on the time identifier information and the device identifier information;

[0067] The first message identifier may be a message identifier that can simultaneously reflect time identifier information and device identifier information.

[0068] Specifically, the first message identifier may include one or more message identifiers. Each message identifier in the first message identifier may be a character string, and may simultaneously reflect time identifier information and device identifier information.

[0069] Specifically, the present invention can generate a first message identifier based on the time identifier information and the device identifier information after obtaining the time identifier information and the device identifier information.

[0070] Specifically, when the message identifier request instruction is used to request a message identifier, the present invention may generate a message identifier based on the time identifier information and the device identifier information, and at this time, the first message identifier may include only one message identifier;

[0071] Specifically, when the message identifier request instruction is used to request multiple message identifiers, the present invention can generate multiple message identifiers based on time identifier information and device identifier information, wherein each of the multiple message identifiers can be generated based on time identifier information and device identifier information.

[0072] It should be noted that the message identifier requester usually has content requirements for the message identifier, such as the splicing result obtained by directly splicing information, or the content mapped using a specified string mapping method, such as hash value calculation and base encoding.

[0073] It is understandable that the present invention can process the time identification information and the device identification information in a corresponding manner according to the content requirements of the message identification requester for the message identification, so as to obtain a message identification that meets the content requirements.

[0074] Optionally, when generating a message identifier based on the time identifier information and the device identifier information, the present invention may directly concatenate the time identifier information and the device identifier information to determine the concatenation result as a message identifier;

[0075] Optionally, when generating a message identifier based on the time identifier information and the device identifier information, the present invention may map the time identifier information and the device identifier information into corresponding character strings respectively, and then concatenate the two mapped character strings, and the concatenated character string may be determined as a message identifier;

[0076] Optionally, the present invention may also first concatenate the time identification information and the device identification information to obtain a corresponding concatenation result, and then map the concatenation result into a corresponding character string, and determine the mapped character string as a message identifier.

[0077] It should be noted that the string mapping method adopted by the present invention when performing string mapping can make the mapping object and the mapping result have a one-to-one correspondence, and thus can make the first message identifier obtained based on the time identification information and the device identification information unique, that is, when the time identification information or the device identification information is different, the message identifier generated based on the time identification information and the device identification information is different.

[0078] S103: Generate a first identifier for identifying a first message identifier based on a predefined first identifier generation method;

[0079] It should be noted that when the same requesting device requests multiple message identifiers at the same time, that is, the message identifier request instruction is used to request multiple message identifiers, since the device identification information of the requesting device is the same as the time identification information, the first message identifier generated based on the device identification information and the time identification information may contain the same message identifier, resulting in the generated message identifier being unable to uniquely identify a message. In order to further ensure the uniqueness of the message identifier ultimately generated by the present invention, the present invention can, on the basis of the first message identifier, add an identifier for uniquely identifying the message identifier in the first message identifier, so that the ultimately generated message identifier can uniquely identify a message, thereby enhancing the reliability of the message identifier generation method.

[0080] The first identifier may include an identifier used to identify each message identifier in the first message identifier.

[0081] Specifically, the first identifier may include a corresponding number of identifiers, each of which may be used to uniquely identify a message identifier in the first message identifier. Each identifier may be composed of at least one of Chinese characters, letters, numbers, mathematical symbols, and punctuation marks.

[0082] The first identifier generation method is the identifier generation method used to generate the first identifier.

[0083] It can be understood that when the message identifier request instruction is used to request a message identifier, the first message identifier may only include a message identifier, and the message identifier can uniquely identify a message. At this time, the first identifier generation method can be a random string generation method. The present invention can use the random string generation method to randomly generate a string as the first identifier;

[0084] When the message identifier request instruction is used to request to obtain multiple message identifiers, the first message identifier may include multiple message identifiers, and the same message identifier may exist in the multiple message identifiers. At this time, the first identifier generation method may be a string generation method for generating non-repeating strings. The present invention may use the first identifier generation method to generate a corresponding number of mutually different strings, and the corresponding number of mutually different strings is the first identifier. The present invention may use the corresponding number of mutually different strings as identifiers of each message identifier in the first message identifier.

[0085] Specifically, when the message identifier requester has a specific content requirement for the message identifier, the present invention can generate a first identifier that meets the requirement in a processing method corresponding to the requirement. For example, when randomly generating a string, a string that meets the requirement is generated; for another example, when generating a non-repeating string, a string that meets the requirement and is non-repeating is generated.

[0086] It should be noted that different message identification request instructions may be sent by the same requesting device at different times, or may be sent by different requesting devices at the same time. Due to the difference in requesting devices or requesting times, the first message identifications generated by the present invention for different message identification requests are different. It is understandable that the first identifications generated by the present invention for different message identification request instructions may be the same or different; for example, the first identification generated by the present invention for a message identification request instruction sent by a requesting device at a first time may be the same as or different from the first identification generated by the present invention for a message identification request instruction sent by the requesting device at a second time.

[0087] S104: Generate a target message identifier based at least on the first message identifier and the first identifier.

[0088] The target message identifier is a message identifier for identifying a message that is finally generated in response to a message identifier request instruction.

[0089] Specifically, the target message identifier may include a corresponding number of message identifiers, and each message identifier in the target message identifier may uniquely identify a message.

[0090] Specifically, when the message identifier request instruction is used to request a message identifier, the target message identifier may include only one message identifier;

[0091] Specifically, when the message identifier request instruction is used to request multiple message identifiers, the target message identifiers may include the same number of message identifiers.

[0092] Specifically, after obtaining the first message identifier and the first identifier, the present invention can generate a target message identifier at least based on the first message identifier and the first identifier.

[0093] It is understandable that the first message identifier and the first identifier as a whole can uniquely identify a message identifier. The present invention can generate a target message identifier based only on the first message identifier and the first identifier.

[0094] Specifically, the present invention can generate each message identifier in the target message identifier based on the first message identifier and the first identifier.

[0095] It should be noted that the message identifier requester usually has content requirements for the message identifier, such as the splicing result obtained by directly splicing information, or the content mapped using a specified string mapping method, such as hash value calculation and base encoding.

[0096] It is understandable that the present invention can process the first message identifier in a corresponding processing manner according to the content requirements of the message identifier requester for the message identifier, so as to obtain a message identifier that meets the content requirements.

[0097] Specifically, the present invention can generate a message identifier in the target message identifier based on the corresponding processing method, a message identifier in the first message identifier, and the identifier corresponding to the message identifier in the first identifier. For example, directly concatenate a message identifier in the first message identifier with the corresponding identifier, and determine the concatenated string as a message identifier in the target message identifier; for another example, using the above-mentioned string mapping method, map a message identifier in the first message identifier to the corresponding string, and map the corresponding identifier to the corresponding string, concatenate the two mapped strings, and determine the concatenation result as a message identifier in the target message identifier; for another example, concatenate a message identifier in the first message identifier with the corresponding identifier to obtain a concatenation result, use the above-mentioned string mapping method to map the concatenation result to a string of the corresponding type, and determine the mapped string as a message identifier in the target message identifier.

[0098] Optionally, the present invention may further obtain second information before executing step S104; in this case, the present invention may generate a target message identifier based on the second information, the first message identifier and the first identifier.

[0099] Optionally, the second information may be information that is individually configured according to the needs of the message identification requester;

[0100] Optionally, the second information may be content that needs to be padded to the message identifier in order to meet a specific length requirement of the message identifier;

[0101] Optionally, the second information may be information used to reflect the identity of the message identifier producer.

[0102] Optionally, the first information may also include the second information. In this case, the present invention may obtain the first information including the second information in response to the message identification request instruction.

[0103] It can be understood that the present invention can generate a target message identifier based on the second information, the first message identifier and the first identifier by adopting methods such as direct determination, splicing and information mapping.

[0104] It should be noted that, since the first message identifier and the first identifier as a whole can uniquely identify a message identifier, when the present invention generates a target message identifier based on the second information, the first message identifier and the first identifier, each message identifier in the target message identifier can also uniquely identify a message.

[0105] It should be noted that the existing technology can generate message identifiers through methods such as UUID, database generation and snowflake algorithm, but UUID generates a fixed 64-bit random string, which may generate duplicate strings; database generation depends on the database, which increases the risk of database access; and the snowflake algorithm generates a Long type message identifier, which cannot meet the generation requirements of other types of strings. The reliability of the message identifier generation methods of the existing technology is low. The present invention uses Figure 1 In steps S101, S102, S103 and S104, the time identification information and the device identification information can be used to generate a first message identifier, and an identifier of the first message identifier, i.e., the first identifier, is added on the basis of the first message identifier. A target message identifier for uniquely identifying the message is generated based on the first message identifier and the first identifier, and can meet specific types of requirements, does not rely on third-party systems or software, does not need to access a database, avoids database access risks, and the message generation method is simple and efficient, which can effectively enhance the reliability of message identifier generation.

[0106] The message identifier generation method proposed in the present invention can obtain the first information in response to the message identifier request instruction sent by the requesting device; wherein the first information includes the device identification information of the requesting device and the time identification information of the predefined time; based on the time identification information and the device identification information, the first message identifier is generated; based on the predefined first identification generation method, the first identification for identifying the first message identifier is generated; at least based on the first message identifier and the first identification, the target message identifier is generated. The present invention can generate the first message identifier using the time identification information and the device identification information, add the identifier of the first message identifier, i.e., the first identification, on the basis of the first message identifier, and generate the target message identifier for uniquely identifying the message based on the first message identifier and the first identification, thereby effectively enhancing the reliability of the message identifier generation.

[0107] based on Figure 1 The present invention proposes a second message identifier generation method. In this method, when the message identifier request instruction is used to request N message identifiers, step S103 may include:

[0108] S1031. Generate N different identifiers based on the first identifier generation method;

[0109] Wherein, N can be a positive integer value that is 1 or greater than 1.

[0110] Specifically, the first identifier generation method is an identifier generation method used to generate N different identifiers.

[0111] The identifier may be information used to identify the message identifier in the first message identifier.

[0112] Specifically, when N is 1, the first identifier generation method may be a random string generation method. The present invention may utilize the random string generation method to arbitrarily generate a string as an identifier, and use the identifier as the first identifier;

[0113] Specifically, when N is greater than 1, the first identifier generation method may be an identifier generation method for generating non-repeating identifiers. The present invention may use the first identifier generation method to generate a corresponding number of mutually different identifiers, and use the corresponding number of mutually different identifiers as identifiers of each message identifier in the first message identifier. The corresponding number of mutually different identifiers is the first identifier.

[0114] Optionally, when N is greater than 1, step S1031 may include:

[0115] Get the initial string to be processed;

[0116] Generate N different strings based on the initial string and the string increment processing method;

[0117] N mutually different character strings are determined as N mutually different identifiers.

[0118] The initial character string may be a preset character string or a currently randomly generated character string.

[0119] The string increment processing method may be to increment the string based on a certain string and obtain the incremented string.

[0120] Specifically, the present invention can utilize a string increment processing method to perform string increment on the basis of an initial string to obtain a first incremented string, and perform string increment on the basis of the first incremented string to obtain a second incremented string, until N-1 incremented strings are obtained; thereafter, the present invention can respectively determine the initial string and the N-1 incremented strings as identifiers of N message identifiers in the first message identifier.

[0121] Specifically, the present invention can also first use the initial string as the identifier of a message identifier in the first message identifier, and then use the string increment processing method to increment the string based on the initial string to obtain a first incremented string, and determine the first incremented string as the identifier of another message identifier in the first message identifier; then, based on the first incremented string, the string is incremented to obtain a second incremented string, and the second incremented string is determined as the identifier of another message identifier in the first message identifier; the loop is repeated until N-1 incremented strings are determined, and N identifiers corresponding to the N message identifiers in the first message identifier are determined.

[0122] It should be noted that the present invention can effectively ensure the acquisition of N different character strings through the initial character string and the character string increment processing method, effectively ensure the generation of the first identifier, and enhance the reliability of the message identifier generation method.

[0123] S1032, respectively determining N mutually different identifiers as identifiers of N message identifiers;

[0124] Specifically, the present invention can use the obtained N different identifiers as identifiers of N message identifiers respectively.

[0125] S1033. Determine an identifier of N message identifiers as a first identifier.

[0126] Specifically, the present invention may determine the identifier of N message identifiers as the first identifier.

[0127] It should be noted that, through steps S1031, S1032 and S1033, the present invention can effectively ensure the generation of the first identifier and enhance the reliability of the message identifier generation method.

[0128] The message identifier generation method proposed in the present invention can effectively ensure the generation of the first identifier and enhance the reliability of the message identifier generation method.

[0129] based on Figure 1 The present invention proposes a third message identifier generation method. In this method, the first message identifier includes a timestamp bit string and a machine bit string; at this time, step S102 may include:

[0130] S1021. Generate a timestamp bit string based on current time information;

[0131] Specifically, each message identifier in the first message identifier may include a timestamp bit string and a machine bit string.

[0132] Specifically, the present invention can utilize a character string encoding processing method to encode the current time information to obtain a corresponding timestamp character string.

[0133] Optionally, the string encoding processing method can be a base encoding processing method such as a base32 encoding processing method. For example, the present invention can obtain the millisecond value from the above-mentioned preset time value to the above-mentioned predefined time, and then use the base32 encoding processing method to encode the millisecond value, and determine the encoding result as a timestamp bit string.

[0134] S1022. Generate a machine bit string based on the device identification information.

[0135] Specifically, the present invention can utilize a character string generation method to encode the device identification information and generate a corresponding machine bit character string.

[0136] Optionally, when the device identification information is the IP address of the requesting device, step S1022 may include:

[0137] Perform integer value conversion on the IP address to obtain the corresponding integer value;

[0138] Encodes an integer value, producing a machine bit string.

[0139] Specifically, the present invention may first convert the IP address of the requesting device into a corresponding integer value of the BigInteger type; then, the present invention may perform string encoding processing on the integer value to generate a corresponding machine bit string.

[0140] It is understandable that when N is greater than 1, the timestamp bit string and the machine bit string of each message identifier in the first message identifier may be the same. For example, when there are A message identifier and B message identifier in the first message identifier, the timestamp bit string of A message identifier and the timestamp bit string of B message identifier may be the same, and the machine bit string of A message identifier and the machine bit string of B message identifier may be the same.

[0141] It should be noted that, through steps S1021 and S1022, the present invention can generate corresponding timestamp bit strings and machine bit strings based on time identification information and device identification information respectively, obtain a first message identifier, effectively guarantee the generation of the first message identifier, thereby effectively guaranteeing the generation of subsequent target message identifiers, and further enhancing the reliability of message identifier generation.

[0142] The message identifier generation method proposed in the present invention can generate corresponding timestamp bit strings and machine bit strings based on time identifier information and device identifier information respectively, obtain a first message identifier, effectively guarantee the generation of the first message identifier, thereby effectively guaranteeing the generation of subsequent target message identifiers, and further enhancing the reliability of message identifier generation.

[0143] like Figure 2 As shown, the present invention proposes a fourth message identifier generation method. In the fourth message identifier generation method, the first information also includes: a predefined end position identifier, the end position identifier includes a start position identifier and / or an end position identifier; at this time, step S104 may include step S1041; wherein:

[0144] S1041. Concatenate the end position identifier, the first message identifier and the first identifier in a preset arrangement order to generate a target message identifier.

[0145] It should be noted that the message identifier requester usually has corresponding requirements for the start bit content and / or end bit content of the message identifier and their length. The present invention can pre-set the corresponding content and the start bit identifier and end bit identifier that meet the length requirements according to the requirements.

[0146] Optionally, the arrangement order may include a start bit identifier, a middle bit identifier and an end bit identifier in sequence.

[0147] Specifically, when the end position identifier includes a start position identifier and an end position identifier, the present invention can sequentially concatenate the start position identifier, the first message identifier, the first identifier, and the end position identifier, and determine the concatenation result as the target message identifier. Figure 3 The structural diagram of the target message identifier shown in the figure, when the first message identifier includes a timestamp bit string and a machine bit string, the present invention can sequentially splice the start bit identifier, the machine bit string, the timestamp bit string, the first identifier and the end bit identifier to determine the corresponding target message identifier;

[0148] Specifically, when the end position identifier includes a start position identifier and an end position identifier, the present invention may also sequentially concatenate the start position identifier, the first identifier, the first message identifier, and the end position identifier, and determine the concatenation result as the target message identifier;

[0149] Specifically, when the end position identifier includes a start position identifier, the present invention can sequentially splice the start position identifier, the first message identifier and the first identifier, or sequentially splice the start position identifier, the first identifier and the first message identifier, and determine the splicing result as the target message identifier.

[0150] Specifically, when the end position identifier includes an end position identifier, the present invention can sequentially splice the first message identifier, the first identifier and the end position identifier, or sequentially splice the first identifier, the first message identifier and the end position identifier, and determine the splicing result as the target message identifier.

[0151] It should be noted that the present invention can pre-set an end position identifier, and splice a target message identifier based on the end position identifier, the first message identifier and the first identifier, so that the target message identifier can have specific content and a specific structure, which can meet the content and structure requirements of the message service requester for the target message identifier, enhance service quality, and increase user stickiness.

[0152] Optionally, in the fourth message identifier generation method, before step S1041, the following steps may also be included:

[0153] Determining whether the character string length of the first message identifier is less than a preset length value;

[0154] When it is determined that the character string length of the first message identifier is less than the preset length value, padding the first message identifier to obtain a first message identifier whose character string length is the preset length value;

[0155] At this time, step S1041 may be:

[0156] According to a preset arrangement order, the end position identifier, the first identifier and the first message identifier whose character string length is a preset length value are spliced ​​to generate a target message identifier.

[0157] In practical applications, the message requester may also have requirements for the length of each component structure in the target message identifier, and the length of the character string of the generated first message identifier may not meet its length requirements. Therefore, the present invention can be set according to its requirements to determine whether the length of the character string of the first message identifier can meet its required length. If not, the present invention can fill it so that its character string length can meet the corresponding requirements.

[0158] The preset length value may be set by technicians according to actual needs, and the present invention does not limit this.

[0159] Specifically, the present invention can determine whether the string length of the first message identifier is less than a preset length value before performing the final splicing of the target message identifier. If it is, the present invention can pad at the end of the first message identifier so that the string length of the first message identifier is the preset length value. The specific padding content can be determined by a technician, such as padding a corresponding number of 0s.

[0160] Specifically, the present invention can, after padding the first message identifier, concatenate the end position identifier, the first identifier and the first message identifier whose character string length is a preset length value to obtain the target message identifier.

[0161] Optionally, when the first message identifier includes a timestamp bit string and a machine bit string, the above-mentioned preset length value may include a timestamp bit string length value and a machine bit string length value. At this time, the present invention can respectively determine whether the string length of the timestamp bit string and the string length of the machine bit string are less than the timestamp bit string length value and the machine bit string length value. If the string length of the timestamp bit string is less than the timestamp bit string length value, the present invention can pad the timestamp bit string; if the string length of the machine bit string is less than the machine bit string length value, the present invention can pad the machine bit string.

[0162] It should be noted that the present invention can make the string length of the first message identifier meet the requirement by supplementing it when the string length of the first message identifier does not meet the requirement, thereby effectively ensuring the reliability of message identifier generation, improving service quality, and enhancing user stickiness.

[0163] It is understandable that after generating the first identifier, the present invention can also determine whether the string length meets the required length, and if not, it can be padded. Moreover, the present invention can adopt a first identifier generation method that can obtain a string length that meets the required length, and directly generate a first identifier that meets the length requirement.

[0164] The message identifier generation method proposed in the present invention can meet the content and structure requirements of the message service requester for the target message identifier by pre-setting the end position identifier and the string padding, thereby enhancing the service quality and increasing the user stickiness.

[0165] The message identifier generating device provided by the present invention is described below. The message identifier generating device described below and the message identifier generating method described above can be referenced to each other.

[0166] like Figure 4 As shown, the present invention proposes a message identifier generation device, comprising: a first obtaining unit 401, a first generating unit 402, a second generating unit 403 and a third generating unit 404; wherein:

[0167] A first obtaining unit 401 is configured to obtain first information in response to a message identification request instruction sent by a requesting device; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time;

[0168] A first generating unit 402, configured to generate a first message identifier based on the time identifier information and the device identifier information;

[0169] The second generating unit 403 is used to generate a first identifier for identifying a first message identifier based on a predefined first identifier generation method;

[0170] The third generating unit 404 is configured to generate a target message identifier based at least on the first message identifier and the first identifier.

[0171] It should be noted that the specific processing processes of the first obtaining unit 401, the first generating unit 402, the second generating unit 403 and the third generating unit 404 and the technical effects thereof can be respectively referred to in the present invention. Figure 1 The relevant descriptions of steps S101, S102, S103 and S104 are not repeated here.

[0172] Optionally, when the message identifier request instruction is used to request N message identifiers, the second generating unit 403 includes: a fourth generating unit, a first determining unit and a second determining unit; wherein:

[0173] A fourth generating unit, configured to generate N different identifiers based on the first identifier generating method;

[0174] A first determining unit, configured to determine N mutually different identifiers as identifiers of N message identifiers respectively;

[0175] The second determining unit is configured to determine an identifier of the N message identifiers as a first identifier.

[0176] Optionally, when N is greater than 1, the fourth generating unit includes: a second obtaining unit, a fifth generating unit and a third determining unit;

[0177] A second obtaining unit is used to obtain an initial character string to be processed;

[0178] A fifth generating unit, configured to generate N different character strings based on the initial character string and the character string increment processing method;

[0179] The third determining unit is configured to determine the N mutually different character strings as N mutually different identifiers.

[0180] Optionally, the first information further includes: a predefined end position identifier, where the end position identifier includes a start position identifier and / or an end position identifier;

[0181] The third generating unit 404 is used to concatenate the end position identifier, the first message identifier and the first identifier according to a preset arrangement order to generate a target message identifier.

[0182] Optionally, the message identifier generation method further includes: a fourth determination unit, a filling unit and a third obtaining unit;

[0183] A fourth determination unit, used to determine whether the character string length of the first message identifier is less than a preset length value before splicing the end position identifier, the first message identifier and the first identifier according to a preset arrangement order to generate a target message identifier;

[0184] A padding unit, used to pad the first message identifier when it is determined that the character string length of the first message identifier is less than a preset length value;

[0185] A third obtaining unit, used to obtain a first message identifier whose character string length is a preset length value;

[0186] The third generating unit 404 is used to concatenate the end position identifier, the first identifier and the first message identifier whose character string length is a preset length value according to a preset arrangement order to generate a target message identifier.

[0187] Optionally, the first message identifier includes a timestamp bit string and a machine bit string; the first generating unit 402 includes: a sixth generating unit and a seventh generating unit;

[0188] A sixth generating unit, used to generate a timestamp bit string based on current time information;

[0189] The seventh generating unit is used to generate a machine bit string based on the device identification information.

[0190] Optionally, when the device identification information is the IP address of the requesting device, the seventh generating unit includes: a fourth obtaining unit and an eighth generating unit;

[0191] The fourth obtaining unit is used to perform integer value conversion processing on the IP address to obtain a corresponding integer value;

[0192] The eighth generation unit is used to encode the integer value to generate a machine bit string.

[0193] The message identifier generation device proposed in the present invention can obtain the first information in response to the message identifier request instruction sent by the requesting device; wherein the first information includes the device identification information of the requesting device and the time identification information of the predefined time; based on the time identification information and the device identification information, the first message identifier is generated; based on the predefined first identification generation method, the first identification for identifying the first message identifier is generated; at least based on the first message identifier and the first identification, the target message identifier is generated. The present invention can generate the first message identifier using the time identification information and the device identification information, add the identifier of the first message identifier, i.e., the first identification, on the basis of the first message identifier, and generate the target message identifier for uniquely identifying the message based on the first message identifier and the first identification, thereby effectively enhancing the reliability of the message identifier generation.

[0194] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the message identifier generation method, which includes:

[0195] In response to the message identification request instruction sent by the requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of the predefined time;

[0196] Generate a first message identifier based on the time identifier information and the device identifier information;

[0197] Based on a predefined first identifier generation method, generate a first identifier for identifying a first message identifier;

[0198] A target message identifier is generated based at least on the first message identifier and the first identifier.

[0199] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0200] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the message identifier generation method provided by the above methods, the method includes:

[0201] In response to the message identification request instruction sent by the requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of the predefined time;

[0202] Generate a first message identifier based on the time identifier information and the device identifier information;

[0203] Based on a predefined first identifier generation method, generate a first identifier for identifying a first message identifier;

[0204] A target message identifier is generated based at least on the first message identifier and the first identifier.

[0205] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the message identifier generation method provided by the above methods, the method comprising:

[0206] In response to the message identification request instruction sent by the requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of the predefined time;

[0207] Generate a first message identifier based on the time identifier information and the device identifier information;

[0208] Based on a predefined first identifier generation method, generate a first identifier for identifying a first message identifier;

[0209] A target message identifier is generated based at least on the first message identifier and the first identifier.

[0210] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0211] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0212] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A message identifier generation method, characterized in that: include: In response to the message identification request instruction sent by the requesting device, obtaining first information; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time; Generate a first message identifier based on the time identifier information and the device identifier information; Based on a predefined first identifier generation method, generate a first identifier for identifying the first message identifier; generating a target message identifier based at least on the first message identifier and the first identifier; When the message identifier request instruction is used to request N message identifiers, the generating a first identifier for identifying the first message identifier based on a predefined first identifier generating method includes: generating N mutually different identifiers based on the first identifier generating method; determining the N mutually different identifiers as identifiers of the N message identifiers respectively; and determining the identifiers of the N message identifiers as the first identifier; When N is 1, the first identifier generation method is a random string generation method; When N is greater than 1, the generating N mutually different identifiers based on the first identification generating method includes: obtaining an initial string to be processed; generating N mutually different strings based on the initial string and the string increment processing method; determining the N mutually different strings as the N mutually different identifiers; Based on the initial character string and the character string increment processing method, N different character strings are generated; the N different character strings are determined as the N different identifiers, including: performing character string increment on the basis of the initial character string to obtain a first incremented character string, performing character string increment on the basis of the first incremented character string to obtain a second incremented character string, until N-1 incremented character strings are obtained; thereafter, the initial character string and the N-1 incremented character strings are respectively determined as identifiers of N message identifiers in the first message identifier.

2. The message identifier generation method according to claim 1, characterized in that: The first information further includes: a predefined end position identifier, the end position identifier includes a start position identifier and / or an end position identifier; the generating a target message identifier based at least on the first message identifier and the first identifier includes: The end position identifier, the first message identifier and the first identifier are concatenated in a preset arrangement order to generate the target message identifier.

3. The message identifier generation method according to claim 2, characterized in that: Before generating the target message identifier by splicing the end position identifier, the first message identifier and the first identifier in a preset arrangement order, the message identifier generating method further includes: Determining whether the length of the character string of the first message identifier is less than a preset length value; When it is determined that the character string length of the first message identifier is less than the preset length value, padding the first message identifier to obtain the first message identifier whose character string length is the preset length value; The step of splicing the end position identifier, the first message identifier and the first identifier in a preset arrangement order to generate the target message identifier includes: The target message identifier is generated by concatenating the end position identifier, the first identifier and the first message identifier whose character string length is the preset length value in a preset arrangement order.

4. The message identifier generation method according to claim 1, characterized in that: The first message identifier includes a timestamp bit string and a machine bit string; and generating the first message identifier based on the time identifier information and the device identifier information includes: Based on the current time information, generate the timestamp bit string; Based on the device identification information, the machine bit string is generated.

5. The message identifier generation method according to claim 4, characterized in that: When the device identification information is the IP address of the requesting device, generating the machine bit string based on the device identification information includes: Performing integer value conversion processing on the IP address to obtain a corresponding integer value; The integer value is encoded to generate the machine bit string.

6. A message identifier generating device, characterized in that: include: A first obtaining unit, a first generating unit, a second generating unit and a third generating unit; wherein: The first obtaining unit is used to obtain first information in response to a message identification request instruction sent by a requesting device; wherein the first information includes device identification information of the requesting device and time identification information of a predefined time; The first generating unit is used to generate a first message identifier based on the time identifier information and the device identifier information; The second generating unit is used to generate a first identifier for identifying the first message identifier based on a predefined first identifier generation method; The third generating unit is configured to generate a target message identifier based at least on the first message identifier and the first identifier; The message identifier generating device is further configured to generate a first identifier for identifying the first message identifier based on a predefined first identifier generating method when the message identifier request instruction is used to request N message identifiers, including: generating N mutually different identifiers based on the first identifier generating method; determining the N mutually different identifiers as identifiers of the N message identifiers respectively; and determining the identifiers of the N message identifiers as the first identifier; When N is 1, the first identifier generation method is a random string generation method; When N is greater than 1, the generating N mutually different identifiers based on the first identification generating method includes: obtaining an initial string to be processed; generating N mutually different strings based on the initial string and the string increment processing method; determining the N mutually different strings as the N mutually different identifiers; Based on the initial character string and the character string increment processing method, N different character strings are generated; the N different character strings are determined as the N different identifiers, including: performing character string increment on the basis of the initial character string to obtain a first incremented character string, performing character string increment on the basis of the first incremented character string to obtain a second incremented character string, until N-1 incremented character strings are obtained; thereafter, the initial character string and the N-1 incremented character strings are respectively determined as identifiers of N message identifiers in the first message identifier.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the message identifier generation method according to any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message identifier generation method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Identification generation method and device, electronic equipment and storage medium

    CN114356925A