CN113271342A - Information processing method and device and storage medium - Google Patents

Information processing method and device and storage medium Download PDF

Info

Publication number
CN113271342A
CN113271342A CN202110461691.5A CN202110461691A CN113271342A CN 113271342 A CN113271342 A CN 113271342A CN 202110461691 A CN202110461691 A CN 202110461691A CN 113271342 A CN113271342 A CN 113271342A
Authority
CN
China
Prior art keywords
identification information
service identification
timestamp
sequence number
abnormal
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.)
Granted
Application number
CN202110461691.5A
Other languages
Chinese (zh)
Other versions
CN113271342B (en
Inventor
李健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110461691.5A priority Critical patent/CN113271342B/en
Publication of CN113271342A publication Critical patent/CN113271342A/en
Application granted granted Critical
Publication of CN113271342B publication Critical patent/CN113271342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/567Integrating service provisioning from a plurality of service providers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses an information processing method, an information processing device and a storage medium, wherein the information processing method comprises the following steps: generating service identification information corresponding to the service request under the condition of receiving the service request; determining an adjustment rule corresponding to the abnormal type under the condition that the service identification information is abnormal and the abnormal type of the service identification information is determined; and adjusting the time stamp in the service identification information and/or the sequence number in the service identification information according to the adjustment rule to obtain the adjusted service identification information so as to respond to the service request based on the adjusted service identification information.

Description

Information processing method and device and storage medium
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to an information processing method and apparatus, and a storage medium.
Background
The snowflake algorithm mainly utilizes a machine time stamp to generate a unique identification number (ID), and the process of calculating the ID for multiple times in the same time is to utilize a sequential bit self-increment mode to avoid the ID during time collision.
In the prior art, when an ID corresponding to a service request is generated by using a snowflake algorithm, time information in the ID may have a problem of clock callback or a problem of sequence bit exhaustion and overflow in the ID, in this case, usually, prompt information that the service request is invalid is directly returned, and other devices are required to generate the ID corresponding to the service request, so that efficiency in generating the ID corresponding to the service request is reduced.
Disclosure of Invention
In order to solve the foregoing technical problems, embodiments of the present invention are directed to providing an information processing method and apparatus, and a storage medium, which can improve efficiency in generating service identification information.
The technical scheme of the invention is realized as follows:
an embodiment of the present application provides an information processing method, including:
under the condition of receiving a service request, generating service identification information corresponding to the service request;
determining a regulation rule corresponding to the abnormal type under the condition that the service identification information is abnormal and the abnormal type of the service identification information is determined;
and adjusting the time stamp in the service identification information and/or the sequence number in the service identification information according to the adjustment rule to obtain the adjusted service identification information so as to respond to the service request based on the adjusted service identification information.
An embodiment of the present application provides an information processing apparatus, the apparatus including:
the generating unit is used for generating service identification information corresponding to the service request under the condition of receiving the service request;
a determining unit, configured to determine, when the service identification information is abnormal and an abnormal type of the service identification information is determined, an adjustment rule corresponding to the abnormal type;
and the adjusting unit is used for adjusting the timestamp in the service identification information and/or the serial number in the service identification information according to the adjusting rule to obtain the adjusted service identification information, and responding to the service request based on the adjusted service identification information.
An embodiment of the present application provides an information processing apparatus, the apparatus including:
the information processing system includes a memory, a processor, and a communication bus, the memory communicating with the processor through the communication bus, the memory storing an information processing program executable by the processor, and the processor executing the information processing method when the information processing program is executed.
The embodiment of the application provides a storage medium, which stores a computer program thereon and is applied to an information processing device, wherein the computer program is used for realizing the information processing method when being executed by a processor.
The embodiment of the invention provides an information processing method, an information processing device and a storage medium, wherein the information processing method comprises the following steps: generating service identification information corresponding to the service request under the condition of receiving the service request; determining an adjustment rule corresponding to the abnormal type under the condition that the service identification information is abnormal and the abnormal type of the service identification information is determined; and adjusting the time stamp in the service identification information and/or the sequence number in the service identification information according to the adjustment rule to obtain the adjusted service identification information so as to respond to the service request based on the adjusted service identification information. By adopting the method, under the condition that the information processing device determines that the service identification information corresponding to the service request is abnormal and the abnormal type of the service identification information, the information processing device can determine the regulation rule corresponding to the abnormal type, and adjust the timestamp in the service identification information and/or the serial number in the service identification information according to the regulation rule to obtain the regulated service identification information, so that the regulated service identification information is used for responding to the service request, other equipment is not needed to be used for generating the service identification information, and the efficiency in generating the service identification information is improved.
Drawings
Fig. 1 is a flowchart of an information processing method in the prior art according to an embodiment of the present application;
fig. 2 is a flowchart of an information processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an exemplary information processing provided in an embodiment of the present application;
fig. 4 is a first schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating a structure of an information processing apparatus according to an embodiment of the present disclosure.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the prior art, as shown in fig. 1, when a service request is received, an ID corresponding to the service request is calculated by using a snowflake algorithm, then a current timestamp in the ID is obtained, the current timestamp is compared with a historical timestamp corresponding to a previous service request, and when it is determined that the current timestamp is greater than the historical timestamp, the ID is determined to be correct and the correct ID is returned (the ID is correctly calculated and returned); under the condition that the current timestamp is smaller than the historical timestamp, outputting an indication of abnormal service request or offline processing a machine for calculating the ID corresponding to the service request without returning the calculated ID (throwing the abnormal machine or offline machine without returning the ID); and under the condition that the current timestamp is determined to be equal to the historical timestamp, further judging whether the current sequence bit in the ID is the maximum value, if the preamble sequence bit is the maximum value, outputting an indication of abnormal service request or off-line processing a machine for calculating the ID corresponding to the service request without returning the calculated ID, if the preamble sequence bit is not the maximum value, performing self-increment on the sequence bit by 1 to obtain the self-incremented sequence bit, then updating the generated ID according to the self-incremented sequence bit and the current timestamp to obtain the updated ID, and returning the updated ID (correctly calculating the ID and returning).
The problems in the prior art can be solved by the method in the first embodiment.
Example one
An embodiment of the present application provides an information processing method, and fig. 2 is a flowchart of the information processing method provided in the embodiment of the present application, and as shown in fig. 2, the information processing method may include:
s101, under the condition that the service request is received, service identification information corresponding to the service request is generated.
The information processing method provided by the embodiment of the application is suitable for a scene of receiving the service request and adjusting the service identification information under the abnormal condition corresponding to the service request.
In the embodiment of the present application, the information processing apparatus may be implemented in various forms. For example, the information processing apparatus described in the present application may include apparatuses such as a mobile phone, a camera, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation apparatus, a wearable device, a smart band, a pedometer, and the like, and apparatuses such as a Digital TV, a desktop computer, a server, and the like.
In this embodiment, the service request may be a request for generating service identification information. Specifically, the service request may be a request for generating an order number, the service request may also be a request for generating a coupon, the service request may also be a request for generating a user identification number, and the specific service request may be determined according to an actual situation, which is not limited in this embodiment of the present application.
In this embodiment of the application, the service identification information may be identification number information corresponding to the service request, and specifically, the service identification information is unique identification information for identifying the service.
In this embodiment of the present application, the information processing apparatus may generate the service identification information corresponding to the service request by using a snowflake algorithm, or the information processing apparatus may generate the service identification information corresponding to the service request by using another algorithm, which may be determined specifically according to an actual situation, and this is not limited in this embodiment of the present application.
In this embodiment of the present application, the service identification information may be 64-bit long and integer JAVA type numbers, and the service identification information may be long and integer JAVA type numbers with other lengths, which may be determined specifically according to an actual situation, and this is not limited in this embodiment of the present application.
In the embodiment of the present application, if the service identification information is 64 bits of long and integer JAVA type number, bit 1 of the service identification information is "positive" or "negative" identification bit, bits 2 to 42 are timestamp information bits, bits 43 to 52 are machine information bits where the program is located, and bits 53 to 64 are serial numbers, which can be understood as incremental numbers, so that the difference of the serial numbers is used to generate different service identification Information (ID) if the former timestamp and machine number are the same. Namely, the service identification information in the present application includes an identification bit, a timestamp, machine information, and a serial number.
S102, under the condition that the service identification information is abnormal and the abnormal type of the service identification information is determined, determining a regulation rule corresponding to the abnormal type.
In the embodiment of the application, after the information processing device generates the service identification information corresponding to the service request, the information processing device may determine the adjustment rule corresponding to the abnormal type when determining that the service identification information is abnormal and determining the abnormal type of the service identification information.
In the embodiment of the application, after the information processing apparatus generates the service identification information corresponding to the service request and before the information processing apparatus determines the adjustment rule corresponding to the abnormal type, the information processing apparatus may further obtain a historical timestamp in the last service identification information, and when the information processing apparatus determines that the timestamp is smaller than the historical timestamp, the information processing apparatus determines that the service identification information is abnormal and the abnormal type is the timestamp abnormality. Correspondingly, the process of determining the regulation rule corresponding to the abnormal type by the information processing device comprises the step of adjusting the time stamp in the service identification information by the information processing device by using the historical time stamp.
In the embodiment of the present application, the previous service identification information is service identification information corresponding to the previous service request.
In the embodiment of the present application, the information processing apparatus adjusts the timestamp by using the historical timestamp, specifically, the information processing apparatus replaces the adjustment rule of the timestamp by using the historical timestamp.
In the embodiment of the present application, the timestamp exception specifically refers to a case where time is dialed back.
In the embodiment of the application, after the information processing device acquires the historical timestamp in the last service identification information, the information processing device determines that the service identification information is abnormal and the abnormal type is the timestamp and the serial number is abnormal under the condition that the information processing device determines that the timestamp is smaller than the historical timestamp and the serial number is equal to the serial number upper limit threshold; correspondingly, the process of the information processing device for determining the adjustment rule corresponding to the abnormal type comprises the following steps: the information processing device adjusts the historical timestamp by using the preset timestamp incremental value to obtain a first timestamp; the information processing device updates the serial number by using a preset serial number lower limit value to obtain an updated serial number; and adjusting the time stamp in the service identification information and the sequence number in the service identification information by using the first time stamp and the updated sequence number to obtain the adjusted service identification information.
In the embodiment of the present application, the sequence number exception specifically refers to a case where a fixed-length sequence bit is exhausted and overflowed. The time stamp and sequence number abnormality specifically refers to a case that time is set back and sequence bits of fixed length are exhausted and overflow.
In the embodiment of the present application, the upper threshold of the serial number may be the maximum value of the serial number configured in the information processing apparatus, may be the maximum value of the serial number received by the information processing apparatus before the information processing apparatus compares the serial number with the upper threshold of the serial number, or may be the maximum value of the serial number acquired by the information processing apparatus in another manner, which may be specifically determined according to the actual situation, and the embodiment of the present application is not limited thereto.
For example, if the serial number is a 12-bit binary number, the upper threshold of the serial number may be 111111111111.
In this embodiment of the present application, the preset incremental timestamp value may be an incremental timestamp value configured in the information processing apparatus, or may be an incremental timestamp value received by the information processing apparatus before the information processing apparatus adjusts the historical timestamp by using the preset incremental timestamp value to obtain the first timestamp, which may be specifically determined according to an actual situation, which is not limited in this embodiment of the present application.
The value of the increment value of the preset timestamp may be 1, 2, or another value, which may be determined according to actual conditions, and is not limited in the embodiment of the present application.
In this embodiment of the present application, the information processing apparatus adjusts the historical timestamp by using the preset timestamp increment value to obtain the first timestamp, specifically, the information processing apparatus determines the sum of the historical timestamp and the preset timestamp increment value to obtain the first timestamp.
In this embodiment of the application, the process of updating the serial number by the information processing apparatus using the preset serial number lower limit value to obtain the updated serial number is specifically a process of replacing the serial number with the preset serial number lower limit value by the information processing apparatus to obtain the updated serial number.
The preset serial number lower limit value may be the minimum value of the serial number configured in the information processing apparatus, may be the minimum value of the serial number received by the information processing apparatus before the information processing apparatus updates the serial number with the preset serial number lower limit value to obtain the updated serial number, or may be the minimum value of the serial number acquired by the information processing apparatus in another manner, and may be specifically determined according to the actual situation, which is not limited in the embodiment of the present application.
It should be further noted that the preset serial number lower limit value may be 0, and the preset serial number lower limit value may also be other values, which may be specifically determined according to actual situations, and this is not limited in this embodiment of the application.
In the embodiment of the application, after the information processing device acquires the historical timestamp in the last service identification information, the information processing device determines that the service identification information is abnormal and the abnormal type is timestamp abnormal under the condition that the information processing device determines that the timestamp is smaller than the historical timestamp and the serial number in the service identification information is smaller than the serial number upper limit threshold; correspondingly, the process that the information processing device determines the regulation rule corresponding to the abnormal type comprises the steps that the information processing device utilizes the historical timestamp to adjust the timestamp in the service identification information; the information processing device updates the sequence number by using the preset sequence number increment value to obtain a first sequence number.
In this embodiment of the present application, the preset serial number increment value may be a serial number increment value configured in the information processing apparatus, or may be a serial number increment value received before the information processing apparatus updates the serial number by using the preset serial number increment value to obtain the first serial number, which may be determined specifically according to an actual situation, which is not limited in this embodiment of the present application.
The value of the increment value of the preset serial number may be 1, 2, or another value, which may be determined according to actual conditions, and is not limited in the embodiment of the present application.
In this embodiment, the information processing apparatus may determine a sum of the preset serial number increment value and the serial number for the information processing apparatus, thereby obtaining the first serial number.
In the embodiment of the application, after the information processing device generates the service identification information corresponding to the service request, the information processing device determines that the service identification information is abnormal and the abnormal type is the serial number abnormality under the condition that the information processing device determines that the timestamp in the service identification information is equal to the historical timestamp and the serial number in the service identification information is equal to the serial number upper limit threshold; correspondingly, the process of determining the adjustment rule corresponding to the abnormal type by the information processing device comprises the following steps: the information processing device adjusts the timestamp by using the preset timestamp incremental value to obtain a second timestamp; the information processing device updates the serial number by using the preset serial number lower limit value to obtain the updated serial number.
In this embodiment of the application, the information processing apparatus adjusts the timestamp by using the preset timestamp increment value to obtain the second timestamp, and may determine the sum of the preset timestamp increment value and the timestamp for the information processing apparatus, so as to obtain the second timestamp.
S103, according to the regulation rule, the timestamp in the service identification information and/or the serial number in the service identification information are/is regulated to obtain the regulated service identification information, and the service request is responded based on the regulated service identification information.
In this embodiment, after the information processing apparatus determines the adjustment rule corresponding to the abnormal type, the information processing apparatus may adjust the timestamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule, so as to obtain the adjusted service identification information.
In this embodiment of the present application, the service identification information specifically includes a timestamp and a sequence number, and the information processing device determines that the service identification information is abnormal when the timestamp in the service identification information corresponding to the service request is smaller than the timestamp corresponding to the last service request, or when the sequence number in the service identification information is equal to the upper threshold of the sequence number, that is, when sequence bits corresponding to the sequence number information in the service identification information overflow.
In the embodiment of the application, after the information processing apparatus acquires the historical timestamp in the last service identification information, in the case that the information processing apparatus determines that the timestamp is smaller than the historical timestamp, the information processing apparatus determines that the service identification information is abnormal and the abnormal type is timestamp abnormal. And when the information processing device determines that the abnormal type of the service identification information is the abnormal timestamp, the information processing device adjusts the timestamp in the service identification information by using the historical timestamp. Correspondingly, the process that the information processing device adjusts the timestamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule to obtain the adjusted service identification information comprises the following steps: the information processing device adjusts the timestamp in the service identification information by using the historical timestamp to obtain the adjusted service identification information.
In the embodiment of the application, when the information processing device determines that the timestamp is smaller than the historical timestamp and the serial number is equal to the serial number upper limit threshold, the information processing device determines that the service identification information is abnormal and the abnormal type is the timestamp and the serial number; under the condition that the information processing device determines that the time stamp and the serial number are abnormal, the information processing device adjusts the historical time stamp by using the incremental value of the preset time stamp to obtain a first time stamp; updating the sequence number by using a preset sequence number lower limit value to obtain an updated sequence number; correspondingly, the information processing device adjusts the time stamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule to obtain the adjusted service identification information.
In this embodiment of the application, the information processing apparatus adjusts the timestamp by using the first timestamp and adjusts the serial number by using the updated serial number to obtain the adjusted service identification information, specifically, the information processing apparatus continues to add the first timestamp, the machine information, and the updated serial number behind the identification bit, thereby obtaining the adjusted service identification information.
In the embodiment of the application, when the information processing device determines that the timestamp is smaller than the historical timestamp and the serial number in the service identification information is smaller than the serial number upper limit threshold, the information processing device determines that the service identification information is abnormal and the abnormal type is timestamp abnormal; under the condition that the information processing device determines that the time stamp is abnormal, the information processing device adjusts the time stamp in the service identification information by using the historical time stamp; updating the sequence number by using a preset sequence number incremental value to obtain a first sequence number; correspondingly, the information processing device adjusts the time stamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule to obtain the adjusted service identification information.
In the embodiment of the application, the process that the information processing device adjusts the serial number by using the first serial number and adjusts the timestamp by using the historical timestamp to obtain the adjusted service identification information includes that the information processing device continues to add the historical timestamp, the machine information and the first serial number behind the identification bit, so as to obtain the adjusted service identification information.
In the embodiment of the application, after the information processing device generates the service identification information corresponding to the service request, the information processing device determines that the service identification information is abnormal and the abnormal type is the serial number abnormality under the condition that the information processing device determines that the timestamp in the service identification information is equal to the historical timestamp and the serial number in the service identification information is equal to the serial number upper limit threshold; correspondingly, the process of determining the adjustment rule corresponding to the abnormal type by the information processing device comprises the following steps: the information processing device adjusts the timestamp by using the preset timestamp incremental value to obtain a second timestamp; the information processing device updates the serial number by using a preset serial number lower limit value to obtain an updated serial number; correspondingly, according to the regulation rule, the process of regulating the time stamp in the service identification information and/or the serial number in the service identification information to obtain the regulated service identification information comprises the steps that the information processing device utilizes the second time stamp to regulate the time stamp and utilizes the updated serial number to regulate the serial number to obtain the regulated service identification information.
In the embodiment of the present application, the process of obtaining the adjusted service identification information by the information processing apparatus adjusting the timestamp by using the second timestamp and adjusting the serial number by using the updated serial number includes continuously adding the second timestamp, the machine information, and the updated serial number behind the identification bit of the information processing apparatus, thereby obtaining the adjusted service identification information.
Illustratively, an exemplary information processing method is shown in fig. 3:
s1, when the service request is received, the information processing device generates service identification information corresponding to the service request.
When the information processing apparatus receives the service request, the information processing apparatus generates (calculates) service identification information corresponding to the service request by using a snowflake algorithm.
S2, the information processing apparatus acquires the history time stamp in the last service identification information.
And S3, when the time stamp is smaller than the historical time stamp, the information processing device determines that the service identification information is abnormal and the abnormal type is time stamp abnormal.
It should be noted that, after the information processing apparatus acquires a timestamp (current timestamp) from the service identification information, the information processing apparatus may compare the timestamp with a historical timestamp in the last service identification information.
S4, the information processing apparatus adjusts the time stamp in the service identification information using the historical time stamp, to obtain the adjusted service identification information.
In addition, in the case where the information processing apparatus determines that the timestamp is smaller than the historical timestamp, the information processing apparatus replaces the timestamp with the historical timestamp, so as to obtain the adjusted service identification information, that is, the current timestamp uses the historical timestamp.
And S5, determining that the service identification information is abnormal and the abnormal type is the abnormal timestamp and the sequence number under the condition that the timestamp is less than the historical timestamp and the sequence number is equal to the sequence number upper limit threshold value.
In the embodiment of the present application, after the information processing apparatus executes step 2, the information processing apparatus may directly execute step 5.
It should be noted that the information processing apparatus may further compare the sequence number in the service identification information with a sequence number upper threshold to determine whether the sequence bit is the maximum value.
S6, the information processing device adjusts the historical timestamp by using the preset timestamp incremental value to obtain a first timestamp; and updating the sequence number by using the preset lower limit value of the sequence number to obtain the updated sequence number.
When the information processing apparatus determines that the sequence number is equal to the sequence number upper threshold (the sequence bit is the maximum value), the information processing apparatus adjusts the historical timestamp by using the preset timestamp increment value to obtain the first timestamp (self-increment the current timestamp by 1), and updates the sequence number by using the preset sequence number lower limit value to obtain the updated sequence number (set the sequence bit to 0).
S7, the information processing apparatus adjusts the timestamp using the first timestamp and adjusts the sequence number using the updated sequence number to obtain the adjusted service identification information.
After the information processing device obtains the adjusted service identification information, the information processing device responds to the service request based on the adjusted service identification information.
And S8, when the time stamp is smaller than the historical time stamp and the sequence number in the service identification information is smaller than the sequence number upper limit threshold value, the information processing device determines that the service identification information is abnormal and the abnormal type is time stamp abnormal.
In the embodiment of the present application, after the information processing apparatus executes step 2, the information processing apparatus may also directly execute step 8.
S9, the information processing device adjusts the time stamp in the service identification information by using the historical time stamp; and updating the sequence number by using a preset sequence number increment value to obtain a first sequence number.
S10, the information processing apparatus adjusts the sequence number using the first sequence number and adjusts the timestamp using the historical timestamp, and obtains adjusted service identification information.
And S11, under the condition that the time stamp in the service identification information is equal to the historical time stamp and the sequence number in the service identification information is equal to the sequence number upper limit threshold value, the information processing device determines that the service identification information is abnormal and the abnormal type is the sequence number abnormal.
In the embodiment of the present application, after the information processing apparatus executes step 1, the information processing apparatus may directly execute step 11.
S12, the information processing device adjusts the timestamp by using the preset timestamp incremental value to obtain a second timestamp; and updating the sequence number by using the preset lower limit value of the sequence number to obtain the updated sequence number.
S13, the information processing apparatus adjusts the timestamp using the second timestamp, and adjusts the sequence number using the updated sequence number, to obtain the adjusted service identification information.
In the embodiment of the application, when the information processing device determines that the timestamp in the service identification information is equal to the historical timestamp and the serial number in the service identification information is smaller than the serial number upper limit threshold (the serial number is not the maximum value), the information processing device updates the serial number by using the preset serial number increment value to obtain a first serial number (namely, the serial number is incremented by 1); and obtaining the adjusted service identification information (namely correctly calculating the id and returning) according to the timestamp and the first sequence number so as to respond to the service request based on the adjusted service identification information. In the case where the information processing apparatus determines that the time stamp is greater than the historical time stamp, the information processing apparatus determines that the service identification information is correct service identification information (i.e., correctly calculates the id, and returns) to respond to the service request based on the correct service identification information.
It can be understood that, under the condition that the information processing device determines that the service identification information corresponding to the service request is abnormal and the abnormal type of the service identification information, the information processing device can determine the adjustment rule corresponding to the abnormal type, and adjust the timestamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule to obtain the adjusted service identification information, so as to respond to the service request by using the adjusted service identification information, and it is not necessary to generate the service identification information by using other devices, thereby improving the efficiency in generating the service identification information.
Example two
Based on the idea of the invention together with the embodiments, the embodiments of the present application provide an information processing apparatus 1 corresponding to an information processing method; fig. 4 is a schematic diagram illustrating a first composition structure of an information processing apparatus according to an embodiment of the present application, where the information processing apparatus 1 may include:
a generating unit 11, configured to generate service identification information corresponding to a service request in a case that the service request is received;
a determining unit 12, configured to determine, when the service identification information is abnormal and an abnormal type of the service identification information is determined, an adjustment rule corresponding to the abnormal type;
an adjusting unit 13, configured to adjust a timestamp in the service identification information and/or a sequence number in the service identification information according to the adjustment rule, to obtain adjusted service identification information, and respond to the service request based on the adjusted service identification information.
In some embodiments of the present application, the apparatus further comprises an acquisition unit;
the acquiring unit is used for acquiring a historical timestamp in the last service identification information;
the determining unit 12 is configured to determine that the service identification information is abnormal and the abnormal type is timestamp abnormal when the timestamp is smaller than the historical timestamp;
correspondingly, the adjusting unit 13 is configured to adjust the timestamp in the service identification information by using a historical timestamp;
correspondingly, the adjusting unit 13 is configured to adjust the timestamp in the service identification information by using the historical timestamp, so as to obtain the adjusted service identification information.
In some embodiments of the present application, the apparatus further comprises an updating unit;
the determining unit 12 is configured to determine that the service identification information is abnormal and the abnormality type is a timestamp and sequence number abnormality when the timestamp is smaller than the historical timestamp and the sequence number is equal to a sequence number upper threshold;
correspondingly, the adjusting unit 13 is configured to adjust the historical timestamp by using a preset timestamp increment value to obtain a first timestamp;
the updating unit is used for updating the serial number by using a preset serial number lower limit value to obtain an updated serial number;
correspondingly, the adjusting unit 13 is configured to adjust the timestamp by using the first timestamp, and adjust the sequence number by using the updated sequence number, so as to obtain the adjusted service identifier information.
In some embodiments of the present application, the determining unit 12 is configured to determine that the service identification information is abnormal and the abnormality type is timestamp abnormality if the timestamp is smaller than the historical timestamp and a sequence number in the service identification information is smaller than a sequence number upper threshold;
correspondingly, the adjusting unit 13 is configured to adjust the timestamp in the service identification information by using a historical timestamp;
the updating unit is used for updating the serial number by using a preset serial number increment value to obtain a first serial number;
correspondingly, the adjusting unit 13 is configured to adjust the sequence number by using the first sequence number, and adjust the timestamp by using the historical timestamp, so as to obtain the adjusted service identifier information.
In some embodiments of the present application, the determining unit 12 is configured to determine that the service identification information is abnormal and the abnormality type is sequence number abnormal, when a timestamp in the service identification information is equal to a historical timestamp and a sequence number in the service identification information is equal to a sequence number upper threshold;
the adjusting unit 13 is configured to adjust the timestamp by using a preset timestamp increment value to obtain a second timestamp;
the updating unit is used for updating the serial number by using a preset serial number lower limit value to obtain the updated serial number;
correspondingly, the adjusting unit 13 is configured to adjust the timestamp by using the second timestamp, and adjust the sequence number by using the updated sequence number, so as to obtain the adjusted service identifier information.
In practical applications, the generating Unit 11, the determining Unit 12 and the adjusting Unit 13 may be implemented by a processor 14 on the information Processing apparatus 1, specifically implemented by a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal processor), a Field Programmable Gate Array (FPGA), or the like; the above data storage may be realized by the memory 15 on the information processing apparatus 1.
An embodiment of the present invention further provides an information processing apparatus 1, and as shown in fig. 5, the information processing apparatus 1 includes: a processor 14, a memory 15 and a communication bus 16, the memory 15 communicating with the processor 14 through the communication bus 16, the memory 15 storing a program executable by the processor 14, the program, when executed, executing the information processing method as described above through the processor 14.
In practical applications, the Memory 15 may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or a combination of the above types of memories and provides instructions and data to processor 14.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by the processor 14 implements the information processing method as described above.
It can be understood that, under the condition that the information processing device determines that the service identification information corresponding to the service request is abnormal and the abnormal type of the service identification information, the information processing device can determine the adjustment rule corresponding to the abnormal type, and adjust the timestamp in the service identification information and/or the serial number in the service identification information according to the adjustment rule to obtain the adjusted service identification information, so as to respond to the service request by using the adjusted service identification information, and it is not necessary to generate the service identification information by using other devices, thereby improving the efficiency in generating the service identification information.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (10)

