CN115827588A - Method, device, equipment and storage medium for generating business global serial number - Google Patents

Method, device, equipment and storage medium for generating business global serial number Download PDF

Info

Publication number
CN115827588A
CN115827588A CN202211667406.6A CN202211667406A CN115827588A CN 115827588 A CN115827588 A CN 115827588A CN 202211667406 A CN202211667406 A CN 202211667406A CN 115827588 A CN115827588 A CN 115827588A
Authority
CN
China
Prior art keywords
serial number
service
cache unit
transaction
level cache
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.)
Pending
Application number
CN202211667406.6A
Other languages
Chinese (zh)
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.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank 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 Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202211667406.6A priority Critical patent/CN115827588A/en
Publication of CN115827588A publication Critical patent/CN115827588A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for generating a business global serial number. The method comprises the following steps: acquiring attribute information of transaction service, wherein the attribute information comprises transaction time, service type and receiving end identification; acquiring an appointed serial number from a cache unit according to the service type of the transaction service; and generating a global serial number aiming at the transaction service according to the attribute information and the specified serial number. After the attribute information of the transaction service is acquired, the designated serial number is directly acquired from the cache unit without being called from the database, and the global serial number is generated according to the attribute information and the sequence acquired from the cache, so that the strong dependence of the generation of the global serial number on the database is relieved, and the normal operation of the service cannot be influenced even if the database has short-term faults.

Description

