CN108734537B - Method and device for counting violation orders - Google Patents
Method and device for counting violation orders Download PDFInfo
- Publication number
- CN108734537B CN108734537B CN201710270088.2A CN201710270088A CN108734537B CN 108734537 B CN108734537 B CN 108734537B CN 201710270088 A CN201710270088 A CN 201710270088A CN 108734537 B CN108734537 B CN 108734537B
- Authority
- CN
- China
- Prior art keywords
- order
- rule
- order information
- middleware
- backtracking
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0609—Qualifying participants for shopping transactions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0633—Managing shopping lists, e.g. compiling or processing purchase lists
- G06Q30/0637—Managing shopping lists, e.g. compiling or processing purchase lists requiring approval before final submission, e.g. parental approval
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Debugging And Monitoring (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the invention provides a method and a device for counting violation orders, which can be used for counting the violation orders in time and reducing the operation load of a system. According to an aspect of an embodiment of the present invention, there is provided a method for counting violation orders, including: acquiring order information of an order; using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result; if the order violation is determined, a second processing process is used for inquiring and processing a matched order of the order; and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for counting violation orders.
Background
In the existing electronic commerce system, illegal orders need to be identified. For example, a user may maliciously place a large number of orders for a certain commodity, but not pay or cancel the orders after payment, which may cause an insufficient inventory of the commodity warehouse, and affect other users to normally purchase the commodity.
In the method for identifying illegal orders in the prior art, order information of each order is usually stored, the order information is counted at regular time, and whether an order violating a rule exists is judged by setting a preset rule.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: firstly, in the prior art, order information is counted regularly by setting a time interval, so that the problem of untimely counting exists, and if an order newly issued between two times of counting violates rules, the order cannot be processed immediately; in addition, in the prior art, a huge amount of orders are searched one by one during each counting, so that a large part of invalid calculated amount exists, and the operation burden of the system is increased.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for counting violation orders, which can count violation orders in time and reduce an operation load of a system.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for counting violation orders, including:
acquiring order information of an order;
using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result;
if the order violation is determined, a second processing process is used for inquiring and processing a matched order of the order;
and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
In some optional embodiments, querying and processing the matching order of the orders using a second processing process comprises:
generating a processed identifier according to the order information and the statistical result;
judging whether the processed identifier exists in a cache or not;
if the processed identification does not exist in the cache, storing the processed identification into the cache, and inquiring a matched order of the order according to the order information and the statistical result so as to process the matched order;
and if the processed identification exists in the cache, not inquiring and processing the matched order.
In some optional embodiments, obtaining order information of the order includes:
storing the order information into rule middleware;
and adding the rule middleware to the tail of the rule queue.
In some optional embodiments, counting the order information according to a statistical rule and determining whether the order is illegal according to a statistical result includes:
acquiring the rule middleware from the head of the rule queue and acquiring the order information in the rule middleware;
storing the order information into a cache according to a statistical rule and carrying out statistics;
according to the statistical result, a label associated with the order is established;
and judging whether the order violates rules or not according to the label.
In some optional embodiments, if the order violation is determined, querying and processing a matching order of the orders using a second processing procedure, including:
if the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue;
obtaining the backtracking middleware from the head of the backtracking queue by using the second processing process, and obtaining the order information and the label in the backtracking middleware;
inquiring a matched order of the order according to the order information and the label;
and processing the matched order.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an apparatus for counting violation orders, including:
the order information acquisition module is used for acquiring order information of the order;
the rule counting module is used for counting the order information according to a counting rule by using a first processing process and judging whether the order violates rules or not according to a counting result;
the backtracking processing module is used for inquiring and processing a matched order of the order by using a second processing process when the order violation is determined;
and the rule processing module is used for storing the order information and the statistical result by using a first processing process and processing the order according to the statistical result.
In some optional embodiments, the backtracking processing module is further configured to: generating a processed identifier according to the order information and the statistical result; judging whether the processed identifier exists in a cache or not; if the processed identification does not exist in the cache, storing the processed identification into the cache, and inquiring a matched order of the order according to the order information and the statistical result so as to process the matched order; and if the processed identification exists in the cache, not inquiring and processing the matched order.
In some optional embodiments, the order information obtaining module is further configured to: storing the order information into rule middleware; and adding the rule middleware to the tail of the rule queue.
In some optional embodiments, the rule statistics module is further configured to: acquiring the rule middleware from the head of the rule queue and acquiring the order information in the rule middleware; storing the order information into a cache according to a statistical rule and carrying out statistics; according to the statistical result, a label associated with the order is established; and judging whether the order violates rules or not according to the label.
In some optional embodiments, the backtracking processing module is further configured to: when the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue; obtaining the backtracking middleware from the head of the backtracking queue by using the second processing process, and obtaining the order information and the label in the backtracking middleware; inquiring a matched order of the order according to the order information and the label; and processing the matched order.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic device for counting violation orders, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to perform at least the following:
acquiring order information of an order;
using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result;
if the order violation is determined, a second processing process is used for inquiring and processing a matched order of the order;
and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, at least realizing:
acquiring order information of an order;
using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result;
if the order violation is determined, a second processing process is used for inquiring and processing a matched order of the order;
and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
One embodiment of the above invention has the following advantages or benefits: because the processing process is adopted to count the order information after placing the order, when the order violation is determined according to the statistical rule, the order is processed, and simultaneously the other processing process is adopted to trace back and process the matched order of the order, the technical means that the order information is regularly counted by setting a time interval in the prior art is solved, the problem that the counting is not timely due to the fact that the order information is regularly counted, and a huge number of orders are searched one by one during each counting, a large part of invalid calculated amount exists, the operation burden of the system is increased, and the technical effects of timely counting the violation order and reducing the operation burden of the system are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of accounting for violation orders, according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the major modules of an apparatus for statistics of violation orders, according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main steps of a method for statistics of violation orders, according to an embodiment of the invention.
As shown in fig. 1, a method for statistics of violation orders according to an embodiment of the present invention includes:
and S10, obtaining order information of the order. The order information includes information related to placing an order, such as an order number of the order, information of a user placing the order, information of goods included in the order, information of order receipt, information of invoice, contact information of a placing user and a receiver, and the like. Various order information of the order is defined on different dimensions respectively, and two different orders can be distinguished through the order information; in other words, if the order information for two orders is the same, or very similar, then it may be substantially determined that the two orders are related.
The statistical rule may be identified by a number or the like, for example, a rule "the number of orders placed by the same IP reaches a certain threshold" may be set as number 10000, and a threshold "10" may be set for it, so that when a first order of the same IP is placed, for example, "IP 1_ 10000: 1 "when a second order is placed for the same IP, a statistical information such as" IP1_ 10000: 2 "to mark statistics for a dimension in the order information under a certain rule. The statistical rules may be preset manually or may be automatically generated according to some manner.
And S11, using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules according to a statistical result. The statistical rules are set according to different dimensions of the order information; for example, within a certain time interval (e.g., within one day), the number of occurrences of the same value of a specific dimension cannot exceed a certain threshold, and if the number of occurrences exceeds the certain threshold, it indicates that there is a possibility that the user is maliciously swiping an order, and accordingly, the orders with the same value of a specific dimension are all illegal orders, and should be screened out and processed. The "first processing process" in the steps represents a distributed processing process, and after the order information of the order is obtained, the steps of judging whether the order violates rules, processing after violation and the like are all executed by the first processing process, but not executed by the process for processing the order placement.
And S12, if the order violation is determined, using a second processing process to inquire and process the matching order of the order. The order violation determination conditions are described above, and are performed by setting corresponding statistical rules for different dimensions of the order. After the order violation is determined, in addition to processing the order, other orders which are in the same time interval with the order and have the same or similar values in the violation dimension need to be traced back before the order is processed as matching orders of the order. And after the first processing process determines that the order is illegal, on one hand, a task of backtracking the matched order is handed to the second processing process for processing, and on the other hand, the subsequent processing step of the order is continuously executed, wherein the actions of the two aspects are synchronously performed according to the rules of distributed processing, and the calculation speed cannot be influenced by the mutual inhibition. In addition, when a specific query is made, a search engine may be selected for execution, for example, ElasticSearch.
And S13, using a first processing process, storing the order information and the statistical result, and processing the order according to the statistical result. And storing the order information and the statistical result to be used as a counting basis of the statistical rule when the order comes later. Order information and statistical results can be stored in a cache in a log form for facilitating subsequent searching, for example, part of the content of the log may take the following form:
{
d_1001_a:5,
d_1001_b:5,
…
d_10003_a:1,
…
Pin:41,
Ip:42,
orderId:10003323,
addr, the achievement 444,
createdat:2017-03-38 15:00:00,
mobile:43,
.....
}
wherein, d _1001_ a:5, d _1001_ b:5 and d _10003_ a:1 represent the statistical result of the corresponding dimension of the order under each rule, Pin represents the identification number of the user, the order or the hardware, Ip represents the network protocol address when the user places the order, orderId represents the order number, addr represents the receiving address, createdat represents the order creation time, and mobile represents the reserved contact way of the receiver.
As can be seen from the above, in the embodiment of the present invention, the processing process is adopted to count the order information after placing the order, and when the order violation is determined according to the statistical rule, the order is processed while another processing process is adopted to trace back and process the matching order of the order, so that the problem that the statistics is not timely due to the fact that the order information is regularly counted by setting the time interval in the prior art is solved, and a huge number of orders are searched one by one during each statistics, which causes a large amount of invalid calculation, increases the operation load of the system, and achieves the technical effects of timely counting the violation orders and reducing the operation load of the system.
Problems are also encountered when handling violation orders in the manner of the above embodiments, such as: the threshold value of the rule of a certain dimension is 6, namely the judgment and the processing of illegal orders can be triggered when the order accumulation with the same value in the dimension reaches 6 pieces; then after the 6 th order is placed, the processing of the 6 th order and the backtracking and processing of the first 5 orders are triggered; after the 7 th order is placed, the 7 th order is triggered to be processed, and the previous 1 st to 6 th orders are processed, so that unnecessary calculation amount loss is caused if backtracking is carried out.
To further address the above issue, in some alternative embodiments, S12, using a second processing procedure to query and process matching orders of the orders, includes:
and generating a processed identifier according to the order information and the statistical result. Processed identification matching orders for recorded orders have undergone backtracking and processing.
And judging whether the processed identifier exists in the cache or not. To improve the operating efficiency of the system, and to coordinate the retrieval of matching orders, the cache may be a Redis cache or the like.
If the processed identification does not exist in the cache, the processed identification is stored in the cache, and a matched order of the order is inquired according to the order information and the statistical result so as to process the matched order.
And if the processed identification exists in the cache, not inquiring and processing the matched order.
The processed identification serves to mark whether a matching order for the violation order has already undergone backtracking. Firstly, the processed identifier should record the violating statistical rules of the illegal order as a characteristic thereof; in addition, since the violation of the order is time-efficient, the order violation can be determined only if the total number of orders with the same value in a certain dimension in a certain time interval reaches the threshold value specified by the statistical rule, and therefore the corresponding processed identifier can also have a time characteristic. For example, when the statistical rule is numbered, an order violates the statistical rule numbered 100001, and the order placing time of the order is located in the preset time interval Y _ M _ D10: 00-Y _ M _ D10: 10, the processed flag may be set to, for example: 100001_ Y _ M _ D10: 00_ Y _ M _ D10: 10.
As can be seen from the above, in the scheme of this embodiment, by setting and comparing the processed identifier, it is possible to avoid the second processing process processing repeated backtracking tasks, and reduce the computational burden of the system.
In other alternative embodiments of the present invention, statistics on violation orders are implemented by using a distributed processing process and a first-in-first-out queue. In this embodiment, at least two fifo queues, namely a regular queue and a backtracking queue, are maintained; the rule queue and the corresponding distributed processing process (such as a first processing process) are used for completing actions such as counting order information, judging whether an order violates rules, recording logs and the like; the backtracking queue and the corresponding distributed processing process (e.g., the second processing process) are used for backtracking and processing the matching order of the order when the order has a violation.
Storing a rule middleware in the rule queue, and storing a backtracking middleware in the backtracking queue; the rule middleware and the backtracking middleware are used for recording some related information such as order information and statistical results, and triggering corresponding processing flows after being acquired by corresponding processes, and can be regarded as a medium for task transmission.
The method for counting violation orders in the embodiment mainly includes the following steps:
and storing the order information of the order into the rule middleware.
And adding the rule middleware to the tail of the rule queue. In order to ensure the fairness of task execution, a first-in first-out queue is adopted, so that when a new middleware is added, the new middleware is added into the tail of the corresponding queue, and when the middleware is taken out for processing, the middleware is obtained from the head of the queue; the backtracking queue is also processed in a similar way, and is not described in detail.
And acquiring the rule middleware from the head of the rule queue, and acquiring the order information in the rule middleware.
And storing the order information into a cache according to a statistical rule and carrying out statistics.
And establishing a label associated with the order according to the statistical result.
And judging whether the order violates rules or not according to the label.
And if the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue. In addition, the first processing process is used for logging the order information and the label (or the statistical result corresponding to the label); the log may be stored in a cache and the first processing procedure may be used to process the order, for example, setting the order as an invalid order, releasing the stock of goods occupied by the order, and the like.
And using the second processing process to obtain the backtracking middleware from the head of the backtracking queue and obtain the order information and the label in the backtracking middleware.
And inquiring a matched order of the order according to the order information and the label. The matching order is the other order with the same or similar value in the violation dimension in the same time interval as the order, as described above.
And processing the matched order. The manner of processing may refer to the manner of processing for the offending order.
As can be seen from the above, in the scheme of this embodiment, whether an order violates a rule is processed through a distributed processing process and a first-in first-out queue, decoupling of current order information processing and matching order processing is achieved, the calculation burden of the system can be effectively alleviated in a high-concurrency and high-calculation-quantity state, meanwhile, the stability of the system is improved, and the problem caused by insufficient concurrency is avoided.
Fig. 2 is a schematic diagram of main blocks of an apparatus for statistics of violation orders according to an embodiment of the present invention.
As shown in fig. 2, an apparatus 200 for statistics of violation orders according to an embodiment of the present invention includes:
an order information obtaining module 201, configured to obtain order information of an order;
a rule statistics module 202, configured to use a first processing procedure, perform statistics on the order information according to a statistical rule, and determine whether the order violates a rule according to a statistical result;
the backtracking processing module 203 is configured to query and process a matching order of the order by using a second processing procedure when the order violation is determined;
and the rule processing module 204 is configured to use a first processing process, store the order information and the statistical result, and process the order according to the statistical result.
In some optional embodiments, the backtracking processing module 203 is further configured to: generating a processed identifier according to the order information and the statistical result; judging whether the processed identifier exists in a cache or not; if the processed identification does not exist in the cache, storing the processed identification into the cache, and inquiring a matched order of the order according to the order information and the statistical result so as to process the matched order; and if the processed identification exists in the cache, not inquiring and processing the matched order.
In some optional embodiments, the order information obtaining module 201 is further configured to: storing the order information into rule middleware; and adding the rule middleware to the tail of the rule queue.
In some optional embodiments, the rule statistics module 202 is further configured to: acquiring the rule middleware from the head of the rule queue and acquiring the order information in the rule middleware; storing the order information into a cache according to a statistical rule and carrying out statistics; according to the statistical result, a label associated with the order is established; and judging whether the order violates rules or not according to the label.
In some optional embodiments, the backtracking processing module 203 is further configured to: when the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue; obtaining the backtracking middleware from the head of the backtracking queue by using the second processing process, and obtaining the order information and the label in the backtracking middleware; inquiring a matched order of the order according to the order information and the label; and processing the matched order.
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
As can be seen from the above, in the embodiment of the present invention, the processing process is adopted to count the order information after placing the order, and when the order violation is determined according to the statistical rule, the order is processed while another processing process is adopted to trace back and process the matching order of the order, so that the problem that the statistics is not timely due to the fact that the order information is regularly counted by setting the time interval in the prior art is solved, and a huge number of orders are searched one by one during each statistics, which causes a large amount of invalid calculation, increases the operation load of the system, and achieves the technical effects of timely counting the violation orders and reducing the operation load of the system.
Fig. 3 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Referring now to FIG. 3, a block diagram of a computer system 300 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, the computer system 300 includes a Central Processing Unit (CPU)301 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the system 300 are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, the processes described above in the schematic representation of the main steps may be implemented as computer software programs according to embodiments of the present invention. For example, an embodiment of the invention comprises a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the method illustrated in the schematic diagram of the main steps. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 301.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an order information acquisition module, a rule statistics module, a backtracking module and a rule processing module. The names of these units do not in some cases constitute a limitation on the units themselves, and for example, the order information acquisition module may also be described as a "module that sends an order acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring order information of an order;
using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result;
if the order violation is determined, a second processing process is used for inquiring and processing a matched order of the order;
and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
According to the technical scheme of the embodiment of the invention, the order information is counted by the processing process after the order is placed, when the order violation is determined according to the statistical rule, the order is processed, and meanwhile, another technical means that the matching order of the order is backtracked and processed by the processing process is adopted, so that the problem that the counting is not timely due to the fact that the order information is counted regularly by setting time intervals in the prior art is solved, and huge orders are searched one by one during each counting, a large part of invalid calculated amount exists, the running load of the system is increased, and the technical effects of timely counting the violation order and reducing the running load of the system are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for accounting for violating orders, comprising:
acquiring order information of an order;
using a first processing process, counting the order information according to a statistical rule and judging whether the order violates rules or not according to a statistical result;
if the order violation is determined, using a second processing process to query and process a matching order of the order, including:
generating a processed identifier according to the order information and the statistical result;
judging whether the processed identifier exists in a cache or not;
if the processed identification does not exist in the cache, storing the processed identification into the cache, and inquiring a matched order of the order according to the order information and the statistical result so as to process the matched order;
if the processed identification is determined to exist in the cache, the matched order is not inquired and processed;
and using a first processing process to store the order information and the statistical result and process the order according to the statistical result.
2. The method of claim 1, wherein obtaining order information for the order comprises:
storing the order information into rule middleware;
and adding the rule middleware to the tail of the rule queue.
3. The method according to claim 2, wherein counting the order information according to a statistical rule and determining whether the order is illegal according to a statistical result comprises:
acquiring the rule middleware from the head of the rule queue and acquiring the order information in the rule middleware;
storing the order information into a cache according to a statistical rule and carrying out statistics;
according to the statistical result, a label associated with the order is established;
and judging whether the order violates rules or not according to the label.
4. The method of claim 3, wherein querying and processing a matching order of the orders using a second processing process if the order violation is determined comprises:
if the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue;
obtaining the backtracking middleware from the head of the backtracking queue by using the second processing process, and obtaining the order information and the label in the backtracking middleware;
inquiring a matched order of the order according to the order information and the label;
and processing the matched order.
5. An apparatus for accounting for violating orders, comprising:
the order information acquisition module is used for acquiring order information of the order;
the rule counting module is used for counting the order information according to a counting rule by using a first processing process and judging whether the order violates rules or not according to a counting result;
the backtracking processing module is configured to query and process a matching order of the order by using a second processing procedure when determining that the order violates a rule, and includes:
generating a processed identifier according to the order information and the statistical result; judging whether the processed identifier exists in a cache or not; if the processed identification does not exist in the cache, storing the processed identification into the cache, and inquiring a matched order of the order according to the order information and the statistical result so as to process the matched order; if the processed identification is determined to exist in the cache, the matched order is not inquired and processed;
and the rule processing module is used for storing the order information and the statistical result by using a first processing process and processing the order according to the statistical result.
6. The apparatus of claim 5, wherein the order information acquisition module is further configured to: storing the order information into rule middleware; and adding the rule middleware to the tail of the rule queue.
7. The apparatus of claim 6, wherein the rule statistics module is further configured to: acquiring the rule middleware from the head of the rule queue and acquiring the order information in the rule middleware; storing the order information into a cache according to a statistical rule and carrying out statistics; according to the statistical result, a label associated with the order is established; and judging whether the order violates rules or not according to the label.
8. The apparatus of claim 7, wherein the backtracking processing module is further configured to: when the order violation is determined, storing the order information and the label into backtracking middleware by using the first processing process and adding the backtracking middleware into the tail part of a backtracking queue; obtaining the backtracking middleware from the head of the backtracking queue by using the second processing process, and obtaining the order information and the label in the backtracking middleware; inquiring a matched order of the order according to the order information and the label; and processing the matched order.
9. An electronic device for statistics of violating orders, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710270088.2A CN108734537B (en) | 2017-04-24 | 2017-04-24 | Method and device for counting violation orders |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710270088.2A CN108734537B (en) | 2017-04-24 | 2017-04-24 | Method and device for counting violation orders |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108734537A CN108734537A (en) | 2018-11-02 |
CN108734537B true CN108734537B (en) | 2021-04-30 |
Family
ID=63934332
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710270088.2A Active CN108734537B (en) | 2017-04-24 | 2017-04-24 | Method and device for counting violation orders |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108734537B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110807703A (en) * | 2019-11-12 | 2020-02-18 | 上海燕汐软件信息科技有限公司 | Order processing method and device, electronic equipment and computer readable storage medium |
CN113763083B (en) * | 2020-09-18 | 2025-01-14 | 北京沃东天骏信息技术有限公司 | Information processing method and device |
CN114429385A (en) * | 2021-12-31 | 2022-05-03 | 北京百度网讯科技有限公司 | An order information detection method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104836701A (en) * | 2015-05-04 | 2015-08-12 | 北京京东尚科信息技术有限公司 | Order monitoring method and monitoring apparatus |
CN106059847A (en) * | 2016-04-08 | 2016-10-26 | 久远谦长(北京)技术服务有限公司 | User ordering behavior detection method and device |
CN106384273A (en) * | 2016-10-08 | 2017-02-08 | 江苏通付盾科技有限公司 | Malicious order scalping detection system and method |
CN106528590A (en) * | 2016-09-18 | 2017-03-22 | 青岛海信电器股份有限公司 | A query method and apparatus |
CN106557955A (en) * | 2016-11-29 | 2017-04-05 | 流量海科技成都有限公司 | Net about car exception order recognition methodss and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9209995B2 (en) * | 2006-12-29 | 2015-12-08 | Prodea Systems, Inc. | Presence status notification from digital endpoint devices through a multi-services gateway device at the user premises |
-
2017
- 2017-04-24 CN CN201710270088.2A patent/CN108734537B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104836701A (en) * | 2015-05-04 | 2015-08-12 | 北京京东尚科信息技术有限公司 | Order monitoring method and monitoring apparatus |
CN106059847A (en) * | 2016-04-08 | 2016-10-26 | 久远谦长(北京)技术服务有限公司 | User ordering behavior detection method and device |
CN106528590A (en) * | 2016-09-18 | 2017-03-22 | 青岛海信电器股份有限公司 | A query method and apparatus |
CN106384273A (en) * | 2016-10-08 | 2017-02-08 | 江苏通付盾科技有限公司 | Malicious order scalping detection system and method |
CN106557955A (en) * | 2016-11-29 | 2017-04-05 | 流量海科技成都有限公司 | Net about car exception order recognition methodss and system |
Also Published As
Publication number | Publication date |
---|---|
CN108734537A (en) | 2018-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108734537B (en) | Method and device for counting violation orders | |
CN109241084B (en) | Data query method, terminal equipment and medium | |
CN110598138A (en) | Cache-based processing method and device | |
CN114091704B (en) | Alarm suppression method and device | |
CN110427304A (en) | O&M method, apparatus, electronic equipment and medium for banking system | |
CN113743697B (en) | Risk alarm method and device | |
CN111861298A (en) | Order canceling method and device | |
CN113783924B (en) | A method and device for processing access request | |
CN113379258A (en) | Inventory management method and device | |
CN113760176A (en) | Data storage method and device | |
CN113763083B (en) | Information processing method and device | |
CN113469825A (en) | Data processing method and device, electronic equipment and computer readable medium | |
CN113760988A (en) | Method, device, equipment and storage medium for associating and processing unbounded stream data | |
CN113220705A (en) | Slow query identification method and device | |
CN113760903B (en) | A method, device, equipment and storage medium for processing unbounded stream data association | |
CN110378641A (en) | A kind of method and apparatus counting unmanned vehicle information | |
CN115935298A (en) | Illegal installation software identification method, device, equipment and storage medium | |
CN112488625B (en) | Method, device, equipment and storage medium for identifying returned part | |
CN110493291A (en) | A kind of method and apparatus handling HTTP request | |
CN113722113A (en) | Traffic statistic method and device | |
CN110597802B (en) | Message processing method and device | |
CN110019256A (en) | Data processing method and device | |
CN112258310A (en) | Resource processing method, device and system | |
CN114661772B (en) | Data processing method and related device | |
CN113114611A (en) | Method and device for managing blacklist |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |