Order query method, device, system and computer-readable storage medium
By using the intermediate dataset in the order query system to lock the target order data, the repeated order problem caused by multi -user login is solved, and the query efficiency and data security are improved.
Patent Information
- Application Number
- CN202011185626.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-10-30
AI Technical Summary
In the case of multi-user login, order queries and operations may lead to repeated ordering problems, wasting computing resources and potentially causing economic losses.
By loading the order data of the un order into the intermediate dataset, and locking the target order data of the intermediate data set, avoid repeated query and operation.
Effectively avoid the problem of repeating orders caused by multi -user login, improve data query efficiency, and ensure data security.
Smart Images

Figure CN114443937B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data query, and in particular to an order query method, device, system and computer-readable storage medium. Background Art
[0002] Currently, performing operations based on queried data is a common way of using database data. However, in some specific scenarios, repeated queries and operations will lead to repeated operations, which not only wastes computing resources, but may also lead to problems such as repeated processing caused by repeated operations.
[0003] Taking the order aggregation service platform for WeChat business, consignment, and multi-level distribution scenarios as an example, the merchant is a multi-level agent model, in which the first-level merchant needs to operate all orders submitted by the lower-level agents to obtain waybills or place orders. Due to the large order volume, the same-level merchant allows multiple employees to log in to the account to obtain waybills and place orders for the orders submitted by the lower-level agents. This will not only operate on the same data, but also obtain waybills and place orders for the same data multiple times, causing customers to place repeated orders or wrong orders, and ultimately causing economic losses.
[0004] Therefore, how to solve the problem of repeated orders caused by multiple users logging in to query and operate orders has become the direction of efforts of technical personnel in this field. Summary of the invention
[0005] The present application provides an order query method, device, system and computer-readable storage medium, which are intended to solve the problem of duplicate orders caused by multiple users logging in to query and operate order. The present application avoids duplicate queries to obtain query results by loading unordered order data into an intermediate data set and locking the target order data of the intermediate data set for query, thereby avoiding the problem of duplicate orders caused by multiple users logging in to query and operate order.
[0006] In a first aspect, the present application provides an order query method, the method comprising:
[0007] Receive a user query request, the user query request carries an order query field and user data, the order queried by the user query request is stored in an order data set, and the order data set includes the order data of the placed order and the order data of the unplaced order;
[0008] Determine the intermediate query address corresponding to the user data;
[0009] Based on the intermediate query address, query the order data corresponding to the order query field in the intermediate data set to obtain the target order data, wherein the intermediate data set is constructed by the order data that has not been placed in the order data set;
[0010] Lock the target order data in the intermediate data set and return the query results based on the target order data.
[0011] In summary of the first aspect of the present application, in a first possible implementation of the first aspect of the present application, before locking the target order data and returning the query result based on the target order data, the method further includes:
[0012] Check whether the target order data is locked in the current time period;
[0013] If not, it triggers locking of target order data;
[0014] If yes, a prompt message is returned.
[0015] Based on the first aspect of the present application, in a second possible implementation manner of the first aspect of the present application, the user data includes a user identifier and a user name, and determining the intermediate query address corresponding to the user data includes:
[0016] Encrypt the user ID and user name to obtain the user key;
[0017] The intermediate query address corresponding to the user key is queried in the cache space, wherein the cache space is used to store the intermediate query addresses corresponding to different user keys.
[0018] Based on the first aspect of the present application, in a third possible implementation manner of the first aspect of the present application, the cache space is specifically used to store key-value pair data consisting of different user keys and different intermediate query addresses, and querying the intermediate query address corresponding to the user key in the cache space includes:
[0019] In the cache space, query the target key-value pair data that matches the user key;
[0020] Read the value data in the target key-value pair data as the intermediate query address.
[0021] Based on the first aspect of the present application, in a fourth possible implementation of the first aspect of the present application, the method further includes:
[0022] Different users are classified and processed to obtain multiple user sets;
[0023] Assign a corresponding intermediate data set to each user set.
[0024] Based on the first aspect of the present application, in a fifth possible implementation of the first aspect of the present application, after the target order data is fed back as a query result, the method further includes:
[0025] Receiving a user order request, wherein the user order request is used to request an order operation for target order data;
[0026] After the target order data is placed, the target order data on which the order operation has been performed in the intermediate data set is deleted, and the state of the order data corresponding to the target order data in the order data set is modified to the ordered state.
[0027] Based on the first aspect of the present application, in the sixth possible implementation of the first aspect of the present application, the query request is specifically used to request to query the logistics waybill data corresponding to the query field, and the order data is specifically the logistics waybill data.
[0028] In a second aspect, the present application provides an order query device, the device comprising:
[0029] A receiving module receives a user query request, the user query request carries an order query field and user data, and the order queried by the user query request is stored in an order data set, and the order data set includes the order data of the placed order and the order data of the unplaced order;
[0030] An address query module, used to determine the intermediate query address corresponding to the user data;
[0031] The data query module is used to query the order data corresponding to the order query field in the intermediate data set based on the intermediate query address to obtain the target order data, where the intermediate data set is constructed by the unordered order data in the order data set.
[0032] The result returning module locks the target order data in the intermediate data set and returns the query results based on the target order data.
[0033] In a third aspect, the present application provides an order query system, the system comprising:
[0034] one or more processors;
[0035] Memory; and
[0036] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the order query method described in the first aspect.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in the data query method described in the first aspect.
[0038] From the above content, it can be concluded that the present application has the following beneficial effects:
[0039] The present application avoids repeated queries to obtain query results by loading unordered order data into an intermediate data set and locking the target order data in the query intermediate data set, thereby avoiding the problem of repeated orders caused by multiple users logging in to query and operate orders.
[0040] At the same time, since this application always queries the intermediate data set and does not operate on the target data set, the data security of the target data set is guaranteed. Moreover, since the intermediate data set consists of order data that has not been placed, each query does not need to traverse the target data set with a large amount of data, thereby improving data query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a scenario diagram of an order query application system provided by an embodiment of the present application;
[0042] Figure 2 It is a flowchart of the order query method provided in the embodiment of the present application;
[0043] Figure 3 This is a schematic diagram of a scenario for determining an intermediate query address provided in an embodiment of the present application;
[0044] Figure 4 is a schematic diagram of a process for allocating intermediate data sets provided in an embodiment of the present application;
[0045] Figure 5 It is a structural diagram of an order query device provided in an embodiment of the present application;
[0046] Figure 6 It is a structural diagram of the order query system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0048] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0049] The embodiments of the present application provide an order query method, device, system, and computer-readable storage medium, which are described in detail below.
[0050] First, see Figure 1 , Figure 1 A scenario diagram of an order query application system in an embodiment of the present application is shown.
[0051] In the present application, the order query application system is a system used to avoid repeated queries on order data. For example, the order query application system can be applied to the express delivery industry to avoid the first-level merchants in the distribution scenario from repeatedly querying and placing orders for express orders submitted by the lower-level agent merchants, which ultimately causes economic losses; for another example, the order query application system can also be applied to the e-commerce industry, where merchants repeatedly query and place orders for orders submitted by users. It is worth noting that the above-mentioned application scenarios of the order query application system are only illustrative examples. In addition, the order query application system can also be used in various industries such as economy, culture, education, medical care, and public management to avoid repeated queries on order data.
[0052] In some embodiments, the order query application system may include a server 110, a network 120, a target storage device 130, an intermediate storage device 140, and a query terminal 150. In some embodiments, the order query application system may copy the order data required for the order operation into the intermediate storage device 140, and then query the data of the intermediate storage device 140 and lock it to avoid repeated queries on the order data.
[0053] The server 110 processes data and / or information from at least one component of the order query application system or an external data source (e.g., the target storage device 130, the query terminal 150). For example, the server 110 can obtain order data from the target storage device 130 and copy the order data to the intermediate storage device 140. For another example, the server 110 can obtain a query request from the query terminal 150, query in the intermediate storage device 140 and lock the query data. In some embodiments, the server 110 can be a single server or a server group. The server group can be a centralized server group connected to the network 120 via an access point, or a distributed server group connected to the network 120 via at least one access point. In some embodiments, the server 110 can be locally connected to the network 120 or remotely connected to the network 120. For example, the server 110 can access information and / or data stored in the target storage device 130 via the network 120. In some embodiments, the server 110 can be implemented on a cloud platform. As an example only, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc. or any combination thereof.
[0054] The network 120 connects the components of the order query application system so that the components can communicate with each other to facilitate the exchange of information and / or data. In some embodiments, at least one component in the order query application system (e.g., server 110, target storage device 130, intermediate storage device 140, query terminal 150) can send information and / or data (e.g., order data) to other components in the order query application system via the network 120. In some embodiments, the network between the components in the order query application system can be any one or more of a wired network or a wireless network. For example, the network 120 can include a cable network, a wired network, an optical fiber network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network (Bluetooth), a ZigBee network (ZigBee), a near field communication (NFC), an in-device bus, an in-device line, a cable connection, etc., or any combination thereof. The network connection between each two parts may adopt one of the above methods or multiple methods.
[0055] The target storage device 130 stores data and / or instructions. In some embodiments, the target storage device 130 stores order data, such as the original order data submitted by the lower-level agent merchant to the first-level merchant. In some embodiments, the target storage device 130 can store data and / or instructions that can be executed by the server 110. In some embodiments, the target storage device 130 may include a large-capacity memory, a removable memory, a volatile read-write memory, a read-only memory (ROM), etc. or any combination thereof. Exemplary large-capacity memory may include a disk, an optical disk, a solid-state disk, etc. Exemplary removable memory may include a flash drive, a floppy disk, an optical disk, a memory card, a compressed disk, a magnetic tape, etc. Exemplary volatile read-write memory may include a random access memory (RAM). Exemplary RAM may include Dynamic Random Access Memory (DRAM), Double-Data-Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Static Random Access Memory (SRAM), Thyristor Random Access Memory (T-RAM), Zero Capacitance Random Access Memory (Z-RAM), etc. Exemplary read-only memory may include Masked Read Only Memory (MROM), Programmable Read Only Memory (PROM), Erasable Programmable Read Only Memory (PEROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disk Read-Only Memory, etc. In some embodiments, the target storage device 130 may be implemented on a cloud platform. By way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc., or any combination thereof.
[0056] The intermediate storage device 140 stores the order data that the user directly queries and needs to place an order, wherein the data of the intermediate storage device 140 comes from the target storage device 130, so as to lock the data stored in the intermediate storage device 140, avoid directly querying the target storage device 130 and repeatedly querying the data of the intermediate storage device 140. In some embodiments, the intermediate storage device 140 may include a large-capacity memory, a removable memory, a volatile read-write memory, a read-only memory, etc., or any combination thereof.
[0057] The query terminal 150 may send a query request and an order request to the order query application system. In some embodiments, the owner of the query terminal 150 may be a staff member (e.g., a staff member of a primary merchant), a user (e.g., an online shopping user), etc. In some embodiments, the query terminal 150 may have an information receiving and / or sending function so that the query terminal 150 receives the query results and initiates an order request based on the query results. In some embodiments, in some embodiments, the query terminal 150 may be a plurality of terminals 151, 152, 153, ... For example, the query terminal 150 may include a mobile device 151, a tablet computer 152, a laptop computer 153, etc. or any combination thereof.
[0058] It should be noted that the above description of the order query application system is only for example and explanation, and does not limit the scope of application of the present application. For those skilled in the art, various modifications and changes can be made to the order query application system under the guidance of the present application, however, these modifications and changes are still within the scope of the present application.
[0059] Next, we will introduce the order query method provided by this application.
[0060] First, see Figure 2 , Figure 2 This is a flow chart of an order query method in an embodiment of the present application, and the order query method includes:
[0061] Step S210, receiving a user query request, the user query request carries an order query field and user data, the order queried by the user query request is stored in an order data set, the order data set includes the order data of the placed order and the order data of the unplaced order;
[0062] A user query request refers to a request sent by a user query terminal to the server 110 for order query, wherein the user query request carries an order query field and user data. Specifically, the order query field refers to a field stored in an order, such as a unique identification number (order number), etc., and the user data is user-related data, such as a user identifier (user ID) and a user name (login account), etc. In some embodiments of the present application, the query request is specifically used to request the logistics waybill data corresponding to the query field, and the order data is specifically the logistics waybill data.
[0063] The orders requested by the user are stored in an order data set, where an order data set refers to a set consisting of multiple order data. For example, the order data in the target storage device 130 can constitute an order data set. In some specific embodiments, the order data set can refer to a database for order storage, such as Mysql, Oracle database, etc. Specifically, the order data set can include both ordered order data and unordered order data, so that the unordered order data in the order data set can be filtered out and entered into the intermediate storage device 140 to avoid directly querying the target storage device 130, thereby ensuring the data security of the target storage device 130. At the same time, the unordered order data can be filtered out and entered into the intermediate storage device 140 to avoid directly traversing the entire order data set and improving the data query efficiency.
[0064] Step S220, determining the intermediate query address corresponding to the user data;
[0065] The intermediate query address refers to the query address corresponding to the intermediate data set, wherein the intermediate data set is a collection of data directly queried by the user request, such as a collection of data stored in the intermediate storage device 140. Specifically, the intermediate data set is constructed from the unordered order data in the order data set to facilitate fast and secure query of the unordered order data. In some embodiments of the present application, the intermediate data set may refer to a database for storing unordered orders, such as a Mysql or Oracle database. In some other embodiments of the present application, the intermediate data set may be a message middleware that stores unordered order data, such as a message queue.
[0066] In some embodiments of the present application, for example, in an embodiment where the intermediate data set refers to a database for order storage, the intermediate query address may be address information including an IP address, a database port, and a data table name. In other embodiments of the present application, for example, in an embodiment where the intermediate data set refers to a message middleware, the intermediate query address may be address information including an IP address and a message middleware port.
[0067] Specifically, the user data may be encrypted to obtain a user key, and then the intermediate query address corresponding to the user key may be queried in the cache space to finally obtain the intermediate query address corresponding to the user data, wherein the cache space is used to store the intermediate query addresses corresponding to different user keys.
[0068] Step S230, based on the intermediate query address, query the order data corresponding to the order query field in the intermediate data set to obtain the target order data, wherein the intermediate data set is constructed by the order data that has not been placed in the order data set;
[0069] After obtaining the intermediate query address, the order data corresponding to the order query field can be queried in the intermediate data set to obtain the target order data, wherein the target order data refers to the order data corresponding to the query field. Specifically, the order data corresponding to the order query field can be queried in the intermediate data set by traversing each order data in the intermediate data set and comparing it with the order query field to finally obtain the target order data. At the same time, since the intermediate data set is constructed by the order data that has not been placed in the order data set, the data traversed during the query process is reduced, thereby improving the query efficiency of the target order data.
[0070] Step S240, locking the target order data in the intermediate data set, and returning the query result based on the target order data;
[0071] After the target order data is obtained through query, the target order data can be locked to prevent other query requests from querying the target order data again. Specifically, locking the target order data in the intermediate data set can refer to locking the target order data for read and write functions. For example, an exclusive lock can be added to the target order data. An exclusive lock means that only the current request can read the data, and other requests cannot read or perform update operations.
[0072] After locking the target order data, the query results can be returned based on the target order data, wherein the query results may include one or more order data, so as to facilitate batch query, batch locking and return of batch order data query results.
[0073] In some embodiments, before locking the target order data and returning the query results based on the target order data, it is also possible to detect whether the target order data is in a locked state in the current time period, so as to avoid continuing to lock the locked target order data and return the query results. Specifically, if it is detected that the target order data is not in a locked state in the current time period, it can trigger the locking of the target order data to avoid other query requests to query the target order data again; if it is detected that the target order data is in a locked state in the current time period, a prompt message can be returned to indicate that the order is being queried, and it is possible to place an order based on the query results, and the order cannot be operated again, so as to avoid the staff from placing repeated orders for the target order data due to repeated queries.
[0074] After completing the user query request and returning the query result to the user terminal 150, in order to place an order according to the query result, the user terminal 150 will also initiate a user order request. Therefore, the server 110 will also perform the following steps according to the user order request:
[0075] Step S250, receiving a user order request, wherein the user order request is used to request an order operation for target order data.
[0076] Step S260, after the target order data is subjected to the order placement operation, the target order data subjected to the order placement operation in the intermediate data set is deleted, and the state of the order data corresponding to the target order data in the order data set is modified to the state of having been subjected to the order placement operation.
[0077] After placing an order for the target order data according to the user's order request, the target order data that has been placed in the intermediate data set can be deleted to ensure that the intermediate data set only retains the order data that has not been placed, improve the query rate of the unordered order data, and avoid repeated queries for the ordered data in the intermediate data set. At the same time, the state of the order data corresponding to the target order data in the order data set can also be modified to the ordered state, avoiding the addition of the order data that is displayed as unordered but actually ordered to the intermediate data set during the update of the intermediate data set data, and ensuring the consistency of the order data in the order data set.
[0078] It is worth noting that the above description of the order query method is only for example and explanation, and does not limit the scope of application of this application. For those skilled in the art, various modifications and changes can be made to the order query application system under the guidance of this application. For example, locking the target order data can also be achieved in other ways. For example, after the target order data is obtained by the first query, the lock mark of the target order data is changed. For example, the unlocked state of 0 is changed to the locked state of 1. When other query requests query the target order data again, since the target order data is in the locked state of 1, the query result of the target order data cannot be returned.
[0079] Continue reading Figure 3 , Figure 3 A flow chart of determining an intermediate query address in an embodiment of the present application. In some embodiments, user data includes a user identifier and a user name, and determining the intermediate query address corresponding to the user data may include:
[0080] Step S310, encrypt the user ID and user name to obtain a user key;
[0081] The user identifier may refer to the identification information of the user in the server, such as the user's unique identification number (user ID). The user name refers to the name of the user's login, that is, the user account. In some embodiments, the user identifier and the user name can be obtained by recording and saving when the user logs in, for example, the session information (Session) of the user's login can be saved in the Redis cache.
[0082] After obtaining the user identification and user name, the user identification and user name can be encrypted to obtain the user key, wherein the user key can be a key for obtaining the intermediate query address corresponding to the user. In some embodiments of the present application, for example, for embodiments in which the user cannot log in repeatedly, the user key and the intermediate query address can be a many-to-one relationship, that is, the user keys corresponding to multiple accounts with query permissions correspond to one intermediate query address, so that in a multi-level distribution scenario, different accounts can perform order query and order placement operations at the same time. In some other embodiments of the present application, for example, for embodiments in which the user can log in repeatedly, the user key and the intermediate query address can be a one-to-one relationship, that is, the user key corresponding to an account with query permissions and can log in repeatedly corresponds to one intermediate query address, so that in a multi-level distribution scenario, the same account can perform order query and order placement operations at the same time.
[0083] Specifically, the user identification and the user name may be encrypted by using encryption algorithms such as BASE64, SHA1, SHA224, SHA256, SHA384, SHA512, and MD5.
[0084] Step S320: query the intermediate query address corresponding to the user key in the cache space, wherein the cache space is used to store the intermediate query addresses corresponding to different user keys respectively.
[0085] The cache space refers to a storage space for storing intermediate query addresses corresponding to different user keys. Exemplarily, the cache space may refer to a Redis cache space. In some specific embodiments of the present application, the cache space may store key-value pair data consisting of different user keys and different intermediate query addresses, that is, key-value data consisting of user keys and intermediate query addresses. Specifically, querying the intermediate query address corresponding to the user key in the cache space may be querying the target key-value pair data that matches the user key in the cache space, and then reading the value data in the target key-value pair data as the intermediate query address. Exemplarily, the key-value pair data in the cache space may be traversed to match the user key with the key data of each traversed key-value pair data. If the match is successful, the target key-value pair data is obtained, and finally the value data in the target key-value pair data is read as the intermediate query address.
[0086] It is worth noting that the above description of the method for determining the intermediate query address is only for example and explanation, and does not limit the scope of application of this application. For those skilled in the art, various modifications and changes can be made to the order query application system under the guidance of this application, for example, the cache space can also be used to store a database of intermediate query addresses corresponding to different user keys.
[0087] Continue reading Figure 4 , Figure 4 A schematic diagram of a process for allocating an intermediate data set in an embodiment of the present application is shown. Determining the intermediate data set may include:
[0088] Step S410, classifying different users to obtain multiple user sets;
[0089] In some embodiments of the present application, for example, in a multi-level distribution scenario, the same first-level merchant allows multiple employees to query and process orders, that is, multiple users are required to use the query terminal 150 to initiate query requests and order requests to the server at the same time, so different users can be classified and processed to obtain multiple user sets, where each user set corresponds to an intermediate data set, so that users in the user set have query permissions for the same intermediate data set. Specifically, classifying different users can refer to unifying the users owned by employees under the same first-level merchant into one user set.
[0090] Step S420: Allocate a corresponding intermediate data set to each user set.
[0091] After obtaining multiple user sets, a corresponding intermediate data set can be allocated to each user set. Specifically, the intermediate query address of the intermediate data set and each user data corresponding to the user set can be stored in the cache space, and finally the allocation of the intermediate data set corresponding to each user set is completed, so that the user can obtain the intermediate query address through the cache space and then query. In some embodiments of the present application, when each user logs in, the user data can be obtained through the logged-in session information (Session information), and then the user data and the intermediate query address are stored in the cache space to complete the allocation of the intermediate data set for the user. In some other embodiments of the present application, when each user logs in, it can also be determined whether the user data has a corresponding intermediate query address. If the intermediate query address is empty, it means that the intermediate data set corresponding to the user has not been created, so the intermediate data set can be created, and the intermediate query address and the user data can be stored in the cache space.
[0092] In some embodiments of the present application, the data of the intermediate data set can also be updated so that the latest unordered order data is always retained in the intermediate data set. Specifically, the data of the intermediate data set can be updated each time a query request is received, that is, the newly added unordered order data in the order data set is added to the intermediate data set, so that each query request can query the latest unordered order data, ensuring the integrity of the intermediate data set. In some other embodiments of the present application, when the intermediate data set is empty, the data of the intermediate data set can also be supplemented according to the order data set, so that the intermediate data set has unordered order data each time a query is made.
[0093] It is worth noting that the above description of the method for determining and allocating the intermediate data set is only for example and explanation, and does not limit the scope of application of the present application. For those skilled in the art, various modifications and changes can be made to the order query application system under the guidance of the present application. For example, when a first-level merchant has only one account and multiple employees need to repeatedly log in to the same account, the intermediate data set can be directly allocated without classifying the users.
[0094] In order to better implement an order query method in the embodiment of the present application, based on the order query method, an order query device is also provided in the embodiment of the present application, such as Figure 5 As shown, the order query device includes:
[0095] The receiving module 501 receives a user query request, the user query request carries an order query field and user data, and the order queried by the user query request is stored in an order data set, and the order data set includes the order data of the placed order and the order data of the unplaced order;
[0096] An address query module 502, used to determine an intermediate query address corresponding to user data;
[0097] The data query module 503 is used to query the order data corresponding to the order query field in the intermediate data set based on the intermediate query address to obtain the target order data, wherein the intermediate data set is constructed by the order data that has not been placed in the order data set.
[0098] The result returning module 504 locks the target order data in the intermediate data set and returns the query result based on the target order data.
[0099] In some embodiments of the present application, the result returning module 504 is specifically used to:
[0100] Check whether the target order data is locked in the current time period;
[0101] If not, it triggers locking of target order data;
[0102] If yes, a prompt message is returned.
[0103] In some embodiments of the present application, the user data includes a user identifier and a user name, and the address query module 502 is specifically used to:
[0104] Encrypt the user ID and user name to obtain the user key;
[0105] The intermediate query address corresponding to the user key is queried in the cache space, wherein the cache space is used to store the intermediate query addresses corresponding to different user keys.
[0106] In some embodiments of the present application, the cache space is specifically used to store key-value pairs consisting of different user keys and different intermediate query addresses, and the address query module 502 is specifically used to:
[0107] In the cache space, query the target key-value pair data that matches the user key;
[0108] Read the value data in the target key-value pair data as the intermediate query address.
[0109] In some embodiments of the present application, the address query module 502 may also be used to:
[0110] Different users are classified and processed to obtain multiple user sets;
[0111] Assign a corresponding intermediate data set to each user set.
[0112] In some embodiments of the present application, the receiving module 501 may also be used for:
[0113] Receive a user order request, wherein the user order request is used to request an order operation for target order data.
[0114] The present application avoids repeated queries to obtain query results by loading unordered order data into an intermediate data set and locking the target order data in the query intermediate data set, thereby avoiding the problem of repeated orders caused by multiple users logging in to query and operate orders.
[0115] At the same time, since the application always queries the intermediate data set and does not operate on the target data set, the data security of the target data set is guaranteed. Moreover, since the intermediate data set consists of order data that has not been placed, each query does not need to traverse the target data set with a large amount of data, thereby improving data query efficiency.
[0116] It should be understood that Figure 5 The device and its modules shown can be implemented in various ways. For example, in some embodiments, the device and its modules can be implemented by hardware, software or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or a dedicated design hardware. Those skilled in the art will understand that the above-mentioned method and system can be implemented using computer executable instructions and / or included in a processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The system and its modules of the present application can not only be implemented by hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but can also be implemented by software such as executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software (for example, firmware).
[0117] It should be noted that the above description of the device and its modules is only for convenience of description and does not limit the present application to the scope of the embodiments. It is understandable that, after understanding the principle of the system, those skilled in the art may arbitrarily combine the modules or form a subsystem to connect with other modules without deviating from the principle. For example, Figure 5 The receiving module 501, the address query module 502, the data query module 503, and the result return module 504 can be different modules in a system, or one module can implement the functions of two or more of the above modules. For example, the receiving module 501 and the address query module 502 can be two modules with receiving and query functions respectively, or one module with both receiving and query functions.
[0118] In order to better implement the order query method in the embodiment of the present application, based on the order query method, the embodiment of the present application also provides an order query system, which integrates any order query device provided in the embodiment of the present application, and the system includes:
[0119] one or more processors;
[0120] Memory; and
[0121] One or more applications, wherein the one or more applications are stored in a memory and configured to execute, by a processor, the steps of the order query method of any one of the above-mentioned order query method embodiments.
[0122] like Figure 6 As shown, it shows a schematic diagram of the structure of the order query system involved in the embodiment of the present application, specifically:
[0123] The order query system may include one or more processors 601 of processing cores and one or more computer-readable storage media memories 602. Those skilled in the art will appreciate that Figure 6 The structure shown in the figure does not constitute a limitation on the order query system, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0124] The processor 601 is the control center of the system, which uses various interfaces and lines to connect various parts of the entire system, and executes various functions of the system and processes data by running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, so as to monitor the system as a whole. Optionally, the processor 601 may include one or more processing cores; the processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0125] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the order query system, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0126] Although not shown, the order query system may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 601 in the order query system will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:
[0127] Receive a user query request, the user query request carries an order query field and user data, the order queried by the user query request is stored in an order data set, and the order data set includes the order data of the placed order and the order data of the unplaced order;
[0128] Determine the intermediate query address corresponding to the user data;
[0129] Based on the intermediate query address, query the order data corresponding to the order query field in the intermediate data set to obtain the target order data, wherein the intermediate data set is constructed by the order data that has not been placed in the order data set;
[0130] Lock the target order data in the intermediate data set and return the query results based on the target order data.
[0131] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0132] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: ROM, RAM, disk or CD, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any order query device method provided in the embodiment of the present application. For example, the computer program is loaded by the processor to execute the following steps:
[0133] Receive a user query request, the user query request carries an order query field and user data, the order queried by the user query request is stored in an order data set, and the order data set includes the order data of the placed order and the order data of the unplaced order;
[0134] Determine the intermediate query address corresponding to the user data;
[0135] Based on the intermediate query address, query the order data corresponding to the order query field in the intermediate data set to obtain the target order data, wherein the intermediate data set is constructed by the order data that has not been placed in the order data set;
[0136] Lock the target order data in the intermediate data set and return the query results based on the target order data.
[0137] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0138] The above is a detailed introduction to an order query method, device, system and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An order query method, characterized in that: The method comprises: Receive a user query request, the user query request carries an order query field and user data, the order queried by the user query request is stored in an order data set, the order data set includes placed order data and unplaced order data; Determine an intermediate query address corresponding to the user data, where the intermediate query address is a query address corresponding to the intermediate data set; Based on the intermediate query address, query the intermediate data set for order data corresponding to the order query field to obtain target order data, wherein the intermediate data set is constructed by unordered order data in the order data set; The target order data in the intermediate data set is locked, and a query result is returned based on the target order data.
2. The method according to claim 1, characterized in that Before locking the target order data and returning the query result based on the target order data, the method further includes: Detecting whether the target order data is in a locked state in the current time period; If not, locking the target order data is triggered; If yes, a prompt message is returned.
3. The method according to claim 1, characterized in that The user data includes a user identifier and a user name, and determining the intermediate query address corresponding to the user data includes: Encrypting the user identifier and the user name to obtain a user key; The intermediate query address corresponding to the user key is queried in a cache space, wherein the cache space is used to store the intermediate query addresses corresponding to different user keys respectively.
4. The method according to claim 3, characterized in that: The cache space is specifically used to store key-value pair data consisting of different user keys and different intermediate query addresses, and querying the intermediate query address corresponding to the user key in the cache space includes: In the cache space, query the target key-value pair data that matches the user key; The value data in the target key-value pair data is read as the intermediate query address.
5. The method according to claim 1, characterized in that The method further comprises: Different users are classified and processed to obtain multiple user sets; A corresponding intermediate data set is allocated to each of the user sets.
6. The method according to claim 1, characterized in that After feeding back the target order data as the query result, the method further includes: Receiving a user order request, wherein the user order request is used to request an order operation to be performed on the target order data; After the order operation is performed on the target order data, the target order data on which the order operation has been performed in the intermediate data set is deleted, and the state of the order data corresponding to the target order data in the order data set is modified to an ordered state.
7. The method according to claim 1, characterized in that The query request is specifically used to request a query for logistics waybill data corresponding to the query field, and the order data is specifically logistics waybill data.
8. An order query device, characterized in that: The device comprises: A receiving module receives a user query request, wherein the user query request carries an order query field and user data, and the order queried by the user query request is stored in an order data set, wherein the order data set includes the order data of the placed order and the order data of the unplaced order; An address query module, used to determine an intermediate query address corresponding to the user data, wherein the intermediate query address is a query address corresponding to the intermediate data set; A data query module, configured to query the order data corresponding to the order query field in the intermediate data set based on the intermediate query address to obtain target order data, wherein the intermediate data set is constructed by the unordered order data in the order data set; The result returning module locks the target order data in the intermediate data set and returns the query result based on the target order data.
9. An order inquiry system, characterized in that: The system comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the order query method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the order query method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Order processing method and device, server and storage medium
CN108805670A
Method and device for preventing repeated payment
CN111127008A