Method, device, equipment and storage medium for generating business global serial number
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a business global serial number.
Background
In the distributed system, when one customer service request is completed by a plurality of background systems together, the service request adopts a global serial number for unique identification, which is the unique transaction association generated in the processing process of the customer service request, and the initial initiator system circulates in the whole transaction process. The execution of a service request spans a plurality of system modules, the result of the service execution is also dispersed in a plurality of systems, and the global serial number is a correlation mechanism for cross-system transaction, and can trace the service and monitor and ensure the data consistency of each system.
However, the current business generally adopts a database self-increment serial number, the database self-increment serial number is generated by a database, and the increment trend and the availability depend on an underlying database. However, because the implementation of the database self-increment is inconsistent, processing is required during database migration, and because the generation of the global serial number strongly depends on the database, once the database fails, a risk that a service cannot run is caused.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for generating a service global serial number, which are used for generating the global service serial number.
According to a first aspect of the present invention, a method for generating a service global serial number is provided, including: acquiring attribute information of transaction service, wherein the attribute information comprises transaction time, service type and receiving end identification;
acquiring an appointed sequence number from a cache unit according to the service type of the transaction service;
and generating a global serial number aiming at the transaction service according to the attribute information and the specified serial number.
According to another aspect of the present invention, there is provided an apparatus for generating a business global serial number, including: the attribute information acquisition module is used for acquiring attribute information of transaction service, wherein the attribute information comprises transaction time, service type and receiving end identification;
the appointed sequence number acquisition module is used for acquiring an appointed sequence number from the cache unit according to the service type of the transaction service;
and the global serial number generating module is used for generating a global serial number aiming at the transaction service according to the attribute information and the specified serial number.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method according to any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to perform the method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, after the attribute information of the transaction service is obtained, the specified serial number is directly obtained from the cache unit without calling from the database, and the global serial number is generated according to the attribute information and the sequence obtained from the cache, so that the strong dependence of the generation of the global serial number on the database is relieved, and the normal operation of the service is not influenced even if the database has short-term faults.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating a service global serial number according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for generating a seed service global serial number according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for generating a service global serial number according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a method for generating a global serial number of a service according to an embodiment of the present invention, where this embodiment is applicable to a case of generating a global serial number of a service, and the method may be executed by a device for generating a global serial number of a service, and the device may be implemented in a form of hardware and/or software. As shown in fig. 1, the method includes:
step S101, acquiring attribute information of transaction service.
Optionally, before obtaining the attribute information of the transaction service, the method further includes: acquiring serial numbers in a specified range from a database; and respectively caching the serial numbers in the specified range into a first-level cache unit and a second-level cache unit, wherein the range of the serial numbers in the first-level cache unit is different from that in the second-level cache unit.
In this embodiment, in order to alleviate an excessive dependency of a global serial number generation process on a database, sequence numbers stored in the database are firstly cached in a first-level cache unit and a second-level cache unit before a transaction service is acquired, because storage spaces corresponding to the first-level cache unit and the second-level cache unit are fixed, only sequence numbers in a specified range stored in the database are respectively cached in the cache units, ranges of the sequence numbers in the first-level cache unit and the second-level cache unit are different, and a length of each sequence number in the cache unit may specifically be 16 bits.
It should be noted that, in this embodiment, each cache unit respectively adopts a self-increment mode to display the serial number, for example, for a first-level cache unit, the initial display serial number 0000000000000001 sets a self-increment step size to 1, that is, 1 is added when it is determined that the serial number 0000000000000001 is removed, and a next serial number 0000000000000002 is displayed until a maximum value 0000000000000010 of the cached serial number is removed, and then the first cache unit is empty. Of course, in this embodiment, only the first-level cache unit is taken as an example for description, and the display manner of the serial numbers of the second-level cache unit is substantially the same as this, which is not described in detail in this embodiment again.
Optionally, the obtaining attribute information of the transaction service includes: identifying the transaction service received by the service receiving unit to obtain a service type; determining the transaction time of the transaction service received by the service receiving unit and the receiving end identification corresponding to the service receiving unit; and taking the service type, the transaction time and the receiving end identification as attribute information.
Specifically, in this embodiment, when the transaction service is received by the service receiving unit, two pieces of information, namely, a receiving end identifier of the service receiving unit and transaction time for receiving the transaction service, are obtained, where the receiving end identifier may be 4 bits, and the transaction time may be 8 bits, which is only an example in this embodiment, and specific bits of the receiving end identifier and the transaction time are not limited. In addition, in this embodiment, the acquired transaction service is also identified to determine the service type, for example, the service type may be a deposit transaction or a withdrawal transaction, and in this embodiment, specific contents of the service type are not limited, and specifically, the transaction time, the service type, and the receiving end identifier are used as attribute information of the transaction service.
Step S102, obtaining the appointed serial number from the cache unit according to the business type of the transaction business.
Optionally, obtaining the specified sequence number from the cache unit according to the service type of the transaction service includes:
inquiring from a first-level cache unit according to the service type to acquire a serial number matched with the service type; and judging whether the serial number matched with the service type is valid, if so, taking the serial number matched with the service type as an appointed serial number, otherwise, updating the serial number of the first-level cache unit, and acquiring the appointed serial number according to the updated first-level cache unit.
Specifically, since serial numbers in different ranges are cached in the first-level cache unit and the second-level cache unit in advance, the serial number generator is used for querying from the first-level cache unit according to the acquired service type, and whether a serial number corresponding to the service type exists in the first-level cache unit is judged. For example, when the transaction service type is a withdrawal service, the serial number currently displayed in the primary cache unit is 0000000000000002, and each serial number corresponds to a different service type, so that it is determined whether the service type corresponding to the displayed serial number is a withdrawal service, if so, it is determined whether 0000000000000002 is valid, that is, whether the serial number is within a specified range of the database cache, and when the maximum cache serial number of the database for the primary cache unit is 0000000000000010, it may be determined that the currently displayed serial number is valid, and 0000000000000002 is directly used as the specified serial number.
When the currently displayed serial number is determined to be invalid, whether a serial number corresponding to the withdrawal service exists is further inquired from the primary cache unit, and when the maximum cache serial number 0000000000000010 is determined to be still not matched with the withdrawal service through traversal operation, the serial number in the primary cache unit is updated, so that the assigned serial number is obtained according to the updated primary cache unit.
Optionally, the updating the sequence number of the first-level cache unit includes: and judging whether the second-level cache unit contains the serial number, if so, directly writing the serial number in the second-level cache unit into the first-level cache unit to update the serial number of the first-level cache unit, otherwise, writing the serial number read from the database into the first-level cache unit and the second-level cache unit to update the serial number of the first-level cache unit and the second-level cache unit.
It should be noted that when it is determined that the sequence number that matches the transaction service and is valid is not found even after the first-level cache unit is traversed, the sequence number in the first-level cache unit is invalidated, whether the sequence number is included in the second-level cache unit is determined, and if the sequence number is included, the sequence number in the second-level cache unit is directly used to update the sequence number of the first-level cache unit. However, under the condition that the second-level cache unit does not contain the serial number, two segments of serial numbers are called from the database and cached in the first-level cache unit and the second-level cache unit respectively, and the caching priority of the first-level cache unit is higher than that of the second-level cache unit, namely, the serial numbers are cached in the second-level cache unit preferentially, so that the serial numbers can be ensured to exist in the first-level cache unit constantly, and effective serial numbers can be inquired from the first-level cache unit. Therefore, in this embodiment, the sequence number may be directly obtained from the first-level cache unit, or the sequence number may be obtained after the first-level cache unit is updated, and a specific determination method of the specified sequence number is not limited.
And step S103, generating a global serial number for the transaction service according to the attribute information and the designated serial number.
Optionally, generating a global serial number for the transaction service according to the attribute information and the specified sequence number includes: extracting the transaction time and the receiving end identification in the attribute information; and splicing the receiving end identification, the transaction time and the designated serial number in sequence to generate a global serial number aiming at the transaction service.
Specifically, when the transaction time is 20110213, the receiving end identifier is 0003, and the determined serial number which is matched with the withdrawal service and is valid is 0000000000000007, splicing is performed according to the sequence of the receiving end identifier, the transaction time and the specified serial number to obtain the serial number 0003201102130000000000000007, and the obtained serial number is used as the global serial number of the transaction service. It is to be understood that this embodiment is merely an example, and the specific contents of the designated serial number are not limited thereto.
According to the embodiment of the invention, after the attribute information of the transaction service is acquired, the specified serial number is directly acquired from the cache unit without being called from the database, and the global serial number is generated according to the attribute information and the sequence acquired from the cache, so that the strong dependence of the generation of the global serial number on the database is relieved, and the normal operation of the service is not influenced even under the condition that the database has short-term faults.
Example two
Fig. 2 is a flowchart of a method for generating a global serial number of a service according to a second embodiment of the present invention, where this embodiment further includes storing a transaction service associated with the global serial number in a database after generating the global serial number for the transaction service according to the attribute information and the specified sequence. As shown in fig. 2, the method includes:
step S201, acquiring attribute information of the transaction service.
Optionally, before obtaining the attribute information of the transaction service, the method further includes: acquiring a serial number in a specified range from a database; and respectively caching the serial numbers in the specified range into a first-level cache unit and a second-level cache unit, wherein the range of the serial numbers in the first-level cache unit is different from that in the second-level cache unit.
Optionally, the obtaining attribute information of the transaction service includes: identifying the transaction service received by the service receiving unit to obtain a service type; determining the transaction time of the transaction service received by the service receiving unit and the receiving end identification corresponding to the service receiving unit; and taking the service type, the transaction time and the receiving end identification as attribute information.
Step S202, obtaining the appointed serial number from the cache unit according to the service type of the transaction service.
Optionally, obtaining the specified sequence number from the cache unit according to the service type of the transaction service includes: inquiring from a first-level cache unit according to the service type to obtain a serial number matched with the service type; and judging whether the serial number matched with the service type is valid, if so, taking the serial number matched with the service type as an appointed serial number, otherwise, updating the serial number of the first-level cache unit, and acquiring the appointed serial number according to the updated first-level cache unit.
Optionally, the updating the sequence number of the first-level cache unit includes: judging whether the second-level cache unit contains the serial number, if so, directly writing the serial number in the second-level cache unit into the first-level cache unit so as to update the serial number of the first-level cache unit; otherwise, writing the serial number read from the database into the first-level cache unit and the second-level cache unit so as to update the serial numbers of the first-level cache unit and the second-level cache unit.
And step S203, generating a global serial number aiming at the transaction service according to the attribute information and the designated serial number.
Optionally, generating a global serial number for the transaction service according to the attribute information and the specified sequence number includes: extracting the transaction time and the receiving end identification in the attribute information; and splicing the receiving end identification, the transaction time and the designated serial number in sequence to generate a global serial number aiming at the transaction service.
And step S204, associating the transaction service with the global serial number to obtain an updated transaction service, and storing the updated transaction service in a database.
After the global serial number for the transaction service is generated, the transaction service and the global serial number are associated to obtain an updated transaction service, and the updated transaction service is stored in the database. The transaction service can be identified according to the global serial number during the execution of the transaction service in the distributed system.
It should be noted that, in the embodiment, after the transaction service after being further detailed is stored in the database, when the transaction service is executed in the distributed system, the related log in the execution process is also stored in the database. In the embodiment, the execution process of the transaction service is recorded by the pipelining recorder to generate the related log. After the updated transaction service is stored in the database, when the transaction service is executed completely, and when the whole execution process of the transaction service needs to be checked, the whole execution process of the transaction service can be acquired by inquiring in each distributed system through the global serial number. And when a certain system node in the distributed system has a fault, the fault occurrence point can be quickly positioned according to the global serial number. Therefore, in the embodiment, the transaction service associated with the global serial number is stored in the database, so that a user can conveniently acquire the transaction service associated with the global serial number from the database as required, and check and fault location are performed on the execution process of the transaction service in the distributed system according to the global serial number.
It should be noted that, in the database in the present embodiment, a plurality of kinds of information are stored, which are a pre-configured serial number, a transaction service associated with a global serial number, and a related log generated during the execution of the transaction service. The sequence number is mainly used for caching in a first-level cache unit and a second-level cache unit before the transaction business is formally operated; the transaction service primary related log associated with the global serial number is mainly used for identifying fault location in a primary operation process of the transaction service in a distributed system. It is to be understood that this embodiment is merely an example, and specific contents included in the database are not limited.
According to the embodiment of the invention, after the attribute information of the transaction service is acquired, the specified serial number is directly acquired from the cache unit without being called from the database, and the global serial number is generated according to the attribute information and the sequence acquired from the cache, so that the strong dependence of the generation of the global serial number on the database is relieved, and the normal operation of the service is not influenced even under the condition that the database has short-term faults. The transaction service associated with the global serial number is stored in the database, so that a user can conveniently acquire the transaction service associated with the global serial number from the database according to needs, and check and fault location are performed on the execution process of the transaction service in the distributed system according to the global serial number.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a device for generating a service global serial number according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: an attribute information acquisition module 310, a specified sequence number acquisition module 320, and a global serial number generation module 330.
The attribute information acquiring module 310 is configured to acquire attribute information of a transaction service, where the attribute information includes transaction time, a service type, and a receiving end identifier;
a designated sequence number obtaining module 320, configured to obtain a designated sequence number from the cache unit according to the service type of the transaction service;
and the global serial number generating module 330 is configured to generate a global serial number for the transaction service according to the attribute information and the specified serial number.
Optionally, the apparatus further includes a serial number caching module, configured to obtain serial numbers in the specified range from the database;
and respectively caching the serial numbers in the specified range into a first-level cache unit and a second-level cache unit, wherein the range of the serial numbers in the first-level cache unit is different from that in the second-level cache unit.
Optionally, the attribute information obtaining module is configured to identify a transaction service received by the service receiving unit to obtain a service type;
determining the transaction time of the transaction service received by the service receiving unit and the receiving end identification corresponding to the service receiving unit;
and taking the service type, the transaction time and the receiving end identification as attribute information.
Optionally, the designated sequence number obtaining module is configured to query the first-level cache unit according to the service type, and obtain a sequence number matched with the service type;
and judging whether the serial number matched with the service type is valid, if so, taking the serial number matched with the service type as an appointed serial number, otherwise, updating the serial number of the first-level cache unit, and acquiring the appointed serial number according to the updated first-level cache unit.
Optionally, the designated serial number obtaining module is configured to determine whether the second-level cache unit includes a serial number, and if so, directly write the serial number in the second-level cache unit into the first-level cache unit, so as to update the serial number of the first-level cache unit; otherwise, writing the serial number read from the database into the first-level cache unit and the second-level cache unit so as to update the serial numbers of the first-level cache unit and the second-level cache unit.
Optionally, the global serial number generating module is configured to extract the transaction time and the receiving end identifier in the attribute information;
and splicing the receiving end identification, the transaction time and the designated serial number in sequence to generate a global serial number aiming at the transaction service.
Optionally, the apparatus further includes an updated transaction service saving module, configured to associate the transaction service with the global serial number to obtain an updated transaction service;
and storing the updated transaction service in a database.
The device for generating the service global serial number provided by the embodiment of the invention can execute the method for generating the service global serial number provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM12, and the RAM13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the generation of a traffic global serial number.
In some embodiments, the method of generating the business global serial number may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM12 and/or the communication unit 19. When the computer program is loaded into the RAM13 and executed by the processor 11, one or more steps of the method of generating a business global serial number described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured by any other suitable means (e.g. by means of firmware) to perform the method of generating the traffic global serial number.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with 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 for generating a service global serial number is characterized by comprising the following steps:
acquiring attribute information of transaction service, wherein the attribute information comprises transaction time, service type and receiving end identification;
acquiring an appointed sequence number from a cache unit according to the service type of the transaction service;
and generating a global serial number aiming at the transaction service according to the attribute information and the specified serial number.
2. The method of claim 1, wherein before obtaining the attribute information of the transaction service, the method further comprises:
acquiring a serial number in a specified range from a database;
and caching the serial numbers in the specified range into a first-level cache unit and a second-level cache unit respectively, wherein the ranges of the serial numbers in the first-level cache unit and the second-level cache unit are different.
3. The method of claim 1, wherein the obtaining attribute information of the transaction service comprises:
identifying the transaction service received by the service receiving unit to obtain a service type;
determining the transaction time of the transaction service received by the service receiving unit and a receiving end identifier corresponding to the service receiving unit;
and taking the service type, the transaction time and the receiving end identification as the attribute information.
4. The method according to claim 2, wherein the obtaining the specified sequence number from the cache unit according to the service type of the transaction service comprises:
inquiring from the first-level cache unit according to the service type to obtain a serial number matched with the service type;
and judging whether the serial number matched with the service type is valid, if so, taking the serial number matched with the service type as the specified serial number, otherwise, updating the serial number of the first-level cache unit, and acquiring the specified serial number according to the updated first-level cache unit.
5. The method of claim 4, wherein the updating the sequence number of the level one cache unit comprises:
judging whether the second-level cache unit contains a serial number, if so, directly writing the serial number in the second-level cache unit into the first-level cache unit so as to update the serial number of the first-level cache unit;
otherwise, writing the serial number read from the database into the first-level cache unit and the second-level cache unit so as to update the serial numbers of the first-level cache unit and the second-level cache unit.
6. The method of claim 1, wherein generating a global serial number for the transaction service based on the attribute information and the specified serial number comprises:
extracting the transaction time and the receiving end identification in the attribute information;
and sequentially splicing the receiving end identification, the transaction time and the designated sequence number to generate a global serial number aiming at the transaction service.
7. The method of claim 2, wherein after generating the global serial number for the transaction service based on the attribute information and the specified serial number, further comprising:
associating the transaction service with the global serial number to obtain an updated transaction service;
and storing the updated transaction service in the database.
8. An apparatus for generating a business global serial number, comprising:
the attribute information acquisition module is used for acquiring attribute information of transaction service, wherein the attribute information comprises transaction time, service type and receiving end identification;
the appointed sequence number acquisition module is used for acquiring an appointed sequence number from the cache unit according to the service type of the transaction service;
and the global serial number generating module is used for generating a global serial number aiming at the transaction service according to the attribute information and the specified serial number.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the method of any one of claims 1-7 when executed.
CN202211667406.6A 2022-12-23 2022-12-23 Method, device, equipment and storage medium for generating business global serial number Pending CN115827588A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211667406.6A CN115827588A (en) 2022-12-23 2022-12-23 Method, device, equipment and storage medium for generating business global serial number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211667406.6A CN115827588A (en) 2022-12-23 2022-12-23 Method, device, equipment and storage medium for generating business global serial number

