CN112860755B - Service identifier generation method, device, computer equipment and medium - Google Patents

Service identifier generation method, device, computer equipment and medium Download PDF

Info

Publication number
CN112860755B
CN112860755B CN202110303355.8A CN202110303355A CN112860755B CN 112860755 B CN112860755 B CN 112860755B CN 202110303355 A CN202110303355 A CN 202110303355A CN 112860755 B CN112860755 B CN 112860755B
Authority
CN
China
Prior art keywords
service
identifier
generated
generation
configuration data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110303355.8A
Other languages
Chinese (zh)
Other versions
CN112860755A (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.)
Ping An Commercial Factoring Co ltd
Original Assignee
Ping An Commercial Factoring 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 Ping An Commercial Factoring Co ltd filed Critical Ping An Commercial Factoring Co ltd
Priority to CN202110303355.8A priority Critical patent/CN112860755B/en
Publication of CN112860755A publication Critical patent/CN112860755A/en
Application granted granted Critical
Publication of CN112860755B publication Critical patent/CN112860755B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24573Query processing with adaptation to user needs using data annotations, e.g. user-defined metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The present invention relates to the field of big data technologies, and in particular, to a service identifier generating method, a device, a computer device, and a storage medium. The method comprises the following steps: receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated; based on the service name, acquiring corresponding configuration data and the generated number of generated service identifiers; generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity; and combining the prefix identifier and the suffix identifier to obtain a service identifier. By adopting the method, the generation efficiency and the accuracy of the service identification can be improved. The application also relates to the technical field of blockchain, and the data such as the generation request, the configuration data, the count number of generated service identifiers, the prefix identifiers, the suffix identifiers, the service identifiers and the like can be uploaded to the blockchain node.

Description

Service identifier generation method, device, computer equipment and medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a service identifier generating method, device, computer equipment, and medium.
Background
In complex business systems, it is often necessary to use a meaningful and orderly serial number to identify each business to identify its uniqueness, e.g., for identifying a large number of orders, accounts, etc.
In the conventional manner, the service identifier is generated based on parameters of the service system, such as database ID or machine clock, and the like, so that the requirement on the service system is high, the coupling is strong, and the service identifier is easy to generate abnormality when the database is abnormal or the machine clock is changed.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a service identifier generating method, apparatus, computer device, and medium capable of improving the efficiency and accuracy of generating a service identifier.
A method for generating a service identifier, the method comprising:
receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated;
based on the service name, acquiring corresponding configuration data and the generated number of generated service identifiers;
generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity;
And combining the prefix identifier and the suffix identifier to obtain a service identifier.
In one embodiment, generating, according to the configuration data and the number of generated service identifiers, a prefix identifier and a suffix identifier of a service identifier to be generated, where the service identifier corresponds to the generation request, includes:
according to the configuration data, determining a prefix generation requirement of the service identifier to be generated corresponding to the generation request, and generating a prefix identifier of the service identifier to be generated based on the prefix generation requirement;
determining the suffix length of the service identifier to be generated based on the configuration data;
and generating a suffix identification of the service identification to be generated according to the suffix length and the generation quantity.
In one embodiment, obtaining the corresponding configuration data and the generated number of the generated service identifiers includes:
acquiring corresponding configuration data and the generated number of generated service identifiers corresponding to the generation request from the distributed system;
before generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity, the method further comprises the following steps:
acquiring an update count for updating a local database according to the configuration data;
judging whether the generated number is smaller than the update count;
When the generation number is smaller than the update count, the generation number in the distributed system is updated, and the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request are continuously generated according to the configuration data and the updated generation number.
In one embodiment, the method further comprises:
the service identification is stored in the distributed system.
In one embodiment, after determining whether the generated number is less than the update count, further comprising:
when the number of generated service identifiers is determined to be greater than or equal to the update count, the generated service identifiers stored in the distributed system are acquired and written into a local database;
and updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation quantity.
In one embodiment, before acquiring the corresponding configuration data and the generated number of the generated service identifiers based on the service names, the method further includes:
inquiring whether a corresponding target name exists in the distributed system according to the service name;
when the corresponding target name does not exist in the distributed system, the target name corresponding to the service name is created, and an initial value of the generated number of the generated service identifications corresponding to the target name is set.
In one embodiment, the method further comprises:
and uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to the blockchain node for storage.
A service invocation monitoring device, the device comprising:
the receiving module is used for receiving a generation request for generating the service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated;
the acquisition module is used for acquiring corresponding configuration data and the generated number of the generated service identifiers based on the service names;
the generating module is used for generating prefix identifiers and suffix identifiers of the service identifiers to be generated corresponding to the generating request according to the configuration data and the generating quantity;
and the combination module is used for combining the prefix identifier and the suffix identifier to obtain the service identifier.
A computer device comprising a memory storing a computer program and a processor, the processor executing the steps of any of the methods described above when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the preceding claims.
According to the service identifier generation method, the device, the computer equipment and the medium, the service name corresponding to the service to be generated is carried in the generation request by receiving the generation request for generating the service identifier, the corresponding configuration data and the generated number of the generated service identifiers are obtained based on the service name, the prefix identifier and the suffix identifier corresponding to the service identifier to be generated are generated according to the configuration data and the generated number, and the prefix identifier and the suffix identifier are combined to obtain the service identifier. Therefore, prefix identifiers and suffix identifiers can be generated according to the acquired corresponding configuration data and the count number, and service identifiers are generated.
Drawings
FIG. 1 is an application scenario diagram of a method for generating service identifiers in one embodiment;
FIG. 2 is a flow diagram of a method for generating service identifiers in one embodiment;
FIG. 3 is a block diagram of a service identifier generating device in one embodiment;
Fig. 4 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The service identifier generating method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The user generates a request for generating the service identifier through the terminal 102, and then sends the request to the server 104, where the request for generating carries a service name corresponding to the service to be generated and the service identifier corresponds to the service. After receiving the generation request, the server 104 may obtain corresponding configuration data and the generated number of generated service identifiers based on the service name, and then generate, according to the configuration data and the generated number, a prefix identifier and a suffix identifier of the service identifier to be generated, which correspond to the generation request. Further server 104 may combine the prefix identification with the suffix identification to obtain a service identification. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a service identifier generating method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
step S202, receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated.
The generation request refers to a request for requesting to generate a service identifier, and the request may carry a service name of a service corresponding to the service identifier to be generated.
In this embodiment, the service may refer to various order services or account services, for example, an online purchase order, an insurance order, and the like, and the request refers to a request for generating an order identifier or an account identifier.
In this embodiment, the user may input the request information through the service terminals corresponding to different service systems, then generate the corresponding generation request, and send the corresponding generation request to the server, so that the server may perform subsequent data.
Step S204, based on the service name, the corresponding configuration data and the generated number of the generated service identifiers are obtained.
The configuration data refers to data which is configured in advance and has a one-to-one correspondence with each service. The configuration data may include a specific generation rule or a generation requirement of a service identifier of the corresponding service.
The generated amount refers to the number of service identifiers generated by the service corresponding to the service name, for example, if the number of generated service identifiers is 5 for a certain insurance order, the corresponding generated number is 5.
In this embodiment, the server may parse the service generation request to parse the service name from the service generation request. For example, the server may parse the service generation request through a regular expression or a parsing template, or the like.
In this embodiment, after resolving the service name, the server may query, according to the service name, the configuration data of the generation request corresponding to the service and the generated number of the generated service identifiers, so as to obtain the queried configuration data and the generated number.
Step S206, generating prefix identifiers and suffix identifiers of the service identifiers to be generated corresponding to the generation request according to the configuration data and the generation quantity.
The prefix identifier is a first half identifier of the service data to be generated, the suffix identifier represents a second half identifier of the service identifier to be generated, for example, for one service identifier "LA2020092700000001", "LA20200927" is a corresponding prefix identifier thereof, and "00000001" is a corresponding suffix identifier thereof.
In this embodiment, the server may determine, through configuration data, a prefix identifier of the service identifier to be generated and a generation requirement corresponding to the suffix identifier, for example, a character length, a character composition, and so on, so that a corresponding task identifier may be generated according to the corresponding generation request.
In this embodiment, the server may determine and generate the prefix identifier and the suffix identifier corresponding to the generation request according to the obtained configuration data and the number of generation.
Step S208, combining the prefix identifier and the suffix identifier to obtain a service identifier.
Specifically, the server may combine the prefix identifier and the suffix identifier, thereby obtaining the service identifier corresponding to the generation request.
In this embodiment, the combination sequence of the prefix identifier and the suffix identifier is not limited, that is, the prefix identifier may precede the suffix identifier, and the suffix identifier may be the suffix identifier after the disaster, or vice versa.
In the service identifier generating method, the generating request is received, the generating request carries the service name of the service corresponding to the service identifier to be generated, the corresponding configuration data and the generated number of the generated service identifiers are obtained based on the service name, the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generating request are generated according to the configuration data and the generated number, and the prefix identifier and the suffix identifier are combined to obtain the service identifier. Therefore, prefix identifiers and suffix identifiers can be generated according to the acquired corresponding configuration data and the count number, and service identifiers are generated.
In one embodiment, generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number may include: according to the configuration data, determining a prefix generation requirement of the service identifier to be generated corresponding to the generation request, and generating a prefix identifier of the service identifier to be generated based on the prefix generation requirement; determining the suffix length of the service identifier to be generated based on the configuration data; and generating a suffix identification of the service identification to be generated according to the suffix length and the generation quantity.
In this embodiment, the configuration data may include a service name key_name, a service identification length key_length, a prefix rule key_prefix, a suffix rule key_suffix, and the like.
In this embodiment, the service name key_name is used to distinguish services, such as "key_name: LA "service name" LA ", different services use different key_names, and IDs of each key_name are isolated from each other and do not affect each other. The service identity length key_length is used to determine the character length of the generated service identity, for example, "key_length:18 "means that the service identity is 18 characters in length. The prefix rule key_prefix is used to generate a prefix of the service identification, for example, LA20$ { date6}, LA "represents the service name," 20 "represents the year" 20 years ", and $ { date6}" represents the date format ymmdd. The suffix rule key_suffix is used to generate the suffix of the service identification.
In this embodiment, the server may determine, according to the configuration data, a prefix generation requirement for generating the service identifier to be generated corresponding to the generation request, that is, a prefix rule key_prefix, and then generate, according to the prefix rule key_prefix, a prefix identifier for generating the service identifier to be generated, for example, "key_prefix: LA20$ { date6}, i.e., name +20+current date, then a prefix identification of "LA20200927" may be generated.
Further, the server may determine the total length of the service identifier to be generated, i.e. key_length, according to the configuration data, such as "key_length:18", then determining the length of the suffix identification according to the prefix identification and the total length key_length, if the total length is 18, the prefix identification is" LA20200927", i.e. the prefix length is 10, then determining the suffix length to be 8.
Further, the server may generate a suffix identifier corresponding to a suffix length according to the obtained number of generated service identifiers generated by the service, that is, the value of key_value, for example, the suffix length is 8, and the obtained number of generated service identifiers is 2, and then the server may add 1 to the number of generated service identifiers, and then determine that the suffix identifier is "00000003" by supplementing 0.
It will be appreciated by those skilled in the art that the foregoing is merely illustrative, and that in other embodiments, the server may generate different prefix identifiers and suffix identifiers and generate service identifiers corresponding to different configuration data according to different prefix rules and suffix rules.
In one embodiment, obtaining the corresponding configuration data and the generated number of the generated service identifiers may include: and acquiring corresponding configuration data and the generated number of the generated service identifiers corresponding to the generation request from the distributed system.
Wherein the distributed system may be a dis system or the like.
In this embodiment, the server may store the generated service identifier and the corresponding generated number thereof in the distributed system, and when the corresponding data needs to be acquired, acquire the corresponding generated number from the distributed system based on the service name key_name.
In this embodiment, before generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number, the method may further include: acquiring an update count for updating a local database according to the configuration data; judging whether the generated number is smaller than the update count; when the generation number is smaller than the update count, the generation number in the distributed system is updated, and the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request are continuously generated according to the configuration data and the updated generation number.
In this embodiment, the server may determine, according to the configuration data, the total count number corresponding to updating the local database, that is, the key_cache, that is, the server may determine, by setting the configuration data, that after generating a certain amount of task identifiers, update the local database, for example, set "key_cache: and 5', when the counting number is smaller than 5, generating a prefix identifier and a suffix identifier corresponding to the generation request according to the configuration data and the generation number, and generating a corresponding service identifier according to the prefix identifier and the suffix identifier.
In one embodiment, after combining the prefix identifier and the suffix identifier to obtain the service identifier, the method may further include: the service identification is stored in the distributed system.
In this embodiment, after each generation of the service identifier, the server may store the generated service identifier to the distributed system, so as to facilitate subsequent use.
In the above embodiment, by acquiring the generated number from the distributed system, then determining whether the generated number is smaller than the count total number, and creating the service identifier when the count number is smaller than the count total number, and storing the service identifier in the distributed system, the generated service identifier can be directly stored in the distributed system, based on the atomic performance of the distributed system, the generated service identifier can be ensured not to be repeated, the accuracy of the generated service identifier can be improved, and the read-write performance of the service identifier generating system can be improved by storing the generated service identifier by the distributed system.
In one embodiment, after determining whether the generated number is less than the update count, the method may further include: when the number of generated service identifiers is determined to be greater than or equal to the update count, the generated service identifiers stored in the distributed system are acquired and written into a local database; and updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation quantity.
In this embodiment, after determining that the number of generated service identifiers is greater than or equal to the update count, the server may obtain the generated service identifiers stored in the distributed system, and store the service identifiers in a local database of the server.
Further, the server may adjust the update count, for example, from 5 to 10, and continuously generate the prefix identifier and the suffix identifier corresponding to the generation request according to the configuration data and the generation number, and when the next generation number reaches the adjusted update count, write the generated service identifier stored in the distributed system into the local database, so as to reduce the number of times of reading and writing to the server database, reduce the reading and writing pressure of the database, and improve the stability of the database.
In this embodiment, for the service identifier stored in the local database, the server may delete the corresponding service identifier in the distributed system, so as to reduce occupation of the distributed system by the service identifier stored in the local database, and improve operation stability of the distributed system.
In the above embodiment, by setting the update count, when the generated number reaches the update count, the generated service identifier is obtained from the distributed system and stored in the local database, so that the frequency of reading and writing to the local database can be reduced, the pressure of reading and writing to the database can be reduced, and the stability of the database can be further improved.
In one embodiment, before acquiring the corresponding configuration data and the generated number of the generated service identifiers based on the service names, the method may further include: inquiring whether a corresponding target name exists in the distributed system according to the service name; when the corresponding target name does not exist in the distributed system, the target name corresponding to the service name is created, and an initial value of the generated number of the generated service identifications corresponding to the target name is set.
In this embodiment, the server may add the configuration in the local database in advance, that is, "id:1, key_name: 'LA', key_value:0, key_length:18, key_cache:5, key_prefix: 'LA20$ { date6 }'. When the service is started, the server can acquire all configured data from the local database, and the configuration data can be realized through map mapping of mybatis. The server may put the acquired data into a ConcurrentHashMap instance.
Further, when the server receives the generation request, it may determine whether there is a corresponding target name in redis, and when there is no corresponding target name in the distributed system, it may generate a record, set the key to "LA", and set the value to the initial value 0.
Then, the server can increase the value corresponding to the key "LA" in the distributed system by 1 to obtain a new value 1, and then find the corresponding configuration object from the convergenthashmap instance by using the key "LA", that is, obtain the corresponding configuration data, and further generate the corresponding service identifier according to the configuration data and the generated number 1.
In the above embodiment, by determining whether the corresponding target name exists in the distributed system, creating the target name corresponding to the service name when determining that the corresponding target name does not exist, and setting the number of generated service identifiers corresponding to the generated service identifier as an initial value, the number of generated service identifiers corresponding to the service can be counted, the generated service identifiers can be stored, the read-write frequency of the database can be reduced, the processing pressure of the database can be reduced, and the stability can be improved.
In one embodiment, the method may further include: and uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to the blockchain node for storage.
The blockchain refers to a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Block chain is essentially a decentralised database, and is a series of data blocks which are generated by correlation using a cryptography method, and each data Block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next Block.
Specifically, the blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In this embodiment, the server may upload and store one or more data of the generation request, the configuration data, the count number of generated service identifiers, the prefix identifier, the suffix identifier, and the service identifier in the nodes of the blockchain, so as to ensure the privacy and security of the data.
In the above embodiment, at least one of the generation request, the configuration data, the count number of the generated service identifier, the prefix identifier, the suffix identifier and the service identifier is uploaded to the blockchain and stored in the node of the blockchain, so that the privacy of the data stored in the blockchain link point can be ensured, and the security of the data can be improved.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 3, there is provided a service identifier generating apparatus, including: a receiving module 100, an acquiring module 200, a prefix identifier and suffix identifier generating module 300 and a combining module 400, wherein:
the receiving module 100 is configured to receive a generation request for generating a service identifier, where the generation request carries a service name corresponding to a service corresponding to the service identifier to be generated.
The obtaining module 200 is configured to obtain, based on the service name, the corresponding configuration data and the generated number of the generated service identifiers.
And the generating module 300 is configured to generate a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generating request according to the configuration data and the generating number.
The combining module 400 is configured to combine the prefix identifier and the suffix identifier to obtain a service identifier.
In one embodiment, the generating module 300 may include:
and the prefix identifier generation sub-module is used for determining a prefix generation requirement of the service identifier to be generated corresponding to the generation request according to the configuration data, and generating the prefix identifier of the service identifier to be generated based on the prefix generation requirement.
And the suffix length determination submodule is used for determining the suffix length of the service identifier to be generated based on the configuration data.
And the suffix identifier generation sub-module is used for generating the suffix identifier of the service identifier to be generated according to the suffix length and the generation quantity.
In one embodiment, the obtaining module 200 is configured to obtain corresponding configuration data from the distributed system, and a generated number of generated service identifiers corresponding to the generation request.
In this embodiment, the apparatus may further include:
And the update count acquisition module is used for acquiring the update count for updating the local database according to the configuration data before generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity.
And the judging module is used for judging whether the generated number is smaller than the update count.
And the first generation number updating module is used for updating the generation number in the distributed system when the generation number is determined to be smaller than the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation number.
In one embodiment, the apparatus may further include:
and the first storage module is used for combining the prefix identifier and the suffix identifier to obtain a service identifier, and then storing the service identifier into the distributed system.
In one embodiment, the apparatus may further include:
and the read-write module is used for judging whether the generated number is smaller than the update count, and when the generated number is determined to be larger than or equal to the update count, acquiring the generated service identifier stored in the distributed system and writing the service identifier into the local database.
And the second generation quantity updating module is used for updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation quantity.
In one embodiment, the apparatus may further include:
and the query module is used for querying whether the corresponding target name exists in the distributed system according to the service name before acquiring the corresponding configuration data and the generated number of the generated service identifiers based on the service name.
And the configuration module is used for creating the target name corresponding to the service name and setting the initial value of the generated number of the generated service identifications corresponding to the target name when the corresponding target name does not exist in the distributed system.
In one embodiment, the apparatus may further include:
and the second storage module is used for uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to the blockchain node for storage.
The specific limitation of the service identifier generating device may be referred to the limitation of the service identifier generating method hereinabove, and will not be described herein. The above-mentioned respective modules in the service identification generating device may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as a generation request, configuration data, the number of counts of generated service identifiers, prefix identifiers, suffix identifiers, service identifiers and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a service identification generation method.
Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of: receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated; based on the service name, acquiring corresponding configuration data and the generated number of generated service identifiers; generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity; and combining the prefix identifier and the suffix identifier to obtain a service identifier.
In one embodiment, when the processor executes the computer program, the generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number may include: according to the configuration data, determining a prefix generation requirement of the service identifier to be generated corresponding to the generation request, and generating a prefix identifier of the service identifier to be generated based on the prefix generation requirement; determining the suffix length of the service identifier to be generated based on the configuration data; and generating a suffix identification of the service identification to be generated according to the suffix length and the generation quantity.
In one embodiment, the processor, when executing the computer program, obtains corresponding configuration data and the generated number of generated service identifiers, and may include: and acquiring corresponding configuration data and the generated number of the generated service identifiers corresponding to the generation request from the distributed system.
In this embodiment, before the processor executes the computer program to generate the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number, the following steps may be further implemented: acquiring an update count for updating a local database according to the configuration data; judging whether the generated number is smaller than the update count; when the generation number is smaller than the update count, the generation number in the distributed system is updated, and the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request are continuously generated according to the configuration data and the updated generation number.
In one embodiment, the processor, when executing the computer program, implements the combining of the prefix identifier and the suffix identifier, and after obtaining the service identifier, may further implement the following steps: the service identification is stored in the distributed system.
In one embodiment, after the processor executes the computer program to determine whether the number of generated data is less than the update count, the following steps may be implemented: when the number of generated service identifiers is determined to be greater than or equal to the update count, the generated service identifiers stored in the distributed system are acquired and written into a local database; and updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation quantity.
In one embodiment, before the processor executes the computer program to obtain the corresponding configuration data and the generated number of the generated service identifiers based on the service names, the following steps may be further implemented: inquiring whether a corresponding target name exists in the distributed system according to the service name; when the corresponding target name does not exist in the distributed system, the target name corresponding to the service name is created, and an initial value of the generated number of the generated service identifications corresponding to the target name is set.
In one embodiment, the following steps may also be implemented when the processor executes the computer program: and uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to the blockchain node for storage.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated; based on the service name, acquiring corresponding configuration data and the generated number of generated service identifiers; generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation quantity; and combining the prefix identifier and the suffix identifier to obtain a service identifier.
In one embodiment, when the computer program is executed by the processor, the generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number may include: according to the configuration data, determining a prefix generation requirement of the service identifier to be generated corresponding to the generation request, and generating a prefix identifier of the service identifier to be generated based on the prefix generation requirement; determining the suffix length of the service identifier to be generated based on the configuration data; and generating a suffix identification of the service identification to be generated according to the suffix length and the generation quantity.
In one embodiment, the computer program, when executed by the processor, implements obtaining corresponding configuration data and a generated number of generated service identifiers, may include: and acquiring corresponding configuration data and the generated number of the generated service identifiers corresponding to the generation request from the distributed system.
In this embodiment, before the computer program is executed by the processor to generate the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number, the following steps may be further implemented: acquiring an update count for updating a local database according to the configuration data; judging whether the generated number is smaller than the update count; when the generation number is smaller than the update count, the generation number in the distributed system is updated, and the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request are continuously generated according to the configuration data and the updated generation number.
In one embodiment, the computer program when executed by the processor implements combining the prefix identifier and the suffix identifier to obtain the service identifier, and further implements the following steps: the service identification is stored in the distributed system.
In one embodiment, after the computer program is executed by the processor to determine whether the number of generated events is less than the update count, the following steps may be implemented: when the number of generated service identifiers is determined to be greater than or equal to the update count, the generated service identifiers stored in the distributed system are acquired and written into a local database; and updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation quantity.
In one embodiment, the computer program when executed by the processor may further implement the following steps before obtaining the corresponding configuration data and the generated number of generated service identifiers based on the service name: inquiring whether a corresponding target name exists in the distributed system according to the service name; when the corresponding target name does not exist in the distributed system, the target name corresponding to the service name is created, and an initial value of the generated number of the generated service identifications corresponding to the target name is set.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to the blockchain node for storage.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for generating a service identifier, the method comprising:
receiving a generation request for generating a service identifier, wherein the generation request carries a service name of a service corresponding to the service identifier to be generated;
based on the service names, obtaining corresponding configuration data and the generated number of generated service identifiers;
generating a prefix identifier and a suffix identifier of the service identifier to be generated, which correspond to the generation request, according to the configuration data and the generation quantity;
Combining the prefix identifier and the suffix identifier to obtain a service identifier;
the obtaining the corresponding configuration data and the generated number of the generated service identifiers includes:
acquiring corresponding configuration data from a distributed system and the generated number of generated service identifiers corresponding to the generation request;
before generating the prefix identifier and the suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the generation number, the method further includes:
acquiring an update count for updating a local database according to the configuration data;
judging whether the generated number is smaller than the update count;
and when the generation quantity is smaller than the update count, updating the generation quantity in the distributed system, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated, which correspond to the generation request, according to the configuration data and the updated generation quantity.
2. The method according to claim 1, wherein the generating, according to the configuration data and the number of generations, a prefix identifier and a suffix identifier of a service identifier to be generated corresponding to the generation request includes:
According to the configuration data, prefix generation requirements of the service identifiers to be generated corresponding to the generation requests are determined, and the prefix identifiers of the service identifiers to be generated are generated based on the prefix generation requirements;
determining the suffix length of the service identifier to be generated based on the configuration data;
and generating the suffix identification of the service identification to be generated according to the suffix length and the generation quantity.
3. The method of claim 1, wherein the combining the prefix identifier and the suffix identifier to obtain a service identifier further comprises:
and storing the service identification into the distributed system.
4. The method of claim 1, wherein said determining if said generated number is less than said update count further comprises:
when the generation number is determined to be greater than or equal to the update count, the generated service identifiers stored in the distributed system are acquired and written into a local database;
and updating the generation quantity in the distributed system according to the update count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated, which correspond to the generation request, according to the configuration data and the updated generation quantity.
5. The method of claim 1, wherein before the obtaining the corresponding configuration data and the generated number of generated service identities based on the service name, further comprises:
inquiring whether a corresponding target name exists in the distributed system according to the service name;
when the corresponding target name does not exist in the distributed system, creating the target name corresponding to the service name, and setting an initial value of the generation number of the generated service identifications corresponding to the target name.
6. The method according to any one of claims 1 to 5, further comprising:
and uploading at least one of the generation request, the configuration data, the count number of the generated service identifiers, the prefix identifiers, the suffix identifiers and the service identifiers to a blockchain node for storage.
7. A service invocation monitoring device, the device comprising:
the receiving module is used for receiving a generation request for generating the service identifier, wherein the generation request carries a service name corresponding to the service to be generated and corresponding to the service identifier;
the acquisition module is used for acquiring corresponding configuration data and the generated number of the generated service identifiers based on the service names;
The generating module is used for generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generating request according to the configuration data and the generating quantity;
the combination module is used for combining the prefix identifier and the suffix identifier to obtain a service identifier;
the acquisition module is further used for acquiring corresponding configuration data from the distributed system and the generated number of the generated service identifiers corresponding to the generation request;
the apparatus further comprises:
the update count acquisition module is used for acquiring update counts for updating the local database according to the configuration data;
the judging module is used for judging whether the generated quantity is smaller than the update count;
and the first generation number updating module is used for updating the generation number in the distributed system when the generation number is determined to be smaller than the updating count, and continuously generating a prefix identifier and a suffix identifier of the service identifier to be generated corresponding to the generation request according to the configuration data and the updated generation number.
8. The apparatus of claim 7, wherein the generating module comprises:
A prefix identifier generating sub-module, configured to determine, according to the configuration data, a prefix generating requirement of a service identifier to be generated corresponding to the generating request, and generate, based on the prefix generating requirement, a prefix identifier of the service identifier to be generated;
a suffix length determining sub-module, configured to determine a suffix length of the service identifier to be generated based on the configuration data;
and the suffix identifier generation sub-module is used for generating the suffix identifier of the service identifier to be generated according to the suffix length and the generation quantity.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202110303355.8A 2021-03-22 2021-03-22 Service identifier generation method, device, computer equipment and medium Active CN112860755B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110303355.8A CN112860755B (en) 2021-03-22 2021-03-22 Service identifier generation method, device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110303355.8A CN112860755B (en) 2021-03-22 2021-03-22 Service identifier generation method, device, computer equipment and medium

Publications (2)

Publication Number Publication Date
CN112860755A CN112860755A (en) 2021-05-28
CN112860755B true CN112860755B (en) 2024-04-05

Family

ID=75991877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110303355.8A Active CN112860755B (en) 2021-03-22 2021-03-22 Service identifier generation method, device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN112860755B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452387A (en) * 2008-12-09 2009-06-10 山东浪潮齐鲁软件产业股份有限公司 Service flow management method
CN104113435A (en) * 2014-07-04 2014-10-22 广州华多网络科技有限公司 Method and device for generating identifier
CN106412866A (en) * 2015-07-30 2017-02-15 三亚中兴软件有限责任公司 Phone bill generation method and apparatus
CN110750506A (en) * 2019-09-17 2020-02-04 苏宁云计算有限公司 Data object identification generation method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452387A (en) * 2008-12-09 2009-06-10 山东浪潮齐鲁软件产业股份有限公司 Service flow management method
CN104113435A (en) * 2014-07-04 2014-10-22 广州华多网络科技有限公司 Method and device for generating identifier
CN106412866A (en) * 2015-07-30 2017-02-15 三亚中兴软件有限责任公司 Phone bill generation method and apparatus
CN110750506A (en) * 2019-09-17 2020-02-04 苏宁云计算有限公司 Data object identification generation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112860755A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN110647582B (en) Method, device, storage medium and computer equipment for block chain network consensus verification
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN110069449B (en) File processing method, device, computer equipment and storage medium
CN109542428B (en) Service processing method, device, computer equipment and storage medium
CN111177302B (en) Service bill processing method, device, computer equipment and storage medium
CN108829781B (en) Client information query method, device, computer equipment and storage medium
CN109558404B (en) Data storage method, device, computer equipment and storage medium
CN112395157B (en) Audit log acquisition method and device, computer equipment and storage medium
CN111865691B (en) Alarm file distribution method, device, equipment and medium based on artificial intelligence
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN111858467B (en) File data processing method, device, equipment and medium based on artificial intelligence
CN112860755B (en) Service identifier generation method, device, computer equipment and medium
CN113111078B (en) Resource data processing method and device, computer equipment and storage medium
CN112783866B (en) Data reading method, device, computer equipment and storage medium
CN112035471B (en) Transaction processing method and computer equipment
CN111708795B (en) Object identification generation method, object identification updating device, computer equipment and medium
CN115168499A (en) Database table fragmentation method and device, computer equipment and storage medium
CN111131393A (en) User activity data statistical method, electronic device and storage medium
CN113205359B (en) Method and device for determining commodity price in bill and computer equipment
CN115017550B (en) Electronic contract data processing method and device, computer equipment and medium
CN113778423B (en) Interface document generation method and system
CN111339574B (en) Block data processing method and device, computer equipment and storage medium
CN117406967B (en) Component identification method and device, electronic equipment and storage medium
CN110209666B (en) data storage method and terminal equipment

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