WO2021217863A1 - Order identifier generation method and apparatus, server, and storage medium - Google Patents

Order identifier generation method and apparatus, server, and storage medium Download PDF

Info

Publication number
WO2021217863A1
WO2021217863A1 PCT/CN2020/099301 CN2020099301W WO2021217863A1 WO 2021217863 A1 WO2021217863 A1 WO 2021217863A1 CN 2020099301 W CN2020099301 W CN 2020099301W WO 2021217863 A1 WO2021217863 A1 WO 2021217863A1
Authority
WO
WIPO (PCT)
Prior art keywords
order
identification
server
database
identifier
Prior art date
Application number
PCT/CN2020/099301
Other languages
French (fr)
Chinese (zh)
Inventor
陈平
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021217863A1 publication Critical patent/WO2021217863A1/en

Links

Images

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/22Indexing; Data structures therefor; Storage structures
    • 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
    • G06F16/2365Ensuring data consistency and integrity
    • 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/2455Query execution
    • G06F16/24552Database cache management
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Lists, e.g. purchase orders, compilation or processing
    • G06Q30/0635Processing of requisition or of purchase orders
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Definitions

  • This application relates to the field of distributed technology of blockchain, and in particular to a method, device, server and storage medium for generating an order identification.
  • the system uses a single database to generate the order number by self-incrementing the sequence of the database.
  • different fields will use different databases, and a large amount of data and messages need to be distinguished for their uniqueness.
  • the inventor realizes that if the data of different databases continue to be used to generate the order identification by the way of self-incrementing the order number of the database, it obviously cannot meet the demand, and it is easy to cause conflicts when accessing different databases.
  • This application also relates to the field of artificial intelligence technology, which can be applied to the direction of smart cities, which can make the generated order identification unique and avoid database access Time conflict.
  • the first aspect of the present application provides a method for generating an order identifier, and the method for generating an order identifier includes:
  • the order type the value weight of the order corresponding to the order type, and the order total amount data of the order, the order number identification is determined, and the corresponding relationship between the area of the preset order and the preset organization identification is queried.
  • Organization ID corresponding to the region where the order belongs;
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
  • the order identifier is sent to the front-end device.
  • a second aspect of the present application provides a server, wherein the server includes a processor and a memory, and the processor is configured to execute at least one computer-readable instruction stored in the memory to implement the following steps:
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
  • the order identifier is sent to the front-end device.
  • a third aspect of the present application provides a computer-readable storage medium on which at least one computer-readable instruction is stored, wherein the at least one computer-readable instruction implements the following steps when executed by a processor:
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
  • the order identifier is sent to the front-end device.
  • a fourth aspect of the present application provides an order identification generating device, and the order identification generating device includes:
  • the receiving module is configured to receive an order confirmation request sent by a front-end device, wherein the order confirmation request carries the order type and the area to which the order belongs;
  • the determining module is used to determine the order number identification and the corresponding relationship between the area of the preset order and the preset organization identification based on the order type, the value weight of the order corresponding to the order type, and the total order data of the order , Query the organization ID corresponding to the region to which the order belongs;
  • the determining module is also used to determine the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper among multiple databases included in the distributed system;
  • a loading module which is used to load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
  • An extraction module configured to extract the target number identifier of the first number segment from the redis cache
  • a generating module configured to generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier;
  • the sending module is configured to send the order identifier to the front-end device in response to the order confirmation request.
  • this application can be applied to fields where order marks are widely used, such as smart logistics, so as to promote the development of smart cities.
  • the naming service of the distributed service framework zookeeper is used to determine the server database identifier corresponding to the target database, which can be used to distinguish the number segment value on different servers, and the redis asynchronous cache can avoid the blockage and lag in the use of the system At the same time, it can also reduce the impact of access to the database.
  • the generated order identification is unique, and in a distributed system , To ensure the global uniqueness of the order identifier and avoid conflicts during database access.
  • Fig. 1 is a flowchart of a preferred embodiment of an order identification generating method disclosed in the present application.
  • Fig. 2 is a functional module diagram of a preferred embodiment of an order identification generating device disclosed in the present application.
  • FIG. 3 is a schematic diagram of the structure of a server implementing a preferred embodiment of the method for generating an order identifier according to the present application.
  • Fig. 1 is a flowchart of a preferred embodiment of an order identification generating method disclosed in the present application. Among them, the order identification generation method is applied to the server. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
  • the front-end device is for the user, and the front-end device may include, but is not limited to, a smart phone, a personal computer, an IPAD, or other electronic devices that the user can operate. Users can perform operations on the front-end equipment, such as submitting a product order when purchasing an online product.
  • the order confirmation request sent by the front-end device when the order confirmation request sent by the front-end device is received, it indicates that the user needs to purchase the goods corresponding to the order. At this time, the order does not generate an order identifier, that is, the order number that uniquely identifies the order, and the server needs to be triggered According to the order confirmation request, a unique order identification is generated.
  • the order type can be used to indicate the type of goods that the user needs to purchase, such as insurance, and the area to which the order belongs can be used to indicate the area where the front-end equipment is located when the order is submitted, such as a certain city.
  • the order number identifiers corresponding to different order types are different, and the organization identifiers corresponding to the regions to which different orders belong are also different.
  • determining the order number identifier includes:
  • the priority identifier corresponding to the order priority is determined as the single number identifier.
  • the value weights of orders corresponding to different order types are different, the value weights can be used to measure the value of an order, and the value weight range can be set to [0,1]. Generally, the greater the value weight, the greater the value of the order, and it also indicates that the order is very important to the user.
  • the order total data can reflect the data that the user needs to pay to purchase the order.
  • the order priority can be determined according to the value weight and the order total data, for example, the value weight is multiplied by the order total data to obtain the product value, and the order priority corresponding to the product value is searched according to the product value.
  • the priority identifier corresponding to the order priority can be determined as the single number identifier. Among them, the order priority can reflect the priority order in which the order is processed. After the order identification is generated, the order processing order can be determined according to the order priority in the order identification, which can provide more efficient orders for high-quality users. Order processing services to provide user experience.
  • the corresponding relationship between the region to which the order belongs and the organization identifier can be established in advance.
  • the region to which each order belongs corresponds to an organization identifier.
  • the corresponding organization identifier in Fuzhou is 3910.
  • each order type corresponds to an order number identification, for example: the order number identification corresponding to the quotation is Q, and the order number identification corresponding to the insurance policy For 10 heads.
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper.
  • the distributed system may include multiple databases, and different servers may share a database, or configure a database separately.
  • the target database may be a database bound to a started server, or the target database may be a database determined from a plurality of databases in a distributed system according to the bearing capacity of the database.
  • ZooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistent services for distributed applications. The functions provided include: configuration maintenance, domain name services, distributed synchronization, group services, etc.
  • determining the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper includes:
  • the server database identification corresponding to the target database is determined.
  • the target database can be selected from the multiple databases of the distributed system to reduce the impact on the database with weaker capacity.
  • the unique server identification can be generated through the naming service of the distributed service framework zookeeper , Determine the server database identifier corresponding to the target database according to the database identifier and the server identifier, and the server database identifier can be used to distinguish the number segment value of the databases of different servers.
  • each database can store multiple number segment values in advance.
  • determining the target database according to the endurance value of each database includes:
  • a target database is determined from a plurality of the databases.
  • the storage capacity of each database is different, the number of historical accesses of each database is also different, and the number of crashes of each database is also different within a preset period of time (for example, within one month) . If there are many visits and few crashes, it indicates that the database has a better bearing capacity. Therefore, the target database can be selected according to the database's bearing capacity.
  • weight values can be set for the number of historical visits and the number of crashes respectively, where the weight value of the number of historical visits can be set to be higher than the weight value of the number of crashes.
  • the endurance value of each database is determined, and a target database whose endurance value exceeds a preset threshold is selected from a plurality of databases. In this way, a database with high tolerance and not easy to collapse can be selected first, so that the database in the distributed system can be used reasonably, reducing the impact on the database with weak tolerance, and increasing the service life of the database.
  • the generating a server identifier for the server through the naming service of the distributed service framework zookeeper includes:
  • the node identifier of the temporary node is determined as the server identifier of the server.
  • a database identification can be created for each database in advance, and a database identification bit table can be created according to the database identification position. Since different servers can share the same database, in order to distinguish between different servers, you can also create a unique server ID for each server through the naming service of the distributed service framework zookeeper.
  • the database identification bit table can be updated according to the database identification and the server identification, that is, the updated database identification bit table can be used to distinguish the number segment values of databases of different servers.
  • the online and offline times of different servers are different. If the server is started for the first time, the server does not have a server identification, that is, the identification bit in the current database identification bit table cannot identify the server Therefore, zookeeper needs to create a unique server ID for the server. At the same time, the database identification bit table is updated.
  • a number segment information table is created in each database, and the number segment information table includes multiple numbers.
  • a first preset number of first number segments can be loaded from the number segment information table of the target database to the remote dictionary service redis cache, where the first preset number is, for example, 100, for example, Load the number segment from 1 to 100 to redis, and then you can directly extract the number segment from redis without extracting it from the database, which can reduce the impact of access to the database.
  • a number value queue can be generated in the redis cache. For example, when a number segment from 1 to 100 is loaded, a queue [1, 2, 3...100] is generated.
  • the server will go online or offline due to some reasons (such as human operation, failure), which will cause the number segment stored on the server to be lost.
  • the redis cache is deployed separately from the server, that is, the redis cache is not integrated on the server. Since the redis cache is more stable than the server, there are few problems.
  • the online/offline of the server will not affect the redis, even if the server is offline, the number segment identifier can still be extracted from the redis cache, reducing the loss of the number segment.
  • the method for generating an order identification further includes:
  • the usage status of the first number segment in the redis cache is monitored.
  • a monitoring event can be created, and the monitoring event is used to monitor the usage status of the first number segment in the redis cache, that is, it can monitor To which number is currently used in the first number segment, for example, if the target number identification of the first number segment is extracted as 90, then it can be monitored that the number "90" is currently used.
  • the usage of the number segments cached by redis can be monitored in time to prevent the number segments from being lost, and at the same time, it is convenient for subsequent number segments to be supplemented in time.
  • the method for generating an order identification further includes:
  • the first number segment is composed of multiple numbers, that is, it represents the range of a number segment
  • the boundary value range of the number segment is usually the value range of the number near the end of the number segment
  • the range of the first number segment is [1,100]
  • the boundary value range can be set to [90,100]. If the position of the currently used value is within the boundary value range of the first number segment, it indicates that the first number segment is about to be used up. For example, if the current use value is 90, it is in the boundary value range.
  • This asynchronous caching method avoids blockage and stalling when the system is in use.
  • the single number identification, the organization identification, the server database identification, and the target number identification can be superimposed together according to a preset identification superimposition rule to generate an order identification.
  • the single number identification, the organization identification, the server database identification, and the target number identification can also be input into an identification generation model, and the order identification is generated through the identification generation model, wherein the identification is The generation model is pre-trained, and a unique identifier (such as an order identifier) is calculated by inputting identifiers of several parameters (such as a single number identifier, the organization identifier, the server database identifier, and the target number identifier).
  • a unique identifier such as an order identifier
  • a distributed system it can be used to generate a unique identifier.
  • the order identifier and other information about the order can be output on the front-end device, such as the order address, the orderer, the order after-sales service, and so on.
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers.
  • the system can be avoided.
  • the generated order identification is unique .
  • the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
  • this application can be applied to fields where order identification is widely used, such as smart logistics, so as to promote the development of smart cities.
  • Fig. 2 is a functional module diagram of a preferred embodiment of an order identification generating device disclosed in the present application.
  • the order identification generating device runs in a server.
  • the order identification generating device may include a plurality of functional modules composed of program code segments.
  • the program code of each program segment in the order identification generating device may be stored in a memory and executed by at least one processor to execute part or all of the steps in the order identification generating method described in FIG. 1.
  • the order identification generating device can be divided into multiple functional modules according to the functions it performs.
  • the functional modules may include: a receiving module 201, a determining module 202, a loading module 203, an extracting module 204, a generating module 205, and a sending module 206.
  • the module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory.
  • the receiving module 201 is configured to receive an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs.
  • the front-end device is for the user, and the front-end device may include, but is not limited to, a smart phone, a personal computer, an IPAD, or other electronic devices that the user can operate. Users can perform operations on the front-end equipment, such as submitting a product order when purchasing an online product.
  • the order confirmation request sent by the front-end device when the order confirmation request sent by the front-end device is received, it indicates that the user needs to purchase the goods corresponding to the order. At this time, the order does not generate an order identifier, that is, the order number that uniquely identifies the order, and the server needs to be triggered According to the order confirmation request, a unique order identification is generated.
  • the order type can be used to indicate the type of goods that the user needs to purchase, such as insurance, and the area to which the order belongs can be used to indicate the area where the front-end equipment is located when the order is submitted, such as a certain city.
  • the determining module 202 is configured to determine the order number identifier according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, and the correspondence between the region to which the preset order belongs and the preset organization identifier In the relationship, query the organization ID corresponding to the region to which the order belongs.
  • the order number identifiers corresponding to different order types are different, and the organization identifiers corresponding to the regions to which different orders belong are also different.
  • each order type corresponds to an order number identification, for example: the order number identification corresponding to the quotation is Q, and the order number identification corresponding to the insurance policy The number is 10, similarly, the corresponding relationship between the region to which the order belongs and the organization ID can be established in advance.
  • the region to which each order belongs corresponds to an organization ID. For example, the corresponding organization ID in Fuzhou is 3910.
  • determining the order number identifier includes:
  • the priority identifier corresponding to the order priority is determined as the single number identifier.
  • the value weights of orders corresponding to different order types are different, the value weights can be used to measure the value of an order, and the value weight range can be set to [0,1]. Generally, the greater the value weight, the greater the value of the order, and it also indicates that the order is very important to the user.
  • the order total data can reflect the data that the user needs to pay to purchase the order.
  • the order priority can be determined according to the value weight and the order total data, for example, the value weight is multiplied by the order total data to obtain the product value, and the order priority corresponding to the product value is searched according to the product value.
  • the priority identifier corresponding to the order priority can be determined as the single number identifier. Among them, the order priority can reflect the priority order in which the order is processed. After the order identification is generated, the order processing order can be determined according to the order priority in the order identification, which can provide more efficient orders for high-quality users. Order processing services to provide user experience.
  • the determining module 202 is also used to determine the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper among multiple databases included in the distributed system.
  • the distributed system may include multiple databases, and different servers may share a database, or configure a database separately.
  • the target database may be a database bound to a started server, or the target database may be a database determined from a plurality of databases in a distributed system according to the bearing capacity of the database.
  • determining the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper includes:
  • the server database identification corresponding to the target database is determined.
  • the target database can be selected from the multiple databases of the distributed system to reduce the impact on the database with weaker capacity.
  • the unique server identification can be generated through the naming service of the distributed service framework zookeeper , Determine the server database identifier corresponding to the target database according to the database identifier and the server identifier, and the server database identifier can be used to distinguish the number segment value of the databases of different servers.
  • each database can store multiple number segment values in advance.
  • determining the target database according to the endurance value of each database includes:
  • a target database is determined from a plurality of the databases.
  • the storage capacity of each database is different, the number of historical accesses of each database is also different, and the number of crashes of each database is also different within a preset period of time (for example, within one month) . If there are many visits and few crashes, it indicates that the database has a better bearing capacity. Therefore, the target database can be selected according to the database's bearing capacity.
  • weight values can be set for the number of historical visits and the number of crashes respectively, where the weight value of the number of historical visits can be set to be higher than the weight value of the number of crashes.
  • the endurance value of each database is determined, and a target database whose endurance value exceeds a preset threshold is selected from a plurality of databases. In this way, a database with a high endurance capacity and not easy to crash can be selected first, so that the database in a distributed system can be reasonably used, reducing the impact on the database with a weak endurance, and improving the service life of the database.
  • the generating a server identifier for the server through the naming service of the distributed service framework zookeeper includes:
  • the node identifier of the temporary node is determined as the server identifier of the server.
  • a database identification can be created for each database in advance, and a database identification bit table can be created according to the database identification position. Since different servers can share the same database, in order to distinguish between different servers, you can also create a unique server ID for each server through the naming service of the distributed service framework zookeeper.
  • the database identification bit table can be updated according to the database identification and the server identification, that is, the updated database identification bit table can be used to distinguish the number segment values of databases of different servers.
  • the online and offline times of different servers are different. If the server is started for the first time, the server does not have a server identification, that is, the identification bit in the current database identification bit table cannot identify the server Therefore, zookeeper needs to create a unique server ID for the server. At the same time, the database identification bit table is updated.
  • the loading module 203 is configured to load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache.
  • a number segment information table is created in each database, and the number segment information table includes multiple numbers.
  • a first preset number of first number segments can be loaded from the number segment information table of the target database to the remote dictionary service redis cache, where the first preset number is, for example, 100, for example, Load the number segment from 1 to 100 to redis, and then you can directly extract the number segment from redis without extracting it from the database, which can reduce the impact of access to the database.
  • a number value queue can be generated in the redis cache. For example, when a number segment from 1 to 100 is loaded, a queue [1, 2, 3...100] is generated.
  • the extraction module 204 is configured to extract the target number identifier of the first number segment from the redis cache.
  • the server will go online or offline due to some reasons (such as human operation, failure), which will cause the number segment stored on the server to be lost.
  • the redis cache is deployed separately from the server, that is, the redis cache is not integrated on the server. Since the redis cache is more stable than the server, there are few problems.
  • the online/offline of the server will not affect the redis, even if the server is offline, the number segment identifier can still be extracted from the redis cache, reducing the loss of the number segment.
  • the generating module 205 is configured to generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier.
  • the single number identification, the organization identification, the server database identification, and the target number identification can be superimposed together according to a preset identification superimposition rule to generate an order identification.
  • the single number identification, the organization identification, the server database identification, and the target number identification can also be input into an identification generation model, and the order identification is generated through the identification generation model, wherein the identification is The generation model is pre-trained, and a unique identifier (such as an order identifier) is calculated by inputting identifiers of several parameters (such as a single number identifier, the organization identifier, the server database identifier, and the target number identifier).
  • a unique identifier such as an order identifier
  • a distributed system it can be used to generate a unique identifier.
  • the sending module 206 is configured to send the order identifier to the front-end device in response to the order confirmation request.
  • the order identifier and other information about the order can be output on the front-end device, such as the order address, the orderer, the order after-sales service, and so on.
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers, and the redis asynchronous cache can avoid the time when the system is used. At the same time, it can also reduce the impact of access to the database.
  • the generated order identification is unique, In a distributed system, the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
  • FIG. 3 is a schematic diagram of the structure of a server implementing a preferred embodiment of the method for generating an order identifier according to the present application.
  • the server 3 includes a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and running on the at least one processor 32, and at least one communication bus 34.
  • FIG. 3 is only an example of the server 3, and does not constitute a limitation on the server 3. It may include more or less components than those shown in the figure, or combine some Components, or different components, for example, the server 3 may also include input and output devices, network access devices, and so on.
  • the server 3 may refer to a computer system that can provide services to other devices (such as electronic devices) in the network. If a personal computer can provide File Transfer Protocol (FTP) service externally, it can also be called a server. In a narrow sense, the server refers to certain high-performance computers that can provide services to the outside world through the network. Compared with ordinary personal computers, they have higher requirements in terms of stability, security, and performance. Therefore, in the CPU , Chipset, memory, disk system, network and other hardware are different from ordinary personal computers.
  • FTP File Transfer Protocol
  • the at least one processor 32 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (ASICs). ), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the processor 32 can be a microprocessor or the processor 32 can also be any conventional processor, etc.
  • the processor 32 is the control center of the server 3, and connects each of the entire server 3 through various interfaces and lines. part.
  • the memory 31 may be used to store the computer program 33 and/or modules/units.
  • the processor 32 runs or executes the computer programs and/or modules/units stored in the memory 31 and calls the computer programs and/or modules/units stored in the memory 31.
  • the data in 31 realizes various functions of the server 3.
  • the memory 31 may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Data (such as audio data) and the like created according to the use of the server 3 are stored.
  • the memory 31 may include volatile and non-volatile memory, such as random access memory (RAM), hard disk, internal memory, plug-in hard disk, smart media card (SMC), and security A digital (Secure Digital, SD) card, a flash card (Flash Card), at least one magnetic disk storage device, a flash memory device, or other computer-readable storage media that can be used to carry or store data.
  • volatile and non-volatile memory such as random access memory (RAM), hard disk, internal memory, plug-in hard disk, smart media card (SMC), and security
  • a digital (Secure Digital, SD) card such as a flash card (Flash Card), at least one magnetic disk storage device, a flash memory device, or other computer-readable storage media that can be used to carry or store data.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the memory 31 in the server 3 stores multiple instructions to implement an order identification generation method, and the processor 32 can execute the multiple instructions to achieve:
  • the order type the value weight of the order corresponding to the order type, and the order total amount data of the order, the order number identification is determined, and the corresponding relationship between the area of the preset order and the preset organization identification is queried.
  • Organization ID corresponding to the region where the order belongs;
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
  • the order identifier is sent to the front-end device.
  • the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers. Through the redis asynchronous cache, the system can be avoided. At the same time, it can also reduce the impact of access to the database. According to the single number identification, the organization identification, the server database identification, and the target number identification, the generated order identification is unique , In a distributed system, the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
  • the integrated modules/units of the server 3 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium.
  • the present application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, and read-only memory (ROM, Read-Only Memory) .
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc.
  • This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network.
  • program modules can be located in local and remote computer storage media including storage devices.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