1. An information processing method, characterized in that the method comprises:
under the condition of receiving a service request, generating service identification information corresponding to the service request;
determining a regulation rule corresponding to the abnormal type under the condition that the service identification information is abnormal and the abnormal type of the service identification information is determined;
and adjusting the time stamp in the service identification information and/or the sequence number in the service identification information according to the adjustment rule to obtain the adjusted service identification information so as to respond to the service request based on the adjusted service identification information.
2. The method according to claim 1, wherein after the generating of the service identification information corresponding to the service request and before the determining of the adjustment rule corresponding to the anomaly type, the method further comprises:
acquiring a historical timestamp in the last service identification information;
determining that the service identification information is abnormal and the abnormal type is abnormal timestamp under the condition that the timestamp is smaller than the historical timestamp;
correspondingly, the determining the adjustment rule corresponding to the abnormal type includes:
adjusting the timestamp in the service identification information by using the historical timestamp;
correspondingly, the adjusting, according to the adjustment rule, the timestamp in the service identification information and/or the sequence number in the service identification information to obtain the adjusted service identification information includes:
and adjusting the timestamp in the service identification information by using the historical timestamp to obtain the adjusted service identification information.
3. The method of claim 2, wherein after obtaining the historical timestamp in the last service identification information, the method further comprises:
determining that the service identification information is abnormal and the abnormal type is the abnormal timestamp and the abnormal sequence number under the condition that the timestamp is less than the historical timestamp and the sequence number is equal to an upper threshold of the sequence number;
correspondingly, the determining the adjustment rule corresponding to the abnormal type includes:
adjusting the historical timestamp by using a preset timestamp incremental value to obtain a first timestamp;
updating the serial number by using a preset serial number lower limit value to obtain an updated serial number;
correspondingly, the adjusting, according to the adjustment rule, the timestamp in the service identification information and/or the sequence number in the service identification information to obtain the adjusted service identification information includes:
and adjusting the time stamp by using the first time stamp and adjusting the sequence number by using the updated sequence number to obtain the adjusted service identification information.
4. The method of claim 2, wherein after obtaining the historical timestamp in the last service identification information, the method further comprises:
under the condition that the timestamp is smaller than the historical timestamp and the sequence number in the service identification information is smaller than the sequence number upper limit threshold value, determining that the service identification information is abnormal and the abnormal type is timestamp abnormal;
correspondingly, the determining the adjustment rule corresponding to the abnormal type includes:
adjusting the timestamp in the service identification information by using the historical timestamp;
updating the sequence number by using a preset sequence number incremental value to obtain a first sequence number;
correspondingly, the adjusting, according to the adjustment rule, the timestamp in the service identification information and/or the sequence number in the service identification information to obtain the adjusted service identification information includes:
and adjusting the sequence number by using the first sequence number, and adjusting the timestamp by using the historical timestamp to obtain the adjusted service identification information.
5. The method of claim 1, wherein after generating the service identification information corresponding to the service request, the method further comprises:
determining that the service identification information is abnormal and the abnormal type is abnormal sequence number under the condition that the time stamp in the service identification information is equal to the historical time stamp and the sequence number in the service identification information is equal to the sequence number upper limit threshold;
correspondingly, the determining the adjustment rule corresponding to the abnormal type includes:
adjusting the timestamp by using a preset timestamp incremental value to obtain a second timestamp;
updating the serial number by using a preset serial number lower limit value to obtain the updated serial number;
correspondingly, the adjusting, according to the adjustment rule, the timestamp in the service identification information and/or the sequence number in the service identification information to obtain the adjusted service identification information includes:
and adjusting the time stamp by using the second time stamp, and adjusting the sequence number by using the updated sequence number to obtain the adjusted service identification information.
6. An information processing apparatus characterized in that the apparatus comprises:
the generating unit is used for generating service identification information corresponding to the service request under the condition of receiving the service request;
a determining unit, configured to determine, when the service identification information is abnormal and an abnormal type of the service identification information is determined, an adjustment rule corresponding to the abnormal type;
and the adjusting unit is used for adjusting the timestamp in the service identification information and/or the serial number in the service identification information according to the adjusting rule to obtain the adjusted service identification information, and responding to the service request based on the adjusted service identification information.
7. The apparatus of claim 6, further comprising an acquisition unit;
the acquiring unit is used for acquiring a historical timestamp in the last service identification information;
the determining unit is configured to determine that the service identification information is abnormal and the abnormal type is timestamp abnormal when the timestamp is smaller than the historical timestamp;
correspondingly, the adjusting unit is configured to adjust the timestamp in the service identification information by using a historical timestamp;
correspondingly, the adjusting unit is configured to adjust the timestamp in the service identification information by using the historical timestamp, so as to obtain the adjusted service identification information.
8. The apparatus of claim 7, further comprising an update unit;
the determining unit is configured to determine that the service identification information is abnormal and the abnormality type is that the timestamp and the sequence number are abnormal, when the timestamp is smaller than the historical timestamp and the sequence number is equal to an upper threshold of the sequence number;
correspondingly, the adjusting unit is configured to adjust the historical timestamp by using a preset timestamp increment value to obtain a first timestamp;
the updating unit is used for updating the serial number by using a preset serial number lower limit value to obtain an updated serial number;
correspondingly, the adjusting unit is configured to adjust the timestamp by using the first timestamp, and adjust the sequence number by using the updated sequence number, so as to obtain the adjusted service identifier information.
9. An information processing apparatus characterized in that the apparatus comprises:
a memory, a processor, and a communication bus, the memory in communication with the processor through the communication bus, the memory storing an information processing program executable by the processor, the information processing program when executed causing the processor to perform the method of any of claims 1 to 5.
10. A storage medium having stored thereon a computer program for application to an information processing apparatus, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 5.
CN202110461691.5A 2021-04-27 2021-04-27 Information processing method and device and storage medium Active CN113271342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110461691.5A CN113271342B (en) 2021-04-27 2021-04-27 Information processing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110461691.5A CN113271342B (en) 2021-04-27 2021-04-27 Information processing method and device and storage medium

