Order data management method and device, equipment, storage medium and product
By obtaining the storage time of order data at preset time intervals in the online transaction database, determining inactive orders and migrating to an independent historical database, the problems of high storage pressure and low performance of the online transaction database are solved, and database performance and query efficiency are improved.
Patent Information
- Application Number
- CN202411446724.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-03-11
AI Technical Summary
Online trading databases face storage pressure and performance degradation when processing massive order data. The existing technology reduces the amount of data in the current transaction table by adding historical tables, but still leads to high storage pressure when the order data is large.
At every preset time interval, the storage time of each order data in the storage is obtained, the inactive order data is determined based on the storage time, and the inactive order data is migrated to an independent historical transaction database to reduce the amount of data in the online transaction database.
By reducing the amount of data in the online transaction database, the database performance and query efficiency are improved, and the problems of high storage pressure and low performance are solved.
Smart Images

Figure CN119597726A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to order data management methods, devices, equipment, storage media and products. Background Art
[0002] At present, with the rapid development of computer technology, Internet payment has become an important part of daily transactions. With the continuous increase in business volume, the order payment system faces the challenge of processing massive data. Among them, online transaction databases, such as Oracle, MySQL and other relational databases, bear the heavy responsibility of storing all order data and refund records. However, with the continuous growth of transaction volume, these databases are facing unprecedented storage pressure, resulting in a gradual decline in performance.
[0003] In the related art, a history table is usually added to the online transaction database, and transaction records older than a certain time are migrated to the history table, thereby reducing the amount of data in the current transaction table and improving the query efficiency of the database. However, in the case of a large amount of order data, as the historical data continues to accumulate, it will eventually lead to a large storage pressure on the online transaction database, that is, the performance of the online transaction database in the related art is low.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide an order data management method, aiming to solve the technical problem of poor performance of online transaction database in related technologies.
[0006] To achieve the above purpose, the present application proposes an order data management method, which is applied to an online transaction database, wherein the online transaction database is communicatively connected with a historical transaction database, and the order data management method includes:
[0007] At every preset time interval, obtain the storage duration of each order data in storage;
[0008] Determine inactive order data based on the storage duration;
[0009] The inactive order data is migrated to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
[0010] Optionally, the step of determining the inactive order data based on the storage duration includes:
[0011] Get the failure time threshold;
[0012] Determine whether the storage duration exceeds the expiration duration threshold;
[0013] If the storage time exceeds the expiration time threshold, the order data whose storage time exceeds the expiration time threshold is determined as inactive order data.
[0014] Optionally, the expiration time threshold includes an expiration time threshold of each order data, and the step of obtaining the expiration time threshold includes:
[0015] Get the transaction attributes of each order data in storage;
[0016] Based on a preset duration mapping table and the transaction attributes, an expiration duration threshold of each order data is determined, wherein the duration mapping table includes mappings between multiple transaction attributes and corresponding expiration duration thresholds.
[0017] Optionally, before the step of determining the expiration time threshold of each order data based on the preset time mapping table and the transaction attribute, the method includes:
[0018] Get historical order data under each transaction attribute;
[0019] Counting the number of orders with different expiration time thresholds in the historical order data under each transaction attribute;
[0020] The expiration time threshold with the largest number of orders is used as the target expiration time threshold of the corresponding transaction attribute, and a mapping is established between the target expiration time threshold and the corresponding transaction attribute to obtain a time mapping table.
[0021] Optionally, before the step of migrating the inactive order data to the historical transaction database, the method includes:
[0022] Marking the inactive order data to obtain marked inactive order data;
[0023] When the marked inactive order data is determined and the marked inactive order data has not been migrated to the historical transaction database, if an order query request regarding the marked inactive order data is received, the order query request is rejected until the marked inactive order data is migrated to the historical transaction database.
[0024] Optionally, after the step of migrating the inactive order data to the historical transaction database, the method includes:
[0025] In response to an order query request, determining whether target query order data exists in the library, wherein the order query request includes the target query order data;
[0026] If the target query order data does not exist in the database, sending an order data reflux instruction about the target query order data to the historical transaction database;
[0027] Receive the target query order data sent by the historical transaction database, and store the target query order data.
[0028] In addition, to achieve the above purpose, the present application also proposes an order data management device, the order data management device comprising:
[0029] An acquisition module, used to acquire the storage duration of each order data in storage at a preset time interval;
[0030] A determination module, configured to determine inactive order data based on the storage duration;
[0031] A migration module is used to migrate the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes an order data management device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the order data management method described above.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the order data management method described above are implemented.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the order data management method described above are implemented.
[0035] One or more technical solutions proposed in this application have at least the following technical effects:
[0036] Compared with the related art, which usually adds a history table to the online transaction database, by migrating transaction records that exceed a certain time to the history table, the data volume of the current transaction table is reduced, and the query efficiency of the database is improved. However, in the case of a large amount of order data, as the historical data continues to accumulate, it will eventually lead to a large storage pressure on the online transaction database, that is, the performance of the online transaction database in the related art is low. In this application, the online transaction database obtains the storage time of each order data in the storage at every preset time interval, determines the inactive order data based on the storage time, and migrates the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other. It can be understood that the present application adds an independent historical transaction database on the basis of the online transaction database, rather than adding a history table to the online transaction database, and stores the inactive order data through the independent historical transaction database. On the basis of ensuring the online transaction function, the data volume of the online transaction database is reduced, thereby improving the performance of the online transaction database. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A flowchart of the first embodiment of the order data management method of this application is provided;
[0040] Figure 2 This is a schematic diagram of the overall process of the application order data management method;
[0041] Figure 3 This is a flowchart of different order classification modes in the order data management method of this application;
[0042] Figure 4 A flowchart of the data migration process of the order data management method for this application;
[0043] Figure 5 A flowchart of the second embodiment of the order data management method of this application is provided;
[0044] Figure 6 A flowchart of data return for the order data management method of this application;
[0045] Figure 7 This is a schematic diagram of the module structure of the order data management device according to an embodiment of the present application;
[0046] Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the order data management method in the embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] The main solution of the embodiment of the present application is: at every preset time interval, obtain the storage duration of each order data in storage; based on the storage duration, determine the inactive order data; migrate the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
[0051] In this embodiment, the online transaction database is used as the execution body. For the convenience of description, it will be described as "online database" hereinafter.
[0052] In the related art, a history table is usually added to the online transaction database, and transaction records older than a certain time are migrated to the history table, thereby reducing the amount of data in the current transaction table and improving the query efficiency of the database. However, when the amount of order data is large, as the historical data continues to accumulate, it will eventually lead to a large storage pressure on the online transaction database, that is, the performance of the online transaction database in the related art is low.
[0053] The present application provides a solution to reduce the amount of data in an online transaction database while ensuring the online transaction function, thereby improving the performance of the online transaction database.
[0054] From the above embodiments, it can be seen that the present application obtains the storage duration of each order data stored at every preset time interval through the online transaction database, determines the inactive order data based on the storage duration, and migrates the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other. It can be understood that the present application adds an independent historical transaction database on the basis of the online transaction database, rather than adding a historical table to the online transaction database, and stores the inactive order data through the independent historical transaction database, thereby reducing the amount of data in the online transaction database while ensuring the online transaction function, thereby improving the performance of the online transaction database.
[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the online library as an example to illustrate this embodiment and the following embodiments.
[0056] Based on this, the present application embodiment provides an order data management method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the order data management method of this application.
[0057] In this embodiment, the order data management method is applied to an online transaction database, the online transaction database is communicatively connected with a historical transaction database, and the order data management method includes steps S100 to S300:
[0058] Step S100, obtaining the storage duration of each order data in storage at every preset time interval;
[0059] It should be noted that the preset time interval is a time period set in advance by the system administrator or database maintenance personnel, which can be several hours, every day, every week, etc., depending on business needs and system design; each order data in storage refers to all order information stored in the database, including processed, pending, completed or canceled orders; the storage duration refers to the time that has passed since the order data was generated or stored in the database. For example, if Order A was created 3 months ago, then the storage duration of Order A is 3 months.
[0060] In a specific implementation, the online library obtains the storage duration of each order data in the storage. Specifically, when a preset time interval arrives, the online library automatically checks or queries the order data in the database.
[0061] Step S200, determining inactive order data based on the storage duration;
[0062] It should be noted that inactive order data refers to orders that have not undergone any transactions, updates or user interactions within a certain period of time. Inactive orders can be orders that have been completed, canceled or abandoned by users.
[0063] In the specific implementation, refer to Figure 2 The step of determining inactive order data based on the storage duration is a data screening process for identifying order records that have not been changed or updated for more than a certain period of time. This process involves comparing the storage duration of each order with a predefined time period to determine the order data marked as inactive order data in each order data. For example, if the set time period is one year, the online library determines that all orders with a storage duration of more than one year are inactive order data.
[0064] In a specific implementation, the online library determines the step of inactive order data based on the storage duration, including:
[0065] Obtain an expiration time threshold; determine whether the storage time exceeds the expiration time threshold; if the storage time exceeds the expiration time threshold, determine the order data whose storage time exceeds the expiration time threshold as inactive order data.
[0066] It should be noted that the expiration time threshold can be a predefined time length or a time length determined according to transaction attributes. It is specifically used to determine whether the order data has become inactive. That is, the expiration time threshold is determined by business needs and policies. For example, an enterprise can define 30 days (a month) or 7 days (a week) of no active orders as inactive.
[0067] In a specific implementation, the online library determines whether the storage duration exceeds the expiration duration threshold. Specifically, for each order in the database, the online library calculates its storage duration, that is, the time from the last activity of the order (such as the last update time or the last interaction time) to the present. Finally, the online library compares this storage duration with the expiration duration threshold obtained in the previous step.
[0068] Furthermore, if the storage duration of an order exceeds the preset expiration time threshold, the order is considered inactive. For example, if the expiration time threshold is set to 365 days, and an order was last updated 400 days ago, the storage duration of the order (400 days) exceeds the expiration time threshold (365 days), so the order will be marked as inactive order data.
[0069] The granular form is that order data that is determined to be inactive will be selected for further processing, such as archiving, deletion, or other business logic operations. This helps companies clean up databases, optimize storage space usage, improve database query efficiency, and enhance customer service quality.
[0070] In a specific implementation, the steps of obtaining the invalidation time threshold from the online library include:
[0071] Acquire transaction attributes of each order data in storage; determine the expiration time threshold of each order data based on a preset time mapping table and the transaction attributes, wherein the time mapping table includes mappings between multiple transaction attributes and corresponding expiration time thresholds.
[0072] It should be noted that transaction attributes refer to features or attributes related to order transactions, including but not limited to transaction types (such as commodity purchases, service reservations), transaction scenarios, different merchants, etc. The online library will extract transaction attribute information for each order; the duration mapping table is a predefined data structure (such as a database table, a hash table, etc.), which contains a mapping relationship between multiple transaction attributes and corresponding expiration time thresholds. The duration mapping table is set in advance and defines different expiration time thresholds corresponding to different transaction attributes. For example, some orders for emergency service reservations may require a shorter expiration time threshold, while some orders for large equipment purchases may require a longer expiration time threshold; for example, the transaction attributes are different merchants. After statistics, it is found that refunds from merchant A mostly occur within 1 month, and refunds from merchant B mostly occur within 1 week. In this case, the order activity time can be set for merchant A and merchant B respectively.
[0073] In the specific implementation, for each order, the online library will look up its transaction attributes and find the expiration time threshold corresponding to the transaction attribute in the time mapping table. The online library will use this threshold to determine whether the order is outdated or inactive.
[0074] In a specific implementation, before the step of determining the expiration time threshold of each order data based on the preset time mapping table and the transaction attribute, the method includes:
[0075] Obtain historical order data under each transaction attribute; count the number of orders with different expiration time thresholds in the historical order data under the transaction attributes; use the expiration time threshold with the largest number of orders as the target expiration time threshold for the corresponding transaction attribute, and establish a mapping between the target expiration time threshold and the corresponding transaction attribute to obtain a time mapping table.
[0076] In a specific implementation, the online library extracts historical order data corresponding to each transaction attribute from the database, wherein the historical order data generally refers to orders that have been completed or terminated and are no longer active, and the historical order data includes information such as transaction attributes and order quantity.
[0077] In the specific implementation, the online library counts the number of orders with different expiration time thresholds in the historical order data under each transaction attribute. Specifically, for each transaction attribute, the online library counts the number of orders with different expiration time thresholds. For example, under the women's clothing attribute, it is necessary to count the number of orders with expiration time thresholds (such as refund time) of 180 days, 30 days, and 7 days.
[0078] In the specific implementation, the online library uses the expiration time threshold with the largest number of orders as the target expiration time threshold of the corresponding transaction attribute, that is, for each transaction attribute, the expiration time threshold with the largest number of orders is determined, and the target expiration time threshold reflects the actual validity period of most orders under the transaction attribute. For example, if 90% of the historical orders of women's clothing attributes have no further activity after 30 days, then 30 days can be regarded as the target expiration time threshold for the purchase of women's clothing attributes.
[0079] In the specific implementation, finally, the online library associates each transaction attribute with the calculated target expiration time threshold to form a mapping relationship and obtain a time mapping table, that is, to summarize the above mapping relationships and create a time mapping table. This table will be used for future order data management to help determine the expiration time threshold for each order.
[0080] In the specific implementation, in this application, the online library divides orders into two types according to actual statistics: active orders and inactive orders. Specific rules are formulated based on the historical data statistics of the order system. For specific examples, please refer to Figure 3 And the following modes are introduced (all of them are explained with 1 month as the effective order period):
[0081] Mode 1: Basic mode. Set the active order expiration time to 1 month, scan the database records every day, and calculate the difference between the maintenance date and the current date. If it exceeds 1 month, it is an inactive order; otherwise, it is an active order.
[0082] Mode 2: Customized mode. You can configure the order active time in a single field or multiple fields according to different merchants, transaction scenarios, and transaction types. For example, after statistics, it is found that most refunds from merchant A occur within 1 month, and most refunds from merchant B occur within 1 week. You can set the order active time for merchant A and merchant B respectively.
[0083] Step S300: Migrate the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
[0084] It should be noted that the historical transaction database is a database specifically used to store past transaction records, usually used to store data that no longer needs to be accessed in real time, and is preferably a non-relational database. Compared with relational data storage, non-relational databases have higher storage efficiency, are used to solve storage resources, and have lower costs.
[0085] In the specific implementation, this application adds an independent historical transaction database based on the online transaction database, rather than adding a historical table to the online transaction database. The inactive order data is stored in the independent historical transaction database. On the basis of ensuring the online transaction function, the amount of data in the online transaction database is reduced, thereby improving the performance of the online transaction database.
[0086] In a specific implementation, the present application proposes an architecture for storing records in combination of a relational database and a non-relational database, thereby reducing the impact of online transactions on the relational database and improving the utilization rate of data storage resources.
[0087] In a specific implementation, before the step of migrating the inactive order data to the historical transaction database, the method includes:
[0088] The inactive order data is marked to obtain the marked inactive order data; when the marked inactive order data is determined and the marked inactive order data has not been migrated to the historical transaction database, if an order query request for the marked inactive order data is received, the order query request is rejected until the marked inactive order data is migrated to the historical transaction database.
[0089] In a specific implementation, before migrating the inactive order data to the historical transaction database, the online library marks the inactive order data to obtain the marked inactive order data. The online library will add a mark to the order data determined to be inactive in the database. This can be achieved by adding a status field (such as isActive, status, etc.) to the order data table to indicate the current status of the order. For example, a field is_active can be set, and this field of the inactive order can be set to FALSE.
[0090] Furthermore, after the online library completes the marking, its inactive order data now has a clear mark indicating that they are inactive. In the case where the inactive order data after the marking is determined and the inactive order data after the marking has not been migrated to the historical transaction database, if an order query request for the inactive order data after the marking is received, the order query request is rejected, that is, if a user or system initiates a query request and hopes to obtain these order data marked as inactive, the system will reject these requests. The rejection method can be to return an error message or code, such as "Order data is not available, please try again", "The requested resource does not exist, please try again", etc. The online library will continue to reject query requests for these order data until these data are successfully migrated to the historical transaction database. Once the data migration is completed, the system can update its status to reflect that the data now exists in the historical database. For future query requests, the online library will reflow the target transaction order data queried in the historical transaction database.
[0091] In the specific implementation, refer to Figure 4 The above method specifically marks the order data as "archiving" during the migration process. Marking the archived data ensures that the source data will not be updated during the migration process. The application where the historical transaction database is located ensures that the data has been successfully migrated through callback. After the historical transaction database clearly migrates successfully and the callback is made, the application where the online transaction database is located is notified to delete the original data; if the callback of the application where the historical transaction database is located times out or fails, the order data is removed from the "archiving" mark; this ensures data consistency, that is, avoids changes in inactive data during migration to the historical transaction database, which destroys data consistency.
[0092] Compared with the related art, which usually adds a history table to the online transaction database, by migrating transaction records that exceed a certain time to the history table, the data volume of the current transaction table is reduced, and the query efficiency of the database is improved. However, in the case of a large amount of order data, as the historical data continues to accumulate, it will eventually lead to a large storage pressure on the online transaction database, that is, the performance of the online transaction database in the related art is low. In this application, the online transaction database obtains the storage time of each order data in the storage at every preset time interval, determines the inactive order data based on the storage time, and migrates the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other. It can be understood that the present application adds an independent historical transaction database on the basis of the online transaction database, rather than adding a history table to the online transaction database, and stores the inactive order data through the independent historical transaction database. On the basis of ensuring the online transaction function, the data volume of the online transaction database is reduced, thereby improving the performance of the online transaction database.
[0093] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 5 , the order data management method comprises:
[0094] In a specific implementation, after the online library migrates the inactive order data to the historical transaction database, the method includes:
[0095] Step A100, in response to an order query request, determining whether target query order data exists in the library, wherein the order query request includes the target query order data;
[0096] In a specific implementation, when the online library receives an order query request, it will perform response processing. Specifically, when responding to the query request, the online library will first check whether the target order data queried by the user exists in the current online transaction database. The order query request includes an identifier of the target query order data, such as an order number or other unique identifier.
[0097] Step A200, if the target query order data does not exist in the database, sending an order data return instruction about the target query order data to the historical transaction database;
[0098] In a specific implementation, if the target query order data does not exist in the library, an order data reflux instruction regarding the target query order data is sent to the historical transaction database, that is, the online library sends a reflux instruction to the historical transaction database, requesting to obtain specific target query order data, wherein the reflux instruction is a request mechanism that requires the historical database to provide specific data.
[0099] Step A300, receiving the target query order data sent by the historical transaction database, and storing the target query order data.
[0100] In a specific implementation, the online library receives the target query order data sent by the historical transaction database. Specifically, the online library will wait for and receive the target order data returned by the historical transaction database, and after receiving the data sent by the historical transaction database, the online library will store the data, which may be temporary storage or permanent storage, depending on business needs. The purpose of storage is to enable users to query the order information they request.
[0101] In the specific implementation, the above method realizes the return of inactive transaction data in the historical transaction database to the online library. Specifically, refer to Figure 6In order to ensure that subsequent transactions of order data archived to the historical transaction database can reuse subsequent transaction procedures, the subsequent transaction procedures for the order records in the historical transaction database are not implemented. Instead, the order data in the historical transaction database are restored back to the online transaction database during subsequent transactions, and the same subsequent transaction procedures are reused.
[0102] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the order data management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0103] The present application also provides an order data management device, referring to Figure 7 , the order data management device comprises:
[0104] The acquisition module 10 is used to acquire the storage duration of each order data in storage at every preset time interval;
[0105] A determination module 20, configured to determine inactive order data based on the storage duration;
[0106] The migration module 30 is used to migrate the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
[0107] Optionally, the determining module 20 includes:
[0108] A threshold acquisition module is used to obtain an invalidation time threshold;
[0109] A judging module, used to judge whether the storage time exceeds the expiration time threshold;
[0110] The inactive order determination module is used to determine the order data whose storage time exceeds the expiration time threshold as inactive order data if the storage time exceeds the expiration time threshold.
[0111] Optionally, the threshold acquisition module includes:
[0112] A transaction attribute acquisition module is used to obtain the transaction attributes of each order data in storage;
[0113] The expiration time threshold determination module is used to determine the expiration time threshold of each order data based on a preset time mapping table and the transaction attribute, wherein the time mapping table includes a mapping between multiple transaction attributes and corresponding expiration time thresholds.
[0114] Optionally, the order data management device further includes:
[0115] The historical order data acquisition module is used to obtain the historical order data under each transaction attribute;
[0116] A statistics module, used to count the number of orders with different expiration time thresholds in the historical order data under each transaction attribute;
[0117] The mapping establishment module is used to use the expiration time threshold with the largest number of orders as the target expiration time threshold of the corresponding transaction attribute, and to establish a mapping between the target expiration time threshold and the corresponding transaction attribute to obtain a time mapping table.
[0118] The order data management device provided by the present application adopts the order data management method in the above embodiment, which can solve the technical problem of order data management. Compared with the prior art, the beneficial effects of the order data management device provided by the present application are the same as the beneficial effects of the order data management method provided by the above embodiment, and the other technical features in the order data management device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0119] The present application provides an order data management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the order data management method in the above-mentioned embodiment one.
[0120] Reference below Figure 8 , which shows a schematic diagram of the structure of an order data management device suitable for implementing the embodiment of the present application. The order data management device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The order data management device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0121] like Figure 8As shown, the order data management device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the order data management device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the order data management device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an order data management device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0122] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0123] The order data management device provided by the present application adopts the order data management method in the above embodiment to solve the technical problem of order data management. Compared with the prior art, the beneficial effects of the order data management device provided by the present application are the same as the beneficial effects of the order data management method provided by the above embodiment, and the other technical features in the order data management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0124] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0125] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0126] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the order data management method in the above-mentioned embodiment.
[0127] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0128] The computer-readable storage medium may be included in the order data management device; or it may exist independently without being assembled into the order data management device.
[0129] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the order data management device, the order data management device: order data management.
[0130] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0133] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned order data management method, and can solve the technical problems of order data management. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the order data management method provided in the above-mentioned embodiment, and will not be repeated here.
[0134] The present application also provides a computer program product, including a computer program, which implements the steps of the order data management method as described above when executed by a processor.
[0135] The computer program product provided by this application can solve the technical problem of order data management. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the order data management method provided by the above embodiment, which will not be repeated here.
[0136] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An order data management method, characterized in that: Applied to an online transaction database, the online transaction database is communicatively connected with a historical transaction database, and the method for order data management includes: At every preset time interval, obtain the storage duration of each order data in storage; Determine inactive order data based on the storage duration; The inactive order data is migrated to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
2. The order data management method according to claim 1, characterized in that: The step of determining the inactive order data based on the storage duration includes: Get the failure time threshold; Determine whether the storage duration exceeds the expiration duration threshold; If the storage time exceeds the expiration time threshold, the order data whose storage time exceeds the expiration time threshold is determined as inactive order data.
3. The order data management method according to claim 2, characterized in that: The expiration time threshold includes the expiration time threshold of each order data, and the step of obtaining the expiration time threshold includes: Get the transaction attributes of each order data in storage; Based on a preset duration mapping table and the transaction attributes, an expiration duration threshold of each order data is determined, wherein the duration mapping table includes mappings between multiple transaction attributes and corresponding expiration duration thresholds.
4. The order data management method according to claim 3, characterized in that: Before the step of determining the expiration time threshold of each order data based on the preset time mapping table and the transaction attribute, the method includes: Get historical order data under each transaction attribute; Counting the number of orders with different expiration time thresholds in the historical order data under each transaction attribute; The expiration time threshold with the largest number of orders is used as the target expiration time threshold of the corresponding transaction attribute, and a mapping is established between the target expiration time threshold and the corresponding transaction attribute to obtain a time mapping table.
5. The order data management method according to claim 1, characterized in that: Before the step of migrating the inactive order data to the historical transaction database, the method includes: Marking the inactive order data to obtain marked inactive order data; When the marked inactive order data is determined and the marked inactive order data has not been migrated to the historical transaction database, if an order query request regarding the marked inactive order data is received, the order query request is rejected until the marked inactive order data is migrated to the historical transaction database.
6. The order data management method according to claim 1, characterized in that: After the step of migrating the inactive order data to the historical transaction database, the method includes: In response to an order query request, determining whether target query order data exists in the library, wherein the order query request includes the target query order data; If the target query order data does not exist in the database, sending an order data reflux instruction about the target query order data to the historical transaction database; Receive the target query order data sent by the historical transaction database, and store the target query order data.
7. An order data management device, characterized in that: The device comprises: An acquisition module, used to acquire the storage duration of each order data in storage at a preset time interval; A determination module, configured to determine inactive order data based on the storage duration; A migration module is used to migrate the inactive order data to the historical transaction database, wherein the historical transaction database and the online transaction database are independent of each other.
8. An order data management device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the order data management method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the order data management method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the order data management method according to any one of claims 1 to 6 are implemented.