An order identifier generation method, comprising: receiving an order determination request sent by a frontend device, the order determination request carrying an order type and a region where an order is located (S11); determining an order number identifier according to the order type, a value weight of an order corresponding to the order type, and the total order amount data of the order, and querying a mechanism identifier corresponding to the region where the order is located from the correspondence between a region where a preset order is located and a preset mechanism identifier (S12); determining an identifier of a server database corresponding to a target database by means of a distributed service framework zookeeper naming service from a plurality of databases comprised by a distributed system (S13); loading a first preset number of first number segments to a remote dictionary server (Redis) cache from a number segment information table of the target database (S14); extracting a target number identifier of the first number segment from the Redis cache (S15); generating an order identifier according to the order number identifier, the mechanism identifier, the identifier of the server database, and the target number identifier (S16); and in response to the order determination request, sending the order identifier to the frontend device (S17). The related data and information can be stored in a blockchain node.

Description

订单标识生成方法、装置、服务器及存储介质Method, device, server and storage medium for generating order identification
本申请要求于2020年4月29日提交中国专利局,申请号为202010358127.6发明名称为“订单标识生成方法、装置、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on April 29, 2020, the application number is 202010358127.6 and the invention title is "Order Mark Generation Method, Device, Server and Storage Medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及区块链的分布式技术领域,尤其涉及一种订单标识生成方法、装置、服务器及存储介质。This application relates to the field of distributed technology of blockchain, and in particular to a method, device, server and storage medium for generating an order identification.
背景技术Background technique
目前,系统采用单一数据库,通过数据库的序列自增的方式来生成订单号。而对于分布式系统来说,不同领域会使用不同的数据库,则需要对大量的数据和消息区分其唯一性。发明人意识到,不同数据库的数据,如果继续采用数据库的自增订单号的方式来生成订单标识,显然不能满足需求,容易造成不同数据库访问时的冲突。At present, the system uses a single database to generate the order number by self-incrementing the sequence of the database. For distributed systems, different fields will use different databases, and a large amount of data and messages need to be distinguished for their uniqueness. The inventor realizes that if the data of different databases continue to be used to generate the order identification by the way of self-incrementing the order number of the database, it obviously cannot meet the demand, and it is easy to cause conflicts when accessing different databases.
发明内容Summary of the invention
鉴于以上内容,有必要提供一种订单标识生成方法、装置、服务器及存储介质,本申请还涉及人工智能技术领域,可应用于智慧城市方向,能使生成的订单标识具有唯一性,避免数据库访问时的冲突。In view of the above, it is necessary to provide an order identification generation method, device, server and storage medium. This application also relates to the field of artificial intelligence technology, which can be applied to the direction of smart cities, which can make the generated order identification unique and avoid database access Time conflict.
本申请的第一方面提供一种订单标识生成方法,所述订单标识生成方法包括:The first aspect of the present application provides a method for generating an order identifier, and the method for generating an order identifier includes:
接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;According to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, the order number identification is determined, and the corresponding relationship between the area of the preset order and the preset organization identification is queried. Organization ID corresponding to the region where the order belongs;
在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
本申请的第二方面提供一种服务器,其中,所述服务器包括处理器和存储器,所述处理器用于执行存储器中存储的至少一个计算机可读指令以实现以下步骤:A second aspect of the present application provides a server, wherein the server includes a processor and a memory, and the processor is configured to execute at least one computer-readable instruction stored in the memory to implement the following steps:
接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识;Determine the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order;
从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构 标识;Querying the organization identifier corresponding to the region to which the order belongs from the corresponding relationship between the region to which the predetermined order belongs and the identifier of the predetermined organization;
在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
本申请的第三方面提供一种计算机可读存储介质,其上存储有至少一个计算机可读指令,其中,所述至少一个计算机可读指令被处理器执行时实现以下步骤:A third aspect of the present application provides a computer-readable storage medium on which at least one computer-readable instruction is stored, wherein the at least one computer-readable instruction implements the following steps when executed by a processor:
接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识;Determine the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order;
从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;Query the organization identifier corresponding to the region to which the order belongs from the corresponding relationship between the region to which the predetermined order belongs and the identifier of the predetermined organization;
在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
本申请的第四方面提供一种订单标识生成装置,所述订单标识生成装置包括:A fourth aspect of the present application provides an order identification generating device, and the order identification generating device includes:
接收模块,用于接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;The receiving module is configured to receive an order confirmation request sent by a front-end device, wherein the order confirmation request carries the order type and the area to which the order belongs;
确定模块,用于根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;The determining module is used to determine the order number identification and the corresponding relationship between the area of the preset order and the preset organization identification based on the order type, the value weight of the order corresponding to the order type, and the total order data of the order , Query the organization ID corresponding to the region to which the order belongs;
所述确定模块,还用于在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;The determining module is also used to determine the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper among multiple databases included in the distributed system;
加载模块,用于从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;A loading module, which is used to load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
提取模块,用于从所述redis缓存中提取所述第一号段的目标号标识;An extraction module, configured to extract the target number identifier of the first number segment from the redis cache;
生成模块,用于根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;A generating module, configured to generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier;
发送模块,用于响应所述订单确定请求,将所述订单标识发送至所述前端设备。The sending module is configured to send the order identifier to the front-end device in response to the order confirmation request.
由以上技术方案,本申请可应用在智慧物流等广泛使用订单标识的领域,从而推动智慧城市的发展。本申请中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识,可以用于区分不同服务器上的号段值,通过redis异步缓存,可以避免系统使用时的堵塞和卡顿现象,同时,也能减少对数据库的访问冲击,根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成的订单标识具有唯一性, 在分布式系统中,保证了订单标识的全局唯一性,避免了数据库访问时的冲突。Based on the above technical solutions, this application can be applied to fields where order marks are widely used, such as smart logistics, so as to promote the development of smart cities. In this application, the naming service of the distributed service framework zookeeper is used to determine the server database identifier corresponding to the target database, which can be used to distinguish the number segment value on different servers, and the redis asynchronous cache can avoid the blockage and lag in the use of the system At the same time, it can also reduce the impact of access to the database. According to the single number identification, the organization identification, the server database identification, and the target number identification, the generated order identification is unique, and in a distributed system , To ensure the global uniqueness of the order identifier and avoid conflicts during database access.
附图说明Description of the drawings
图1是本申请公开的一种订单标识生成方法的较佳实施例的流程图。Fig. 1 is a flowchart of a preferred embodiment of an order identification generating method disclosed in the present application.
图2是本申请公开的一种订单标识生成装置的较佳实施例的功能模块图。Fig. 2 is a functional module diagram of a preferred embodiment of an order identification generating device disclosed in the present application.
图3是本申请实现订单标识生成方法的较佳实施例的服务器的结构示意图。FIG. 3 is a schematic diagram of the structure of a server implementing a preferred embodiment of the method for generating an order identifier according to the present application.
具体实施方式Detailed ways
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to be able to understand the above objectives, features and advantages of the application more clearly, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the application and the features in the embodiments can be combined with each other if there is no conflict.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of this application. The terms used in the specification of the application herein are only for the purpose of describing specific embodiments, and are not intended to limit the application.
图1是本申请公开的一种订单标识生成方法的较佳实施例的流程图。其中,该订单标识生成方法应用于服务器中,根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。Fig. 1 is a flowchart of a preferred embodiment of an order identification generating method disclosed in the present application. Among them, the order identification generation method is applied to the server. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
S11、接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域。S11. Receive an order confirmation request sent by a front-end device, where the order confirmation request carries an order type and a region to which the order belongs.
其中,前端设备是针对用户而言的,前端设备可以包括但不限于智能手机、个人电脑、IPAD或其他用户可以操作的电子设备。用户可以在前端设备上进行操作,比如购买某个线上商品时提交商品订单。Among them, the front-end device is for the user, and the front-end device may include, but is not limited to, a smart phone, a personal computer, an IPAD, or other electronic devices that the user can operate. Users can perform operations on the front-end equipment, such as submitting a product order when purchasing an online product.
本申请实施例中,当接收到前端设备发送的订单确定请求时,表明用户需要购买该订单对应的商品,此时,该订单没有生成订单标识,即唯一标识该订单的订单编号,需要触发服务器根据该订单确定请求去生成唯一的订单标识。In this embodiment of the application, when the order confirmation request sent by the front-end device is received, it indicates that the user needs to purchase the goods corresponding to the order. At this time, the order does not generate an order identifier, that is, the order number that uniquely identifies the order, and the server needs to be triggered According to the order confirmation request, a unique order identification is generated.
其中,订单类型可以用于表示用户所需要购买的商品的类型,比如保险类,订单所属区域可以用于表示该订单在提交时前端设备所处的区域,比如某个城市。Among them, the order type can be used to indicate the type of goods that the user needs to purchase, such as insurance, and the area to which the order belongs can be used to indicate the area where the front-end equipment is located when the order is submitted, such as a certain city.
S12、根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识。S12. Determine the order number identifier according to the order type, the value weight of the order corresponding to the order type, and the total order data of the order, and query from the correspondence relationship between the region to which the preset order belongs and the preset organization identifier The organization identifier corresponding to the region to which the order belongs.
其中,不同的订单类型所对应的单号标识是不同的,不同的订单所属区域所对应的机构标识也是不同的。Among them, the order number identifiers corresponding to different order types are different, and the organization identifiers corresponding to the regions to which different orders belong are also different.
具体的,根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识包括:Specifically, according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, determining the order number identifier includes:
根据订单类型,确定所述订单类型对应的订单的价值权重;According to the order type, determine the value weight of the order corresponding to the order type;
获取所述订单的订单总额数据;Acquiring the total order data of the order;
根据所述价值权重以及所述订单总额数据,确定订单优先级;Determine the order priority according to the value weight and the total order data;
将所述订单优先级对应的优先级标识确定为单号标识。The priority identifier corresponding to the order priority is determined as the single number identifier.
在该实施方式中,不同的订单类型对应的订单的价值权重是不同的,价值权重可以用于衡量某个订单的价值的高低,价值权重的范围可以设置为[0,1]。通常,价值权重越大,表明该订单的价值越大,也表明该订单对于用户而言是非常重要的。订单总额数据可以反映出用户购买该订单所需要支付的数据。可以根据价值权重以及所述订单总额数据,确定订单优先级,比如将价值权重乘以订单总额数据,得到乘积值,在根据乘积值查找对应于该乘积值的订单优先级。最后,即可将所述订单优先级对应的优先级标识确定 为单号标识。其中,订单优先级可以反映出该订单被处理的优先顺序,后续在生成订单标识后,可以根据该订单标识中的订单优先级来决定订单的先后处理顺序,从而可以为优质用户提供更高效的订单处理服务,提供用户体验。In this embodiment, the value weights of orders corresponding to different order types are different, the value weights can be used to measure the value of an order, and the value weight range can be set to [0,1]. Generally, the greater the value weight, the greater the value of the order, and it also indicates that the order is very important to the user. The order total data can reflect the data that the user needs to pay to purchase the order. The order priority can be determined according to the value weight and the order total data, for example, the value weight is multiplied by the order total data to obtain the product value, and the order priority corresponding to the product value is searched according to the product value. Finally, the priority identifier corresponding to the order priority can be determined as the single number identifier. Among them, the order priority can reflect the priority order in which the order is processed. After the order identification is generated, the order processing order can be determined according to the order priority in the order identification, which can provide more efficient orders for high-quality users. Order processing services to provide user experience.
其中,可以预先建立订单所属区域与机构标识的对应关系,该对应关系中,每种订单所属区域对应一个机构标识,比如:福州市对应的机构标识为3910。Among them, the corresponding relationship between the region to which the order belongs and the organization identifier can be established in advance. In the corresponding relationship, the region to which each order belongs corresponds to an organization identifier. For example, the corresponding organization identifier in Fuzhou is 3910.
可选的,可以预先建立订单类型与单号标识的对应关系,该对应关系中,每种订单类型对应一个单号标识,比如:报价单对应的单号标识为Q,保单对应的单号标识为10头。Optionally, the correspondence relationship between the order type and the order number identification can be established in advance. In the correspondence relationship, each order type corresponds to an order number identification, for example: the order number identification corresponding to the quotation is Q, and the order number identification corresponding to the insurance policy For 10 heads.
S13、在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识。S13. In the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper.
其中,分布式系统中可以包括多个数据库,不同的服务器可以共用一个数据库,也可以单独配置一个数据库。所述目标数据库可以是与启动的服务器绑定的数据库,或者,所述目标数据库可以是根据数据库的承受能力,从分布式系统的多个数据库中确定的数据库。Among them, the distributed system may include multiple databases, and different servers may share a database, or configure a database separately. The target database may be a database bound to a started server, or the target database may be a database determined from a plurality of databases in a distributed system according to the bearing capacity of the database.
其中,ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件。它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护、域名服务、分布式同步、组服务等。Among them, ZooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistent services for distributed applications. The functions provided include: configuration maintenance, domain name services, distributed synchronization, group services, etc.
具体的,所述在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识包括:Specifically, in the multiple databases included in the distributed system, determining the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper includes:
在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库;Among the multiple databases included in the distributed system, determine the target database according to the endurance value of each database;
通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识;Generate a server identifier for the server to which the target database belongs through the naming service of the distributed service framework zookeeper;
根据所述目标数据库的数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识。According to the database identification of the target database and the server identification, the server database identification corresponding to the target database is determined.
在该实施方式中,可以从分布式系统的多个数据库中,挑选目标数据库,减少对承受能力较弱的数据库的冲击,同时,通过分布式服务框架zookeeper的命名服务,来生成唯一的服务器标识,根据数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识,该服务器数据库标识能够用于区别不同服务器的数据库的号段值。其中,每个数据库都可以预先存储多个号段值。In this embodiment, the target database can be selected from the multiple databases of the distributed system to reduce the impact on the database with weaker capacity. At the same time, the unique server identification can be generated through the naming service of the distributed service framework zookeeper , Determine the server database identifier corresponding to the target database according to the database identifier and the server identifier, and the server database identifier can be used to distinguish the number segment value of the databases of different servers. Among them, each database can store multiple number segment values in advance.
具体的,所述在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库包括:Specifically, among the multiple databases included in the distributed system, determining the target database according to the endurance value of each database includes:
获取所述分布式系统的每个数据库的历史访问次数,以及预设时间内每个所述数据库的崩溃次数;Acquiring the historical access times of each database of the distributed system and the number of crashes of each database within a preset time;
根据所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值;Determining the endurance value of each database according to the number of historical visits and the number of crashes;
根据所述承受能力值,从多个所述数据库中确定目标数据库。According to the endurance value, a target database is determined from a plurality of the databases.
其中,分布式系统中,每个数据库的存储容量是不同的,每个数据库的历史访问数量也是不同的,预设时间内(比如一个月内),每个所述数据库的崩溃次数也是不同的。如果访问次数很多,而崩溃次数很少,表明该数据库的承受能力较好,因此,可以根据数据库的承受能力来选择目标数据库。Among them, in a distributed system, the storage capacity of each database is different, the number of historical accesses of each database is also different, and the number of crashes of each database is also different within a preset period of time (for example, within one month) . If there are many visits and few crashes, it indicates that the database has a better bearing capacity. Therefore, the target database can be selected according to the database's bearing capacity.
具体的,可以分别为历史访问次数以及崩溃次数设置权重值,其中,可以设置历史访问次数的权重值高于崩溃次数的权重值。根据权重值、所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值,并从多个数据库中,选择承受能力值超过预设阈值的目标数据库。这样,可以优先选择承受能力高且不容易崩溃的数据库,让分 布式系统中的数据库得到合理的利用,减少对承受能力较弱的数据库的冲击,提高数据库的使用寿命。Specifically, weight values can be set for the number of historical visits and the number of crashes respectively, where the weight value of the number of historical visits can be set to be higher than the weight value of the number of crashes. According to the weight value, the number of historical visits and the number of crashes, the endurance value of each database is determined, and a target database whose endurance value exceeds a preset threshold is selected from a plurality of databases. In this way, a database with high tolerance and not easy to collapse can be selected first, so that the database in the distributed system can be used reasonably, reducing the impact on the database with weak tolerance, and increasing the service life of the database.
具体的,所述通过分布式服务框架zookeeper的命名服务,为所述服务器生成服务器标识包括:Specifically, the generating a server identifier for the server through the naming service of the distributed service framework zookeeper includes:
从数据库标识位表中获取标识位;Obtain the identification position from the database identification position table;
判断所述标识位中是否存在能够标识所述服务器的标识位;Judging whether there is an identification bit capable of identifying the server in the identification bits;
若所述标识位中不存在能够标识所述服务器的标识位,通过分布式服务框架zookeeper的命名服务创建临时节点;If there is no identification bit that can identify the server in the identification bits, create a temporary node through the naming service of the distributed service framework zookeeper;
将所述临时节点的节点标识确定为所述服务器的服务器标识。The node identifier of the temporary node is determined as the server identifier of the server.
其中,可以预先为每个数据库创建数据库标识,并根据数据库标识位创建数据库标识位表。由于不同的服务器可以共用同一个数据库,为了区别不同的服务器,还可以通过分布式服务框架zookeeper的命名服务为每个服务器创建唯一的服务器标识。可以根据数据库标识和服务器标识来更新数据库标识位表,即更新后的数据库标识位表可以用于区分不同服务器的数据库的号段值。Among them, a database identification can be created for each database in advance, and a database identification bit table can be created according to the database identification position. Since different servers can share the same database, in order to distinguish between different servers, you can also create a unique server ID for each server through the naming service of the distributed service framework zookeeper. The database identification bit table can be updated according to the database identification and the server identification, that is, the updated database identification bit table can be used to distinguish the number segment values of databases of different servers.
通常,不同的服务器上线和下线的时间是不同的,如果服务器是第一次启动,则该服务器是没有服务器标识的,即当前数据库标识位表中的标识位是不能够标识所述服务器的,因此,需要由zookeeper为所述服务器创建唯一的服务器标识。同时,更新数据库标识位表。Generally, the online and offline times of different servers are different. If the server is started for the first time, the server does not have a server identification, that is, the identification bit in the current database identification bit table cannot identify the server Therefore, zookeeper needs to create a unique server ID for the server. At the same time, the database identification bit table is updated.
S14、从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中。S14. Load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache.
其中,每个数据库中都会新建号段信息表,该号段信息表包括多个号。在确定目标数据库后,可以将所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中,其中,第一预设数量比如100个,比如可以加载1至100的号段至redis中,后续就可以直接从redis中提取号段,而不需要从数据库中提取,从而可以减少对数据库的访问冲击。Among them, a number segment information table is created in each database, and the number segment information table includes multiple numbers. After the target database is determined, a first preset number of first number segments can be loaded from the number segment information table of the target database to the remote dictionary service redis cache, where the first preset number is, for example, 100, for example, Load the number segment from 1 to 100 to redis, and then you can directly extract the number segment from redis without extracting it from the database, which can reduce the impact of access to the database.
具体的,在加载时,可以在redis缓存生成一个号值队列,比如加载1至100的号段,就生成队列【1、2、3……100】。Specifically, during loading, a number value queue can be generated in the redis cache. For example, when a number segment from 1 to 100 is loaded, a queue [1, 2, 3...100] is generated.
S15、从所述redis缓存中提取所述第一号段的目标号标识。S15. Extract the target number identifier of the first number segment from the redis cache.
通常,服务器会由于某些原因(比如人为操作、故障)而上线或下线,这会导致服务器上存储的号段丢失。为了尽可能地避免这种情况发生,本申请实施例中,在部署设备时,将redis缓存与服务器分开独立部署的,即redis缓存并没有集成在服务器上。由于redis缓存的稳定性比服务器高,很少会出现问题,将第一号段存储至远程字典服务redis缓存中,后续在从redis缓存中提取目标号标识,而不需要从服务器中去提取目标号标识,服务器的上线/下线均不会影响到redis,即使服务器下线了,仍能从所述redis缓存中提取号段标识,减少了号段的丢失。Usually, the server will go online or offline due to some reasons (such as human operation, failure), which will cause the number segment stored on the server to be lost. In order to avoid this situation as much as possible, in the embodiment of the present application, when deploying the device, the redis cache is deployed separately from the server, that is, the redis cache is not integrated on the server. Since the redis cache is more stable than the server, there are few problems. Store the first number segment in the remote dictionary service redis cache, and subsequently extract the target number identifier from the redis cache, without the need to extract the target from the server Number identification, the online/offline of the server will not affect the redis, even if the server is offline, the number segment identifier can still be extracted from the redis cache, reducing the loss of the number segment.
所述订单标识生成方法还包括:The method for generating an order identification further includes:
创建监听事件;Create a listener event;
通过所述监听事件,监听所述redis缓存中的所述第一号段的使用状态。Through the monitoring event, the usage status of the first number segment in the redis cache is monitored.
在该实施方式中,每次从所述redis缓存中提取目标号标识时,可以创建监听事件,该监听事件用于监听所述redis缓存中的所述第一号段的使用状态,即可以监听到所述第一号段当前使用到了哪个号,比如提取了所述第一号段的目标号标识为90,则可以监听到当前使用了“90”这个号。通过监听事件,可以及时监控到redis缓存的号段的使用情况,以防号段丢失,同时,便于后续号段的及时补充。In this embodiment, each time the target number identifier is extracted from the redis cache, a monitoring event can be created, and the monitoring event is used to monitor the usage status of the first number segment in the redis cache, that is, it can monitor To which number is currently used in the first number segment, for example, if the target number identification of the first number segment is extracted as 90, then it can be monitored that the number "90" is currently used. By monitoring events, the usage of the number segments cached by redis can be monitored in time to prevent the number segments from being lost, and at the same time, it is convenient for subsequent number segments to be supplemented in time.
所述订单标识生成方法还包括:The method for generating an order identification further includes:
根据所述使用状态,获取当前使用值;According to the usage status, obtain the current usage value;
判断所述当前使用值的位置是否处于所述第一号段的边界值范围;Judging whether the position of the currently used value is within the boundary value range of the first number segment;
若所述当前使用值的位置处于所述第一号段的边界值范围,从所述号段信息表中异步加载第二预设数量的第二号段至所述redis缓存中。If the position of the currently used value is within the boundary value range of the first number segment, asynchronously load a second preset number of second number segments from the number segment information table to the redis cache.
在该实施方式中,所述第一号段是由多个号组成的,即代表了一个号段的范围,而该号段的边界值范围通常是该号段接近末端的号的取值范围,比如第一号段的范围为[1,100],可以设置边界值范围[90,100]。如果当前使用值的位置处于所述第一号段的边界值范围,表明所述第一号段即将使用完了,比如当前使用值为90,则处于边界值范围,为了避免所述redis中的号段使用完而没有加载号段的情况发生,可以在当前使用值的位置处于第一号段的边界值范围时,从所述号段信息表中异步加载第二预设数量的第二号段至所述redis缓存中,以确保redis中有足够的号段可以使用。比如,可以加载100个[101,200]的第二号段值redis中。In this embodiment, the first number segment is composed of multiple numbers, that is, it represents the range of a number segment, and the boundary value range of the number segment is usually the value range of the number near the end of the number segment For example, the range of the first number segment is [1,100], and the boundary value range can be set to [90,100]. If the position of the currently used value is within the boundary value range of the first number segment, it indicates that the first number segment is about to be used up. For example, if the current use value is 90, it is in the boundary value range. When the segment is used up without loading the number segment, it is possible to asynchronously load the second preset number of the second number segment from the number segment information table when the current use value position is within the boundary value range of the first number segment To the redis cache to ensure that there are enough number segments available in redis. For example, you can load 100 second segment values of [101,200] in redis.
这种异步缓存的方式,避免了系统使用时的堵塞和卡顿现象。This asynchronous caching method avoids blockage and stalling when the system is in use.
S16、根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识。S16. Generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier.
可选的,可以根据预先设置的标识叠加规则,将所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识叠加在一起,生成订单标识。Optionally, the single number identification, the organization identification, the server database identification, and the target number identification can be superimposed together according to a preset identification superimposition rule to generate an order identification.
可选的,还可以将所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识输入至标识生成模型中,通过该标识生成模型来生成订单标识,其中,该标识生成模型为预先训练好的,通过输入几个参数的标识(比如单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识),来计算唯一的标识(比如订单标识)。Optionally, the single number identification, the organization identification, the server database identification, and the target number identification can also be input into an identification generation model, and the order identification is generated through the identification generation model, wherein the identification is The generation model is pre-trained, and a unique identifier (such as an order identifier) is calculated by inputting identifiers of several parameters (such as a single number identifier, the organization identifier, the server database identifier, and the target number identifier).
在分布式系统中,可以用于生成唯一的标识。In a distributed system, it can be used to generate a unique identifier.
S17、响应所述订单确定请求,将所述订单标识发送至所述前端设备。S17. In response to the order confirmation request, send the order identifier to the front-end device.
其中,服务器将所述订单标识发送至所述前端设备后,在前端设备上即可输出所述订单标识以及关于订单的其他信息,比如订单地址、订单人、订单售后服务等等。Wherein, after the server sends the order identifier to the front-end device, the order identifier and other information about the order can be output on the front-end device, such as the order address, the orderer, the order after-sales service, and so on.
在图1所描述的方法流程中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识,可以用于区分不同服务器上的号段值,通过redis异步缓存,可以避免系统使用时的堵塞和卡顿现象,同时,也能减少对数据库的访问冲击,根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成的订单标识具有唯一性,在分布式系统中,保证了订单标识的全局唯一性,避免了数据库访问时的冲突。In the method process described in Figure 1, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers. Through the asynchronous cache of redis, the system can be avoided. At the same time, it can also reduce the impact of access to the database. According to the single number identification, the organization identification, the server database identification, and the target number identification, the generated order identification is unique , In a distributed system, the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
由以上实施例可知,本申请可应用在智慧物流等广泛使用订单标识的领域,从而推动智慧城市的发展。It can be seen from the above embodiments that this application can be applied to fields where order identification is widely used, such as smart logistics, so as to promote the development of smart cities.
图2是本申请公开的一种订单标识生成装置的较佳实施例的功能模块图。Fig. 2 is a functional module diagram of a preferred embodiment of an order identification generating device disclosed in the present application.
在一些实施例中,所述订单标识生成装置运行于服务器中。所述订单标识生成装置可以包括多个由程序代码段所组成的功能模块。所述订单标识生成装置中的各个程序段的程序代码可以存储于存储器中,并由至少一个处理器所执行,以执行图1所描述的订单标识生成方法中的部分或全部步骤。In some embodiments, the order identification generating device runs in a server. The order identification generating device may include a plurality of functional modules composed of program code segments. The program code of each program segment in the order identification generating device may be stored in a memory and executed by at least one processor to execute part or all of the steps in the order identification generating method described in FIG. 1.
本实施例中,所述订单标识生成装置根据其所执行的功能,可以被划分为多个功能模块。所述功能模块可以包括:接收模块201、确定模块202、加载模块203、提取模块204、生成模块205及发送模块206。本申请所称的模块是指一种能够被至少一个处理器所执行并且能够完成固定功能的一系列计算机程序段,其存储在存储器中。In this embodiment, the order identification generating device can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a receiving module 201, a determining module 202, a loading module 203, an extracting module 204, a generating module 205, and a sending module 206. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory.
接收模块201,用于接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域。The receiving module 201 is configured to receive an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs.
其中,前端设备是针对用户而言的,前端设备可以包括但不限于智能手机、个人电脑、IPAD或其他用户可以操作的电子设备。用户可以在前端设备上进行操作,比如购买某个线上商品时提交商品订单。Among them, the front-end device is for the user, and the front-end device may include, but is not limited to, a smart phone, a personal computer, an IPAD, or other electronic devices that the user can operate. Users can perform operations on the front-end equipment, such as submitting a product order when purchasing an online product.
本申请实施例中,当接收到前端设备发送的订单确定请求时,表明用户需要购买该订单对应的商品,此时,该订单没有生成订单标识,即唯一标识该订单的订单编号,需要触发服务器根据该订单确定请求去生成唯一的订单标识。In this embodiment of the application, when the order confirmation request sent by the front-end device is received, it indicates that the user needs to purchase the goods corresponding to the order. At this time, the order does not generate an order identifier, that is, the order number that uniquely identifies the order, and the server needs to be triggered According to the order confirmation request, a unique order identification is generated.
其中,订单类型可以用于表示用户所需要购买的商品的类型,比如保险类,订单所属区域可以用于表示该订单在提交时前端设备所处的区域,比如某个城市。Among them, the order type can be used to indicate the type of goods that the user needs to purchase, such as insurance, and the area to which the order belongs can be used to indicate the area where the front-end equipment is located when the order is submitted, such as a certain city.
确定模块202,用于根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识。The determining module 202 is configured to determine the order number identifier according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, and the correspondence between the region to which the preset order belongs and the preset organization identifier In the relationship, query the organization ID corresponding to the region to which the order belongs.
其中,不同的订单类型所对应的单号标识是不同的,不同的订单所属区域所对应的机构标识也是不同的。Among them, the order number identifiers corresponding to different order types are different, and the organization identifiers corresponding to the regions to which different orders belong are also different.
可选的,可以预先建立订单类型与单号标识的对应关系,该对应关系中,每种订单类型对应一个单号标识,比如:报价单对应的单号标识为Q,保单对应的单号标识为10头,类似的,可以预先建立订单所属区域与机构标识的对应关系,该对应关系中,每种订单所属区域对应一个机构标识,比如:福州市对应的机构标识为3910。Optionally, the correspondence relationship between the order type and the order number identification can be established in advance. In the correspondence relationship, each order type corresponds to an order number identification, for example: the order number identification corresponding to the quotation is Q, and the order number identification corresponding to the insurance policy The number is 10, similarly, the corresponding relationship between the region to which the order belongs and the organization ID can be established in advance. In the corresponding relationship, the region to which each order belongs corresponds to an organization ID. For example, the corresponding organization ID in Fuzhou is 3910.
可选的,根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识包括:Optionally, according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, determining the order number identifier includes:
根据订单类型,确定所述订单类型对应的订单的价值权重;According to the order type, determine the value weight of the order corresponding to the order type;
获取所述订单的订单总额数据;Acquiring the total order data of the order;
根据所述价值权重以及所述订单总额数据,确定订单优先级;Determine the order priority according to the value weight and the total order data;
将所述订单优先级对应的优先级标识确定为单号标识。The priority identifier corresponding to the order priority is determined as the single number identifier.
在该实施方式中,不同的订单类型对应的订单的价值权重是不同的,价值权重可以用于衡量某个订单的价值的高低,价值权重的范围可以设置为[0,1]。通常,价值权重越大,表明该订单的价值越大,也表明该订单对于用户而言是非常重要的。订单总额数据可以反映出用户购买该订单所需要支付的数据。可以根据价值权重以及所述订单总额数据,确定订单优先级,比如将价值权重乘以订单总额数据,得到乘积值,在根据乘积值查找对应于该乘积值的订单优先级。最后,即可将所述订单优先级对应的优先级标识确定为单号标识。其中,订单优先级可以反映出该订单被处理的优先顺序,后续在生成订单标识后,可以根据该订单标识中的订单优先级来决定订单的先后处理顺序,从而可以为优质用户提供更高效的订单处理服务,提供用户体验。In this embodiment, the value weights of orders corresponding to different order types are different, the value weights can be used to measure the value of an order, and the value weight range can be set to [0,1]. Generally, the greater the value weight, the greater the value of the order, and it also indicates that the order is very important to the user. The order total data can reflect the data that the user needs to pay to purchase the order. The order priority can be determined according to the value weight and the order total data, for example, the value weight is multiplied by the order total data to obtain the product value, and the order priority corresponding to the product value is searched according to the product value. Finally, the priority identifier corresponding to the order priority can be determined as the single number identifier. Among them, the order priority can reflect the priority order in which the order is processed. After the order identification is generated, the order processing order can be determined according to the order priority in the order identification, which can provide more efficient orders for high-quality users. Order processing services to provide user experience.
所述确定模块202,还用于在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识。The determining module 202 is also used to determine the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper among multiple databases included in the distributed system.
其中,分布式系统中可以包括多个数据库,不同的服务器可以共用一个数据库,也可以单独配置一个数据库。所述目标数据库可以是与启动的服务器绑定的数据库,或者,所述目标数据库可以是根据数据库的承受能力,从分布式系统的多个数据库中确定的数据库。Among them, the distributed system may include multiple databases, and different servers may share a database, or configure a database separately. The target database may be a database bound to a started server, or the target database may be a database determined from a plurality of databases in a distributed system according to the bearing capacity of the database.
具体的,所述在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识包括:Specifically, in the multiple databases included in the distributed system, determining the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper includes:
在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库;Among the multiple databases included in the distributed system, determine the target database according to the endurance value of each database;
通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识;Generate a server identifier for the server to which the target database belongs through the naming service of the distributed service framework zookeeper;
根据所述目标数据库的数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识。According to the database identification of the target database and the server identification, the server database identification corresponding to the target database is determined.
在该实施方式中,可以从分布式系统的多个数据库中,挑选目标数据库,减少对承受能力较弱的数据库的冲击,同时,通过分布式服务框架zookeeper的命名服务,来生成唯一的服务器标识,根据数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识,该服务器数据库标识能够用于区别不同服务器的数据库的号段值。其中,每个数据库都可以预先存储多个号段值。In this embodiment, the target database can be selected from the multiple databases of the distributed system to reduce the impact on the database with weaker capacity. At the same time, the unique server identification can be generated through the naming service of the distributed service framework zookeeper , Determine the server database identifier corresponding to the target database according to the database identifier and the server identifier, and the server database identifier can be used to distinguish the number segment value of the databases of different servers. Among them, each database can store multiple number segment values in advance.
具体的,所述在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库包括:Specifically, among the multiple databases included in the distributed system, determining the target database according to the endurance value of each database includes:
获取所述分布式系统的每个数据库的历史访问次数,以及预设时间内每个所述数据库的崩溃次数;Acquiring the historical access times of each database of the distributed system and the number of crashes of each database within a preset time;
根据所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值;Determining the endurance value of each database according to the number of historical visits and the number of crashes;
根据所述承受能力值,从多个所述数据库中确定目标数据库。According to the endurance value, a target database is determined from a plurality of the databases.
其中,分布式系统中,每个数据库的存储容量是不同的,每个数据库的历史访问数量也是不同的,预设时间内(比如一个月内),每个所述数据库的崩溃次数也是不同的。如果访问次数很多,而崩溃次数很少,表明该数据库的承受能力较好,因此,可以根据数据库的承受能力来选择目标数据库。Among them, in a distributed system, the storage capacity of each database is different, the number of historical accesses of each database is also different, and the number of crashes of each database is also different within a preset period of time (for example, within one month) . If there are many visits and few crashes, it indicates that the database has a better bearing capacity. Therefore, the target database can be selected according to the database's bearing capacity.
具体的,可以分别为历史访问次数以及崩溃次数设置权重值,其中,可以设置历史访问次数的权重值高于崩溃次数的权重值。根据权重值、所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值,并从多个数据库中,选择承受能力值超过预设阈值的目标数据库。这样,可以优先选择承受能力高且不容易崩溃的数据库,让分布式系统中的数据库得到合理的利用,减少对承受能力较弱的数据库的冲击,提高数据库的使用寿命。Specifically, weight values can be set for the number of historical visits and the number of crashes respectively, where the weight value of the number of historical visits can be set to be higher than the weight value of the number of crashes. According to the weight value, the number of historical visits and the number of crashes, the endurance value of each database is determined, and a target database whose endurance value exceeds a preset threshold is selected from a plurality of databases. In this way, a database with a high endurance capacity and not easy to crash can be selected first, so that the database in a distributed system can be reasonably used, reducing the impact on the database with a weak endurance, and improving the service life of the database.
具体的,所述通过分布式服务框架zookeeper的命名服务,为所述服务器生成服务器标识包括:Specifically, the generating a server identifier for the server through the naming service of the distributed service framework zookeeper includes:
从数据库标识位表中获取标识位;Obtain the identification position from the database identification position table;
判断所述标识位中是否存在能够标识所述服务器的标识位;Judging whether there is an identification bit capable of identifying the server in the identification bits;
若所述标识位中不存在能够标识所述服务器的标识位,通过分布式服务框架zookeeper的命名服务创建临时节点;If there is no identification bit that can identify the server in the identification bits, create a temporary node through the naming service of the distributed service framework zookeeper;
将所述临时节点的节点标识确定为所述服务器的服务器标识。The node identifier of the temporary node is determined as the server identifier of the server.
其中,可以预先为每个数据库创建数据库标识,并根据数据库标识位创建数据库标识位表。由于不同的服务器可以共用同一个数据库,为了区别不同的服务器,还可以通过分布式服务框架zookeeper的命名服务为每个服务器创建唯一的服务器标识。可以根据数据库标识和服务器标识来更新数据库标识位表,即更新后的数据库标识位表可以用于区分不同服务器的数据库的号段值。Among them, a database identification can be created for each database in advance, and a database identification bit table can be created according to the database identification position. Since different servers can share the same database, in order to distinguish between different servers, you can also create a unique server ID for each server through the naming service of the distributed service framework zookeeper. The database identification bit table can be updated according to the database identification and the server identification, that is, the updated database identification bit table can be used to distinguish the number segment values of databases of different servers.
通常,不同的服务器上线和下线的时间是不同的,如果服务器是第一次启动,则该服务器是没有服务器标识的,即当前数据库标识位表中的标识位是不能够标识所述服务器的,因此,需要由zookeeper为所述服务器创建唯一的服务器标识。同时,更新数据库标识位表。Generally, the online and offline times of different servers are different. If the server is started for the first time, the server does not have a server identification, that is, the identification bit in the current database identification bit table cannot identify the server Therefore, zookeeper needs to create a unique server ID for the server. At the same time, the database identification bit table is updated.
加载模块203,用于从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中。The loading module 203 is configured to load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache.
其中,每个数据库中都会新建号段信息表,该号段信息表包括多个号。在确定目标数据库后,可以将所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中,其中,第一预设数量比如100个,比如可以加载1至100的号 段至redis中,后续就可以直接从redis中提取号段,而不需要从数据库中提取,从而可以减少对数据库的访问冲击。Among them, a number segment information table is created in each database, and the number segment information table includes multiple numbers. After the target database is determined, a first preset number of first number segments can be loaded from the number segment information table of the target database to the remote dictionary service redis cache, where the first preset number is, for example, 100, for example, Load the number segment from 1 to 100 to redis, and then you can directly extract the number segment from redis without extracting it from the database, which can reduce the impact of access to the database.
具体的,在加载时,可以在redis缓存生成一个号值队列,比如加载1至100的号段,就生成队列【1、2、3……100】。Specifically, during loading, a number value queue can be generated in the redis cache. For example, when a number segment from 1 to 100 is loaded, a queue [1, 2, 3...100] is generated.
提取模块204,用于从所述redis缓存中提取所述第一号段的目标号标识。The extraction module 204 is configured to extract the target number identifier of the first number segment from the redis cache.
通常,服务器会由于某些原因(比如人为操作、故障)而上线或下线,这会导致服务器上存储的号段丢失。为了尽可能地避免这种情况发生,本申请实施例中,在部署设备时,将redis缓存与服务器分开独立部署的,即redis缓存并没有集成在服务器上。由于redis缓存的稳定性比服务器高,很少会出现问题,将第一号段存储至远程字典服务redis缓存中,后续在从redis缓存中提取目标号标识,而不需要从服务器中去提取目标号标识,服务器的上线/下线均不会影响到redis,即使服务器下线了,仍能从所述redis缓存中提取号段标识,减少了号段的丢失。Usually, the server will go online or offline due to some reasons (such as human operation, failure), which will cause the number segment stored on the server to be lost. In order to avoid this situation as much as possible, in the embodiment of the present application, when deploying the device, the redis cache is deployed separately from the server, that is, the redis cache is not integrated on the server. Since the redis cache is more stable than the server, there are few problems. Store the first number segment in the remote dictionary service redis cache, and subsequently extract the target number identifier from the redis cache, without the need to extract the target from the server Number identification, the online/offline of the server will not affect the redis, even if the server is offline, the number segment identifier can still be extracted from the redis cache, reducing the loss of the number segment.
生成模块205,用于根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识。The generating module 205 is configured to generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier.
可选的,可以根据预先设置的标识叠加规则,将所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识叠加在一起,生成订单标识。Optionally, the single number identification, the organization identification, the server database identification, and the target number identification can be superimposed together according to a preset identification superimposition rule to generate an order identification.
可选的,还可以将所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识输入至标识生成模型中,通过该标识生成模型来生成订单标识,其中,该标识生成模型为预先训练好的,通过输入几个参数的标识(比如单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识),来计算唯一的标识(比如订单标识)。Optionally, the single number identification, the organization identification, the server database identification, and the target number identification can also be input into an identification generation model, and the order identification is generated through the identification generation model, wherein the identification is The generation model is pre-trained, and a unique identifier (such as an order identifier) is calculated by inputting identifiers of several parameters (such as a single number identifier, the organization identifier, the server database identifier, and the target number identifier).
在分布式系统中,可以用于生成唯一的标识。In a distributed system, it can be used to generate a unique identifier.
发送模块206,用于响应所述订单确定请求,将所述订单标识发送至所述前端设备。The sending module 206 is configured to send the order identifier to the front-end device in response to the order confirmation request.
其中,服务器将所述订单标识发送至所述前端设备后,在前端设备上即可输出所述订单标识以及关于订单的其他信息,比如订单地址、订单人、订单售后服务等等。Wherein, after the server sends the order identifier to the front-end device, the order identifier and other information about the order can be output on the front-end device, such as the order address, the orderer, the order after-sales service, and so on.
在图2所描述的装置中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识,可以用于区分不同服务器上的号段值,通过redis异步缓存,可以避免系统使用时的堵塞和卡顿现象,同时,也能减少对数据库的访问冲击,根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成的订单标识具有唯一性,在分布式系统中,保证了订单标识的全局唯一性,避免了数据库访问时的冲突。In the device described in Figure 2, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers, and the redis asynchronous cache can avoid the time when the system is used. At the same time, it can also reduce the impact of access to the database. According to the single number identification, the organization identification, the server database identification, and the target number identification, the generated order identification is unique, In a distributed system, the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
图3是本申请实现订单标识生成方法的较佳实施例的服务器的结构示意图。所述服务器3包括存储器31、至少一个处理器32、存储在所述存储器31中并可在所述至少一个处理器32上运行的计算机程序33及至少一条通讯总线34。FIG. 3 is a schematic diagram of the structure of a server implementing a preferred embodiment of the method for generating an order identifier according to the present application. The server 3 includes a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and running on the at least one processor 32, and at least one communication bus 34.
本领域技术人员可以理解,图3所示的示意图仅仅是所述服务器3的示例,并不构成对所述服务器3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述服务器3还可以包括输入输出设备、网络接入设备等。Those skilled in the art can understand that the schematic diagram shown in FIG. 3 is only an example of the server 3, and does not constitute a limitation on the server 3. It may include more or less components than those shown in the figure, or combine some Components, or different components, for example, the server 3 may also include input and output devices, network access devices, and so on.
其中,服务器3可以是指能对网络中其它设备(如电子设备)提供服务的计算机系统。如果一个个人电脑能够对外提供文件传输协议(File Transfer Protocol,简称FTP)服务,也可以叫服务器。从狭义范围上讲,服务器专指某些高性能计算机,能通过网络,对外提供服务,其相对于普通的个人电脑来说,稳定性、安全性、性能等方面都要求更高,因此在CPU、芯片组、内存、磁盘系统、网络等硬件和普通的个人电脑有所不同。Among them, the server 3 may refer to a computer system that can provide services to other devices (such as electronic devices) in the network. If a personal computer can provide File Transfer Protocol (FTP) service externally, it can also be called a server. In a narrow sense, the server refers to certain high-performance computers that can provide services to the outside world through the network. Compared with ordinary personal computers, they have higher requirements in terms of stability, security, and performance. Therefore, in the CPU , Chipset, memory, disk system, network and other hardware are different from ordinary personal computers.
所述至少一个处理器32可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。该处理器32可以是微处理器或者该处理器32也可以是任何常规的处理器等,所述处理器32是所述服务器3的控制中心,利用各种接口和线路连接整个服务器3的各个部分。The at least one processor 32 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (ASICs). ), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 32 can be a microprocessor or the processor 32 can also be any conventional processor, etc. The processor 32 is the control center of the server 3, and connects each of the entire server 3 through various interfaces and lines. part.
所述存储器31可用于存储所述计算机程序33和/或模块/单元,所述处理器32通过运行或执行存储在所述存储器31内的计算机程序和/或模块/单元,以及调用存储在存储器31内的数据,实现所述服务器3的各种功能。所述存储器31可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据服务器3的使用所创建的数据(比如音频数据)等。此外,存储器31可以包括易失性和非易失性存储器,例如随机存取存储器(Random Access Memory,RAM)、硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他能够用于携带或存储数据的计算机可读的存储介质。所述计算机可读存储介质可以是非易失性,也可以是易失性的。The memory 31 may be used to store the computer program 33 and/or modules/units. The processor 32 runs or executes the computer programs and/or modules/units stored in the memory 31 and calls the computer programs and/or modules/units stored in the memory 31. The data in 31 realizes various functions of the server 3. The memory 31 may mainly include a storage program area and a storage data area. The storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Data (such as audio data) and the like created according to the use of the server 3 are stored. In addition, the memory 31 may include volatile and non-volatile memory, such as random access memory (RAM), hard disk, internal memory, plug-in hard disk, smart media card (SMC), and security A digital (Secure Digital, SD) card, a flash card (Flash Card), at least one magnetic disk storage device, a flash memory device, or other computer-readable storage media that can be used to carry or store data. The computer-readable storage medium may be non-volatile or volatile.
结合图1,所述服务器3中的所述存储器31存储多个指令以实现一种订单标识生成方法,所述处理器32可执行所述多个指令从而实现:With reference to FIG. 1, the memory 31 in the server 3 stores multiple instructions to implement an order identification generation method, and the processor 32 can execute the multiple instructions to achieve:
接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;According to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order, the order number identification is determined, and the corresponding relationship between the area of the preset order and the preset organization identification is queried. Organization ID corresponding to the region where the order belongs;
在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
具体地,所述处理器32对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instructions by the processor 32, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
在图3所描述的服务器3中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识,可以用于区分不同服务器上的号段值,通过redis异步缓存,可以避免系统使用时的堵塞和卡顿现象,同时,也能减少对数据库的访问冲击,根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成的订单标识具有唯一性,在分布式系统中,保证了订单标识的全局唯一性,避免了数据库访问时的冲突。In the server 3 described in Figure 3, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper, which can be used to distinguish the number segment value on different servers. Through the redis asynchronous cache, the system can be avoided. At the same time, it can also reduce the impact of access to the database. According to the single number identification, the organization identification, the server database identification, and the target number identification, the generated order identification is unique , In a distributed system, the global uniqueness of the order identifier is guaranteed, and conflicts during database access are avoided.
所述服务器3集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可 以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器以及只读存储器(ROM,Read-Only Memory)。If the integrated modules/units of the server 3 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, and read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc. This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种订单标识生成方法,应用于服务器中,其中,所述订单标识生成方法包括:A method for generating an order identifier, applied to a server, wherein the method for generating an order identifier includes:
    接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
    根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识;Determine the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order;
    从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;Query the organization identifier corresponding to the region to which the order belongs from the corresponding relationship between the region to which the predetermined order belongs and the identifier of the predetermined organization;
    在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
    从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
    从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
    根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
    响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
  2. 根据权利要求1所述的订单标识生成方法,其中,根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识包括:The method for generating an order identification according to claim 1, wherein determining the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order comprises:
    根据订单类型,确定所述订单类型对应的订单的价值权重;According to the order type, determine the value weight of the order corresponding to the order type;
    获取所述订单的订单总额数据;Acquiring the total order data of the order;
    根据所述价值权重以及所述订单总额数据,确定订单优先级;Determine the order priority according to the value weight and the total order data;
    将所述订单优先级对应的优先级标识确定为单号标识。The priority identifier corresponding to the order priority is determined as the single number identifier.
  3. 根据权利要求1所述的订单标识生成方法,其中,所述在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识包括:The method for generating an order identification according to claim 1, wherein said determining the server database identification corresponding to the target database through the naming service of the distributed service framework zookeeper among the multiple databases included in the distributed system comprises:
    在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库;Among the multiple databases included in the distributed system, determine the target database according to the endurance value of each database;
    通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识;Generate a server identifier for the server to which the target database belongs through the naming service of the distributed service framework zookeeper;
    根据所述目标数据库的数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识。According to the database identification of the target database and the server identification, the server database identification corresponding to the target database is determined.
  4. 根据权利要求3所述的订单标识生成方法,其中,所述在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库包括:The method for generating an order identification according to claim 3, wherein, among the multiple databases included in the distributed system, determining the target database according to the affordability value of each of the databases comprises:
    获取所述分布式系统的每个数据库的历史访问次数,以及预设时间内每个所述数据库的崩溃次数;Acquiring the historical access times of each database of the distributed system and the number of crashes of each database within a preset time;
    根据所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值;Determining the endurance value of each database according to the number of historical visits and the number of crashes;
    根据所述承受能力值,从多个所述数据库中确定目标数据库。According to the endurance value, a target database is determined from a plurality of the databases.
  5. 根据权利要求3所述的订单标识生成方法,其中,所述通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识包括:The order identification generating method according to claim 3, wherein said generating a server identification for the server to which the target database belongs through the naming service of the distributed service framework zookeeper comprises:
    从数据库标识位表中获取标识位;Obtain the identification position from the database identification position table;
    判断所述标识位中是否存在能够标识所述目标数据库所属的服务器的标识位;Judging whether there is an identification bit capable of identifying the server to which the target database belongs in the identification bits;
    若所述标识位中不存在能够标识所述目标数据库所属的服务器的标识位,通过分布式服务框架zookeeper的命名服务创建临时节点;If there is no identification bit that can identify the server to which the target database belongs, create a temporary node through the naming service of the distributed service framework zookeeper;
    将所述临时节点的节点标识确定为所述服务器的服务器标识。The node identifier of the temporary node is determined as the server identifier of the server.
  6. 根据权利要求1至5中任一项所述的订单标识生成方法,其中,所述订单标识生成方法还包括:The method for generating an order identification according to any one of claims 1 to 5, wherein the method for generating an order identification further comprises:
    创建监听事件;Create a listener event;
    通过所述监听事件,监听所述redis缓存中的所述第一号段的使用状态。Through the monitoring event, the usage status of the first number segment in the redis cache is monitored.
  7. 根据权利要求1至5中任一项所述的订单标识生成方法,所述订单标识生成方法还包括:The method for generating an order identification according to any one of claims 1 to 5, the method for generating an order identification further comprises:
    根据所述使用状态,获取当前使用值;According to the usage status, obtain the current usage value;
    判断所述当前使用值的位置是否处于所述第一号段的边界值范围;Judging whether the position of the currently used value is within the boundary value range of the first number segment;
    若所述当前使用值的位置处于所述第一号段的边界值范围,从所述号段信息表中异步加载第二预设数量的第二号段至所述redis缓存中。If the position of the currently used value is within the boundary value range of the first number segment, asynchronously load a second preset number of second number segments from the number segment information table to the redis cache.
  8. 一种服务器,其中,所述服务器包括处理器和存储器,所述处理器用于执行存储器中存储的至少一个计算机可读指令以实现以下步骤:A server, wherein the server includes a processor and a memory, and the processor is configured to execute at least one computer-readable instruction stored in the memory to implement the following steps:
    接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
    根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识;Determine the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order;
    从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;Query the organization identifier corresponding to the region to which the order belongs from the corresponding relationship between the region to which the predetermined order belongs and the identifier of the predetermined organization;
    在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
    从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
    从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
    根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
    响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
  9. 根据权利要求8所述的服务器,其中,所述处理器执行所述至少一个计算机可读指令以实现所述根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识时,具体包括:The server according to claim 8, wherein the processor executes the at least one computer-readable instruction to implement the value weight of the order corresponding to the order type, the order type, and the order of the order The total data, when determining the tracking number identification, specifically include:
    根据订单类型,确定所述订单类型对应的订单的价值权重;According to the order type, determine the value weight of the order corresponding to the order type;
    获取所述订单的订单总额数据;Acquiring the total order data of the order;
    根据所述价值权重以及所述订单总额数据,确定订单优先级;Determine the order priority according to the value weight and the total order data;
    将所述订单优先级对应的优先级标识确定为单号标识。The priority identifier corresponding to the order priority is determined as the single number identifier.
  10. 根据权利要求8所述的服务器,其中,所述处理器执行所述至少一个计算机可读指令以实现所述在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识时,具体包括:The server according to claim 8, wherein the processor executes the at least one computer-readable instruction to implement the determination of the multiple databases included in the distributed system through the naming service of the distributed service framework zookeeper The server database identifier corresponding to the target database includes:
    在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库;Among the multiple databases included in the distributed system, determine the target database according to the endurance value of each database;
    通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识;Generate a server identifier for the server to which the target database belongs through the naming service of the distributed service framework zookeeper;
    根据所述目标数据库的数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识。According to the database identification of the target database and the server identification, the server database identification corresponding to the target database is determined.
  11. 根据权利要求10所述的服务器,其中,所述处理器执行所述至少一个计算机可读 指令以实现所述在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库时,具体包括:The server according to claim 10, wherein the processor executes the at least one computer readable instruction to implement the plurality of databases included in the distributed system, according to the affordability value of each of the databases, When determining the target database, it specifically includes:
    获取所述分布式系统的每个数据库的历史访问次数,以及预设时间内每个所述数据库的崩溃次数;Acquiring the historical access times of each database of the distributed system and the number of crashes of each database within a preset time;
    根据所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值;Determining the endurance value of each database according to the number of historical visits and the number of crashes;
    根据所述承受能力值,从多个所述数据库中确定目标数据库。According to the endurance value, a target database is determined from a plurality of the databases.
  12. 根据权利要求10所述的服务器,其中,所述处理器执行所述至少一个计算机可读指令以实现所述通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识时,具体包括:The server according to claim 10, wherein the processor executes the at least one computer-readable instruction to implement the naming service through the distributed service framework zookeeper, when generating a server identifier for the server to which the target database belongs , Specifically including:
    从数据库标识位表中获取标识位;Obtain the identification position from the database identification position table;
    判断所述标识位中是否存在能够标识所述目标数据库所属的服务器的标识位;Judging whether there is an identification bit capable of identifying the server to which the target database belongs in the identification bits;
    若所述标识位中不存在能够标识所述目标数据库所属的服务器的标识位,通过分布式服务框架zookeeper的命名服务创建临时节点;If there is no identification bit that can identify the server to which the target database belongs, create a temporary node through the naming service of the distributed service framework zookeeper;
    将所述临时节点的节点标识确定为所述服务器的服务器标识。The node identifier of the temporary node is determined as the server identifier of the server.
  13. 根据权利要求8至12中任一项所述的服务器,其中,所述处理器执行所述至少一个计算机可读指令还用以执行以下步骤:The server according to any one of claims 8 to 12, wherein the processor executing the at least one computer readable instruction is further configured to execute the following steps:
    创建监听事件;Create a listener event;
    通过所述监听事件,监听所述redis缓存中的所述第一号段的使用状态。Through the monitoring event, the usage status of the first number segment in the redis cache is monitored.
  14. 根据权利要求8至12中任一项所述的服务器,其中,所述处理器执行所述至少一个计算机可读指令还用以执行以下步骤:The server according to any one of claims 8 to 12, wherein the processor executing the at least one computer readable instruction is further configured to execute the following steps:
    根据所述使用状态,获取当前使用值;According to the usage status, obtain the current usage value;
    判断所述当前使用值的位置是否处于所述第一号段的边界值范围;Judging whether the position of the currently used value is within the boundary value range of the first number segment;
    若所述当前使用值的位置处于所述第一号段的边界值范围,从所述号段信息表中异步加载第二预设数量的第二号段至所述redis缓存中。If the position of the currently used value is within the boundary value range of the first number segment, asynchronously load a second preset number of second number segments from the number segment information table to the redis cache.
  15. 一种计算机可读存储介质,其上存储有至少一个计算机可读指令,其中,所述至少一个计算机可读指令被处理器执行时实现以下步骤:A computer-readable storage medium has at least one computer-readable instruction stored thereon, wherein the at least one computer-readable instruction implements the following steps when executed by a processor:
    接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;Receiving an order confirmation request sent by a front-end device, where the order confirmation request carries the order type and the area to which the order belongs;
    根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识;Determine the order number identification according to the order type, the value weight of the order corresponding to the order type, and the order total amount data of the order;
    从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;Query the organization identifier corresponding to the region to which the order belongs from the corresponding relationship between the region to which the predetermined order belongs and the identifier of the predetermined organization;
    在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;Among the multiple databases included in the distributed system, the server database identifier corresponding to the target database is determined through the naming service of the distributed service framework zookeeper;
    从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;Loading a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
    从所述redis缓存中提取所述第一号段的目标号标识;Extracting the target number identifier of the first number segment from the redis cache;
    根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;Generating an order identification according to the single number identification, the institution identification, the server database identification, and the target number identification;
    响应所述订单确定请求,将所述订单标识发送至所述前端设备。In response to the order confirmation request, the order identifier is sent to the front-end device.
  16. 根据权利要求15所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识时,具体包括:The storage medium according to claim 15, wherein the at least one computer-readable instruction is executed by the processor to implement the value weight of the order corresponding to the order type, the order type, and the order When determining the order number identification, it specifically includes:
    根据订单类型,确定所述订单类型对应的订单的价值权重;According to the order type, determine the value weight of the order corresponding to the order type;
    获取所述订单的订单总额数据;Acquiring the total order data of the order;
    根据所述价值权重以及所述订单总额数据,确定订单优先级;Determine the order priority according to the value weight and the total order data;
    将所述订单优先级对应的优先级标识确定为单号标识。The priority identifier corresponding to the order priority is determined as the single number identifier.
  17. 根据权利要求15所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识时,具体包括:The storage medium according to claim 15, wherein the at least one computer-readable instruction is executed by the processor to implement the naming service of the distributed service framework zookeeper among the multiple databases included in the distributed system. , When determining the server database identifier corresponding to the target database, it specifically includes:
    在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库;Among the multiple databases included in the distributed system, determine the target database according to the endurance value of each database;
    通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识;Generate a server identifier for the server to which the target database belongs through the naming service of the distributed service framework zookeeper;
    根据所述目标数据库的数据库标识以及所述服务器标识,确定所述目标数据库对应的服务器数据库标识。According to the database identification of the target database and the server identification, the server database identification corresponding to the target database is determined.
  18. 根据权利要求17所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述在分布式系统包括的多个数据库中,根据每个所述数据库的承受能力值,确定目标数据库时,具体包括:The storage medium according to claim 17, wherein the at least one computer-readable instruction is executed by the processor to implement the multiple databases included in the distributed system, according to the bearing capacity of each of the databases Value, when determining the target database, specifically include:
    获取所述分布式系统的每个数据库的历史访问次数,以及预设时间内每个所述数据库的崩溃次数;Acquiring the historical access times of each database of the distributed system and the number of crashes of each database within a preset time;
    根据所述历史访问次数以及所述崩溃次数,确定每个所述数据库的承受能力值;Determining the endurance value of each database according to the number of historical visits and the number of crashes;
    根据所述承受能力值,从多个所述数据库中确定目标数据库。According to the endurance value, a target database is determined from a plurality of the databases.
  19. 根据权利要求17所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述通过分布式服务框架zookeeper的命名服务,为所述目标数据库所属的服务器生成服务器标识时,具体包括:The storage medium according to claim 17, wherein the at least one computer-readable instruction is executed by the processor to implement the naming service through the distributed service framework zookeeper, and generate a server for the server to which the target database belongs When marking, specifically include:
    从数据库标识位表中获取标识位;Obtain the identification position from the database identification position table;
    判断所述标识位中是否存在能够标识所述目标数据库所属的服务器的标识位;Judging whether there is an identification bit capable of identifying the server to which the target database belongs in the identification bits;
    若所述标识位中不存在能够标识所述目标数据库所属的服务器的标识位,通过分布式服务框架zookeeper的命名服务创建临时节点;If there is no identification bit that can identify the server to which the target database belongs, create a temporary node through the naming service of the distributed service framework zookeeper;
    将所述临时节点的节点标识确定为所述服务器的服务器标识。The node identifier of the temporary node is determined as the server identifier of the server.
  20. 一种订单标识生成装置,其中,所述订单标识生成装置包括:An order identification generating device, wherein the order identification generating device includes:
    接收模块,用于接收前端设备发送的订单确定请求,其中,所述订单确定请求携带有订单类型以及订单所属区域;The receiving module is configured to receive an order confirmation request sent by a front-end device, wherein the order confirmation request carries the order type and the area to which the order belongs;
    确定模块,用于根据所述订单类型、所述订单类型对应的订单的价值权重以及所述订单的订单总额数据,确定单号标识,以及从预设订单所属区域与预设机构标识的对应关系中,查询所述订单所属区域对应的机构标识;The determining module is used to determine the order number identification and the corresponding relationship between the area of the preset order and the preset organization identification based on the order type, the value weight of the order corresponding to the order type, and the total order data of the order , Query the organization ID corresponding to the region to which the order belongs;
    所述确定模块,还用于在分布式系统包括的多个数据库中,通过分布式服务框架zookeeper的命名服务,确定目标数据库对应的服务器数据库标识;The determining module is also used to determine the server database identifier corresponding to the target database through the naming service of the distributed service framework zookeeper among multiple databases included in the distributed system;
    加载模块,用于从所述目标数据库的号段信息表中加载第一预设数量的第一号段至远程字典服务redis缓存中;A loading module, which is used to load a first preset number of first number segments from the number segment information table of the target database to the remote dictionary service redis cache;
    提取模块,用于从所述redis缓存中提取所述第一号段的目标号标识;An extraction module, configured to extract the target number identifier of the first number segment from the redis cache;
    生成模块,用于根据所述单号标识、所述机构标识、所述服务器数据库标识以及所述目标号标识,生成订单标识;A generating module, configured to generate an order identifier according to the single number identifier, the institution identifier, the server database identifier, and the target number identifier;
    发送模块,用于响应所述订单确定请求,将所述订单标识发送至所述前端设备。The sending module is configured to send the order identifier to the front-end device in response to the order confirmation request.
