CN117035135A - Product reservation method, device, computer equipment and storage medium - Google Patents

Product reservation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117035135A
CN117035135A CN202311013314.0A CN202311013314A CN117035135A CN 117035135 A CN117035135 A CN 117035135A CN 202311013314 A CN202311013314 A CN 202311013314A CN 117035135 A CN117035135 A CN 117035135A
Authority
CN
China
Prior art keywords
reservation
virtual network
node
network point
product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311013314.0A
Other languages
Chinese (zh)
Inventor
胡天协
房传程
戴耀
笪婧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311013314.0A priority Critical patent/CN117035135A/en
Publication of CN117035135A publication Critical patent/CN117035135A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • G06Q10/00Administration; Management
    • G06Q10/02Reservations, e.g. for tickets, services or events
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06315Needs-based resource requirements planning or analysis

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Quality & Reliability (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a product reservation method, a product reservation device, computer equipment and a storage medium. The method comprises the following steps: generating a first node of each virtual network point on a hash ring according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm; in response to a received product reservation request, identifying the reservation quantity and reservation requirements in the product reservation request, and generating a second node on the hash ring according to the reservation quantity and reservation requirements by adopting a preset hash algorithm; on the hash ring, taking the second node as a starting point, and acquiring the first nodes one by one as target nodes according to a preset direction; and processing a product reservation request through the target virtual network point corresponding to the target node under the condition that the reservation condition of the target virtual network point corresponding to the target node meets the reservation requirement and the product quantity of the target virtual network point corresponding to the target node is not less than the reservation quantity. The method can improve the processing efficiency of product reservation.

Description

Product reservation method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technology, and in particular, to a product reservation method, apparatus, computer device, storage medium, and computer program product.
Background
There are high concurrency situations in commercial banks for commemorative coin picking reservations, and distributed methods, such as using a cache server cluster to store the commemorative coin allowance of a website in real time, are generally chosen. The reservation priority of each network point is influenced by the distribution density of the population geographic position, the reservation access quantity of some large-scale urban network points is high, the reservation access quantity of some rural network points is low, and if some large-scale network points are managed by a certain cache server, the related server is easy to be impacted by flow. The high concurrency is difficult to manage the surplus of the commemorative coins of the website, not only the surplus is required to be managed, but also the reservation time of the client is required to be managed due to the carrying capacity of the website client. When a user inquires that a network point of a certain region of a city has residual commemorative coin allowance to initiate locking, the commemorative coin of the network point in the certain region is possibly locked by other users, so that the locking failure causes that the allowance inquiry needs to be initiated again, and customer dissatisfaction is caused. At high concurrency, the efficiency of processing product reservations is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a product reservation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the efficiency of product reservation processing.
In a first aspect, the present application provides a product reservation method. The method comprises the following steps:
generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring;
identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In one embodiment, a preset hash algorithm is adopted, a first hash value corresponding to each virtual dot is generated according to the product number and reservation conditions of each virtual dot, each first hash value is mapped to a hash ring, and before the first node of each virtual dot on the hash ring is obtained, the method further comprises:
according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained;
configuring the product quantity of each virtual website according to the total product quantity;
taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point;
taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point;
and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
In one embodiment, a preset hash algorithm is adopted, and a first hash value corresponding to each virtual dot is generated according to the product quantity and reservation conditions of each virtual dot, including:
According to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point;
based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point;
and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
In one embodiment, the reservation requirement includes a reservation region and a reservation time period, and the generating a second hash value according to the reservation number and the reservation requirement by adopting a preset hash algorithm includes:
acquiring a user identifier corresponding to a product reservation request;
and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
In one embodiment, processing a product reservation request through a target virtual network point corresponding to a target node includes:
updating the product quantity of the target virtual network point according to the reserved quantity;
And under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
In one embodiment, a method includes:
and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
In a second aspect, the application further provides a product reservation device. The device comprises:
the first mapping module is used for generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto the hash ring to obtain a first node of each virtual network point on the hash ring;
the second mapping module is used for responding to the received product reservation request, identifying the reservation quantity and reservation requirement in the product reservation request, adopting a preset hash algorithm, generating a second hash value according to the reservation quantity and the reservation requirement, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
The matching module is used for acquiring the first nodes one by one on the hash ring by taking the second node as a starting point according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and the processing module is used for stopping acquiring the first node and processing the product reservation request through the target virtual network point corresponding to the target node under the condition that the reservation condition of the target virtual network point corresponding to the target node meets the reservation requirement and the product quantity of the target virtual network point corresponding to the target node is not less than the reservation quantity.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring;
identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
On the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring;
identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
On the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring;
identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
On the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
The product reservation method, the device, the computer equipment, the storage medium and the computer program product adopt a preset hash algorithm, generate a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point, map each first hash value onto a hash ring, and obtain a first node of each virtual network point on the hash ring; identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring; on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired; and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes. According to the number of products managed by different time periods of each website, the website is mapped to the hash ring node, so that the mapping of the product reservation website and the consistency hash ring node is realized, the product reservation management is convenient, the hash value can be calculated on the hash ring according to various reservation demands of customers, the website meeting the demands is hit rapidly, and the processing efficiency of product reservation can be improved.
Drawings
FIG. 1 is an application environment diagram of a product reservation method in one embodiment;
FIG. 2 is a flow chart of a product reservation method in one embodiment;
FIG. 3 is a block diagram of a product reservation apparatus in one embodiment;
fig. 4 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The product reservation method provided by the embodiment of the application can be applied to computer equipment, and it can be understood that in the application environment shown in fig. 1, the computer equipment can be specifically a terminal 102 or a server 104. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a product reservation method is provided, and the method is applied to the server 104 in fig. 1 for illustration, and includes the following steps:
step 202, a preset hash algorithm is adopted, a first hash value corresponding to each virtual network point is generated according to the product quantity and reservation conditions of each virtual network point, and each first hash value is mapped to a hash ring to obtain a first node of each virtual network point on the hash ring.
The hash algorithm maps binary values of any length to binary values of a shorter fixed length, and the binary values of the fixed length obtained by the operation become hash values. Hash values are a unique and extremely compact representation of a piece of data. The virtual network points are logical child nodes after the product supply service capability mapping of the physical network points on the service platform is abstracted, each virtual network point is provided with a corresponding physical network point, and the physical network points are entity network points such as standardized branches, branch processing and saving places which are scattered in urban and rural street and sublevel, have fixed operation places and mainly provide face-to-face service for customers through bank teller.
Optionally, the server builds a consistent hash ring in advance, the number of nodes of the hash ring is 32 times 2, and the number is subtracted by 1 from 0 to 32 times 2. After the hash ring is constructed, a global unique ID can be configured for each virtual node according to the number of products available for reservation and reservation conditions of each virtual node, then a preset hash algorithm is adopted, a first hash value corresponding to each virtual node is calculated according to the global unique ID of each virtual node, and each first hash value is mapped onto the hash ring to obtain a first node of each virtual node on the hash ring.
In a possible implementation manner, when servers are allocated to the virtual nodes, the flow management can be performed according to the distribution density of the first node on the hash ring, that is, the distribution density of the virtual nodes on the hash ring is equal to that of the cache servers distributed to the designated number, or the single-instance management or multiple-instance management can be directly performed according to the situation, wherein the single-instance management is that all the virtual nodes are managed by one server, and the multiple-instance management can be that each server manages one virtual node but is not limited to. If the traffic distribution of some cache servers is uneven or the traffic reaches the peak value of all the cache servers and needs to newly add the cache servers, the node segmentation can be dynamically carried out on the virtual network points with higher access and then the virtual network points are distributed to the cache servers with lower load or newly added cache servers for management, or the attribution management servers of part of the virtual network points can be directly adjusted. The product management authority managed by each virtual network point is uniformly distributed to each cache server, and when the load balancing efficiency of each server needs to be dynamically adjusted, the management server of the virtual network point is only required to be adjusted, so that the virtual network point has better transverse capacity expansion capability.
Step 204, in response to the received product reservation request, identifying the reservation number and reservation requirement in the product reservation request, adopting a preset hash algorithm, generating a second hash value according to the reservation number and reservation requirement, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring.
The product reservation request is initiated by a user on the terminal, transmitted to the server and used for applying for requesting information for reserving a certain number of products.
Optionally, after receiving a product reservation request sent by a user terminal, the server identifies the reservation number and the reservation requirement selected by the user from the product reservation request, configures a user ID for the user according to the reservation number and the reservation requirement, then calculates a second hash value according to the user ID by adopting the same preset hash algorithm, and maps the second hash value to the hash ring to obtain a second node of the user on the hash ring.
Step 206, on the hash ring, the first nodes are acquired one by one according to the preset direction with the second node as a starting point, and each time a first node is acquired, the first node acquired currently is used as a target node.
The preset direction may be a clockwise direction or a counterclockwise direction, and in this embodiment, the preset direction is a clockwise direction.
Optionally, the server searches the first nodes one by one on the hash ring with the second node as a starting point in a clockwise direction, firstly searches the nearest first nodes, then obtains the product number and reservation conditions of the virtual nodes corresponding to the nodes, judges whether the product number and reservation conditions of the virtual nodes are completely matched with the reservation number and reservation requirements in the current product reservation request, if not, continues to search the second nearest first nodes, obtains the product number and reservation conditions of the virtual nodes corresponding to the nodes, judges whether the product number and reservation conditions of the virtual nodes are completely matched with the reservation number and reservation requirements in the current product reservation request, and if not, continues to search the next first node until a first node meeting the requirements is found.
And step 208, stopping obtaining the first node and processing the product reservation request through the target virtual network point corresponding to the target node under the condition that the reservation condition of the target virtual network point corresponding to the target node meets the reservation requirement and the product quantity of the target virtual network point corresponding to the target node is not less than the reservation quantity.
Optionally, in a general case, the reservation requirement includes multiple requirements, each requirement has a corresponding condition in reservation conditions, the server matches each of the reservation conditions and the reservation requirements, and determines that the reservation conditions of the target virtual network point meet the reservation requirements when each condition of the target virtual network point meets the corresponding requirement, if the product number of the target virtual network point is greater than or equal to the reservation number at the same time, the target virtual network point can process the product reservation request, and forwards the product reservation request to the cache server where the target virtual network point is located.
Correspondingly, under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, discarding the first node which is currently acquired, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
In one possible implementation manner, when the reservation condition of the target virtual network point corresponding to the target node meets the reservation requirement and the product number of the target virtual network point corresponding to the target node is not less than the reservation number, the product number preemption action is initiated, because the server may receive multiple product reservation requests at the same time, and accordingly, each first node may simultaneously receive multiple preemption actions. If the preemption is unsuccessful, the current target node is abandoned, and a next first node is acquired on the hash ring according to a preset direction and is used as a new target node; and if the preemption is successful, stopping acquiring the first node, and processing the product reservation request through the target virtual network point corresponding to the target node.
In the product reservation method, a preset hash algorithm is adopted, a first hash value corresponding to each virtual network point is generated according to the product quantity and reservation conditions of each virtual network point, and each first hash value is mapped to a hash ring to obtain a first node of each virtual network point on the hash ring; identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring; on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired; and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes. According to the number of products managed by different time periods of each website, the website is mapped to the hash ring node, so that the mapping of the product reservation website and the consistency hash ring node is realized, the product reservation management is convenient, the hash value can be calculated on the hash ring according to various reservation demands of customers, the website meeting the demands is hit rapidly, and the processing efficiency of product reservation can be improved.
In one embodiment, a preset hash algorithm is adopted, a first hash value corresponding to each virtual dot is generated according to the product quantity and reservation conditions of each virtual dot, each first hash value is mapped to a hash ring, and before the first node of each virtual dot on the hash ring is obtained, the method further comprises: according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
Correspondingly, a preset hash algorithm is adopted, and a first hash value corresponding to each virtual network point is generated according to the product quantity and reservation conditions of each virtual network point, including: according to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
Further, the reservation requirement includes a reservation zone and a reservation time period, and the generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm includes: acquiring a user identifier corresponding to a product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
Alternatively, take the business of commercial bank management commemorative coin reservation as an example:
commercial banks pre-distribute daily commemorative coins at the website. Dividing all physical net points in a zone into a plurality of virtual net point nodes according to the number of the commemorative coins allocated to each net point on the same day and a certain number of the virtual net point nodes by average slices, and meanwhile, distributing a global unique ID to each zone, wherein the composition rules are as follows: the division range + physical network point number (corresponding to physical network point identifier) +virtual network point identifier (corresponding to virtual network point identifier) +number of commemorative coins + reserved time period may be referred to as virtual branch id.
When a client applies for a commemorative coin of a website in a certain zone, a hash value is generated after key words such as a client identification card number (equivalent to a user identification), a reserved zone, a reserved period, a reserved quantity and the like are connected in series and can be recorded as a customerHashID. In order to prevent the generation of fragment nodes, the number of reserved commemorative coins by a customer is set to be a fixed value, and the number of reserved commemorative coins can be divided by the total number of the commemorative coins managed by each virtual net point, for example, the customer can only initiate reservation of 20 commemorative coins each time, and each virtual net point node manages the release work of 2000 commemorative coins.
After constructing the hash ring, calculating a hash value brnoHashID according to the virtual BranchID, and mapping the hash value brnoHashID onto the hash ring, namely marking the virtual BranchID for the hash ring node with the corresponding value; or uniformly distributing the virtual node points to a certain untagged node point of the hash ring according to the actual physical node point bearing capacity.
The virtual brnohasid is to virtually divide the service capability of the website into a plurality of virtual service capability nodes according to the number and the time period, and determine the virtual service website by using a unique identifier (i.e. candidate key) so as to uniformly map the service capability of the website to the hash ring. The more virtual dots are distributed on the hash ring, the more average the distribution is, the more the function of balance solving can be embodied, so that the dot service capability is required to be thin in slices to a certain extent, the number of the virtual dots is more, and the composition rule is exemplified as follows: virtual brnohashid=physical network number+mesh point service capability slice number, or virtual brnohashid=physical network number+mesh point service capability slice number+management commemorative coin number+service period.
The customerhashID is to determine the client's requirements with a unique identification (i.e., candidate key) to map the client's requirements to a hash ring. According to the service requirement of the customer, the method mainly comprises the area where the website is located, the reservation period and the number of commemorative coins, so that the following candidate key composition rules are directly defined for identifying the requirement of the customer in a certain commemorative coin reservation activity, and the composition rules are exemplified as follows: customerhashtid = customer identification number + site number + reservation period + commemorative coin demand number, where "+" represents a string directly concatenated. By value= Hash (customerHashID), the customer requirements can be uniquely mapped to a certain node of the hash ring space.
In this embodiment, according to the number of products managed by different periods of each website, the website is mapped to the hash ring node, so that mapping between the product reservation website and the consistent hash ring node is realized, product reservation management is facilitated, hash values can be calculated on the hash ring according to various reservation demands of customers to quickly hit the website meeting the demands, and the processing efficiency of product reservation can be improved.
In one embodiment, processing a product reservation request through a target virtual mesh point corresponding to a target node includes: updating the product quantity of the target virtual network point according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
Optionally, the server starts from the second node, clockwise searches for the first node with all the latest reservation conditions meeting the reservation requirements of the client, and after determining that the target node meets the requirements, deducts and updates the product quantity of the relevant virtual network points on the cache server of the management target node and records the log. If the number of products of the related virtual network points is 0, the first node corresponding to the virtual network point is logged out from the hash ring. If one virtual node has the conditions that the locked product quantity is abandoned and taken, the client cancels reservation and the product quantity is newly increased, the corresponding first node of the virtual node can be dynamically increased on the hash ring.
In this embodiment, according to the number of products of each virtual website, the first node on the hash ring is updated in real time, so that a client can be matched with a suitable virtual website at the first time, product reservation is completed, and the processing efficiency of product reservation can be improved.
In one embodiment, a product reservation method includes:
according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
According to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point. And mapping each first hash value to the hash ring to obtain a first node of each virtual network point on the hash ring.
In response to receiving a product reservation request, a reservation quantity and a reservation demand in the product reservation request are identified, the reservation demand including a reservation zone and a reservation period. Acquiring a user identifier corresponding to a product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value. And mapping the second hash value to the hash ring to obtain a second node on the hash ring.
On the hash ring, taking a second node as a starting point, acquiring first nodes one by one in a clockwise direction, and taking the first node acquired currently as a target node when one first node is acquired;
and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
And under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes. Updating the product quantity of the target virtual network point according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a product reservation device for realizing the related product reservation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiment of one or more product reservation devices provided below may refer to the limitation of the product reservation method hereinabove, and will not be repeated here.
In one embodiment, as shown in FIG. 3, there is provided a product reservation apparatus 300 comprising: a first mapping module 301, a second mapping module 302, a matching module 303, and a processing module 304, wherein:
the first mapping module 301 is configured to generate a first hash value corresponding to each virtual dot according to the product number and the reservation condition of each virtual dot by adopting a preset hash algorithm, and map each first hash value onto a hash ring to obtain a first node of each virtual dot on the hash ring;
the second mapping module 302 is configured to identify, in response to a received product reservation request, a reservation number and a reservation requirement in the product reservation request, generate a second hash value according to the reservation number and the reservation requirement by adopting a preset hash algorithm, and map the second hash value onto the hash ring to obtain a second node on the hash ring;
the matching module 303 is configured to acquire first nodes one by one on the hash ring with the second node as a starting point according to a preset direction, and take the first node currently acquired as a target node when one first node is acquired;
and the processing module 304 is configured to stop acquiring the first node and process the product reservation request through the target virtual node corresponding to the target node when the reservation condition of the target virtual node corresponding to the target node meets the reservation requirement and the product number of the target virtual node corresponding to the target node is not less than the reservation number.
In one embodiment, the apparatus further comprises:
the dot division module 305 is configured to perform virtual dot division on the physical dots according to the total product number of the physical dots, so as to obtain a plurality of virtual dots corresponding to the physical dots; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
In one embodiment, the first mapping module 301 is further configured to obtain, according to the physical mesh point corresponding to each virtual mesh point, a physical mesh point identifier corresponding to each virtual mesh point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
In one embodiment, the second mapping module 302 is further configured to obtain a user identifier corresponding to the product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
In one embodiment, the processing module 304 is further configured to update the product quantity of the target virtual website according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
In an embodiment, the matching module 303 is further configured to discard the currently acquired first node when the reservation condition of the target virtual node corresponding to the target node does not meet the reservation requirement or the product number of the target virtual node corresponding to the target node is smaller than the reservation number, and acquire the next first node on the hash ring according to the preset direction as a new target node.
The respective modules in the product reservation device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data such as the product quantity of each virtual website. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a product reservation method.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 4 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring; identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring; on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired; and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In one embodiment, the processor when executing the computer program further performs the steps of: according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
In one embodiment, the processor when executing the computer program further performs the steps of: according to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a user identifier corresponding to a product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
In one embodiment, the processor when executing the computer program further performs the steps of: updating the product quantity of the target virtual network point according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
In one embodiment, the processor when executing the computer program further performs the steps of: and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring; identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring; on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired; and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In one embodiment, the computer program when executed by the processor further performs the steps of: according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
In one embodiment, the computer program when executed by the processor further performs the steps of: according to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a user identifier corresponding to a product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
In one embodiment, the computer program when executed by the processor further performs the steps of: updating the product quantity of the target virtual network point according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
In one embodiment, the computer program when executed by the processor further performs the steps of: and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of: generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring; identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, generating a second hash value according to the reservation quantity and the reservation requirement by adopting a preset hash algorithm, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring; on the hash ring, taking a second node as a starting point, acquiring first nodes one by one according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired; and under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not less than the reservation quantity, stopping acquiring the first node, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
In one embodiment, the computer program when executed by the processor further performs the steps of: according to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, and a plurality of virtual network points corresponding to the physical network points are obtained; configuring the product quantity of each virtual website according to the total product quantity; taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point; taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point; and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
In one embodiment, the computer program when executed by the processor further performs the steps of: according to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point; based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point; and carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification, the product number and the reserved time period of each virtual network point to obtain a first hash value corresponding to each virtual network point.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a user identifier corresponding to a product reservation request; and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting a preset hash algorithm to obtain a second hash value.
In one embodiment, the computer program when executed by the processor further performs the steps of: updating the product quantity of the target virtual network point according to the reserved quantity; and under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
In one embodiment, the computer program when executed by the processor further performs the steps of: and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to the preset direction to serve as a new target node.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method of product reservation, the method comprising:
generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value to a hash ring to obtain a first node of each virtual network point on the hash ring;
Identifying the reservation quantity and the reservation requirement in the product reservation request in response to the received product reservation request, adopting the preset hash algorithm, generating a second hash value according to the reservation quantity and the reservation requirement, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
on the hash ring, the second node is taken as a starting point, first nodes are acquired one by one according to a preset direction, and each time a first node is acquired, the first node acquired at present is taken as a target node;
and stopping acquiring the first node under the condition that the reservation conditions of the target virtual network points corresponding to the target nodes meet the reservation requirements and the product quantity of the target virtual network points corresponding to the target nodes is not smaller than the reservation quantity, and processing the product reservation request through the target virtual network points corresponding to the target nodes.
2. The method of claim 1, wherein the generating, by using a preset hash algorithm, a first hash value corresponding to each virtual dot according to the number of products and a reservation condition of each virtual dot, and mapping each first hash value to a hash ring, so as to obtain before a first node of each virtual dot on the hash ring, further comprises:
According to the total product quantity of the physical network points, virtual network point division is carried out on the physical network points, so that a plurality of virtual network points corresponding to the physical network points are obtained;
configuring the product quantity of each virtual website according to the total product quantity;
taking the region range of the physical network point as the region range of each virtual network point corresponding to the physical network point;
taking the reserved time period of the physical network point as the reserved time period of each virtual network point corresponding to the physical network point;
and taking the zone range to which each virtual net point belongs and the reservation time period of each virtual net point as reservation conditions of each virtual net point.
3. The method of claim 2, wherein the generating, by using a preset hash algorithm, the first hash value corresponding to each virtual dot according to the product number and the reservation condition of each virtual dot includes:
according to the physical network point corresponding to each virtual network point, obtaining the physical network point identifier corresponding to each virtual network point;
based on the division relationship between the virtual network points and the physical network points, obtaining the virtual network point identification of each virtual network point;
And carrying out hash operation according to the physical network point identification corresponding to each virtual network point, the region range to which each virtual network point belongs, the virtual network point identification of each virtual network point, the product quantity and the reserved time period by adopting the preset hash algorithm, and obtaining a first hash value corresponding to each virtual network point.
4. The method of claim 1, wherein the reservation requirement includes a reservation compartment and a reservation time period, wherein the employing the preset hash algorithm to generate a second hash value based on the reservation number and the reservation requirement comprises:
acquiring a user identifier corresponding to the product reservation request;
and carrying out hash operation according to the user identification corresponding to the product reservation request, the reservation number, the reservation zone and the reservation time period by adopting the preset hash algorithm to obtain the second hash value.
5. The method of claim 1, wherein the processing the product reservation request through the target virtual mesh point corresponding to the target node comprises:
updating the product quantity of the target virtual network point according to the reserved quantity;
And under the condition that the product quantity of the target virtual network point is 0, logging off the target node on the hash ring.
6. The method according to claim 1, characterized in that the method comprises:
and discarding the first node which is currently acquired under the condition that the reservation condition of the target virtual network point corresponding to the target node does not meet the reservation requirement or the product quantity of the target virtual network point corresponding to the target node is smaller than the reservation quantity, and acquiring the next first node on the hash ring according to a preset direction to serve as a new target node.
7. A product reservation device, the device comprising:
the first mapping module is used for generating a first hash value corresponding to each virtual network point according to the product quantity and reservation conditions of each virtual network point by adopting a preset hash algorithm, and mapping each first hash value onto a hash ring to obtain a first node of each virtual network point on the hash ring;
the second mapping module is used for responding to the received product reservation request, identifying the reservation quantity and reservation requirement in the product reservation request, adopting the preset hash algorithm, generating a second hash value according to the reservation quantity and the reservation requirement, and mapping the second hash value onto the hash ring to obtain a second node on the hash ring;
The matching module is used for acquiring first nodes one by one on the hash ring by taking the second node as a starting point according to a preset direction, and taking the first node acquired currently as a target node when one first node is acquired;
and the processing module is used for stopping acquiring the first node and processing the product reservation request through the target virtual network point corresponding to the target node under the condition that the reservation condition of the target virtual network point corresponding to the target node meets the reservation requirement and the product quantity of the target virtual network point corresponding to the target node is not less than the reservation quantity.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311013314.0A 2023-08-11 2023-08-11 Product reservation method, device, computer equipment and storage medium Pending CN117035135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311013314.0A CN117035135A (en) 2023-08-11 2023-08-11 Product reservation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311013314.0A CN117035135A (en) 2023-08-11 2023-08-11 Product reservation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117035135A true CN117035135A (en) 2023-11-10

Family

ID=88631264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311013314.0A Pending CN117035135A (en) 2023-08-11 2023-08-11 Product reservation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117035135A (en)

Similar Documents

Publication Publication Date Title
US9454558B2 (en) Managing an index of a table of a database
CN105100146B (en) Date storage method, apparatus and system
CN103312624A (en) Message queue service system and method
US11797559B2 (en) System and method for real time data aggregation in a virtual cube in a multidimensional database environment
CN111241350A (en) Graph data query method and device, computer equipment and storage medium
CN110036381B (en) In-memory data search technique
CN111400301B (en) Data query method, device and equipment
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CA2846717A1 (en) Systems and methods for managing large volumes of data in a digital earth environment
CN107276914B (en) Self-service resource allocation scheduling method based on CMDB
CN109271438B (en) Database access method and system
CN117035135A (en) Product reservation method, device, computer equipment and storage medium
CN112817980B (en) Data index processing method, device, equipment and storage medium
CN106326295A (en) Method and device for storing semantic data
US20170147393A1 (en) Cache-efficient system for two-phase processing
Abawajy et al. A framework for scalable distributed provenance storage system
CN115408396B (en) Method, device, computer equipment and storage medium for storing business data
US11841857B2 (en) Query efficiency using merged columns
CN113609130B (en) Method, device, electronic equipment and storage medium for acquiring gateway access data
CN113419671B (en) Personal data space access control method
CN116578571A (en) Method, device, computer equipment and storage medium for updating guest group data
WO2023184562A1 (en) System and methods for auditable data management
CN117632470A (en) Service processing method, device, equipment, storage medium and program product
CN115794807A (en) Data updating method, device, equipment, storage medium and computer program product
CN117648336A (en) Data query method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination