CN111460129A - Method and device for generating identification, electronic equipment and storage medium - Google Patents

Method and device for generating identification, electronic equipment and storage medium Download PDF

Info

Publication number
CN111460129A
CN111460129A CN202010230639.4A CN202010230639A CN111460129A CN 111460129 A CN111460129 A CN 111460129A CN 202010230639 A CN202010230639 A CN 202010230639A CN 111460129 A CN111460129 A CN 111460129A
Authority
CN
China
Prior art keywords
identifier
information
user information
service
generating
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
CN202010230639.4A
Other languages
Chinese (zh)
Other versions
CN111460129B (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.)
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance 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 Taikang Insurance Group Co Ltd, Taikang Online Property Insurance Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN202010230639.4A priority Critical patent/CN111460129B/en
Publication of CN111460129A publication Critical patent/CN111460129A/en
Application granted granted Critical
Publication of CN111460129B publication Critical patent/CN111460129B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for generating an identifier, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises: receiving a service request sent by a user, wherein the service request comprises type information, service information and user information, and the type information represents the service type requested by the service request; determining data forms to which the service information and the user information respectively belong according to the type information; respectively generating a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generation modules corresponding to the data forms to which the service information and the user information belong; and storing the mapping relation between the user information identification and the service information identification. According to the embodiment, the problem that the identifier generation fails due to the fact that huge pressure is applied to the database under the scene of high concurrency of user requests can be avoided.

Description

