A method and device for processing order data
By intercepting and sorting order data in the database, and automatically identifying new user orders within the target time, the problem of manual screening is solved, system performance and efficiency are improved, and service timeouts and memory overflows are avoided.
Patent Information
- Application Number
- CN201911184560.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-27
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2039-11-27
AI Technical Summary
When the system accumulates a large amount of order data, it is currently used to use manual or semi-manual methods to filter new user orders within a specified time to consume a lot of time, resulting in service performance degradation and may even cause service timeout.
By intercepting order data within the target time, generating a pending result set, obtaining user identification code, and finding and sorting in the database to determine the first order transaction time, removing order data that does not belong to the target time, thereby obtaining the target time New user order data.
It realizes automatic and rapid identification of new user orders within a certain time period, significantly improving system performance, reducing computing and storage pressure, and avoiding service timeouts and memory overflow problems.
Smart Images

Figure CN112862554B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for processing order data. Background Art
[0002] For e-commerce and related companies, data such as the growth of new users and new users' shopping habits can provide important data support for the company's strategic development. Whether or not an e-commerce company can attract more new users is the key to measuring whether it has good development prospects.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] In the case of a large amount of order data accumulated in the system, the existing manual or semi-manual method of screening out new user orders within a specified time will consume a lot of time, thereby reducing service performance, and in severe cases even causing service timeouts. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for processing order data, which can solve the problem of poor system service performance and high cost when identifying an order from a new user.
[0006] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a method for processing order data is provided, comprising intercepting order data within a target time to generate a result set to be processed; obtaining a user identification code corresponding to the order, searching for order data corresponding to the user identification code in a database, sorting the found order data according to the order transaction time, and then determining the first order transaction time corresponding to the user identification code; removing order data whose first order transaction time is not within the target time from the result set to be processed to generate a result set, and then obtaining new user order data within the target time.
[0007] Optionally, sorting the found order data according to the order transaction time, and then determining the first order transaction time corresponding to the user identification code, includes:
[0008] Based on the order type, cluster the found order data to obtain the order data of the target type;
[0009] According to the order transaction time, the order data of the target type are sorted, and then the first order transaction time corresponding to the user identification code is determined.
[0010] Optionally, obtaining a user identification code corresponding to the order, and searching a database for order data corresponding to the user identification code includes:
[0011] A user identification code corresponding to the order is obtained, order data in a to-be-processed result set is deduplicated based on the user identification code, and order data corresponding to the user identification code is searched in a database.
[0012] Optionally, the order data within the target time is intercepted to generate a result set to be processed, including:
[0013] Intercept order data within the target time and filter the order data based on the target type;
[0014] Generate a result set to be processed based on the filtered order data whose order status is completed.
[0015] In addition, according to one aspect of an embodiment of the present invention, there is provided an order data processing device, comprising an interception module, for intercepting order data within a target time to generate a result set to be processed; a processing module, for obtaining a user identification code corresponding to the order, searching a database for order data corresponding to the user identification code, for sorting the found order data according to the order transaction time, and then determining the first order transaction time corresponding to the user identification code; a generation module, for removing order data whose first order transaction time is not within the target time from the result set to be processed, so as to generate a result set, and then obtain new user order data within the target time.
[0016] Optionally, the processing module sorts the found order data according to the order transaction time, and then determines the first order transaction time corresponding to the user identification code, including:
[0017] Based on the order type, cluster the found order data to obtain the order data of the target type;
[0018] According to the order transaction time, the order data of the target type are sorted, and then the first order transaction time corresponding to the user identification code is determined.
[0019] Optionally, the processing module obtains a user identification code corresponding to the order, and searches a database for order data corresponding to the user identification code, including:
[0020] A user identification code corresponding to the order is obtained, order data in a to-be-processed result set is deduplicated based on the user identification code, and order data corresponding to the user identification code is searched in a database.
[0021] Optionally, the interception module intercepts the order data within the target time to generate a result set to be processed, including:
[0022] Intercept order data within the target time and filter the order data based on the target type;
[0023] Generate a pending result set based on the filtered order data with the order status as completed
[0024] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including:
[0025] one or more processors;
[0026] a storage device for storing one or more programs,
[0027] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above computing embodiments.
[0028] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, any of the above-mentioned methods based on the computing embodiment is implemented.
[0029] One embodiment of the above invention has the following advantages or beneficial effects: the present invention intercepts order data within the target time to generate a to-be-processed result set; obtains the user identification code corresponding to the order, searches for order data corresponding to the user identification code in the database, sorts the found order data according to the order transaction time, and then determines the first order transaction time corresponding to the user identification code; removes order data whose first order transaction time is not within the target time from the to-be-processed result set to generate a result set, and then obtains new user order data within the target time. Thus, the present invention can automatically and quickly identify new user orders within a certain time period.
[0030] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0032] Figure 1 is a schematic diagram of the main flow of the method for processing order data according to the first embodiment of the present invention
[0033] Figure 2 is a schematic diagram of the main flow of the method for processing order data according to the second embodiment of the present invention;
[0034] Figure 3 is a schematic diagram of main modules of an order data processing device according to an embodiment of the present invention;
[0035] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0036] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] Figure 1 is a schematic diagram of the main flow of a method for processing order data according to a first embodiment of the present invention. The method for processing order data may include:
[0039] Step S101, intercepting order data within a target time to generate a result set to be processed.
[0040] In an embodiment, the present invention distinguishes new users from a time dimension, and can set the start time begin_date of the target time and the end time end_date of the target time, and intercept orders in the order data whose order transaction time is greater than or equal to the start time begin_date of the target time and less than or equal to the end time end_date of the target time.
[0041] In some embodiments, since orders can be divided into multiple types, such as consumption orders, complaint orders, etc., new users of different target types can be identified according to different business needs. Therefore, after intercepting the order data within the target time, the present invention filters the order data based on the target type. Then, based on the filtered order data with the order status as completed, a result set to be processed is generated. In other words, the order data is processed in a targeted manner according to business needs.
[0042] Step S102, obtaining a user identification code corresponding to the order, searching for order data corresponding to the user identification code in a database, sorting the found order data according to order transaction time, and then determining the first order transaction time corresponding to the user identification code.
[0043] In an embodiment, the user identification code may be set as a pin (personal identification number, each pin corresponds to a unique user), and the user identification code pin corresponding to the obtained order is stored in a set of pin values pinList.
[0044] In addition, the order transaction time is trade_date, and the found order data is sorted according to the order transaction time trade_date. Furthermore, the first order transaction time can be regarded as the earliest order transaction time corresponding to a pin in the database, which can be obtained through the database's built-in function Min(expr). Each pin corresponds to an earliest order transaction time. Among them, Min(expr) is a function in the database query statement, which is used to query the minimum target value.
[0045] In some embodiments, the found order data can be clustered based on the order type to obtain the order data of the target type. Then, the order data of the target type is sorted according to the order transaction time, and then the first order transaction time corresponding to the user identification code is determined. It can be seen that this embodiment also clusters the found order data based on the order type according to the business needs, and then determines the first order transaction time.
[0046] It is also worth noting that after obtaining the user identification code corresponding to the order, the order data in the processing result set can be deduplicated based on the user identification code. Furthermore, the distinct keyword can be used to remove duplicate values from the result set, so that all non-duplicate pin values within the target time can be obtained. Distinct is a keyword in the database query statement, which can remove duplicate data in the result set.
[0047] It can be seen that whether it is to use the query statement in the database to perform deduplication processing or to determine the first order transaction time, the database is used to share the computing pressure, so the present invention can reduce the computing performance pressure of the system.
[0048] Step S103, remove the order data whose first order transaction time is not within the target time from the to-be-processed result set to generate a result set, and then obtain the new user order data within the target time.
[0049] In an embodiment, the new user order data can be evaluated and analyzed. For example, a large number of new user orders may be generated due to a certain promotional activity. Of course, it is also possible that a large number of new user orders are not generated. Therefore, the results of executing a certain event can be judged based on the new user order data obtained within the target time.
[0050] In some embodiments, the start time begin_date of the target time and the end time end_date of the target time can be set. If the first order transaction time is less than the start time begin_date of the target time, the corresponding order data can be removed from the pending result set to generate a result set, and then the new user order can be located in the result set. In other words, the first order transaction time of the old user must be before the target time.
[0051] Of course, if the first order transaction time is greater than the end time end_date of the target time, the corresponding order data also needs to be removed from the pending result set. This situation is likely caused by a system error.
[0052] It is worth noting that the present invention removes order data that does not fall within the target time from the to-be-processed result set, and then generates a result set, which can avoid abnormal problems caused by memory overflow (OOM: Out Of Memory).
[0053] Therefore, the order data processing method proposed by the present invention can significantly improve the database performance for systems with a large number of historical orders. At the same time, when filtering data, the present invention does not need to create a collection or a new database table to store historical orders to achieve comparison and filtering. It can be operated in the database and completed through basic database query statements, which can simplify system design and reduce system performance pressure.
[0054] Furthermore, the present invention does not need to traverse the collection once every time a new user order is marked, nor does it need to write the new user into the collection after marking the new user order. In other words, there is no read and write operation, thereby greatly reducing the computing performance pressure.
[0055] Figure 2 is a schematic diagram of the main flow of a method for processing order data according to a second embodiment of the present invention. The method for processing order data may include:
[0056] Step S201, intercepting order data within a target time, and filtering the order data based on the target type.
[0057] Step S202, generating a to-be-processed result set according to the filtered order data whose order status is completed.
[0058] Step S203, obtaining a user identification code corresponding to the order, and performing deduplication processing on the order data in the processing result set based on the user identification code.
[0059] Step S204, searching the database for order data corresponding to the user identification code.
[0060] Step S205: clustering the found order data based on the order type to obtain order data of the target type.
[0061] Step S206, sorting the order data of the target type according to the order transaction time, and then determining the first order transaction time corresponding to the user identification code.
[0062] Step S207, remove the order data whose first order transaction time is not within the target time from the to-be-processed result set to generate a result set, and then obtain the new user order data within the target time.
[0063] Figure 3 is a schematic diagram of the main modules of the order data processing device according to an embodiment of the present invention, such as Figure 3 As shown, the order data processing device 300 includes an interception module 301, a processing module 302 and a generation module 303. The interception module 301 intercepts the order data within the target time to generate a result set to be processed; the processing module 302 obtains the user identification code corresponding to the order, searches for the order data corresponding to the user identification code in the database, sorts the found order data according to the order transaction time, and then determines the first order transaction time corresponding to the user identification code; the generation module 303 removes the order data whose first order transaction time does not fall within the target time from the result set to be processed, so as to generate a result set, and then obtain the new user order data within the target time.
[0064] In some embodiments, the processing module 302 sorts the found order data according to the order transaction time, and then determines the first order transaction time corresponding to the user identification code, including:
[0065] Based on the order type, the found order data is clustered to obtain the order data of the target type; according to the order transaction time, the order data of the target type is sorted to determine the first order transaction time corresponding to the user identification code.
[0066] In some other embodiments, the processing module 302 obtains the user identification code corresponding to the order, and searches the database for order data corresponding to the user identification code, including:
[0067] A user identification code corresponding to the order is obtained, order data in a to-be-processed result set is deduplicated based on the user identification code, and order data corresponding to the user identification code is searched in a database.
[0068] It is worth noting that the interception module 301 intercepts the order data within the target time to generate a result set to be processed, including:
[0069] Capture order data within the target time and filter the order data based on the target type; generate a pending result set based on the filtered order data with a completed order status.
[0070] It should be noted that the order data processing method and the order data processing device described in the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.
[0071] Figure 4 An exemplary system architecture 400 is shown to which the method for processing order data or the device for processing order data according to the embodiment of the present invention can be applied.
[0072] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0073] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0074] The terminal devices 401 , 402 , and 403 may be various electronic devices having an order data processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0075] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0076] It should be noted that the order data processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the computing device is generally arranged in the server 405 .
[0077] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0078] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0079] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0080] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a processor of liquid crystal order data (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0081] In particular, according to the embodiments disclosed in the present invention, 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 invention 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 the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0082] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 the present invention, a 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, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0083] 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 invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flow chart, and the combination of the boxes in the block diagram 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.
[0084] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, it may be described as follows: a processor includes an interception module, a processing module, and a generation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0085] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes intercepting order data within the target time to generate a result set to be processed; obtaining a user identification code corresponding to the order, searching for order data corresponding to the user identification code in the database, sorting the found order data according to the order transaction time, and then determining the first order transaction time corresponding to the user identification code; removing order data whose first order transaction time does not fall within the target time from the result set to be processed, so as to generate a result set, and then obtain new user order data within the target time.
[0086] According to the technical solution of the embodiment of the present invention, it is possible to solve the problem of poor system service performance and high cost when identifying an order from a new user.
[0087] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing order data, characterized in that: include: Capture order data within the target time to generate a result set to be processed; Obtaining a user identification code corresponding to the order, searching for order data corresponding to the user identification code in a database through a basic database query statement, clustering the found order data based on order type to obtain order data of a target type, sorting the order data of the target type according to order transaction time, and then determining the first order transaction time corresponding to the user identification code; wherein the database does not contain a created collection or a newly created database table; The order data whose first order transaction time is not within the target time is removed from the result set to be processed to generate a result set, and then obtain the new user order data within the target time.
2. The method according to claim 1, characterized in that: Obtaining a user identification code corresponding to the order, and searching a database for order data corresponding to the user identification code, including: A user identification code corresponding to the order is obtained, order data in a to-be-processed result set is deduplicated based on the user identification code, and order data corresponding to the user identification code is searched in a database.
3. The method according to any one of claims 1-2, characterized in that: Capture order data within the target time to generate a result set to be processed, including: Intercept order data within the target time and filter the order data based on the target type; Generate a result set to be processed based on the filtered order data whose order status is completed.
4. A device for processing order data, characterized in that: The interception module is used to intercept the order data within the target time to generate a result set to be processed; a processing module, configured to obtain a user identification code corresponding to the order, search for order data corresponding to the user identification code in a database through a basic database query statement, cluster the found order data based on order type to obtain order data of a target type, sort the order data of the target type according to order transaction time, and further determine the first order transaction time corresponding to the user identification code; wherein the database does not contain a created collection or a newly created database table; The generation module is used to remove the order data whose first order transaction time does not fall within the target time from the to-be-processed result set to generate a result set, thereby obtaining the new user order data within the target time.
5. The device according to claim 4, characterized in that The processing module obtains a user identification code corresponding to the order, and searches a database for order data corresponding to the user identification code, including: A user identification code corresponding to the order is obtained, order data in a to-be-processed result set is deduplicated based on the user identification code, and order data corresponding to the user identification code is searched in a database.
6. The device according to any one of claims 4-5, characterized in that: The interception module intercepts the order data within the target time to generate a result set to be processed, including: Intercept order data within the target time and filter the order data based on the target type; Generate a result set to be processed based on the filtered order data whose order status is completed.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