PCT/CN2020/099301 2020-04-29 2020-06-30 Order identifier generation method and apparatus, server, and storage medium WO2021217863A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010358127.6A CN111694841A (en) 2020-04-29 2020-04-29 Order mark generation method, device, server and storage medium
CN202010358127.6 2020-04-29

Publications (1)

Publication Number Publication Date
WO2021217863A1 true WO2021217863A1 (en) 2021-11-04

Family

ID=72476835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099301 WO2021217863A1 (en) 2020-04-29 2020-06-30 Order identifier generation method and apparatus, server, and storage medium

Country Status (2)

Country Link
CN (1) CN111694841A (en)
WO (1) WO2021217863A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331584A (en) * 2021-11-12 2022-04-12 中国邮电器材集团有限公司 Order data storage method, device, equipment and storage medium
CN115545829A (en) * 2022-09-29 2022-12-30 中航信移动科技有限公司 Checking display system of server identification, electronic equipment and storage medium
CN115564525A (en) * 2022-09-29 2023-01-03 中航信移动科技有限公司 Method for checking and displaying server identification, electronic equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637043B (en) * 2020-11-17 2022-03-18 广州市玄武无线科技股份有限公司 Message filtering method, system, terminal and storage medium
CN113011945A (en) * 2021-03-16 2021-06-22 深圳市微创云启科技有限公司 Order number generation method and device, terminal equipment and storage medium
CN112862574A (en) * 2021-04-08 2021-05-28 上海哔哩哔哩科技有限公司 Distributed order number generation method and system
CN113220682A (en) * 2021-05-08 2021-08-06 北京猿力未来科技有限公司 Business data analysis method, data processing method, data analysis system and storage medium
CN113487230A (en) * 2021-07-27 2021-10-08 平安国际智慧城市科技股份有限公司 Order distribution method and device, computer equipment and storage medium
CN113568891B (en) * 2021-08-05 2024-02-20 深圳墨世科技有限公司 Distributed ID generation method, device, server and readable storage medium
CN114331550A (en) * 2021-12-31 2022-04-12 北京金堤科技有限公司 Advertisement word price adjusting method and device, electronic equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108243264A (en) * 2016-12-27 2018-07-03 中国移动通信有限公司研究院 A kind of sequence number generation method and system
CN109240848A (en) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 A kind of data object tag generation method and device
CN109271388A (en) * 2018-09-29 2019-01-25 北京奇虎科技有限公司 A kind of generation method and terminal device of Identity Code
CN109783578A (en) * 2019-01-09 2019-05-21 腾讯科技(深圳)有限公司 Method for reading data, device, electronic equipment and storage medium
US20190190783A1 (en) * 2017-12-15 2019-06-20 Nicira, Inc. Coordinator in cluster membership management protocol

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9256659B1 (en) * 2012-08-08 2016-02-09 Amazon Technologies, Inc. Systems and methods for generating database identifiers based on database characteristics
CN106372994A (en) * 2016-08-31 2017-02-01 北京炎黄新星网络科技有限公司 Method and system for processing orders
CN106651193A (en) * 2016-12-29 2017-05-10 江西博瑞彤芸科技有限公司 Order information distribution method
CN107798031B (en) * 2017-02-17 2020-07-24 平安科技(深圳)有限公司 Policy information query method and device
CN107749015A (en) * 2017-09-30 2018-03-02 天脉聚源(北京)科技有限公司 The display methods and device of shopping guide's order
CN107945064A (en) * 2017-10-27 2018-04-20 链家网(北京)科技有限公司 A kind of service order numbering generation method and device
CN109450987B (en) * 2018-10-18 2021-08-03 杭州云永网络科技有限公司 Number generation method, device and system and storage medium
CN109936642A (en) * 2019-01-28 2019-06-25 中国银行股份有限公司 The method, apparatus and system of machine ID are generated in a kind of distributed system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108243264A (en) * 2016-12-27 2018-07-03 中国移动通信有限公司研究院 A kind of sequence number generation method and system
US20190190783A1 (en) * 2017-12-15 2019-06-20 Nicira, Inc. Coordinator in cluster membership management protocol
CN109240848A (en) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 A kind of data object tag generation method and device
CN109271388A (en) * 2018-09-29 2019-01-25 北京奇虎科技有限公司 A kind of generation method and terminal device of Identity Code
CN109783578A (en) * 2019-01-09 2019-05-21 腾讯科技(深圳)有限公司 Method for reading data, device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331584A (en) * 2021-11-12 2022-04-12 中国邮电器材集团有限公司 Order data storage method, device, equipment and storage medium
CN115545829A (en) * 2022-09-29 2022-12-30 中航信移动科技有限公司 Checking display system of server identification, electronic equipment and storage medium
CN115564525A (en) * 2022-09-29 2023-01-03 中航信移动科技有限公司 Method for checking and displaying server identification, electronic equipment and storage medium
CN115564525B (en) * 2022-09-29 2024-05-03 中航信移动科技有限公司 Method for checking and displaying server identification, electronic equipment and storage medium
CN115545829B (en) * 2022-09-29 2024-05-31 中航信移动科技有限公司 Checking display system of server identification, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111694841A (en) 2020-09-22