Method and device for generating identification, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating an identifier, an electronic device, and a storage medium.
Background
At present, in order to ensure the data processing sequence or data uniqueness, generating a unique identifier for each data becomes a business requirement. For example, in the insurance field, a user may send a data processing request for applying for a policy, requesting for policy approval, requesting for claim settlement, etc. for various reasons, and a unique identifier may be generated for the request sent by the user to ensure the data processing sequence. The way of generating the identifier is usually to store an individually generated identifier list in the database, and after receiving a user request each time, the database may generate a unique identifier for the user request according to an autonomous key of the identifier list.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
when the identifier is generated, the database needs to be continuously accessed, and under the scene of high concurrency of user requests, huge pressure is caused on the database, so that the identifier generation fault is easily caused, and further the identifier generation failure is caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a system, and a storage medium for generating an identifier, which can avoid a problem that, in a scenario where a user request is highly concurrent, a huge pressure is applied to a database, which causes an identifier generation failure, and thus an identifier generation failure.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of identity generation.
The method for generating the identifier comprises the following steps: receiving a service request sent by a user, wherein the service request comprises type information, service information and user information, and the type information represents the service type requested by the service request; determining data forms to which the service information and the user information respectively belong according to the type information; respectively generating a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generation modules corresponding to the data forms to which the service information and the user information belong; and storing the mapping relation between the user information identification and the service information identification.
In one embodiment, the data form includes a first data form corresponding to the user information and a second data form corresponding to the business information; the unique parameters comprise a first unique parameter corresponding to the first data form and a second unique parameter corresponding to the second form;
the generating module of the identification corresponding to the data form to which the service information and the user information belong respectively generates the service information identification and the user information identification according to the service request and the unique parameter, and the generating module of the identification comprises:
and generating a user information identifier for the user information according to the user information and the first unique parameter by an identifier generating module corresponding to the first data form, and generating a service information identifier for the service information according to the service information and the second unique parameter by an identifier generating module corresponding to the second data form.
In another embodiment, the generating, by the identifier generating module corresponding to the first data form, a user information identifier for the user information according to the user information and the first unique parameter includes:
according to the user information, inquiring a user information identifier corresponding to the user information from the first data form to obtain an inquiry result;
if the query result is not empty, determining the query result as a user information identifier of the user information;
and if the query result is empty, generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generation module corresponding to the first data form.
In yet another embodiment, the unique parameter includes a unique number and a timestamp corresponding to the service request;
the generating of the service information identifier and the user information identifier according to the service request and the unique parameter includes:
and generating a service information identifier and a user information identifier according to the type information, the unique number and the timestamp corresponding to the service request.
In yet another embodiment, further comprising:
judging whether the number of unique parameters stored in a cache corresponding to the identifier generation module is smaller than a preset value or not;
if so, acquiring the unique parameter from the database through the identifier generation module, and storing the unique parameter in a cache corresponding to the identifier generation module.
In another embodiment, before the generating, by the identifier generating module corresponding to the data form to which the service information and the user information belong respectively, a service information identifier and a user information identifier according to the service request and the unique parameter, the method further includes:
judging whether the cache corresponding to the identifier generation module is in fault;
if not, acquiring the unique parameter from the cache corresponding to the identifier generation module through the identifier generation module;
if yes, the unique parameter is obtained from a database through the identification generation module, and a cache failure alarm mechanism is started.
In yet another embodiment, the type information includes a policy contract type, a policy batch type, and a policy claim type.
To achieve the above object, according to another aspect of the present invention, an apparatus for generating an identifier is provided.
The device for generating the identification comprises the following components: a receiving unit, configured to receive a service request sent by a user, where the service request includes type information, service information, and user information, and the type information indicates a service type requested by the service request; a determining unit, configured to determine, according to the type information, data forms to which the service information and the user information belong respectively; a generating unit, configured to generate a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generating modules corresponding to the data forms to which the service information and the user information belong, respectively; and the storage unit is used for storing the mapping relation between the user information identifier and the service information identifier.
In one embodiment, the data form includes a first data form corresponding to the user information and a second data form corresponding to the business information; the unique parameters comprise a first unique parameter corresponding to the first data form and a second unique parameter corresponding to the second form;
the generating unit is specifically configured to:
and generating a user information identifier for the user information according to the user information and the first unique parameter by an identifier generating module corresponding to the first data form, and generating a service information identifier for the service information according to the service information and the second unique parameter by an identifier generating module corresponding to the second data form.
In another embodiment, the generating unit is specifically configured to:
according to the user information, inquiring a user information identifier corresponding to the user information from the first data form to obtain an inquiry result;
if the query result is not empty, determining the query result as a user information identifier of the user information;
and if the query result is empty, generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generation module corresponding to the first data form.
In yet another embodiment, the unique parameter includes a unique number and a timestamp corresponding to the service request;
the generating unit is specifically configured to:
and generating a service information identifier and a user information identifier according to the type information, the unique number and the timestamp corresponding to the service request.
In yet another embodiment, the apparatus further comprises:
the judging unit is used for judging whether the number of the unique parameters stored in the cache corresponding to the identifier generating module is smaller than a preset value or not;
and the obtaining unit is used for obtaining the unique parameter from the database through the identification generating module and storing the unique parameter into a cache corresponding to the identification generating module if the unique parameter is obtained.
In another embodiment, the determining unit is further configured to determine whether a cache corresponding to the identifier generating module fails;
the obtaining unit is further configured to obtain, if not, the unique parameter from the cache corresponding to the identifier generating module through the identifier generating module;
and the obtaining unit is further used for obtaining the unique parameter from the database through the identification generating module and starting a cache failure alarm mechanism if the unique parameter is the same as the unique parameter.
In yet another embodiment, the type information includes a policy contract type, a policy batch type, and a policy claim type.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating the identifier provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, which when executed by a processor implements the method for generating an identifier provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, after a service request sent by a user is received, the data form to which the service information and the user information in the service request belong respectively can be determined according to the type information in the service request, then the service information identifier and the user information identifier are generated respectively through the identifier generation modules corresponding to the data form, and the corresponding relation between the service information identifier and the user information identifier is stored. In the embodiment of the invention, the service information identifier and the user information identifier are respectively generated for the corresponding service request through the identifier generation modules corresponding to the data forms, and the user request is distributed to the identifier generation modules corresponding to the data forms under the scene of high concurrency of the user request, so that the problems that the identifier generation fault is caused by huge pressure caused by access to a database and the identifier generation is failed are avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of one principal flow of a method of identity generation in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of yet another major flow of a method of identity generation in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main elements of an identity generating apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The embodiment of the invention provides an identifier generation system, which can be used for generating a unique identifier for a service request. The service request comprises type information, and the type information represents the service type of the service requested by the user. For example, the business types may include policy contract, policy approval, policy claim settlement, and the like. In the embodiment of the invention, as the corresponding service information and the corresponding user information are involved in the service processing of each service type, and the service information identifier and the user information identifier can be respectively generated for each service information and user information for facilitating data processing, a data form corresponding to the service information and the user information in each service type is configured in the embodiment of the invention so as to store the corresponding service information and the corresponding user information. Meanwhile, in the embodiment of the invention, the system for generating the identification is provided with the identification generation module corresponding to each data form, for the service information and the user information in each service request, after the corresponding data form is determined, the corresponding service information identification and the corresponding user information identification can be generated according to the identification generation module corresponding to the data form, and the generated service information identification and the generated user information identification are stored. Therefore, under the scene of high concurrency of service requests, each service request can be distributed to different identifier generation modules to generate identifiers based on the service data information in the service request and the data form corresponding to the user data information, namely, the service requests are dispersed to generate the identifiers, and the problem that the identifier generation fails due to huge pressure caused by access to a database under the scene of high concurrency of the service requests is avoided.
An embodiment of the present invention provides a method for generating an identifier, which may be performed by a system for generating an identifier, as shown in fig. 1, and includes the following steps.
S101: and receiving a service request sent by a user.
The service request comprises type information, service information and user information, wherein the type information represents the service type requested by the service request.
After receiving the service request, the service request may be analyzed, where the service request includes type information for indicating a type of a service requested by the service request, and thus a service type requested by a user may be determined according to the type information. In the insurance field, when a user needs to operate the insurance policy, a service request is sent, the service request comprises fields representing the type of the requested service, and the type information of the service request, namely the type of the requested service, can be determined according to the fields.
For example, the service request may include a service request that a user requests a policy contract, a service request that a user requests a policy correction, and a service request that a user requests a policy claim, so the type information may be determined as a policy contract type, a policy batch type, and a policy claim type.
The service information represents information related to a service requested by the service request, for example, when the service request requests policy contract for the user, the service information represents information related to a policy requested by the user for underwriting. The user information indicates information of a user corresponding to a service requested by the service request, for example, when the service request requests a policy contract for the user, the user information indicates information related to an underwriting user for whom the user requests underwriting. Therefore, in order to facilitate data processing, in the embodiment of the present invention, the service information may specifically be configured to include policy information, the user information includes underwriting user information, the data form corresponding to the policy information and the data form corresponding to the underwriting user information are configured correspondingly, the data form corresponding to the policy information is used to store the policy information, and includes the generated policy identifier, that is, the service information identifier, and the data form corresponding to the underwriting user information is used to store the underwriting user information, that is, the underwriting user identifier, that is, the user information identifier.
S102: and determining the data forms to which the service information and the user information respectively belong according to the type information.
After the type information in the service request is determined, the service type requested by the service request can be determined according to the type information, and then data forms to which the service information and the user information respectively belong in the service type can be determined.
For example, in the insurance field, the type information may be a field indicating type information in the service request, and the type of service requested by the user may be determined according to the specific content of the field indicating type information.
In the embodiment of the invention, the data form for storing the service information and the user information is respectively configured for each service type, so that after the service type of the service request is determined according to the type information, the data form to which the service information and the user information respectively belong can be determined.
S103: and respectively generating a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generating modules corresponding to the data forms to which the service information and the user information belong.
The unique parameter is obtained from the cache corresponding to the identifier generation module.
The unique parameter may be stored in a cache corresponding to the identifier generation module in advance, and when the identifier is generated, the identifier generation module may obtain the unique parameter to be used from the cache. In the embodiment of the present invention, a cache cluster may be set, where the cache cluster includes caches corresponding to the identifier generating modules, and each cache stores a plurality of different unique parameters in advance, so that each corresponding identifier generating module directly obtains the unique parameters from the caches when generating an identifier. Therefore, the unique parameter is directly obtained from the cache by the identifier generating module when the identifier is generated, the operation is purely based on the memory, and the database does not need to be accessed, so that the efficiency of obtaining the unique parameter can be improved.
It should be noted that, the generated user information identifier and the generated service information identifier usually have a bit requirement, so in the embodiment of the present invention, in order to meet the bit requirement for generating the identifier, each identifier may be generated by splicing according to the service request and the unique parameter.
In the embodiment of the invention, each data form can be configured with a corresponding identification generation module. Specifically, a first data form corresponding to the user information and a second data form corresponding to the service information may be configured. After the first data form and the second data form are determined, an identifier generation module corresponding to the first data form and an identifier generation module corresponding to the second data form can be respectively determined, then, a user information identifier is generated according to the identifier generation module corresponding to the first data form, and a service information identifier is generated according to the identifier generation module corresponding to the second data form. In order to ensure the uniqueness of the generated identifier, the unique parameters used for generating the user information identifier and the service information identifier in this step are different from each other, and a first unique parameter corresponding to the first data form and a second unique parameter corresponding to the second form may be configured. This step can be specifically performed as: and generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generating module corresponding to the first data form, and generating a service information identifier for the service information according to the service information and the second unique parameter through an identifier generating module corresponding to the second data form.
It should be noted that, because the unique parameter may be obtained from the cache corresponding to the identifier generation module, the first unique parameter is obtained from the cache corresponding to the identifier generation module by the identifier generation module corresponding to the first data form, and the second unique parameter is obtained from the cache corresponding to the identifier generation module by the identifier generation module corresponding to the second data form.
It should be noted that, in some scenarios, a user information identifier corresponding to user information may already exist in a data form corresponding to the user information in a service request, and at this time, it is not necessary to generate a user information identifier for the user information, so in the above steps, the step of generating a user information identifier for the user information according to the user information and the first unique parameter by using the identifier generation module corresponding to the first data form may be specifically performed as: according to the user information, inquiring a user information identifier corresponding to the user information from the first data form to obtain an inquiry result; if the query result is not null, determining the query result as the user information identifier of the user information; and if the query result is null, generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generation module corresponding to the first data form.
If the query result is null, it indicates that the user information identifier of the user information does not exist in the first data form, so that the user information identifier needs to be generated for the user information according to the user information and the first unique parameter by an identifier generation module corresponding to the first data form; if the query result is not null, it indicates that the user information identifier of the user information already exists in the first data form, and the query result can be directly determined as the user information identifier of the user information.
In the embodiment of the present invention, the way in which the identifier generation module generates each identifier according to the unique parameter and the service request is not limited. The unique parameter ensures the uniqueness of the generated identifier, and the service request can be specifically parameters such as type information.
Specifically, the way of generating the identifier by the identifier generation module may be generated according to the parameter and the unique parameter included in the service request. The parameter included in the service request may be type information, the unique parameter may include a unique number and a timestamp corresponding to the service request, and the step of generating the service information identifier and the user information identifier according to the service request and the unique parameter may be specifically performed as: and generating a service information identifier and a user information identifier according to the type information, the unique number and the timestamp corresponding to the service request. The unique number may be generated in advance, and in order to ensure the uniqueness of the generated identifier, the unique numbers used by the identifier generation modules need to be different from each other. The way of generating the identifier by the identifier generation module may be to splice the type information, the timestamp, and the unique parameter.
In the embodiment of the present invention, in a manner of generating the identifier by using the type information, the type identifier corresponding to the type information may be preset, and the type identifier is used as the type information for generating the identifier. For example, for the type information being a policy contract type, the type flag may be set to P; if the type information is a policy correction type, the type identifier can be set as E; for the type information being the policy claim type, a type identifier C may be set.
The timestamp is generated when the service request is received, and the identifier generation module can acquire the timestamp of the user request and further generate a user information identifier and a service information identifier according to the type identifier, the timestamp and the unique number. The way of generating each identifier by the identifier generation module can be to perform personalized splicing on the type identifier, the timestamp and the unique number. For example, type identification + unique number + timestamp generates a user information identification.
For example, the user request identifier is set to 17 bits, the type identifier is one bit, the unique number is 10 bits, and the timestamp is the first two bits of the hour, minute and second, that is, 6 bits, so as to obtain a 17-bit user information identifier.
In the embodiment of the present invention, the unique parameter may further include a random number, and the manner of generating each identifier by the identifier generation module may be to generate the user request identifier by performing personalized concatenation on the type identifier, the timestamp, the random number, and the unique number. For example, type identification + unique number + random number + timestamp generates each identification.
It should be noted that, the manner of generating each identifier in the embodiment of the present invention may also include multiple manners, and the embodiment of the present invention is not limited. For example, the identification is generated by personalized concatenation based on machine code, traffic type code, and type identification, timestamp, random number, and unique number.
In the embodiment of the invention, the unique parameters stored in the cache can be obtained from a database, the database can generate different unique parameters based on the self-increment rule of the database, and the unique parameters can be supplemented from the database when the number of the unique parameters in the cache is less than a preset value. The concrete mode is as follows: judging whether the number of the unique parameters stored in the cache corresponding to the identifier generation module is smaller than a preset value or not; and if so, acquiring the unique parameter from the database and storing the unique parameter into a cache corresponding to the identifier generation module.
When the number of the unique parameters stored in the cache corresponding to the identifier generation module is judged to be smaller than the preset value, in order to avoid that the unique parameters stored in the cache cannot meet the identifier generation module, the unique parameters can be obtained from the database and stored in the cache. For example, the plurality of unique parameters may be obtained from a database by the identifier generating module and stored in a cache corresponding to the identifier generating module.
In the embodiment of the invention, a cache failure mechanism can be further arranged to avoid that the identifier generation module cannot acquire the unique parameter due to the failure of the cache, so that the generation of the user request identifier fails. The specific mode can be as follows: judging whether the cache corresponding to the identifier generation module is in fault; if not, acquiring a unique parameter from a cache corresponding to the identifier generation module through the identifier generation module; if yes, the unique parameter is obtained from the database through the identification generation module, and a cache failure alarm mechanism is started.
After judging whether the cache corresponding to the identifier generation module is in fault, if the cache corresponding to the identifier generation module is in fault, the unique parameter can be directly obtained from the corresponding cache through the identifier generation module when the user request identifier is generated; if the cache corresponding to the identifier generation module fails, the identifier generation module cannot acquire the unique parameter from the cache, and the unique parameter can be acquired from the database through the identifier generation module when the user request identifier is generated, so that the user request identifier is ensured to be normally generated, and meanwhile, a cache failure alarm mechanism is started to inform related personnel of timely processing, so that the high availability of the cache is ensured.
S104: and storing the mapping relation between the user information identification and the service information identification.
The service information identifier and the user information identifier correspond to the same service request, so that the mapping relationship between the user information identifier and the service information identifier needs to be stored, so as to facilitate subsequent service processing. The mapping relationship may be stored in a data form storing the user information identifier, or may be stored in a data form storing the service information identifier.
In the embodiment of the invention, the service information identifier and the user information identifier are respectively generated for the corresponding service request through the identifier generation modules corresponding to the data forms, and the user request is distributed to the identifier generation modules corresponding to the data forms under the scene of high concurrency of the user request, so that the problems that the identifier generation fault is caused by huge pressure caused by access to a database and the identifier generation is failed are avoided.
The method for generating the identifier in the embodiment of the present invention is specifically described below with reference to the embodiment shown in fig. 1, by taking the example of generating the identifier for the service request in the insurance field, where the service type may include a policy underwriting type, a policy modifying type, and a policy claim type. An embodiment of the present invention provides a method for generating an identifier, as shown in fig. 2, the method includes the following steps.
S201: a service request is received.
After receiving the service request, a timestamp corresponding to the service request may be generated. The corresponding service request is analyzed, so that the type information in the service request can be obtained, and the type identifier corresponding to the type information can be obtained. In the embodiment of the invention, the service request also comprises service information and user information.
For example, if the field indicating the service request is EDOR, the type information can be determined to be a policy approval type, if the field indicating the service request is PO L ICY, the type information can be determined to be a policy contract type, and if the field indicating the service request is C L AIM, the type information can be determined to be a policy settlement type.
S202: and determining a first data insurance policy to which the user information belongs and a second data form to which the service information belongs according to the type information.
For each service type, a data form to which the user information belongs and a data form to which the service information belongs are configured, so that the service type corresponding to the service request can be determined according to the type information in the step, and further a first data policy to which the user information belongs and a second data form to which the service information belongs are obtained.
S203: a first random number is generated by an identifier generation module corresponding to the first dataform, and a second random number is generated by an identifier generation module corresponding to the second dataform.
The corresponding identifier generation module can be determined through each data form, each identifier generation module can further generate a random number for generating the identifier, and the mode of generating the random number can be realized through a random number generation mechanism.
S204: a first unique number is generated by an identification generation module corresponding to the first dataform, and a second unique number is generated by an identification generation module corresponding to the second dataform.
The cache cluster comprises caches corresponding to the identification generating modules respectively, unique numbers which are generated by the database and are different from each other are prestored in the caches, and the identification generating modules can acquire the unique numbers from the caches corresponding to the identification generating modules to generate identifications.
It should be noted that, in the cache cluster, the node may be connected to the corresponding identifier generating module to implement communication. The nodes comprise main nodes and standby nodes, the main nodes can monitor whether the nodes are in failure through mutual communication, and the standby nodes can be started after the main nodes are detected to be in failure.
S205: and generating a user information identifier according to the type identifier, the timestamp, the first unique number and the first random number by using an identifier generation module corresponding to the first data form, and generating a user information identifier according to the type identifier, the timestamp, the second unique number and the second random number by using an identifier generation module corresponding to the second data form.
The identification generation module corresponding to the first data form can perform personalized splicing on the type identification, the timestamp, the first unique number and the first random number to generate the user information identification. The identifier generation module corresponding to the second data form can splice the type identifier, the timestamp, the second unique number and the second random number in an individualized way to generate the service information identifier.
S206: and storing the corresponding relation between the user information identification and the service information identification.
After the user information identifier and the service information identifier are generated, the corresponding relationship between the user information identifier and the service information identifier may be stored.
In the embodiment of the invention, the user information identifier and the service information identifier are generated for the service request through the identifier generation module corresponding to each data form, and the user request is distributed to the identifier generation module corresponding to each data form under the scene of high concurrency of the user request, so that the problems that huge pressure is caused on a database, the identifier generation is failed and the identifier generation is failed are avoided.
In order to solve the problems in the prior art, an embodiment of the present invention provides an apparatus 300 for generating an identifier, as shown in fig. 3, where the apparatus 300 includes:
a receiving unit 301, configured to receive a service request sent by a user, where the service request includes type information, service information, and user information, and the type information indicates a service type requested by the service request;
a determining unit 302, configured to determine, according to the type information, data forms to which the service information and the user information respectively belong;
a generating unit 303, configured to generate, according to the service request and the unique parameter, a service information identifier and a user information identifier through identifier generating modules corresponding to the data forms to which the service information and the user information belong, respectively;
a storage unit 304, configured to store a mapping relationship between the user information identifier and the service information identifier.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 1, and the description thereof is omitted.
In an implementation manner of the embodiment of the present invention, the data form includes a first data form corresponding to the user information and a second data form corresponding to the service information; the unique parameters comprise a first unique parameter corresponding to the first data form and a second unique parameter corresponding to the second form;
the generating unit 303 is specifically configured to:
and generating a user information identifier for the user information according to the user information and the first unique parameter by an identifier generating module corresponding to the first data form, and generating a service information identifier for the service information according to the service information and the second unique parameter by an identifier generating module corresponding to the second data form.
In another implementation manner of the embodiment of the present invention, the generating unit 303 is specifically configured to:
according to the user information, inquiring a user information identifier corresponding to the user information from the first data form to obtain an inquiry result;
if the query result is not empty, determining the query result as a user information identifier of the user information;
and if the query result is empty, generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generation module corresponding to the first data form.
In another implementation manner of the embodiment of the present invention, the unique parameter includes a unique number and a timestamp corresponding to the service request;
the generating unit 303 is specifically configured to:
and generating a service information identifier and a user information identifier according to the type information, the unique number and the timestamp corresponding to the service request.
In another implementation manner of the embodiment of the present invention, the apparatus 300 further includes:
the judging unit is used for judging whether the number of the unique parameters stored in the cache corresponding to the identifier generating module is smaller than a preset value or not;
and the obtaining unit is used for obtaining the unique parameter from the database through the identification generating module and storing the unique parameter into a cache corresponding to the identification generating module if the unique parameter is obtained.
In another implementation manner of the embodiment of the present invention, the determining unit is further configured to determine whether a cache corresponding to the identifier generating module fails;
the obtaining unit is further configured to obtain, if not, the unique parameter from the cache corresponding to the identifier generating module through the identifier generating module;
and the obtaining unit is further used for obtaining the unique parameter from the database through the identification generating module and starting a cache failure alarm mechanism if the unique parameter is the same as the unique parameter.
In yet another implementation of the embodiment of the present invention, the type information includes a policy contract type, a policy batch type, and a policy claim type.
It should be understood that the embodiment of the present invention is implemented in the same manner as the embodiment shown in fig. 1 or fig. 2, and is not repeated herein.
In the embodiment of the invention, after a service request sent by a user is received, the data form to which the service information and the user information in the service request belong respectively can be determined according to the type information in the service request, then the service information identifier and the user information identifier are generated respectively through the identifier generation modules corresponding to the data form, and the corresponding relation between the service information identifier and the user information identifier is stored. In the embodiment of the invention, the service information identifier and the user information identifier are respectively generated for the corresponding service request through the identifier generation modules corresponding to the data forms, and the user request is distributed to the identifier generation modules corresponding to the data forms under the scene of high concurrency of the user request, so that the problems that the identifier generation fault is caused by huge pressure caused by access to a database and the identifier generation is failed are avoided.
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
The electronic device of the present invention includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the processor, the instructions being executable by the at least one processor to cause the at least one processor to perform a method of identity generation as provided by an embodiment of the present invention.
Fig. 4 illustrates an exemplary system architecture 400 to which the method of identity generation or the apparatus of identity generation of embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, product information — just an example) to the terminal device.
It should be noted that the method for generating the identifier provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the apparatus for generating the identifier is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 5 is only an example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
To the I/O interface 505, AN input section 506 including a keyboard, a mouse, and the like, AN output section 507 including a keyboard such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 508 including a hard disk and the like, and a communication section 509 including a network interface card such as a L AN card, a modem, and the like, the communication section 509 performs communication processing via a network such as the internet, a drive 510 is also connected to the I/O interface 505 as necessary, a removable medium 511 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a determining unit, a generating unit, and a storing unit. Where the names of these elements do not in some cases constitute a limitation of the element itself, for example, a receiving element may also be described as "an element of the function of the receiving element".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method for identifier generation provided by the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of identity generation, comprising:
receiving a service request sent by a user, wherein the service request comprises type information, service information and user information, and the type information represents the service type requested by the service request;
determining data forms to which the service information and the user information respectively belong according to the type information;
respectively generating a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generation modules corresponding to the data forms to which the service information and the user information belong;
and storing the mapping relation between the user information identification and the service information identification.
2. The method of claim 1, wherein the data form comprises a first data form corresponding to the user information and a second data form corresponding to the business information; the unique parameters comprise a first unique parameter corresponding to the first data form and a second unique parameter corresponding to the second form;
the generating module of the identification corresponding to the data form to which the service information and the user information belong respectively generates the service information identification and the user information identification according to the service request and the unique parameter, and the generating module of the identification comprises:
and generating a user information identifier for the user information according to the user information and the first unique parameter by an identifier generating module corresponding to the first data form, and generating a service information identifier for the service information according to the service information and the second unique parameter by an identifier generating module corresponding to the second data form.
3. The method of claim 2, wherein generating, by the identifier generation module corresponding to the first data form, a user information identifier for the user information according to the user information and the first unique parameter comprises:
according to the user information, inquiring a user information identifier corresponding to the user information from the first data form to obtain an inquiry result;
if the query result is not empty, determining the query result as a user information identifier of the user information;
and if the query result is empty, generating a user information identifier for the user information according to the user information and the first unique parameter through an identifier generation module corresponding to the first data form.
4. The method of claim 1, wherein the unique parameter comprises a unique number and a timestamp corresponding to the service request;
the generating of the service information identifier and the user information identifier according to the service request and the unique parameter includes:
and generating a service information identifier and a user information identifier according to the type information, the unique number and the timestamp corresponding to the service request.
5. The method of claim 1, further comprising:
judging whether the number of unique parameters stored in a cache corresponding to the identifier generation module is smaller than a preset value or not;
if so, acquiring the unique parameter from the database through the identifier generation module, and storing the unique parameter in a cache corresponding to the identifier generation module.
6. The method according to claim 1, wherein before the generating the service information identifier and the user information identifier according to the service request and the unique parameter by the identifier generating module corresponding to the data form to which the service information and the user information belong, respectively, further comprises:
judging whether the cache corresponding to the identifier generation module is in fault;
if not, acquiring the unique parameter from the cache corresponding to the identifier generation module through the identifier generation module;
if yes, the unique parameter is obtained from a database through the identification generation module, and a cache failure alarm mechanism is started.
7. The method of claim 1, wherein the type information includes a policy contract type, a policy batch type, and a policy claim type.
8. An apparatus for identity generation, comprising:
a receiving unit, configured to receive a service request sent by a user, where the service request includes type information, service information, and user information, and the type information indicates a service type requested by the service request;
a determining unit, configured to determine, according to the type information, data forms to which the service information and the user information belong respectively;
a generating unit, configured to generate a service information identifier and a user information identifier according to the service request and the unique parameter through identifier generating modules corresponding to the data forms to which the service information and the user information belong, respectively;
and the storage unit is used for storing the mapping relation between the user information identifier and the service information identifier.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010230639.4A 2020-03-27 2020-03-27 Method, device, electronic equipment and storage medium for generating identification Active CN111460129B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010230639.4A CN111460129B (en) 2020-03-27 2020-03-27 Method, device, electronic equipment and storage medium for generating identification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010230639.4A CN111460129B (en) 2020-03-27 2020-03-27 Method, device, electronic equipment and storage medium for generating identification

Publications (2)

Publication Number Publication Date
CN111460129A true CN111460129A (en) 2020-07-28
CN111460129B CN111460129B (en) 2023-08-22

Family

ID=71683325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010230639.4A Active CN111460129B (en) 2020-03-27 2020-03-27 Method, device, electronic equipment and storage medium for generating identification

Country Status (1)

Country Link
CN (1) CN111460129B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199923A (en) * 2020-10-20 2021-01-08 重庆紫光华山智安科技有限公司 Identification generation method, system, device and medium based on distributed system
CN112511317A (en) * 2020-12-31 2021-03-16 河南信大网御科技有限公司 Input distribution method, input agent and mimicry distributed storage system
CN112835904A (en) * 2021-02-04 2021-05-25 北京电解智科技有限公司 Data processing method and data processing device
CN113438290A (en) * 2021-06-22 2021-09-24 康键信息技术(深圳)有限公司 Method, device and equipment for detecting repeated request and storage medium
CN113762698A (en) * 2021-01-21 2021-12-07 北京沃东天骏信息技术有限公司 Method, device and system for processing service information
CN116366249A (en) * 2023-06-01 2023-06-30 广东维信智联科技有限公司 Interactive communication system based on digital information

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140281066A1 (en) * 2009-10-30 2014-09-18 Cleversafe, Inc. Highly autonomous dispersed storage system retrieval method
CN105071976A (en) * 2015-09-08 2015-11-18 安一恒通(北京)科技有限公司 Data transmission method and device
CN105656888A (en) * 2015-12-29 2016-06-08 刘鑫淼 Business processing method and device and system for keeping user information secret
CN105989153A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Interaction method and device of database
CN107832401A (en) * 2017-11-01 2018-03-23 郑州云海信息技术有限公司 Database data access method, system, device and computer-readable recording medium
CN109214676A (en) * 2018-08-29 2019-01-15 中国建设银行股份有限公司 A kind of service order processing method, device, server and storage medium
CN109313687A (en) * 2016-01-24 2019-02-05 赛义德·卡姆兰·哈桑 Computer security based on artificial intelligence
CN110008226A (en) * 2019-04-03 2019-07-12 平安信托有限责任公司 Construction method, device, computer equipment and the storage medium of data model
CN110490594A (en) * 2019-07-18 2019-11-22 招联消费金融有限公司 Business data processing method, device, computer equipment and storage medium
CN110602151A (en) * 2018-06-12 2019-12-20 中国电信股份有限公司 Application identifier management method, device and system
CN110782240A (en) * 2019-10-12 2020-02-11 上海陆家嘴国际金融资产交易市场股份有限公司 Service data processing method and device, computer equipment and storage medium
CN110796556A (en) * 2019-10-30 2020-02-14 泰康保险集团股份有限公司 Information processing method and device, computer readable storage medium and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140281066A1 (en) * 2009-10-30 2014-09-18 Cleversafe, Inc. Highly autonomous dispersed storage system retrieval method
CN105989153A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Interaction method and device of database
CN105071976A (en) * 2015-09-08 2015-11-18 安一恒通(北京)科技有限公司 Data transmission method and device
CN105656888A (en) * 2015-12-29 2016-06-08 刘鑫淼 Business processing method and device and system for keeping user information secret
CN109313687A (en) * 2016-01-24 2019-02-05 赛义德·卡姆兰·哈桑 Computer security based on artificial intelligence
CN107832401A (en) * 2017-11-01 2018-03-23 郑州云海信息技术有限公司 Database data access method, system, device and computer-readable recording medium
CN110602151A (en) * 2018-06-12 2019-12-20 中国电信股份有限公司 Application identifier management method, device and system
CN109214676A (en) * 2018-08-29 2019-01-15 中国建设银行股份有限公司 A kind of service order processing method, device, server and storage medium
CN110008226A (en) * 2019-04-03 2019-07-12 平安信托有限责任公司 Construction method, device, computer equipment and the storage medium of data model
CN110490594A (en) * 2019-07-18 2019-11-22 招联消费金融有限公司 Business data processing method, device, computer equipment and storage medium
CN110782240A (en) * 2019-10-12 2020-02-11 上海陆家嘴国际金融资产交易市场股份有限公司 Service data processing method and device, computer equipment and storage medium
CN110796556A (en) * 2019-10-30 2020-02-14 泰康保险集团股份有限公司 Information processing method and device, computer readable storage medium and electronic equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199923A (en) * 2020-10-20 2021-01-08 重庆紫光华山智安科技有限公司 Identification generation method, system, device and medium based on distributed system
CN112511317A (en) * 2020-12-31 2021-03-16 河南信大网御科技有限公司 Input distribution method, input agent and mimicry distributed storage system
CN113762698A (en) * 2021-01-21 2021-12-07 北京沃东天骏信息技术有限公司 Method, device and system for processing service information
CN112835904A (en) * 2021-02-04 2021-05-25 北京电解智科技有限公司 Data processing method and data processing device
CN113438290A (en) * 2021-06-22 2021-09-24 康键信息技术(深圳)有限公司 Method, device and equipment for detecting repeated request and storage medium
CN116366249A (en) * 2023-06-01 2023-06-30 广东维信智联科技有限公司 Interactive communication system based on digital information
CN116366249B (en) * 2023-06-01 2023-11-03 广东维信智联科技有限公司 Interactive communication system based on digital information

Also Published As

Publication number Publication date
CN111460129B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN113495921B (en) Routing method and device for database cluster
CN111127181B (en) Voucher accounting method and device
CN111427701A (en) Workflow engine system and business processing method
CN110795315A (en) Method and device for monitoring service
CN116303608A (en) Data processing method and device for application service
CN110245014B (en) Data processing method and device
CN113282589A (en) Data acquisition method and device
CN110928594A (en) Service development method and platform
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN112948138A (en) Method and device for processing message
CN113641706A (en) Data query method and device
CN113111626A (en) Sequence generation method and device, electronic equipment and storage medium
CN109087097B (en) Method and device for updating same identifier of chain code
CN113726885A (en) Method and device for adjusting flow quota
CN111984616A (en) Method, device and system for updating shared file
CN113419745A (en) Application instance number management method and device, electronic equipment and computer readable medium
CN112099841A (en) Method and system for generating configuration file
CN113326060A (en) Service request processing method, device and system and service configuration method and device
CN112559001A (en) Method and device for updating application
CN112306984A (en) Data source routing method and device
CN112711572A (en) Online capacity expansion method and device suitable for sub-warehouse and sub-meter
CN110262756B (en) Method and device for caching data
CN115484149B (en) Network switching method, network switching device, electronic equipment and storage medium
CN113766437B (en) Short message sending method and device

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