Order management method, device, equipment and storage medium
By collecting and clustering order data, combining B+ tree and TPR tree indexing technology, efficient spatio-temporal range query and data analysis of order data is realized, solving the problem of decreasing database response speed under high concurrent query requests.
Patent Information
- Application Number
- CN202410676573.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-05-29
AI Technical Summary
When the existing order management system faces high concurrent query requests, the response speed of the relational database decreases, resulting in a bottleneck in system performance.
Order data is collected through multiple interfaces, cluster feature vectors are generated using data flow clustering algorithm, and time information is converted into Unix timestamps for B+ tree indexing, and geographic information is converted into two-dimensional plane coordinates for TPR tree indexing. Combining time-space index and spatial index for spatiotemporal range query and data analysis.
It improves the query speed and accuracy of order data, solves the problem of the database response speed decrease under high concurrent query requests, and realizes efficient management and analysis of large-scale order data.
Smart Images

Figure CN118503309B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of order management, and in particular to an order management method, device, equipment and storage medium. Background Art
[0002] With the rapid development of e-commerce, more and more consumers choose to shop online, which has led to an explosive growth in order data on e-commerce platforms. A large amount of order data includes not only product information and user information, but also order time information and geographic information. How to efficiently manage and analyze this order data has become an important challenge facing e-commerce platforms.
[0003] At present, most order management systems use traditional database management methods and rely on relational databases for data storage and query. However, traditional relational databases have many limitations when processing large-scale data, especially when processing large-scale data containing time and space dimensions. For example, when faced with high-concurrency query requests, the response speed of relational databases may drop significantly, leading to system performance bottlenecks. At the same time, the diversity and complexity of order data also put forward higher requirements for real-time data processing and analysis. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem that the response speed of the relational database decreases when facing high-concurrency query requests in the existing order management process.
[0005] A first aspect of the present invention provides an order management method, the order management method comprising:
[0006] Collect order data from various e-commerce platforms through multiple interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector;
[0007] According to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and a B+ tree index processing is performed on the order data in a time dimension according to the Unix timestamp to obtain a time index;
[0008] According to the clustering feature vector, the geographic information of the order data is converted into two-dimensional plane coordinates, and the order data is subjected to TPR tree indexing processing in a spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index;
[0009] The time index and the space index are combined to obtain a comprehensive index. Based on the comprehensive index, the order data is queried in a time-space range and data analysis is performed to achieve management of the order data.
[0010] Optionally, in a first implementation of the first aspect of the present invention, the order data includes real-time order data and historical order data, and the cluster feature vector includes a first cluster feature vector and a second cluster feature vector;
[0011] The method of collecting order data from various e-commerce platforms through multiple interfaces and performing data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector includes:
[0012] Collect order data from various e-commerce platforms through multiple interfaces, and perform preliminary clustering processing on the order data through a preset data stream clustering algorithm to generate preliminary clustering results;
[0013] Performing cluster feature extraction processing on the preliminary clustering result to obtain a preliminary cluster feature vector;
[0014] According to the preliminary clustering feature vector, micro-clustering processing is performed on the real-time order data to generate a micro-clustering result, and feature vector extraction processing is performed on the micro-clustering result to obtain a first clustering feature vector;
[0015] According to the preliminary clustering feature vector, macro clustering processing is performed on the historical order data to generate a macro clustering result, and feature vector extraction processing is performed on the macro clustering result to obtain a second clustering feature vector.
[0016] Optionally, in a second implementation of the first aspect of the present invention, converting the time information of the order data into a Unix timestamp according to the clustering feature vector, and performing B+ tree index processing on the order data in a time dimension according to the Unix timestamp to obtain the time index includes:
[0017] Extracting order time information of the order data in the cluster feature vector, and converting the order time information into a Unix timestamp;
[0018] Initialize a B+ tree structure, and segment the Unix timestamp to obtain multiple time periods;
[0019] Inserting the Unix timestamp into a B+ tree structure in time sequence according to the time period, and in the process of inserting the Unix timestamp into the B+ tree structure, determining whether the number of nodes in the B+ tree structure is greater than a preset maximum number of key values and whether the number of nodes is less than a preset minimum number of key values;
[0020] If the number of nodes in the B+ tree structure is greater than the preset maximum key value number, the nodes in the B+ tree structure are split; if the number of nodes is less than the preset minimum key value number, the nodes in the B+ tree structure are merged to obtain an initial time index;
[0021] The adjacent nodes in the initial time index are merged to obtain a time index.
[0022] Optionally, in a third implementation manner of the first aspect of the present invention, converting the geographic information of the order data into two-dimensional plane coordinates according to the cluster feature vector, and performing TPR tree indexing processing on the order data in a spatial dimension according to the two-dimensional plane coordinates to obtain the spatial index includes:
[0023] Extracting geographic information from the cluster feature vector and a time parameter corresponding to the geographic information, and converting the geographic information of the order data into two-dimensional plane coordinates;
[0024] Initialize the TPR tree structure and create a root node of the TPR tree structure;
[0025] Insert the two-dimensional plane coordinates and the corresponding time parameters into the TPR tree structure, perform future position prediction based on the two-dimensional plane coordinates and time parameters of the inserted node, and update the minimum bounding rectangle and time parameters of the node based on the prediction results;
[0026] and in the process of inserting the two-dimensional plane coordinates and the corresponding time parameters into the TPR tree structure, determining whether the number of nodes in the TPR tree structure is greater than a preset maximum number of nodes and whether the number of nodes in the TPR tree structure is less than a preset minimum number of nodes;
[0027] If the number of nodes in the TPR tree structure is greater than the preset maximum number of nodes, the split position of the node in the TPR tree structure is determined according to the minimum bounding rectangle of the node and the time parameter, and the split operation is performed according to the split position; if the number of nodes in the TPR tree structure is less than the preset minimum number of nodes, the nodes to be merged in the TPR tree structure are determined according to the minimum bounding rectangle of the node and the time parameter, and the nodes to be merged are merged to obtain an initial spatial index;
[0028] After the splitting operation and the merging operation, the minimum bounding rectangle and the time parameter of the node are updated, and the adjacent nodes in the initial spatial index are merged again to obtain the spatial index.
[0029] Optionally, in a fourth implementation of the first aspect of the present invention, the time index and the space index are combined to obtain a comprehensive index, and according to the comprehensive index, a time-space range query and data analysis processing are performed on the order data to implement management of the order data, including:
[0030] Preprocessing the time index and the space index, extracting key node information in the time index and the space index, and obtaining index node information;
[0031] According to the index node information, redundant nodes in the time index and the space index are merged, and the time index and the space index are fused to generate a fusion tree structure to obtain a preliminary comprehensive index;
[0032] Performing global optimization processing on the preliminary comprehensive index, merging adjacent and similar nodes in the fusion tree structure to obtain a comprehensive index;
[0033] According to the comprehensive index, a time-space range query process is performed on the order data to generate an order query result, and the order query result is analyzed to obtain an order data analysis report to achieve management of the order data.
[0034] Optionally, in a fifth implementation of the first aspect of the present invention, the fusing of the time index and the space index to generate a fused tree structure to obtain a preliminary comprehensive index includes:
[0035] Inputting the nodes in the time index and the nodes in the space index into a preset association model, performing time-space association analysis, and generating time-space fusion nodes;
[0036] Initializing a fusion tree structure, inserting a time-space fusion node into the fusion tree structure, and performing node merging and deletion operations to obtain a preliminary fusion tree;
[0037] Using a clustering algorithm to perform cluster analysis on the nodes in the preliminary fusion tree, merging adjacent and similar nodes to obtain an optimized fusion tree;
[0038] The nodes in the optimized fusion tree are sorted and adjusted according to their timestamps, minimum bounding rectangles and time parameters to obtain a preliminary comprehensive index.
[0039] Optionally, in a sixth implementation of the first aspect of the present invention, performing a spatiotemporal range query process on the order data according to the comprehensive index to generate an order query result, and analyzing the order query result to obtain an order data analysis report, and implementing management of the order data includes:
[0040] Obtaining a query request, and determining a query time range and a query space range according to the comprehensive index;
[0041] Performing time and space range search processing on the comprehensive index to determine the order data within the time range and obtain preliminary time screening results;
[0042] Perform spatial range retrieval processing on the comprehensive index to determine the order data within the spatial range and obtain a preliminary spatial screening result;
[0043] Performing spatiotemporal joint filtering processing on the preliminary spatial screening results and the preliminary spatial screening results, and performing spatiotemporal matching in combination with time information and spatial information to obtain a spatiotemporal matching result;
[0044] According to the time-space matching result, the order data is integrated and sorted to form an order query result, and the order query result is analyzed to obtain an order data analysis report to achieve management of the order data.
[0045] A second aspect of the present invention provides an order management device, the order management device comprising:
[0046] A data collection module is used to collect order data from various e-commerce platforms through multiple interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector;
[0047] A time index generating module, configured to convert the time information of the order data into a Unix timestamp according to the clustering feature vector, and perform B+ tree index processing on the order data in a time dimension according to the Unix timestamp to obtain a time index;
[0048] A spatial index generation module, used to convert the geographic information of the order data into two-dimensional plane coordinates according to the cluster feature vector, and perform TPR tree index processing on the order data in the spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index;
[0049] The management module is used to combine the time index and the space index to obtain a comprehensive index, and perform time-space range query and data analysis processing on the order data according to the comprehensive index to achieve management of the order data.
[0050] The third aspect of the present invention provides an order management device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the order management device executes the steps of the above-mentioned order management method.
[0051] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned order management method.
[0052] The above-mentioned order management method, device, equipment and storage medium perform data clustering processing on order data through a data stream clustering algorithm to generate a clustering feature vector; according to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and a time index is obtained through B+ tree index processing; the geographic information is converted into two-dimensional plane coordinates, and a spatial index is obtained through TPR tree index processing; the time index and the spatial index are combined to obtain a comprehensive index, and the order data is subjected to time and space range query and data analysis processing according to the comprehensive index. This method extracts the feature vector of data in a high-dimensional data space through a data stream clustering algorithm, thereby simplifying the data structure, and combines the multidimensional indexing technology to quickly index and retrieve the data in the time and space dimensions, respectively, thereby improving the speed and accuracy of data query.
[0053] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a schematic diagram of a first embodiment of an order management method in an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of an embodiment of an order management device in an embodiment of the present invention;
[0057] Figure 3 It is a schematic diagram of an embodiment of an order management device in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.
[0060] To facilitate understanding of this embodiment, an order management method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps:
[0061] 101. Collect order data from various e-commerce platforms through multiple interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector;
[0062] In one embodiment of the present invention, the order data includes real-time order data and historical order data, and the clustering feature vector includes a first clustering feature vector and a second clustering feature vector; the order data is collected from various e-commerce platforms through multiple interfaces, and the order data is subjected to data clustering processing through a preset data stream clustering algorithm to generate a clustering feature vector, including: collecting order data from various e-commerce platforms through multiple interfaces, and performing preliminary clustering processing on the order data through a preset data stream clustering algorithm to generate preliminary clustering results; performing clustering feature extraction processing on the preliminary clustering results to obtain preliminary clustering feature vectors; performing micro-clustering processing on the real-time order data according to the preliminary clustering feature vectors to generate micro-clustering results, and performing feature vector extraction processing on the micro-clustering results to obtain a first clustering feature vector; performing macro-clustering processing on the historical order data according to the preliminary clustering feature vectors to generate macro-clustering results, and performing feature vector extraction processing on the macro-clustering results to obtain a second clustering feature vector.
[0063] Specifically, first, order data is collected from various e-commerce platforms through various interfaces, including basic order information, such as order number, order time, payment time, delivery address, current delivery location, etc. After preprocessing, these data enter the next step of data stream clustering algorithm processing. The data stream clustering algorithm can process a large amount of order data in real time, generate clustering feature vectors, and extract the core features of the order data. Next, the data stream clustering algorithm performs preliminary clustering processing on the collected order data to generate preliminary clustering results. Preliminary clustering processing is to group order data in real time and cluster orders with similar characteristics together. This step utilizes online clustering algorithms, such as the CluStream algorithm, and its specific operating formula is as follows:
[0064] ;
[0065] In the formula, Indicates Cluster centers, Indicates at time The order feature vector at time, Indicates at time The weight coefficient of the moment, Represents the number of orders within the time window. Through this formula, the system can dynamically update the cluster center to adapt to the real-time changes in order data.
[0066] Then, the preliminary clustering results are processed by clustering feature extraction to obtain the preliminary clustering feature vector. The purpose of clustering feature extraction is to extract the core features that can represent each cluster from the preliminary clustering results, such as order quantity, order amount, order distribution, etc. The calculation formula of the preliminary clustering feature vector is as follows:
[0067] ;
[0068] In the formula, Indicates The feature vector of a cluster, Indicates The number of orders in the clusters, Represents the order feature vector belonging to the cluster. This formula averages the order feature vectors within the cluster to obtain a feature vector that can represent the entire cluster. According to the preliminary cluster feature vector, the real-time order data is micro-clustered to generate micro-cluster results, and the feature vector is extracted from the micro-cluster results to obtain the first cluster feature vector. Micro-clustering is a more fine-grained clustering analysis of real-time order data to track the changes in orders in real time. The feature vector in the micro-clustering result can reflect the dynamic characteristics of real-time order data, such as the number of real-time orders and the distribution of real-time orders. At the same time, according to the preliminary cluster feature vector, the historical order data is macro-clustered to generate macro-clustering results, and the feature vector is extracted from the macro-clustering results to obtain the second cluster feature vector. Macro-clustering is a large-scale clustering analysis of historical order data to summarize the overall characteristics of historical orders. The feature vector in the macro-clustering result can reflect the global characteristics of historical order data, such as the total amount of historical orders and the distribution of historical orders.
[0069] 102. According to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and a B+ tree index processing is performed on the order data in the time dimension according to the Unix timestamp to obtain a time index;
[0070] In one embodiment of the present invention, the step of converting the time information of the order data into a Unix timestamp according to the clustering feature vector, and performing B+ tree index processing on the order data in the time dimension according to the Unix timestamp to obtain the time index comprises: extracting the order time information of the order data in the clustering feature vector, and converting the order time information into a Unix timestamp; initializing a B+ tree structure, and performing segmentation processing on the Unix timestamp to obtain a plurality of time periods; inserting the Unix timestamp into the B+ tree structure in time order according to the time period, and in the process of inserting the Unix timestamp into the B+ tree structure, determining whether the number of nodes in the B+ tree structure is greater than a preset maximum number of key values and whether the number of nodes is less than a preset minimum number of key values; if the number of nodes in the B+ tree structure is greater than the preset maximum number of key values, performing a split operation on the nodes in the B+ tree structure, and if the number of nodes is less than the preset minimum number of key values, performing a merge operation on the nodes in the B+ tree structure to obtain an initial time index; and merging adjacent nodes in the initial time index to obtain a time index.
[0071] Specifically, the order time information of the order data in the cluster feature vector is extracted. The cluster feature vector contains various attribute information of the order data, including time information. In order to facilitate subsequent processing, it is necessary to standardize this time information, that is, convert it into a Unix timestamp. The Unix timestamp represents the number of seconds that have passed since 00:00:00 UTC on January 1, 1970, and is a commonly used method of expressing time. Next, initialize the B+ tree structure. The B+ tree is a balanced tree that is suitable for storing and querying a large amount of ordered data, especially in scenarios where frequent range queries are required. Each node of the B+ tree contains multiple key values and pointers, and all data is stored in the leaf nodes. The leaf nodes form an ordered linked list for easy sequential access. The extracted Unix timestamp is segmented and the timestamp is divided into a certain time interval, such as a time period per day. Through this segmentation processing, the order data can be organized in chronological order, which is convenient for fast search and range query. Then, the processed Unix timestamps are inserted into the B+ tree structure in chronological order. During the insertion process, it is necessary to determine whether the number of nodes in the B+ tree structure is greater than the preset maximum number of key values or less than the preset minimum number of key values. Specifically, if the number of key values in a node exceeds the preset maximum value, a node splitting operation is required; if the number of key values in a node is less than the preset minimum value, a node merging operation is required. In this way, the B+ tree can maintain balance and ensure query efficiency. In the node splitting operation, the key value in the node is divided into two parts, each part forms a new child node, and the key value and pointer in the parent node are updated. For example, assuming that there are 6 key values in the node \(N\), when its maximum number of key values is 4, it needs to be split into two nodes, each containing 3 key values. After the split operation, the key value and pointer in the parent node need to be updated to point to the new child node. In the node merging operation, two adjacent nodes are merged into one node, and the key value and pointer in the parent node are updated. For example, assuming that two adjacent nodes each contain 2 key values, when their minimum number of key values is 2, they need to be merged into one node containing 4 key values. After the merge operation, the key value and pointer in the parent node need to be updated to reflect the new node structure. Finally, the initial time index is optimized, and the adjacent nodes in the initial time index are merged to reduce redundancy and obtain the final time index. In this way, the query efficiency can be further improved and the orderliness of the data and the balance of the structure can be ensured.
[0072] 103. According to the clustering feature vector, the geographic information of the order data is converted into two-dimensional plane coordinates, and TPR tree indexing processing is performed on the order data in the spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index;
[0073] In one embodiment of the present invention, the geographic information of the order data is converted into two-dimensional plane coordinates according to the cluster feature vector, and the order data is subjected to TPR tree index processing in the spatial dimension according to the two-dimensional plane coordinates to obtain the spatial index, which includes: extracting the geographic information in the cluster feature vector and the time parameter corresponding to the geographic information, and converting the geographic information of the order data into two-dimensional plane coordinates; initializing the TPR tree structure and creating a root node of the TPR tree structure; inserting the two-dimensional plane coordinates and the corresponding time parameter into the TPR tree structure, and performing future position prediction according to the two-dimensional plane coordinates and time parameters of the inserted node, and updating the minimum circumscribed rectangle and time parameter of the node according to the prediction result; and inserting the two-dimensional plane coordinates and the corresponding time parameter of the TPR tree structure into the root node of the TPR tree structure. During the process, it is determined whether the number of nodes in the TPR tree structure is greater than a preset maximum number of nodes and whether the number of nodes in the TPR tree structure is less than a preset minimum number of nodes; if the number of nodes in the TPR tree structure is greater than the preset maximum number of nodes, the split position of the node in the TPR tree structure is determined according to the minimum bounding rectangle of the node and the time parameter, and a split operation is performed according to the split position; if the number of nodes in the TPR tree structure is less than the preset minimum number of nodes, the nodes to be merged in the TPR tree structure are determined according to the minimum bounding rectangle of the node and the time parameter, and a merge operation is performed on the nodes to be merged to obtain an initial spatial index; after the split operation and the merge operation, the minimum bounding rectangle and the time parameter of the node are updated, and the adjacent nodes in the initial spatial index are merged again to obtain a spatial index.
[0074] Specifically, first, the geographic information and its corresponding time parameters in the cluster feature vector are extracted. The cluster feature vector contains multiple attribute information of the order data, including geographic location information and time information. Geographic information such as delivery address, longitude and latitude, current location of the order or intermediate node, etc., are extracted and converted into two-dimensional plane coordinates. Two-dimensional plane coordinates can intuitively represent the geographic location, which is convenient for subsequent spatial index processing. For time parameters, order creation time, estimated delivery time, and delivery time corresponding to the intermediate node corresponding to the order can be used. Next, the TPR tree structure is initialized. TPR tree (Time-Parameterized R-tree) is a structure suitable for dynamic spatial object indexing and can handle spatial positions that change over time. Create the root node of the TPR tree structure and set the initial minimum bounding rectangle (MBR) and time parameters. The minimum bounding rectangle represents the minimum rectangular area containing the spatial object, and the time parameter is used to record the time information of the spatial object. Then, the two-dimensional plane coordinates and corresponding time parameters of the order data are inserted into the TPR tree structure. During the insertion process, it is necessary to predict the future position based on the two-dimensional plane coordinates and time parameters of the node, and update the minimum bounding rectangle and time parameters of the node based on the prediction results. In the process of inserting the two-dimensional plane coordinates and time parameters into the TPR tree structure, it is necessary to determine whether the nodes in the TPR tree structure are greater than the preset maximum number of nodes and less than the preset minimum number of nodes. If the number of objects in a node exceeds the preset maximum value, a node splitting operation is required; if the number of objects in a node is less than the preset minimum value, a node merging operation is required. In this way, the TPR tree can maintain balance and ensure query efficiency. In the node splitting operation, the objects in the node are divided into two parts, each part forms a new child node, and the minimum bounding rectangle and time parameters in the parent node are updated. For example, assuming that there are 8 objects in the node \(N\), when its maximum number of objects is 4, it needs to be split into two nodes, each containing 4 objects. After the splitting operation, the minimum bounding rectangle and time parameters in the parent node need to be updated to point to the new child node. In the node merging operation, two adjacent nodes are merged into one node, and the minimum bounding rectangle and time parameters in the parent node are updated. For example, assuming that two adjacent nodes each contain 2 objects, when their minimum number of objects is 2, they need to be merged into one node containing 4 objects. After the merge operation, the minimum bounding rectangle and time parameters in the parent node need to be updated to reflect the new node structure. Finally, the initial spatial index is optimized, and the adjacent nodes in the initial spatial index are merged to reduce redundancy and obtain the final spatial index. In this way, the query efficiency can be further improved and the orderliness of the data and the balance of the structure can be ensured.
[0075] 104. Combine the time index and the space index to obtain a comprehensive index. Based on the comprehensive index, perform time and space range query and data analysis and processing on the order data to achieve management of the order data.
[0076] In one embodiment of the present invention, the time index and the space index are combined to obtain a comprehensive index, and according to the comprehensive index, a time-space range query and data analysis processing are performed on the order data to achieve management of the order data, including: preprocessing the time index and the space index, extracting key node information in the time index and the space index, and obtaining index node information; according to the index node information, merging redundant nodes in the time index and the space index, and fusing the time index and the space index to generate a fusion tree structure to obtain a preliminary comprehensive index; performing global optimization processing on the preliminary comprehensive index, merging adjacent and similar nodes in the fusion tree structure to obtain a comprehensive index; according to the comprehensive index, a time-space range query processing is performed on the order data to generate an order query result, and the order query result is analyzed to obtain an order data analysis report to achieve management of the order data.
[0077] Specifically, first, the time index and the space index are preprocessed to extract the key node information. The key node information in the time index and the space index includes the key value of the node, the child node pointer and the related metadata (such as the minimum bounding rectangle and time parameter of the node). By extracting these key node information, a set of index node information can be obtained, which will serve as the basis for subsequent fusion processing. Next, according to the extracted index node information, the redundant nodes in the time index and the space index are merged. Redundant nodes refer to those nodes that are very close in time and space. These nodes can be merged into one node to reduce the complexity of the index and improve the query efficiency. After merging the redundant nodes, the time index and the space index are fused to generate a fusion tree structure. The fusion tree structure combines the characteristics of the time index and the space index, and can handle the query requirements of time and space at the same time. The specific implementation steps include: first, according to the comprehensive characteristics of time and space, the index nodes are inserted into the fusion tree according to certain rules. Then, according to the characteristics of the fusion tree, the position and structure of the nodes are dynamically adjusted to ensure the balance of the tree and the query efficiency. After the initial comprehensive index is generated, it is globally optimized. The purpose of global optimization is to further reduce redundancy and improve the compactness and query efficiency of the index by merging adjacent and similar nodes. The final comprehensive index is obtained through global optimization. The comprehensive index can efficiently support spatiotemporal range query and data analysis processing. Specifically, the order data is queried in a spatiotemporal range according to the comprehensive index. The purpose of the spatiotemporal range query is to quickly retrieve qualified order data according to the specified time range and space range. The order data within the specified range can be found by traversing the nodes in the comprehensive index. After the spatiotemporal range query, the order query results are generated and analyzed. The order query results contain all the order data that meet the query conditions, which can be further statistically analyzed, such as order quantity statistics, order amount statistics, order distribution analysis, etc. Through these analyses, order data analysis reports can be generated to provide decision support for order management.
[0078] Furthermore, the fusion processing of the time index and the space index to generate a fusion tree structure to obtain a preliminary comprehensive index includes: inputting the nodes in the time index and the nodes in the space index into a preset association model, performing time-space association analysis, and generating time-space fusion nodes; initializing the fusion tree structure, inserting the time-space fusion nodes into the fusion tree structure, and performing node merging and deletion operations to obtain a preliminary fusion tree; using a clustering algorithm to perform clustering analysis on the nodes in the preliminary fusion tree, merging adjacent and similar nodes to obtain an optimized fusion tree; and sorting and adjusting the nodes according to the timestamps, minimum bounding rectangles, and time parameters of the nodes in the optimized fusion tree to obtain a preliminary comprehensive index.
[0079] Specifically, first, the nodes in the time index and the nodes in the space index are input into the preset association model to perform time-space association analysis. The purpose of time-space association analysis is to effectively combine the data of the time dimension and the space dimension to generate a time-space fusion node. This step requires matching the time node and the space node to find the corresponding time and space position. Next, the fusion tree structure is initialized, the generated time-space fusion node is inserted into the fusion tree structure, and the node merging and deletion operations are performed to obtain a preliminary fusion tree. During the insertion process, the structure of the fusion tree needs to be dynamically adjusted to ensure the balance of the tree and the query efficiency. After the preliminary fusion tree is generated, the clustering algorithm is used to perform clustering analysis on the nodes in the preliminary fusion tree, merge adjacent and similar nodes, and obtain an optimized fusion tree. The purpose of the clustering algorithm is to cluster similar nodes together to further reduce the complexity and redundancy of the tree. Finally, the nodes are sorted and adjusted according to the timestamps and minimum bounding rectangles (MBR) of the nodes in the optimized fusion tree and the time parameters to obtain a preliminary comprehensive index. The purpose of this step is to further optimize the structure of the fusion tree to make it more compact and efficient. Specifically, the nodes in the fusion tree can be traversed, the nodes can be sorted according to timestamps and MBRs, and the positions of the nodes can be adjusted to ensure the efficiency of the query.
[0080] Furthermore, according to the comprehensive index, the order data is queried in a time-space range to generate an order query result, and the order query result is analyzed to obtain an order data analysis report, thereby realizing management of the order data, including: obtaining a query request, and determining a query time range and a space range according to the comprehensive index; performing a time-space range retrieval process on the comprehensive index to determine the order data within the time range and obtain a preliminary time screening result; performing a space range retrieval process on the comprehensive index to determine the order data within the space range and obtain a preliminary space screening result; performing a time-space joint filtering process on the preliminary space screening result and the preliminary space screening result, and performing time-space matching in combination with time information and space information to obtain a time-space matching result; according to the time-space matching result, the order data is integrated and sorted to form an order query result, and the order query result is analyzed to obtain an order data analysis report, thereby realizing management of the order data.
[0081] Specifically, first, a query request is obtained, and the query time range and space range are determined according to the comprehensive index. The comprehensive index combines the information of the time index and the space index, and can quickly locate the order data that meets the query conditions. When a user submits a query request, it usually includes a time range and a space range, such as querying the order data of a certain geographical area within a certain time period. By parsing the query request, the system can determine the time range and the space range, and search in the comprehensive index. Next, the comprehensive index is subjected to a time and space range search process. The purpose of the time and space range search is to find order data that meets the time range and space range in the comprehensive index. First, the order data within the time range is determined to obtain a preliminary time screening result. This step searches for order data whose timestamp is within the query time range by traversing the nodes in the comprehensive index. Then, the comprehensive index is subjected to a space range search process to determine the order data within the space range and obtain a preliminary space screening result. The purpose of the space range search is to find order data whose geographical location is within the query space range in the comprehensive index. By traversing the nodes in the comprehensive index, the order data whose spatial coordinates are within the query space range is searched. After obtaining the preliminary time screening results and preliminary space screening results, the two results are subjected to spatiotemporal joint filtering processing, and spatiotemporal matching is performed in combination with time information and space information to obtain spatiotemporal matching results. The purpose of spatiotemporal joint filtering processing is to perform an intersection operation on the time screening results and the space screening results to find order data that meets both the time range and the space range. According to the spatiotemporal matching results, the order data is integrated and sorted to generate order query results. The purpose of the integration and sorting processing is to further process the spatiotemporal matching results in order to generate query results that meet user needs. Specifically, the order can be sorted according to the timestamp of the order, or according to the importance of the order. The specific implementation of the sorting processing can be adjusted according to the needs of the user. After the order query results are generated, the query results are analyzed to obtain an order data analysis report. The purpose of order data analysis is to count and analyze the query results in order to generate valuable reports. For example, information such as order quantity, order amount, and order distribution can be counted. Through these analyses, an order data analysis report can be generated to provide decision support for order management.
[0082] Specifically, the comprehensive index is searched in time and space ranges. Specifically, the order data within the time range is first determined to obtain a preliminary time screening result. This step searches for order data with timestamps within the query time range by traversing the nodes in the comprehensive index. In order to traverse the nodes in the comprehensive index, a depth-first search (DFS) or breadth-first search (BFS) algorithm can be used. The following are the specific steps for traversing the comprehensive index nodes:
[0083] 1. Initialize the search stack or queue: put the root node of the comprehensive index into the stack or queue.
[0084] 2. Node traversal loop: Repeat the following steps until the stack or queue is empty:
[0085] Take a node from the stack or queue .
[0086] ·Judgment Node Is it a leaf node? If it is a leaf node, check the timestamp of each order data in the node. Is it within the query time range? If it is within the range, the order data is added to the preliminary time screening results.
[0087] If the node If it is not a leaf node, all its child nodes are added to the stack or queue. Formula (1) shows the process of time range retrieval:
[0088] Time_Filter ;
[0089] In formula (1), Time_Filter Indicates the time range In the node set Filter to get the set of nodes that meet the conditions ,in Representation Node The timestamp of the
[0090] In this embodiment, the order data is clustered by a data stream clustering algorithm to generate a clustering feature vector; according to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and the time index is obtained by B+ tree index processing; the geographic information is converted into two-dimensional plane coordinates, and the spatial index is obtained by TPR tree index processing; the time index and the spatial index are combined to obtain a comprehensive index, and the order data is subjected to time and space range query and data analysis processing according to the comprehensive index. This method extracts the feature vector of the data in the high-dimensional data space through the data stream clustering algorithm, thereby simplifying the data structure, and combines the multidimensional indexing technology to quickly index and retrieve the data in the time and space dimensions, respectively, thereby improving the speed and accuracy of data query.
[0091] The above describes the order management method in the embodiment of the present invention. The following describes the order management device in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, an order management device includes:
[0092] The data collection module 201 is used to collect order data from various e-commerce platforms through various interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector;
[0093] A time index generating module 202, configured to convert the time information of the order data into a Unix timestamp according to the clustering feature vector, and perform B+ tree index processing on the order data in a time dimension according to the Unix timestamp to obtain a time index;
[0094] A spatial index generating module 203, configured to convert the geographic information of the order data into two-dimensional plane coordinates according to the clustering feature vector, and perform TPR tree indexing processing on the order data in a spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index;
[0095] The management module 204 is used to combine the time index and the space index to obtain a comprehensive index, and perform time-space range query and data analysis processing on the order data according to the comprehensive index to achieve management of the order data.
[0096] In an embodiment of the present invention, the order management device runs the above order management method, and the order management device performs data clustering processing on the order data through a data stream clustering algorithm to generate a clustering feature vector; according to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and a time index is obtained through B+ tree index processing; the geographic information is converted into two-dimensional plane coordinates, and a spatial index is obtained through TPR tree index processing; the time index and the spatial index are combined to obtain a comprehensive index, and the order data is subjected to time and space range query and data analysis processing according to the comprehensive index. This method extracts the feature vector of data in a high-dimensional data space through a data stream clustering algorithm, thereby simplifying the data structure, and combines multidimensional indexing technology to quickly index and retrieve data in time and space dimensions, respectively, thereby improving the speed and accuracy of data query.
[0097] above Figure 2 The order management apparatus in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the order management device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0098] Figure 33 is a schematic diagram of the structure of an order management device provided by an embodiment of the present invention. The order management device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage device terminals) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the order management device 300. Furthermore, the processor 310 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the order management device 300 to implement the steps of the above-mentioned order management method.
[0099] The order management device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The order management device structure shown does not constitute a limitation on the order management device provided by the present invention, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0100] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the order management method.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0103] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An order management method, characterized in that: The order management method comprises: Collect order data from various e-commerce platforms through multiple interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector; According to the clustering feature vector, the time information of the order data is converted into a Unix timestamp, and a B+ tree index processing is performed on the order data in a time dimension according to the Unix timestamp to obtain a time index; According to the clustering feature vector, the geographic information of the order data is converted into two-dimensional plane coordinates, and the order data is subjected to TPR tree indexing processing in a spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index; The time index and the space index are combined to obtain a comprehensive index, and according to the comprehensive index, a time-space range query and data analysis processing are performed on the order data to achieve management of the order data. The time index and the space index are combined to obtain a comprehensive index, and according to the comprehensive index, a time-space range query and data analysis processing are performed on the order data to achieve management of the order data, which includes: preprocessing the time index and the space index, extracting key node information in the time index and the space index, and obtaining index node information; merging redundant nodes in the time index and the space index according to the index node information, and fusing the time index and the space index to generate a fusion tree structure to obtain a preliminary comprehensive index; performing global optimization processing on the preliminary comprehensive index, merging adjacent and similar nodes in the fusion tree structure to obtain a comprehensive index; according to the comprehensive index, a time-space range query processing is performed on the order data to generate an order query result, and the order query result is analyzed to obtain an order data analysis report to achieve management of the order data.
2. The order management method according to claim 1, characterized in that: The order data includes real-time order data and historical order data, and the cluster feature vector includes a first cluster feature vector and a second cluster feature vector; The method of collecting order data from various e-commerce platforms through multiple interfaces and performing data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector includes: Collect order data from various e-commerce platforms through multiple interfaces, and perform preliminary clustering processing on the order data through a preset data stream clustering algorithm to generate preliminary clustering results; Performing cluster feature extraction processing on the preliminary clustering result to obtain a preliminary cluster feature vector; According to the preliminary clustering feature vector, micro-clustering processing is performed on the real-time order data to generate a micro-clustering result, and feature vector extraction processing is performed on the micro-clustering result to obtain a first clustering feature vector; According to the preliminary clustering feature vector, macro clustering processing is performed on the historical order data to generate a macro clustering result, and feature vector extraction processing is performed on the macro clustering result to obtain a second clustering feature vector.
3. The order management method according to claim 1, characterized in that: The step of converting the time information of the order data into a Unix timestamp according to the clustering feature vector, and performing B+ tree index processing on the order data in the time dimension according to the Unix timestamp to obtain the time index includes: Extracting order time information of the order data in the cluster feature vector, and converting the order time information into a Unix timestamp; Initialize a B+ tree structure, and segment the Unix timestamp to obtain multiple time periods; Inserting the Unix timestamp into a B+ tree structure in time sequence according to the time period, and in the process of inserting the Unix timestamp into the B+ tree structure, determining whether the number of nodes in the B+ tree structure is greater than a preset maximum number of key values and whether the number of nodes is less than a preset minimum number of key values; If the number of nodes in the B+ tree structure is greater than the preset maximum key value number, the nodes in the B+ tree structure are split; if the number of nodes is less than the preset minimum key value number, the nodes in the B+ tree structure are merged to obtain an initial time index; The adjacent nodes in the initial time index are merged to obtain a time index.
4. The order management method according to claim 1, characterized in that: The step of converting the geographic information of the order data into two-dimensional plane coordinates according to the clustering feature vector, and performing TPR tree indexing processing on the order data in the spatial dimension according to the two-dimensional plane coordinates to obtain the spatial index includes: Extracting geographic information from the cluster feature vector and a time parameter corresponding to the geographic information, and converting the geographic information of the order data into two-dimensional plane coordinates; Initialize the TPR tree structure and create a root node of the TPR tree structure; Insert the two-dimensional plane coordinates and the corresponding time parameters into the TPR tree structure, perform future position prediction based on the two-dimensional plane coordinates and time parameters of the inserted node, and update the minimum bounding rectangle and time parameters of the node based on the prediction results; and in the process of inserting the two-dimensional plane coordinates and the corresponding time parameters into the TPR tree structure, determining whether the number of nodes in the TPR tree structure is greater than a preset maximum number of nodes and whether the number of nodes in the TPR tree structure is less than a preset minimum number of nodes; If the number of nodes in the TPR tree structure is greater than the preset maximum number of nodes, the split position of the node in the TPR tree structure is determined according to the minimum bounding rectangle of the node and the time parameter, and the split operation is performed according to the split position; if the number of nodes in the TPR tree structure is less than the preset minimum number of nodes, the nodes to be merged in the TPR tree structure are determined according to the minimum bounding rectangle of the node and the time parameter, and the nodes to be merged are merged to obtain an initial spatial index; After the splitting operation and the merging operation, the minimum bounding rectangle and the time parameter of the node are updated, and the adjacent nodes in the initial spatial index are merged again to obtain the spatial index.
5. The order management method according to claim 1, characterized in that: The time index and the space index are fused to generate a fusion tree structure, and the preliminary comprehensive index is obtained, including: Inputting the nodes in the time index and the nodes in the space index into a preset association model, performing time-space association analysis, and generating time-space fusion nodes; Initializing a fusion tree structure, inserting a time-space fusion node into the fusion tree structure, and performing node merging and deletion operations to obtain a preliminary fusion tree; Using a clustering algorithm to perform cluster analysis on the nodes in the preliminary fusion tree, merging adjacent and similar nodes to obtain an optimized fusion tree; The nodes in the optimized fusion tree are sorted and adjusted according to their timestamps, minimum bounding rectangles and time parameters to obtain a preliminary comprehensive index.
6. The order management method according to claim 5, characterized in that: The step of performing a time-space range query process on the order data according to the comprehensive index to generate an order query result, and analyzing the order query result to obtain an order data analysis report to achieve the management of the order data includes: Obtaining a query request, and determining a query time range and a spatial range according to the comprehensive index; Performing time and space range search processing on the comprehensive index to determine the order data within the time range and obtain preliminary time screening results; Perform spatial range retrieval processing on the comprehensive index to determine the order data within the spatial range and obtain a preliminary spatial screening result; Performing spatiotemporal joint filtering processing on the preliminary time screening result and the preliminary space screening result, and performing spatiotemporal matching in combination with the time information and the space information to obtain a spatiotemporal matching result; According to the time-space matching results, the order data is integrated and sorted to generate order query results, and the order query results are analyzed to obtain an order data analysis report to achieve management of the order data.
7. An order management device, characterized in that: The order management device comprises: A data collection module is used to collect order data from various e-commerce platforms through multiple interfaces, and perform data clustering processing on the order data through a preset data stream clustering algorithm to generate a clustering feature vector; A time index generating module, configured to convert the time information of the order data into a Unix timestamp according to the clustering feature vector, and perform B+ tree index processing on the order data in a time dimension according to the Unix timestamp to obtain a time index; A spatial index generation module, used to convert the geographic information of the order data into two-dimensional plane coordinates according to the cluster feature vector, and perform TPR tree index processing on the order data in the spatial dimension according to the two-dimensional plane coordinates to obtain a spatial index; A management module is used to combine the time index and the space index to obtain a comprehensive index, and perform a time-space range query and data analysis processing on the order data according to the comprehensive index to achieve management of the order data. The time index and the space index are combined to obtain a comprehensive index, and the time-space range query and data analysis processing are performed on the order data according to the comprehensive index to achieve management of the order data, including: pre-processing the time index and the space index, extracting key node information in the time index and the space index, and obtaining index node information; merging redundant nodes in the time index and the space index according to the index node information, and fusing the time index and the space index to generate a fusion tree structure to obtain a preliminary comprehensive index; performing global optimization processing on the preliminary comprehensive index, merging adjacent and similar nodes in the fusion tree structure to obtain a comprehensive index; performing a time-space range query processing on the order data according to the comprehensive index to generate an order query result, and analyzing the order query result to obtain an order data analysis report to achieve management of the order data.
8. An order management device, characterized in that: The order management device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the order management device to perform the steps of the order management method as described in any one of claims 1-6.
9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the order management method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Space database indexing method of regional double-tree structure
CN102609530A
Spatio-temporal data index building and searching methods, a spatio-temporal data index building and searching device and spatio-temporal data index building and searching equipment
CN104750708A