Publications (2)

Publication Number Publication Date
CN113271342A true CN113271342A (en) 2021-08-17
CN113271342B CN113271342B (en) 2023-03-07

Family

ID=77229586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110461691.5A Active CN113271342B (en) 2021-04-27 2021-04-27 Information processing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN113271342B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229555A (en) * 2017-05-04 2017-10-03 北京小度信息科技有限公司 Mark generating method and device
CN109597853A (en) * 2018-10-22 2019-04-09 平安科技(深圳)有限公司 Business scenario element sequence generation method, device, medium and computer equipment
CN109740120A (en) * 2018-12-14 2019-05-10 深圳壹账通智能科技有限公司 The generation method of unique identification, device, computer equipment under distributed environment
CN110554732A (en) * 2019-08-22 2019-12-10 北京奇艺世纪科技有限公司 identification number generation method and device, electronic equipment and storage medium
CN110580305A (en) * 2018-05-22 2019-12-17 北京京东尚科信息技术有限公司 Method, apparatus, system, and medium for generating identifier
CN110737806A (en) * 2019-09-09 2020-01-31 贝壳技术有限公司 Global ID generation method and device for business entity
CN112199923A (en) * 2020-10-20 2021-01-08 重庆紫光华山智安科技有限公司 Identification generation method, system, device and medium based on distributed system
US20210097043A1 (en) * 2018-12-26 2021-04-01 Baidu Online Network Technology (Beijing) Co., Ltd. Data processing method, device, and a storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229555A (en) * 2017-05-04 2017-10-03 北京小度信息科技有限公司 Mark generating method and device
CN110580305A (en) * 2018-05-22 2019-12-17 北京京东尚科信息技术有限公司 Method, apparatus, system, and medium for generating identifier
CN109597853A (en) * 2018-10-22 2019-04-09 平安科技(深圳)有限公司 Business scenario element sequence generation method, device, medium and computer equipment
CN109740120A (en) * 2018-12-14 2019-05-10 深圳壹账通智能科技有限公司 The generation method of unique identification, device, computer equipment under distributed environment
US20210097043A1 (en) * 2018-12-26 2021-04-01 Baidu Online Network Technology (Beijing) Co., Ltd. Data processing method, device, and a storage medium
CN110554732A (en) * 2019-08-22 2019-12-10 北京奇艺世纪科技有限公司 identification number generation method and device, electronic equipment and storage medium
CN110737806A (en) * 2019-09-09 2020-01-31 贝壳技术有限公司 Global ID generation method and device for business entity
CN112199923A (en) * 2020-10-20 2021-01-08 重庆紫光华山智安科技有限公司 Identification generation method, system, device and medium based on distributed system

Also Published As

Publication number Publication date
CN113271342B (en) 2023-03-07

Similar Documents

Publication Publication Date Title
WO2021052029A1 (en) Data object identifier generation method and apparatus, computer device, and storage medium
CN110554732B (en) Identification number generation method and device, electronic equipment and storage medium
CN111917897B (en) Identification generation method, device, equipment and storage medium
CN110634052A (en) Method and device for generating order number by distributed architecture
US20180352432A1 (en) Method for anonymously identifying a security module
CN112464155B (en) Data processing method, multiparty secure computing system and electronic equipment
JP2017523664A (en) Phase deviation compensation method and apparatus
CN113271342B (en) Information processing method and device and storage medium
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN111709216A (en) Distributed unique identification code generation method, device, computer equipment and medium
CN109101232B (en) Method, device, computer equipment and storage medium for product development
CN113656163A (en) Service resource scheduling method, device, computer equipment and storage medium
CN109298934B (en) Heartbeat period adjusting method, device and system
CN111611002A (en) Data upgrading method and device, computer equipment and storage medium
CN110692078B (en) Transaction data processing method, device and storage medium based on blockchain
CN115498735A (en) Fuel cell monomer voltage monitoring method and fuel cell controller
CN114157705A (en) Information pushing method and device and storage medium
CN111355797B (en) Data reconciliation updating method, device, computer equipment and storage medium
CN110489231B (en) Transaction information recording method, apparatus and computer readable storage medium
US10951403B2 (en) Updating cryptographic keys stored in non-volatile memory
CN116010413B (en) Identification generation method, server and storage medium
CN113138863A (en) Method, device, equipment and storage medium for generating identification information of message
CN111381927A (en) Virtual machine adjusting method, virtual machine adjusting device, network equipment and readable storage medium
EP3681100B1 (en) Updating cryptographic keys stored in non-volatile memory
CN109038590B (en) Load flow calculation backspacing method and system

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