Similar Documents

Publication Publication Date Title
WO2021217863A1 (en) Order identifier generation method and apparatus, server, and storage medium
US11823178B2 (en) Optimization of high volume transaction performance on a blockchain
US11218325B2 (en) Asset management method and apparatus, and electronic device
EP3373543B1 (en) Service processing method and apparatus
US9454558B2 (en) Managing an index of a table of a database
US10002170B2 (en) Managing a table of a database
CN107395665A (en) A kind of block chain service handling and business common recognition method and device
US11106659B2 (en) Blockchain-based recording and querying operations
US10795882B2 (en) Blockchain-based data compression and searching
WO2021073201A1 (en) Data processing method and apparatus based on distributed distribution, and related device
CN111813868B (en) Data synchronization method and device
CN109271564A (en) Declaration form querying method and equipment
WO2022057525A1 (en) Method and device for data retrieval, electronic device, and storage medium
CN111899018A (en) Order data processing method, device, server and storage medium
US20220383412A1 (en) Methods, apparatuses and systems for first look matching of orders
CN114328731A (en) Information processing method, device, electronic equipment and storage medium
US11683173B2 (en) Consensus algorithm for distributed ledger technology
CN110889040B (en) Method and device for pushing information
CN113194127B (en) Data storage method, data transmission method and computing equipment
CN115099978B (en) Data processing method and device
US20220188295A1 (en) Dynamic management of blockchain resources
CN118115276A (en) Virtual resource processing method, device, equipment, storage medium and program product
CN116450672A (en) Counting method, user base number counting method, corresponding device and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20933075

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20933075

Country of ref document: EP

Kind code of ref document: A1