Publications (1)

Publication Number Publication Date
CN115827588A true CN115827588A (en) 2023-03-21

Family

ID=85516215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211667406.6A Pending CN115827588A (en) 2022-12-23 2022-12-23 Method, device, equipment and storage medium for generating business global serial number

Country Status (1)

Country Link
CN (1) CN115827588A (en)

Similar Documents

Publication Publication Date Title
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN116340318A (en) Method, device, equipment and storage medium for processing secondary index record
CN115617800A (en) Data reading method and device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN114443802A (en) Interface document processing method and device, electronic equipment and storage medium
CN115827588A (en) Method, device, equipment and storage medium for generating business global serial number
CN115203158A (en) Data comparison method, device, equipment and storage medium
CN114564149A (en) Data storage method, device, equipment and storage medium
CN114443493A (en) Test case generation method and device, electronic equipment and storage medium
CN114611155B (en) Data management node verification method, device, equipment and medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN116400956A (en) Code merging information determining method and device, electronic equipment and storage medium
CN118093048A (en) Multi-module starting management method, device, equipment and medium
CN115203246A (en) Linked list query method and device, electronic equipment and storage medium
CN117609150A (en) Data migration method, device, equipment and medium
CN115391046A (en) Quota management method, device, equipment and medium
CN117573776A (en) Data synchronization method and device, storage medium and electronic equipment
CN115858104A (en) Method, device and equipment for acquiring snapshot of transaction commit sequence number and storage medium
CN114840544A (en) Data publishing method, data updating method, device, equipment and storage medium
CN116578646A (en) Time sequence data synchronization method, device, equipment and storage medium
CN115421665A (en) Data storage method, device, equipment and storage medium
CN118296076A (en) Data synchronization method, device, equipment and storage medium
CN117453747A (en) Data quality detection method and device, electronic equipment and storage medium

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