WO2017092599A1 - 一种库存异常数据的检测方法、装置及电子设备 - Google Patents

一种库存异常数据的检测方法、装置及电子设备 Download PDF

Info

Publication number
WO2017092599A1
WO2017092599A1 PCT/CN2016/107016 CN2016107016W WO2017092599A1 WO 2017092599 A1 WO2017092599 A1 WO 2017092599A1 CN 2016107016 W CN2016107016 W CN 2016107016W WO 2017092599 A1 WO2017092599 A1 WO 2017092599A1
Authority
WO
WIPO (PCT)
Prior art keywords
inventory
change data
data
abnormal
new
Prior art date
Application number
PCT/CN2016/107016
Other languages
English (en)
French (fr)
Inventor
陈彩莲
王金炜
袁康
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017092599A1 publication Critical patent/WO2017092599A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders

Definitions

  • the present application relates to the field of data detection technologies, and in particular, to a method, a device, and an electronic device for detecting inventory abnormal data.
  • the business factors include the wrong setting of the commodity inventory data by the merchant
  • the platform technical factors include the inaccurate deduction of the inventory during the commodity transaction process caused by the technical reasons.
  • the platform technology factor is the main reason for the inaccuracy of the commodity inventory data. For example, after the order operation, the inventory should be deducted but the inventory is not deducted, or the inventory should be replenished but the inventory is not replenished. Since e-commerce platforms usually involve multiple complex systems (transaction systems and inventory management systems, etc.), it is self-evident that real-time monitoring of inventory anomalies, especially for systems with mass goods.
  • the prior art performs offline calculation by utilizing a Hadoop cluster to find out whether the system has a risk of oversold goods.
  • this method also has some shortcomings, that is, the non-real-time performance of offline calculation cannot meet the actual demand.
  • online real-time monitoring methods are currently used to detect commodity inventory data that has been oversold.
  • the method uses the commodity inventory data at a certain point in time as the reference inventory data (generally the inventory at the zero point, so it is also called the zero inventory), and the reference inventory data and the accumulated inventory change value within the preset time interval after the time point. For comparison, when the baseline inventory data is found to be less than the accumulated inventory change value, it is determined that the system has an oversold problem.
  • the online real-time monitoring detection method detects the existence of oversold risk based on the cumulative value of the inventory change over a period of time, if the reference inventory data is large, it may take a long time interval to detect the reference.
  • the inventory data is less than the cumulative value of the inventory change. It can be seen that this method does not really achieve the effect of detecting inventory anomalies in real time, that is, it cannot be detected every time an abnormal inventory change data is generated.
  • the present application provides a method, a device, and an electronic device for detecting inventory abnormality data, so as to solve the problem that the prior art cannot change the inventory change data of each abnormality in real time.
  • the application provides a method for detecting inventory abnormal data, including:
  • the detecting, according to the new transaction status change data and the inventory deduction mode of the to-be-detected order application, detecting whether the newly added inventory change data is abnormal inventory change data includes:
  • the detecting, according to the new transaction status change data and the inventory deduction mode of the to-be-detected order application, detecting whether the newly added inventory change data is abnormal inventory change data includes:
  • the detecting, according to the new transaction status change data and the inventory deduction mode of the to-be-detected order application, detecting whether the newly added inventory change data is abnormal inventory change data includes:
  • the method further includes:
  • the new inventory change data is stored as a detection result of the abnormal inventory change data.
  • it also includes:
  • the order to be inspected is marked as an order with an abnormal inventory update.
  • the method further includes:
  • the new inventory change data is deleted as the detection result of the abnormal inventory change data.
  • the acquiring the new transaction status change data of the to-be-detected order and the corresponding new inventory change data are as follows:
  • it also includes:
  • the abnormal processing result is stored in the newly added transaction state change data or the newly added inventory change data;
  • the abnormal processing result is used as an abnormal cause of the abnormal stock change data.
  • the processing result is stored in the newly added transaction state change data; and before the storing the abnormality processing result in the newly added transaction state change data, the method further includes:
  • the exception processing result is obtained through an inventory interface provided by the inventory management system.
  • the detection method of the inventory abnormality data is performed.
  • the detection method of the inventory abnormal data is run in an abnormal data detection platform constructed based on a real-time distributed computing processing framework.
  • the inventory abnormality detection notification is generated by the following steps:
  • the abnormal data detecting platform After the abnormal data detecting platform receives at least one of the newly added transaction state change data and the new inventory change data, if the preset sent inventory abnormality detecting notification condition is established, the sending corresponds to the adding The stock status change data or the stock abnormality detection notification of the order to which the new stock change data belongs.
  • the preset sending inventory abnormality detecting notification condition includes: the current time and the time interval between receiving the newly added transaction state change data or the newly added inventory change data reaches a preset time interval, or waiting Check the memory space occupied by the order to reach the preset memory space.
  • the method further includes:
  • the application further provides a detecting device for inventory abnormal data, comprising:
  • a first acquiring unit configured to acquire new transaction status change data of the to-be-detected order and new inventory change data corresponding thereto;
  • a detecting unit configured to detect, according to the newly added transaction state change data and the inventory deduction mode of the to-be-detected order application, whether the newly added inventory change data is abnormal inventory change data.
  • the detecting unit includes:
  • Obtaining a subunit configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order
  • a calculating subunit configured to calculate an expected value of the new inventory change data according to the current transaction status and an inventory deduction mode of the to-be-detected order application;
  • a determining subunit configured to determine whether the newly added inventory change data and the expected value are the same
  • the determination abnormal subunit is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • the detecting unit includes:
  • Obtaining a subunit configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order
  • a calculating subunit configured to generate an expected transaction status of the to-be-detected order according to the inventory deduction mode of the to-be-detected order application and the new inventory change data;
  • a determining subunit configured to determine whether a current transaction status of the to-be-detected order and the expected transaction status are the same;
  • the determination abnormal subunit is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • the detecting unit includes:
  • Obtaining a subunit configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order
  • a calculating subunit configured to calculate an expected value of the new inventory change data according to the current transaction status and an inventory deduction mode of the to-be-detected order application; and an inventory deduction mode applied according to the to-be-detected order And the newly added inventory change data, generating an expected transaction status of the to-be-detected order;
  • a determining subunit configured to determine whether the new inventory change data and the expected value are the same, and whether the current transaction status of the to-be-detected order and the expected transaction status are the same;
  • the determination abnormal subunit is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • the method further includes:
  • the storage result unit is configured to store the detection result that the new inventory change data is the abnormal inventory change data.
  • it also includes:
  • a marking unit for marking the to-be-detected order as an order for an inventory update exception.
  • the method further includes:
  • a judging unit configured to determine whether the to-be-detected order is marked as an order that the inventory update is abnormal
  • the deleting unit is configured to delete the detection result of the abnormal inventory change data as the abnormal inventory change data if the determination result is YES.
  • it also includes:
  • a second acquiring unit configured to acquire a pre-stored abnormal processing result when the new inventory change data is generated; the abnormal processing result is stored in the newly added transaction state change data or the newly added inventory change data;
  • a setting unit configured to use the abnormal processing result as an abnormal cause of the abnormal inventory change data.
  • the detection method of the inventory abnormality data is performed.
  • the detection method of the inventory abnormal data is run in an abnormal data detection platform constructed based on a real-time distributed computing processing framework.
  • it also includes:
  • a notification unit is generated for generating the inventory abnormality detection notification.
  • the generating the notification unit includes:
  • a synchronization subunit configured to synchronize the new transaction state change data and the new inventory change data to the abnormal data detection platform by using an incremental data real-time synchronization device
  • a sending subunit configured to: after the abnormal data detecting platform receives the at least one of the newly added transaction state change data and the new inventory change data, if the preset sending inventory abnormality detecting notification condition is established, An inventory abnormality detection notification corresponding to the new transaction state change data or the order to which the new inventory change data belongs is transmitted.
  • the generating the notification unit further includes:
  • a data processing sub-unit configured to perform data regularization processing on the newly added transaction state change data and the new inventory change data according to a preset data normalization rule.
  • an electronic device including:
  • a memory configured to store inventory abnormality data detecting means, wherein the detecting means of the inventory abnormal data is executed by the processor, comprising the steps of: acquiring a new transaction state change number of the to-be-detected order And the new inventory change data corresponding thereto; and detecting whether the new inventory change data is abnormal inventory change data according to the newly added transaction state change data.
  • the method, device and electronic device for detecting inventory abnormality data obtained new transaction state change data of the to-be-detected order and corresponding new inventory change data; and change data and pending orders according to the newly added transaction status.
  • the applied inventory deduction mode detects whether the new inventory change data is abnormal inventory change data, that is, real-time analysis and judgment on the correctness of the inventory change caused by each transaction status change, thereby enabling fine-grained detection. Inventory change data to identify problems in the inventory update process in a timely manner.
  • FIG. 1 is a flow chart of an embodiment of a method for detecting inventory abnormality data of the present application
  • FIG. 2 is a flowchart of an embodiment of detecting an inventory abnormality data of the present application for transmitting an inventory abnormality detection notification
  • FIG. 3 is a schematic diagram of an abnormal data detection platform of an embodiment of a method for detecting inventory abnormal data according to the present application
  • step S103 is a flow chart of step S103 of the embodiment of the method for detecting inventory abnormality data of the present application
  • FIG. 5 is still another flowchart of step S103 of the embodiment of the apparatus for detecting inventory abnormality data of the present application.
  • step S103 of the embodiment of the apparatus for detecting inventory abnormality data of the present application is still another flowchart of step S103 of the embodiment of the apparatus for detecting inventory abnormality data of the present application
  • FIG. 7 is a schematic diagram of an embodiment of a device for detecting inventory abnormality data of the present application.
  • FIG. 8 is a detailed schematic diagram of a detecting unit 103 of an apparatus for detecting inventory abnormality data of the present application
  • FIG. 9 is a detailed schematic diagram of an embodiment of a device for detecting inventory abnormality data according to the present application.
  • FIG. 10 is a specific schematic diagram of an apparatus for generating an abnormality of the inventory abnormality detecting unit 213 of the present application
  • FIG. 11 is a schematic diagram of an embodiment of an electronic device of the present application.
  • the basic idea of the core of the method for detecting inventory abnormal data is to detect whether there is an abnormality in the corresponding stock change data based on the order status change data, that is, fine-grained detection of the stock change data. By By detecting the inventory changes caused by each transaction status change, it is possible to discover problems in the inventory update process in real time, thereby improving the accuracy of the commodity inventory data.
  • FIG. 1 is a flowchart of an embodiment of a method for detecting inventory abnormality data according to the present application.
  • the method includes the following steps:
  • Step S101 Acquire new transaction status change data of the to-be-detected order and new inventory change data corresponding thereto.
  • the new transaction status change data and the new inventory change data described in the embodiments of the present application are both change data belonging to the same order.
  • the orders belonging to the same data are referred to as pending orders.
  • the new transaction status change data refers to the transaction status change data generated when the order is operated.
  • Order operations include: order generation, payment, shipping or refund operations.
  • the operation of the order will change the transaction status of the order, resulting in transaction status change data.
  • the order status of the order includes: order status, payment status, delivery status, and refund status.
  • the new inventory change data refers to the new inventory change data corresponding to the newly added transaction status change data, that is, when the order is operated, the transaction status change data and the inventory change data are generated.
  • Example 1 the shopping website sells a kind of clothes, the clothes have a total of 200 stocks, of which 100 are red and 100 are blue, and the current products are all using the "deduction of inventory reduction" inventory deduction mode; when Xiaohong is on the website
  • the newly added transaction state change data of the to-be-detected order and the corresponding new inventory change data are obtained by adopting the following method: acquiring new transaction state change data and adding new inventory according to the order number of the to-be-detected order Change the data.
  • step S103 detect whether there is an abnormality in the inventory change data based on the transaction state change data.
  • the transaction status change data and the inventory change data in the actual application are usually derived from different systems, that is, the transaction status change data is derived from the transaction system, and the inventory change data is derived from the inventory management system.
  • the data changes of different systems are in a sequential order. If each data change triggers the method provided by the embodiment of the present application, it may be because the data has not arrived yet, resulting in a false positive result. Although the error determination result can be corrected by re-detection after both data are acquired, the detection efficiency is greatly reduced. It can be seen that if the data can be detected after obtaining the transaction status change data and the inventory change data, the detection efficiency and system performance are improved.
  • the method provided by the embodiment of the present application is performed when the inventory abnormality detection notification corresponding to the to-be-detected order is monitored.
  • FIG. 2 is a flowchart of sending an inventory abnormality detection notification according to an embodiment of the method for detecting inventory abnormality data of the present application.
  • the inventory abnormality detection notification may be generated by the following steps:
  • Step S201 Synchronize the newly added transaction state change data and the new inventory change data to the abnormal data detection platform by using an incremental data real-time synchronization device.
  • the incremental transaction real-time synchronization device can synchronize the new transaction status change data generated by the transaction system and the new inventory change data generated by the inventory management system to the abnormal data detection platform.
  • FIG. 3 is a schematic diagram of an abnormal data detection platform of the method for detecting inventory abnormal data according to the present application.
  • the DRC in Figure 3 is an incremental data real-time synchronization device that synchronizes the incremental data of the transaction system and the inventory management system to the abnormal data detection platform in real time through the DRC as a data source for tradeSpout and invSpout.
  • the detection platform includes two data sources: tradeSpout and invSpout, and three calculation modules: etlBolt, actionBolt and checkBolt.
  • the tradeSpout data source includes new transaction status change data
  • the invSpout data source includes new inventory change data. Since the data source is accessed via DRC, The number of concurrent tradespout and invSpout is related to the topic of the data source, and the two correspond to each other.
  • the etlBolt calculation module in the detection platform subscribes to the change data of tradeSpout and invSpout.
  • etlBolt isolates the physical relationship of the data source and can freely increase the number of concurrent.
  • etlBolt obtains any new data, it will transmit the order number of the newly added data.
  • the new transaction state change data and the new inventory change data data are preprocessed (including data filtering and the like) by the etlBolt calculation module, so that the data actually needed for detecting the abnormality can be stored in the HBASE intermediate table. .
  • Step S203 After the abnormal data detecting platform receives at least one of the newly added transaction state change data and the newly added inventory change data, if the preset sent inventory abnormality detecting notification condition is established, the corresponding office is sent. An inventory abnormality detection notification of an order to which the new transaction status change data or the new inventory change data belongs is described.
  • the method provided in the embodiment of the present application is to control the sending of the inventory abnormality detection notification by using the actionBolt calculation module after the abnormal data detecting platform receives at least one of the newly added transaction state change data and the newly added inventory change data.
  • the actionBolt calculation module is configured to control the sending inventory abnormality detection notification, and the order number is transmitted when the preset sending stock abnormality detecting notification condition is established.
  • the preset sending inventory abnormality detecting notification condition includes: the current time and the time interval between receiving the newly added transaction state change data or the newly added inventory change data reaches a preset time interval, or the order to be detected The occupied memory space reaches the preset memory space.
  • the first condition is that an inventory anomaly detection notification for the order to which the new data belongs is sent after the preset time interval after the first new data is acquired, that is, it is assumed that the arrival time interval of the two aspects of data should be in advance.
  • the second condition is to send an inventory abnormality detection notification for the order to which the new data belongs when the memory space for storing the newly added data reaches the maximum range of the preset memory.
  • the checkBolt calculation module in the detection platform subscribes to the actionBolt data.
  • the new transaction status change data and the new inventory change of the order number are taken out from the HBASE according to the order number in the notification.
  • the data is executed by the method provided in the embodiment of the present application to detect the inventory abnormality data. If the data abnormality is detected, the abnormal data is output to the database.
  • the detection logic of the inventory abnormal data is used as a service plug-in of the abnormal data detection platform, and is run in real time on the detection platform by means of a JAR package to realize a business target.
  • the embodiment of the present application constructs an abnormal data detection platform through the existing real-time distributed computing processing framework STORM and HBASE data storage system, which not only simplifies the process of platform construction, but also builds the detection platform independently of the transaction system and the inventory management system, It will put a burden on the trading system and the inventory management system.
  • Step S103 Detect whether the new inventory change data is abnormal inventory change data according to the newly added transaction state change data and the inventory deduction mode of the to-be-detected order application.
  • the inventory deduction mode described in the embodiment of the present application is provided by the inventory management system, for example, taking a mode of reducing inventory or paying off inventory.
  • the trading system decides which inventory deduction mode to use based on business needs. Therefore, the inventory deduction mode can be stored in the transaction status change data.
  • the inventory change data is related to the inventory deduction mode. Under the same transaction status change data, if the inventory deduction mode is different, the generated inventory change data is also different.
  • the method provided in the embodiment of the present application is based on the premise of the known inventory deduction mode, and detects whether the new inventory change data is abnormal according to the newly added transaction status change data.
  • step S103 Three alternative embodiments of step S103 are given below:
  • Step S103 of the first scheme includes:
  • Step S1031 Acquire a current transaction status of the to-be-detected order according to the newly added transaction status change data.
  • the current transaction status of the pending order is obtained from the newly added transaction status change data.
  • the current transaction status is described in the example 1 in step S101.
  • Step S1033 Calculate an expected value of the new inventory change data according to the current transaction status and the inventory deduction mode of the to-be-detected order application.
  • the calculation rules for the expected value of the inventory change data can be set according to the specific application requirements. Taking the inventory deduction mode of “taking the inventory reduction” as an example, the applicable calculation rules include: 1) when the order status is In the inactive state, if the saleable inventory has been reduced, the expected value is the replenishable saleable inventory; 2) when the order status is in effect, the expected value is reduced for saleable inventory; 3) when the order status is closed before payment When the available inventory has been reduced, the expected value is the replenishable saleable inventory.
  • the various calculation rules described above are only changes to the specific embodiments, and do not depart from the core of the present application, and therefore are all within the scope of the present application.
  • Step S1035 Determine whether the newly added inventory change data and the expected value are the same.
  • the actual change data in the newly added inventory change data is compared with the expected value of the stock change data acquired in step S1033 to determine whether the two are consistent.
  • Step S1037 If yes, it is determined that the new inventory change data is normal inventory change data.
  • the new inventory change data is normal inventory change data.
  • Step S1039 If no, it is determined that the new inventory change data is the abnormal inventory change data.
  • the new inventory change data is abnormal inventory change data.
  • the abnormal inventory data detection from the transaction state change data to the inventory change data can be realized.
  • scenario 2 the basic idea of scenario 2 is to implement the detection of inventory change data to transaction state change data, ie, comparing the actual value of the transaction change data with the expected value.
  • FIG. 5 is still another flowchart of step S103 of the method for detecting inventory abnormality data of the present application. And detecting, according to the newly added transaction state change data, whether the newly added inventory change data is abnormal inventory change data, including:
  • Step S1031' acquiring the current transaction status of the to-be-detected order according to the newly added transaction status change data.
  • Step S1031' is the same as step S1031, and details are not described herein again.
  • Step S1033' generating an expected transaction status of the to-be-detected order according to the inventory deduction mode of the to-be-detected order application and the new inventory change data.
  • the expected transaction status of the pending order can be derived backward. This step is still described in the example 1 in step S101, since the current products are used.
  • Step S1035' determining whether the current transaction status of the to-be-detected order and the expected transaction status are the same.
  • the actual transaction status in the newly added transaction status change data is compared with the obtained expected transaction status one by one to determine whether the actual value of each transaction status is consistent with the expected value.
  • Step S1037' If yes, it is determined that the new inventory change data is normal inventory change data.
  • the new inventory change data is normal inventory change data.
  • Step S1037' If no, it is determined that the newly added stock change data is the abnormal stock change data.
  • the new inventory change data is abnormal inventory change data.
  • abnormal inventory data detection from the inventory change data to the transaction state change data can be realized.
  • the third scheme is to combine the scheme 1 and the scheme 2 to realize the detection from the transaction status change data to the inventory change data and the two dimensions from the inventory change data to the transaction status change data.
  • FIG. 6 is still another flowchart of step S103 of the method for detecting inventory abnormality data of the present application. And detecting, according to the newly added transaction state change data, whether the newly added inventory change data is abnormal inventory change data, including:
  • Step S1031 : acquiring the current transaction status of the to-be-detected order according to the newly added transaction status change data.
  • Step S1031" is the same as step S1031, and details are not described herein again.
  • Step S1033 calculating an expected value of the new inventory change data according to the current transaction status and an inventory deduction mode of the to-be-detected order application; and an inventory deduction mode and a location according to the to-be-detected order application
  • the new inventory change data is generated, and the expected transaction status of the to-be-detected order is generated.
  • This step combines the above steps S1033 and S1033', and will not be described again here.
  • Step S1035" determining whether the new inventory change data and the expected value are the same, and whether the current transaction status of the to-be-detected order and the expected transaction status are the same.
  • This step determines whether the actual value of the newly added inventory change data is the same as the expected value, and the current status of the pending order. Whether the transaction status and the expected transaction status are the same.
  • Step S1037 If yes, it is determined that the new inventory change data is normal inventory change data.
  • the new inventory change data is normal inventory change data.
  • Step S1039 If no, it is determined that the new inventory change data is the abnormal inventory change data.
  • the new inventory change data is abnormal inventory change data.
  • step S103 may be implemented by selecting one of the foregoing solutions according to specific application requirements.
  • the above various detection schemes are only changes of the specific embodiments, and do not deviate from the core of the present application, and therefore are within the protection scope of the present application.
  • the step S103 detects that the new inventory change data is abnormal inventory change data, the abnormality may be due to the lack of new data on the one hand, etc., in order to make the misjudgment in the later stage.
  • the result is corrected.
  • the method provided by the embodiment of the present application further includes the step of storing the detection result that the new inventory change data is abnormal inventory change data. Further, in order to facilitate the easy to find the inventory change data determined to be abnormal in the later stage, it is preferable to mark the order to be detected as an order in which the inventory update is abnormal.
  • the detection method when detecting the new inventory data, if the new inventory change data is detected as normal inventory change data, the detection method further includes: determining whether the to-be-detected order is marked as an order with an abnormal inventory update. If it is found that the order has been marked as an order with abnormal inventory update, it is necessary to delete the detection result of the inventory change data whose abnormality of the new inventory change data is abnormal, thereby correcting the result of the misjudgment.
  • the inventory change data caused by each transaction state change can be detected, and the problems existing in the inventory update process can be found in real time, thereby improving the accuracy of the commodity inventory data.
  • the abnormal cause of the coarseness and the fineness can be directly determined, for example, the saleable inventory is not reduced or the replenishable inventory is not replenished.
  • the prior art manually obtains the inventory management system log method to obtain the fine-grained reason for the abnormal inventory update data. Since the method is manually operated, it requires a lot of manpower and is a huge project.
  • the method provided by the embodiment of the present application further includes: 1) acquiring a pre-stored abnormal processing result when the new inventory change data is generated; the abnormal processing result is stored in the newly added transaction state change data or the The new inventory change data is added; 2) the abnormal processing result is used as the abnormal cause of the abnormal inventory change data.
  • the abnormal processing result described in the embodiment of the present application refers to an error code or an error description returned by the inventory management system when generating inventory change data.
  • the inventory management system When the inventory management system generates inventory change data, it generally analyzes the cause of the failure, and then returns the corresponding error code and error description, and records the error code and error description into the exception log file.
  • a fine-grained abnormal cause is obtained by manually finding an abnormal log file.
  • the method provided by the embodiment of the present application pre-stores the abnormal processing result in the newly added transaction state change data or the new inventory change data, so that when it is determined that the new inventory change data is abnormal data, the direct reading can be directly read.
  • the abnormal processing result is stored in advance in the newly added transaction state change data, so that when the newly added transaction state change data and the newly added inventory change data are not synchronized, the abnormal processing result can be replaced by the abnormal processing result.
  • the abnormal inventory change data is determined to reduce the false positive rate of abnormal data.
  • the inventory management system provides an inventory interface for the transaction system to invoke in the desired scenario.
  • the transaction system maps the inventory interface to a short number of return information stored in the new transaction status change data.
  • a method for detecting inventory abnormality data is provided.
  • the present application further provides a device for detecting inventory abnormality data.
  • the device corresponds to an embodiment of the above method.
  • FIG. 7 is a schematic diagram of an embodiment of a device for detecting inventory abnormality data according to the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. The device embodiments described below are merely illustrative.
  • the first obtaining unit 101 is configured to acquire new transaction state change data of the to-be-detected order and new inventory change data corresponding thereto;
  • the detecting unit 103 is configured to detect, according to the newly added transaction state change data and the inventory deduction mode of the to-be-detected order application, whether the newly added inventory change data is abnormal inventory change data.
  • FIG. 8 is a specific schematic diagram of the detecting unit 103 of the detecting device embodiment of the inventory abnormality data of the present application.
  • the detecting unit 103 includes:
  • the obtaining sub-unit 1031 is configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order;
  • a calculating sub-unit 1033 configured to perform an inventory deduction mode according to the current transaction status and the to-be-detected order application Calculating the expected value of the new inventory change data
  • a determining sub-unit 1035 configured to determine whether the newly added inventory change data and the expected value are the same
  • the determining normal sub-unit 1037 is configured to determine that the new inventory change data is normal inventory change data if the determination result is YES;
  • the determination abnormality subunit 1039 is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • the detecting unit 103 includes:
  • Obtaining a subunit configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order
  • a calculating subunit configured to generate an expected transaction status of the to-be-detected order according to the inventory deduction mode of the to-be-detected order application and the new inventory change data;
  • a determining subunit configured to determine whether a current transaction status of the to-be-detected order and the expected transaction status are the same;
  • the determination abnormal subunit is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • the detecting unit 103 includes:
  • Obtaining a subunit configured to acquire, according to the newly added transaction status change data, a current transaction status of the to-be-detected order
  • a calculating subunit configured to calculate an expected value of the new inventory change data according to the current transaction status and an inventory deduction mode of the to-be-detected order application; and an inventory deduction mode applied according to the to-be-detected order And the newly added inventory change data, generating an expected transaction status of the to-be-detected order;
  • a determining subunit configured to determine whether the new inventory change data and the expected value are the same, and whether the current transaction status of the to-be-detected order and the expected transaction status are the same;
  • the determination abnormal subunit is configured to determine that the new inventory change data is the abnormal inventory change data if the determination result is negative.
  • FIG. 9 is a specific schematic diagram of an embodiment of a device for detecting inventory abnormality data according to the present application.
  • the method further includes:
  • the storage result unit 201 is configured to store the detection result of the new inventory change data as the abnormal inventory change data.
  • it also includes:
  • the marking unit 203 is configured to mark the to-be-detected order as an order for an inventory update abnormality.
  • the method further includes:
  • the determining unit 205 is configured to determine whether the to-be-detected order is marked as an order that the inventory update is abnormal;
  • the deleting unit 207 is configured to delete the detection result of the abnormal inventory change data as the abnormal inventory change data if the determination result is YES.
  • it also includes:
  • the second obtaining unit 209 is configured to acquire a pre-stored abnormal processing result when the new inventory change data is generated, where the abnormal processing result is stored in the newly added transaction state change data or the newly added inventory change data. ;
  • the setting unit 211 is configured to use the processing result as an abnormal cause of the abnormal inventory change data.
  • the detection method of the inventory abnormality data is performed.
  • the detection method of the inventory abnormal data is run in an abnormal data detection platform constructed based on a real-time distributed computing processing framework.
  • it also includes:
  • the generating notification unit 213 is configured to generate the inventory abnormality detecting notification.
  • FIG. 10 is a specific schematic diagram of the apparatus for generating a notification of the inventory abnormality data of the present application.
  • the generating notification unit 213 includes:
  • the synchronization subunit 2131 is configured to synchronize the newly added transaction state change data and the new inventory change data to the abnormal data detection platform by using an incremental data real-time synchronization device;
  • a sending subunit 2133 configured to: after the abnormal data detecting platform receives at least one of the newly added transaction state change data and the new inventory change data, if a preset sending inventory abnormality detecting notification condition is established, And sending an inventory abnormality detection notification corresponding to the new transaction state change data or the order to which the new inventory change data belongs.
  • the generating the notification unit 213 further includes:
  • the data processing sub-unit 2132 is configured to perform data regularization processing on the newly added transaction state change data and the new inventory change data according to a preset data normalization rule.
  • FIG. 11 is a schematic diagram of an embodiment of an electronic device of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the device embodiments described below are merely illustrative.
  • An electronic device of the embodiment comprising: a display 1101; a processor 1102; and a memory 1103 configured to store detection means of inventory abnormality data, the detection device of the inventory abnormality data being
  • the method includes the following steps: acquiring new transaction status change data of the to-be-detected order and new inventory change data corresponding thereto; and detecting the newly added inventory change data according to the newly added transaction status change data. Whether it is abnormal inventory change data.
  • the method, device and electronic device for detecting inventory abnormality data obtained new transaction state change data of the to-be-detected order and corresponding new inventory change data; and change data and pending orders according to the newly added transaction status.
  • the applied inventory deduction mode detects whether the new inventory change data is abnormal inventory change data, that is, real-time analysis and judgment on the correctness of the inventory change caused by each transaction status change, thereby enabling fine-grained detection. Inventory change data to identify problems in the inventory update process in a timely manner.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种库存异常数据的检测方法、装置及电子设备。所述库存异常数据的检测方法包括:获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。采用本申请提供的方法,能够对每一次交易状态变更所引起的库存变更的正确性进行实时的分析判断,从而能够达到细粒度的检测库存变更数据,及时发现库存更新过程中的问题。

Description

一种库存异常数据的检测方法、装置及电子设备
本申请要求2015年12月04日递交的申请号为201510882926.2、发明名称为“一种库存异常数据的检测方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据检测技术领域,具体涉及一种库存异常数据的检测方法、装置及电子设备。
背景技术
在大型电子商务网站运行过程中,网站记录的商品库存数据与商品实际库存量不一致是一个较为常见的问题,即:网站的商品库存数据不准确。库存数据不准确不仅会对平台业务产生极大的影响,同时也将损害其它各方的利益。对于一个包括海量商品的电子商务网站,需要实时准确地监控不准确的商品库存数据,智能的分析问题的产生原因,对不准确的商品库存数据有总的认识和详细原因的分析,以便做到从容应对。
导致商品库存数据不准确的关键因素包括业务因素和平台技术因素。其中业务因素包括商家对商品库存数据的错误设置等,平台技术因素包括技术原因导致的商品交易过程中库存扣减不准确等。相对于业务因素而言,平台技术因素是导致商品库存数据不准确的主要原因,例如,对订单操作后应该扣库存却没有扣库存,或者应该回补库存却没有回补库存等。由于电子商务平台通常涉及多个复杂系统(交易系统和库存管理系统等),因此要实时监控库存异常情况,尤其是针对有海量商品的系统,复杂性不言而喻。
最常见的情况是商品库存数据大于商品实际库存量,这种错误的库存数据将导致电子商务网站最终出现商品超卖的问题。商品超卖是商品库存数据不准确产生的最严重问题,同时也是卖家最容易发现的问题。卖家发现商品超卖后,首先将超卖情况反馈给网站,然后网站技术人员介入排查,这种处理方式是解决商品超卖问题的最原始方法。该方法存在的缺点是:只有在真正发生商品超卖后,才能发现系统存在这样的问题,而不能预见商品具有超卖风险。为了解决这个问题,现有技术通过利用Hadoop集群进行离线计算,以发现系统是否存在商品超卖风险。然而,该方法同样存在一些缺点,即:离线计算的非实时性不能满足实际需求。
为了能够实时地检测库存异常,目前通常采用在线实时监控的方法检测已经发生超卖情况的商品库存数据。该方法是以某个时间点的商品库存数据作为基准库存数据(一般取零点时刻的库存,故也叫零点库存),将基准库存数据与该时间点后预设时间间隔内的库存变化累计值进行比较,当发现基准库存数据小于库存变化累计值时,判定系统发生商品超卖问题。
由于上述在线实时监控的检测方法是基于一段时间的库存变化累计值来检测是否存在超卖风险的,因此,如果基准库存数据很大,则可能需要经历较长的时间间隔,才能够检测到基准库存数据小于库存变化累计值。可见,该方法并没有真正达到实时检测库存异常的效果,即:无法在每产生一个异常的库存变更数据时就将其检测出来。
发明内容
本申请提供一种库存异常数据的检测方法、装置及电子设备,以解决现有技术存在无法实时检测到每一个异常的库存变更数据的问题。
本申请提供一种库存异常数据的检测方法,包括:
获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;
根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
可选的,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;
判断所述新增库存变更数据和所述预期值是否相同;
若是,则判定所述新增库存变更数据为正常的库存变更数据;
若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断所述待检测订单的当前交易状态和所述预期交易状态是否相同;
若是,则判定所述新增库存变更数据为正常的库存变更数据;
若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同;
若是,则判定所述新增库存变更数据为正常的库存变更数据;
若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,如果检测到所述新增库存变更数据为所述异常的库存变更数据,还包括:
存储所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,还包括:
将所述待检测订单标记为库存更新异常的订单。
可选的,如果检测到所述新增库存变更数据为正常的库存变更数据,还包括:
判断所述待检测订单是否被标记为所述库存更新异常的订单;
若是,则删除所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,所述获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据,采用如下方式:
根据所述待检测订单的订单号,获取所述新增交易状态变更数据和所述新增库存变更数据。
可选的,还包括:
获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;
将所述异常处理结果作为所述异常的库存变更数据的异常原因。
可选的,所述处理结果存储在所述新增交易状态变更数据中;在将所述异常处理结果存储在所述新增交易状态变更数据中之前,还包括:
通过库存管理系统提供的库存接口,获取所述异常处理结果。
可选的,当监听到对应所述待检测订单的库存异常检测通知时,执行所述库存异常数据的检测方法。
可选的,所述库存异常数据的检测方法运行在基于实时分布式的计算处理框架构建的异常数据检测平台中。
可选的,所述库存异常检测通知,采用如下步骤生成:
通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台;
在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
可选的,所述预设的发送库存异常检测通知条件包括:当前时间与接收到所述新增交易状态变更数据或所述新增库存变更数据的时间间隔达到预设的时间间隔,或者待检测订单所占用的内存空间达到预设的内存空间。
可选的,在所述将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台之后,还包括:
根据预设的数据规范化规则,对所述新增交易状态变更数据和所述新增库存变更数据进行数据规则化处理。
相应的,本申请还提供一种库存异常数据的检测装置,包括:
第一获取单元,用于获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;
检测单元,用于根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
可选的,所述检测单元包括:
获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;
判断子单元,用于判断所述新增库存变更数据和所述预期值是否相同;
判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正 常的库存变更数据;
判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述检测单元包括:
获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元,用于根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断子单元,用于判断所述待检测订单的当前交易状态和所述预期交易状态是否相同;
判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述检测单元包括:
获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断子单元,用于判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同;
判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,如果检测到所述新增库存变更数据为所述异常的库存变更数据,还包括:
存储结果单元,用于存储所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,还包括:
标记单元,用于将所述待检测订单标记为库存更新异常的订单。
可选的,如果检测到所述新增库存变更数据为正常的库存变更数据,还包括:
判断单元,用于判断所述待检测订单是否被标记为所述库存更新异常的订单;
删除单元,用于如果上述判断结果为是,则删除所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,还包括:
第二获取单元,用于获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;
设置单元,用于将所述异常处理结果作为所述异常的库存变更数据的异常原因。
可选的,当监听到对应所述待检测订单的库存异常检测通知时,执行所述库存异常数据的检测方法。
可选的,所述库存异常数据的检测方法运行在基于实时分布式的计算处理框架构建的异常数据检测平台中。
可选的,还包括:
生成通知单元,用于生成所述库存异常检测通知。
可选的,所述生成通知单元包括:
同步子单元,用于通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台;
发送子单元,用于在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
可选的,所述生成通知单元还包括:
数据处理子单元,用于根据预设的数据规范化规则,对所述新增交易状态变更数据和所述新增库存变更数据进行数据规则化处理。
相应的,本申请还提供一种电子设备,包括:
显示器;
处理器;以及
存储器,所述存储器被配置成存储库存异常数据的检测装置,所述库存异常数据的检测装置被所述处理器执行时,包括如下步骤:获取待检测订单的新增交易状态变更数 据及与其对应的新增库存变更数据;根据所述新增交易状态变更数据,检测所述新增库存变更数据是否为异常的库存变更数据。
与现有技术相比,本申请具有以下优点:
本申请提供的库存异常数据的检测方法、装置及电子设备,通过获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;并根据新增交易状态变更数据和待检测订单应用的库存扣减模式,检测新增库存变更数据是否为异常的库存变更数据,即:对每一次交易状态变更所引起的库存变更的正确性进行实时的分析判断,从而能够达到细粒度的检测库存变更数据,及时发现库存更新过程中的问题。
附图说明
图1是本申请的库存异常数据的检测方法实施例的流程图;
图2是本申请的库存异常数据的检测方法实施例发送库存异常检测通知的流程图;
图3是本申请的库存异常数据的检测方法实施例异常数据检测平台的示意图;
图4是本申请的库存异常数据的检测方法实施例步骤S103的一种流程图;
图5是本申请的库存异常数据的检测装置实施例步骤S103的又一种流程图;
图6是本申请的库存异常数据的检测装置实施例步骤S103的再一种流程图;
图7是本申请的库存异常数据的检测装置实施例的示意图;
图8是本申请的库存异常数据的检测装置实施例检测单元103的具体示意图;
图9是本申请的库存异常数据的检测装置实施例的具体示意图;
图10是本申请的库存异常数据的检测装置实施例生成通知单元213的具体示意图;
图11是本申请的电子设备实施例的示意图。
具体实施方式
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。
在本申请中,提供了一种库存异常数据的检测方法、装置及电子设备。在下面的实施例中逐一进行详细说明。
本申请提供的库存异常数据的检测方法的核心的基本思想是:基于订单的交易状态变更数据检测相应的库存变更数据是否存在异常,即:细粒度的检测库存变更数据。由 于对每一次交易状态变更所引起的库存变更进行检测,因而能够实时发现库存更新过程中存在的问题,从而提高商品库存数据的准确性。
请参考图1,其为本申请的库存异常数据的检测方法实施例的流程图。所述方法包括如下步骤:
步骤S101:获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据。
本申请实施例所述的新增交易状态变更数据和新增库存变更数据,二者均为属于同一订单的变更数据,本申请实施例将这两方面数据同属的订单称为待检测订单。其中,新增交易状态变更数据是指,对订单进行操作时所产生的交易状态变更数据。订单操作包括:订单生成、付款、发货或退款操作等操作。对订单的操作将改变订单的交易状态,从而产生交易状态变更数据。与操作相对应的,订单的交易状态包括:订单状态、付款状态、发货状态和退款状态等。新增库存变更数据是指,与新增交易状态变更数据对应的新增库存变更数据,即:对订单进行操作时,将产生交易状态变更数据和库存变更数据两方面数据。
例1,购物网站售卖一种衣服,该衣服共有200件库存,其中红色100件,蓝色100件,且当前商品都采用“拍下减库存”的库存扣减模式;当小红在该网站中拍下红色衣服2件并且未付款时,系统首先生成一个新订单,假设订单号为100000001;与此同时,还将产生交易状态变更数据和库存变更数据,即:新增交易状态变更数据和新增库存变更数据;其中,交易状态变更数据包括:订单号=100000001、商品=红色的衣服、订单状态=已生效、付款状态=未付款、发货状态=未发货、退款状态=未退款;由于库存扣减模式为“拍下减库存”的模式,因此库存变更数据包括:订单号=100000001、商品=红色的衣服、可售库存的变更量=-2、可售库存的结果=98、预扣库存的变更量=0、预扣库存的结果=0、占用库存的变更量=0、占用库存的结果=0。
例2,如果例1中的小红在拍下商品后一直未付款,由于超时导致订单被关闭,则在订单关闭时,将产生交易状态变更数据和库存变更数据;其中,交易状态变更数据包括:订单号=100000001、商品=红色的衣服、订单状态=已生效、付款状态=订单关闭、发货状态=未发货、退款状态=未退款;由于库存扣减模式为“拍下减库存”的模式,因此库存变更数据包括:订单号=100000001、商品=红色的衣服、可售库存的变更量=2、可售库存的结果=100、预扣库存的变更量=0、预扣库存的结果=0、占用库存的变更量=0、占用库存的结果=0。
要基于交易状态变更数据来检测库存变更数据是否存在异常,首先需要获取新增交易状态变更数据及与其对应的新增库存变更数据这两方面数据。在本实施例中,获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据,采用如下方式:根据待检测订单的订单号,获取新增交易状态变更数据和新增库存变更数据。
当获取到待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据这两方面数据后,就可以进入步骤S103基于交易状态变更数据对库存变更数据是否存在异常进行检测。
需要注意的是,实际应用中的交易状态变更数据和库存变更数据通常来源于不同的系统,即:交易状态变更数据来源于交易系统,库存变更数据来源于库存管理系统。不同系统的数据变更是有先后顺序的,如果每一条数据变更都触发一次本申请实施例提供的方法,那么可能因为另一方面数据还没到,导致出现误判的结果。虽然此后可以在两方面数据均获取后再通过重新检测纠正该错误判定结果,但是却极大的降低了检测效率。可见,如果能在获取到交易状态变更数据和库存变更数据两方面数据后再进行检测,就会提高检测效率和系统性能。
为了能够在获取到两方面数据后再进行检测,本申请实施例提供的方法是在监听到对应待检测订单的库存异常检测通知时执行的。
请参考图2,其为本申请的库存异常数据的检测方法实施例发送库存异常检测通知的流程图。在本实施例中,库存异常检测通知,可以采用如下步骤生成:
步骤S201:通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台。
当对订单进行具体操作时,可以通过增量数据实时同步装置,将交易系统产生的新增交易状态变更数据和库存管理系统产生的新增库存变更数据同步到异常数据检测平台中。
为了便于实现异常数据检测平台,本申请实施例基于实时分布式的计算处理框架构建异常数据检测平台。请参考图3,其为本申请的库存异常数据的检测方法实施例异常数据检测平台的示意图。图3中的DRC是增量数据实时同步装置,通过DRC将交易系统和库存管理系统的增量数据的实时同步到异常数据检测平台,作为tradeSpout和invSpout的数据源。检测平台包括tradeSpout和invSpout两个数据源,以及etlBolt、actionBolt和checkBolt三个计算模块。其中,tradeSpout数据源包括新增交易状态变更数据,invSpout数据源包括新增库存变更数据。由于数据源是通过DRC接入进来的,因此 tradeSpout和invSpout的并发数与数据源的topic相关,二者相互对应。
图3检测平台中的etlBolt计算模块订阅tradeSpout和invSpout的变更数据,作为tradeSpout和invSpout数据源的下一级,etlBolt隔离了数据源物理上的数量关系,可以自由提高并发数。当etlBolt获取到任意一条新增数据后,将新增数据的订单号发射出去。
优选的,还可以通过etlBolt计算模块对新增交易状态变更数据和新增库存变更数据数据进行预处理(包括数据过滤等处理),以便能够将检测异常时真正需要的数据存储到HBASE中间表中。
步骤S203:在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
本申请实施例提供的方法是在异常数据检测平台接收到新增交易状态变更数据和新增库存变更数据的至少一者后,通过actionBolt计算模块控制库存异常检测通知的发送。actionBolt计算模块用于控制发送库存异常检测通知,当预设的发送库存异常检测通知条件成立时将订单号发射出去。
具体的,预设的发送库存异常检测通知条件包括:当前时间与接收到所述新增交易状态变更数据或所述新增库存变更数据的时间间隔达到预设的时间间隔,或者待检测订单所占用的内存空间达到预设的内存空间。其中,第一个条件是在获取到第一条新增数据后的预设时间间隔后发送对于该新增数据所属订单的库存异常检测通知,即:假设两方面数据的到达时间间隔应该在预设时间间隔内;上述第二个条件是当存储新增数据的内存空间达到预设内存最大范围时,发送对于该新增数据所属订单的库存异常检测通知。
通过上述步骤S201和步骤S203,能够控制执行本申请提供的方法的时机。检测平台中的checkBolt计算模块订阅actionBolt的数据,当接收到actionBolt发送的库存异常检测通知时,根据通知中的订单号,从HBASE里取出该订单号的新增交易状态变更数据和新增库存变更数据,执行本申请实施例提供的方法,进行库存异常数据的检测,如果检测到数据异常,则将异常数据输出到数据库中。本申请实施例将库存异常数据的检测逻辑,作为异常数据检测平台的业务插件,通过JAR包的方式在检测平台上实时运行起来,实现业务目标。
本申请实施例通过现有的实时分布式的计算处理框架STORM和HBASE数据存储系统构建异常数据检测平台,不仅简化了平台构建的过程,而且构建的检测平台独立于交易系统和库存管理系统,不会对交易系统和库存管理系统产生负担。
步骤S103:根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
当获取到待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据后,就可以基于交易状态变更数据来检测库存变更数据是否存在异常。
本申请实施例所述的库存扣减模式是由库存管理系统提供的,例如,拍下减库存模式或付款减库存等模式。交易系统根据业务需要决定采用哪一种库存扣减模式。因此,库存扣减模式可以存储在交易状态变更数据中。库存变更数据与库存扣减模式有关,在相同的交易状态变更数据下,如果库存扣减模式不同,则产生的库存变更数据也是不同的。本申请实施例提供的方法是基于已知库存扣减模式的大前提,根据新增交易状态变更数据检测新增库存变更数据是否异常。
在实际应用中,可以采用多种检测方案检测新增库存变更数据是否异常。下面给出步骤S103的三种可选的实施方案:
1)方案一
方案一的基本思想是实现从交易状态变更数据到库存变更数据的检测,即:将库存变更数据的实际值和预期值进行比较。请参考图4,其为本申请的库存异常数据的检测方法实施例步骤S103的一种流程图。方案一的步骤S103包括:
步骤S1031:根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态。
方案一首先需要从新增交易状态变更数据中获取待检测订单的当前交易状态。以步骤S101中的例1对当前交易状态进行说明,该例中新增交易状态变更数据包括:订单号=100000001、商品=红色的衣服、订单状态=已生效、付款状态=未付款、发货状态=未发货、退款状态=未退款,其中当前交易状态为:订单状态=已生效、付款状态=未付款、发货状态=未发货、退款状态=未退款。
步骤S1033:根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值。
根据当前交易状态和待检测订单应用的库存扣减模式,能够计算出新增库存变更数据的预期值。继续以步骤S101中的例1对本步骤进行说明,由于当前商品都采用“拍下减库存”的库存扣减模式,并且当前交易状态为:订单状态=已生效、付款状态=未付款、发货状态=未发货、退款状态=未退款,因此库存变更数据的预期值应该为:订单号=100000001、商品=红色的衣服、可售库存的变更量=-2、可售库存的结果=98、预扣库存 的变更量=0、预扣库存的结果=0、占用库存的变更量=0、占用库存的结果=0。
在实际应用中,可以根据具体的应用需求,设置库存变更数据预期值的计算规则,以“拍下减库存”的库存扣减模式为例,可应用的计算规则包括:1)当订单状态是未生效状态时,如果可售库存已减,则预期值为回补可售库存;2)当订单状态是生效状态时,预期值为可售库存已减;3)当订单状态是付款前关闭时,如果可售库存已减,则预期值为回补可售库存。上述各种不同的计算规则,只是具体实施方式的变更,都不偏离本申请的核心,因此都在本申请的保护范围之内。
步骤S1035:判断所述新增库存变更数据和所述预期值是否相同。
将新增库存变更数据中的实际变更数据与步骤S1033获取的库存变更数据的预期值进行对比,判断二者是否一致。
步骤S1037:若是,则判定所述新增库存变更数据为正常的库存变更数据。
如果新增库存变更数据中的实际值与预期值相同,则能够判定新增库存变更数据为正常的库存变更数据。
步骤S1039:若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
相反的,如果新增库存变更数据中的实际值与预期值不相同,则能够判定新增库存变更数据为异常的库存变更数据。
通过方案一,能够实现从交易状态变更数据到库存变更数据这个维度的异常库存数据检测。
2)方案二
与方案一相反,方案二的基本思想是实现从库存变更数据到交易状态变更数据的检测,即:将交易变更数据的实际值和预期值进行比较。请参考图5,其为本申请的库存异常数据的检测方法实施例步骤S103的又一种流程图。所述根据所述新增交易状态变更数据,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
步骤S1031’:根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态。
步骤S1031’与步骤S1031相同,此处不再赘述。
步骤S1033’:根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态。
根据新增库存变更数据和待检测订单应用的库存扣减模式,能够反向推导出待检测订单的预期交易状态。仍以步骤S101中的例1对本步骤进行说明,由于当前商品都采用 “拍下减库存”的库存扣减模式,并且库存变更数据为:订单号=100000001、商品=红色的衣服、可售库存的变更量=-2、可售库存的结果=98、预扣库存的变更量=0、预扣库存的结果=0、占用库存的变更量=0、占用库存的结果=0,因此当前交易状态的预期值应该为:订单状态=已生效、付款状态=未付款、发货状态=未发货、退款状态=未退款。
步骤S1035’:判断所述待检测订单的当前交易状态和所述预期交易状态是否相同。
将新增交易状态变更数据中的实际交易状态与获取到的预期交易状态逐一进行对比,判断各种交易状态的实际值与预期值是否均一致。
步骤S1037’:若是,则判定所述新增库存变更数据为正常的库存变更数据。
如果新增交易状态变更数据中的实际值与预期值相同,则能够判定新增库存变更数据为正常的库存变更数据。
步骤S1037’:若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
相反的,如果新增交易状态变更数据中的实际值与预期值不相同,则能够判定新增库存变更数据为异常的库存变更数据。
通过方案二,能够实现从库存变更数据到交易状态变更数据这个维度的异常库存数据检测。
3)方案三
方案三是将方案一与方案二相结合,实现从交易状态变更数据到库存变更数据,以及从库存变更数据到交易状态变更数据的两个维度的检测。请参考图6,其为本申请的库存异常数据的检测方法实施例步骤S103的再一种流程图。所述根据所述新增交易状态变更数据,检测所述新增库存变更数据是否为异常的库存变更数据常,包括:
步骤S1031”:根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态。
步骤S1031”与步骤S1031相同,此处不再赘述。
步骤S1033”:根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态。
本步骤综合了上述步骤S1033和步骤S1033’,此处不再赘述。
步骤S1035”:判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同。
本步骤判断新增库存变更数据的实际值是否与预期值相同,以及待检测订单的当前 交易状态和预期交易状态是否相同。
步骤S1037”:若是,则判定所述新增库存变更数据为正常的库存变更数据。
如果新增库存变更数据中的实际值与预期值相同,并且待检测订单的当前交易状态和预期交易状态也相同,则能够判定新增库存变更数据为正常的库存变更数据。
步骤S1039”:若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
相反的,如果新增库存变更数据中的实际值与预期值不相同,或者待检测订单的当前交易状态和预期交易状态不相同,则能够判定新增库存变更数据为异常的库存变更数据。
在实际应用中,可以根据具体的应用需求,选择上述方案之一实现步骤S103。上述各种不同的检测方案,只是具体实施方式的变更,都不偏离本申请的核心,因此都在本申请的保护范围之内。
需要说明的是,如果步骤S103检测到新增库存变更数据为异常的库存变更数据,由于该异常可能是由于缺少一方面的新增数据等原因而造成的误判,为了使得后期能够对误判结果进行纠正,本申请实施例提供的方法还包括:存储新增库存变更数据为异常的库存变更数据的检测结果的步骤。并且,为了便于后期易于查找到判定为异常的库存变更数据,优选的方法是将待检测订单标记为库存更新异常的订单。相应的,在对每一对新增数据进行检测时,如果检测到新增库存变更数据为正常的库存变更数据,则检测方法还包括:判断待检测订单是否被标记为库存更新异常的订单。如果发现该订单已经被标记为库存更新异常的订单,则需要删除新增库存变更数据为异常的库存变更数据的检测结果,由此实现对误判结果的纠正。
通过上述步骤S101和步骤S103,能够对每一次交易状态变更所引起的库存变更数据进行检测,实时发现库存更新过程中存在的问题,从而提高商品库存数据的准确性。
在实际应用中,不仅需要检测出异常的库存变更数据,还需要定位出异常数据的产生原因,以确定有效的解决方案,从而做到及时止损。通过本申请实施例提供的方法,能够直接确定较粗细度的异常原因,例如,可售库存该减未减或可售库存该回补未回补等。但是,在实际应用中,还需要分析出异常数据产生的细粒度原因,例如,导致可售库存该减未减的进一步原因是可售库存不足,还是商品数据被删除等。现有技术通过人工查找库存管理系统日志的方法,以获取异常的库存更新数据产生的细粒度原因。由于该方法是由人工操作的,因而需要消耗大量的人力,是一个浩大的工程。
为了解决现有技术存在的无法自动定位异常的库存更新数据产生的细粒度原因的问 题,本申请实施例提供的方法还包括:1)获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;2)将所述异常处理结果作为所述异常的库存变更数据的异常原因。
本申请实施例所述的异常处理结果是指,库存管理系统在生成库存变更数据时对外返回的错误码或错误描述。库存管理系统在生成库存变更数据时,一般都会分析出失败原因,然后对外返回相应的错误码和错误描述,并将这些错误码和错误描述记录到异常日志文件中。现有技术即通过人工查找异常日志文件的方法获取细粒度的异常原因。
本申请实施例提供的方法是将上述异常处理结果预先存储在新增交易状态变更数据或新增库存变更数据中,使得当判断出新增库存变更数据为异常数据时,能够通过直接读取预先存储的异常处理结果,从而获取到库存变更数据出现异常的细粒度原因。
优选的,将异常处理结果预先存储在新增交易状态变更数据中,使得在新增交易状态变更数据和新增库存变更数据不同步的情况下,能够用异常处理结果替代新增库存变更数据,以确定异常的库存变更数据,达到减少异常数据的误判率的效果。
具体的,库存管理系统提供库存接口以供交易系统在需要的场景下调用。交易系统将库存接口映射为简短数字的返回信息保存在新增交易状态变更数据中。
在上述的实施例中,提供了一种库存异常数据的检测方法,与之相对应的,本申请还提供一种库存异常数据的检测装置。该装置是与上述方法的实施例相对应。
请参看图7,其为本申请的库存异常数据的检测装置实施例的示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。
本实施例的一种库存异常数据的检测装置,包括:
第一获取单元101,用于获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;
检测单元103,用于根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
请参看图8,其为本申请的库存异常数据的检测装置实施例检测单元103的具体示意图。可选的,所述检测单元103包括:
获取子单元1031,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元1033,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模 式,计算所述新增库存变更数据的预期值;
判断子单元1035,用于判断所述新增库存变更数据和所述预期值是否相同;
判定正常子单元1037,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
判定异常子单元1039,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述检测单元103包括:
获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元,用于根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断子单元,用于判断所述待检测订单的当前交易状态和所述预期交易状态是否相同;
判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
可选的,所述检测单元103包括:
获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
计算子单元,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
判断子单元,用于判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同;
判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
请参看图9,其为本申请的库存异常数据的检测装置实施例的具体示意图。可选的, 如果检测到所述新增库存变更数据为所述异常的库存变更数据,还包括:
存储结果单元201,用于存储所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,还包括:
标记单元203,用于将所述待检测订单标记为库存更新异常的订单。
可选的,如果检测到所述新增库存变更数据为正常的库存变更数据,还包括:
判断单元205,用于判断所述待检测订单是否被标记为所述库存更新异常的订单;
删除单元207,用于如果上述判断结果为是,则删除所述新增库存变更数据为所述异常的库存变更数据的检测结果。
可选的,还包括:
第二获取单元209,用于获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;
设置单元211,用于将所述处理结果作为所述异常的库存变更数据的异常原因。
可选的,当监听到对应所述待检测订单的库存异常检测通知时,执行所述库存异常数据的检测方法。
可选的,所述库存异常数据的检测方法运行在基于实时分布式的计算处理框架构建的异常数据检测平台中。
可选的,还包括:
生成通知单元213,用于生成所述库存异常检测通知。
请参看图10,其为本申请的库存异常数据的检测装置实施例生成通知单元213的具体示意图。可选的,所述生成通知单元213包括:
同步子单元2131,用于通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台;
发送子单元2133,用于在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
可选的,所述生成通知单元213还包括:
数据处理子单元2132,用于根据预设的数据规范化规则,对所述新增交易状态变更数据和所述新增库存变更数据进行数据规则化处理。
请参考图11,其为本申请的电子设备实施例的示意图。由于设备实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的设备实施例仅仅是示意性的。
本实施例的一种电子设备,该电子设备包括:显示器1101;处理器1102;以及存储器1103,所述存储器1103被配置成存储库存异常数据的检测装置,所述库存异常数据的检测装置被所述处理器1102执行时,包括如下步骤:获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;根据所述新增交易状态变更数据,检测所述新增库存变更数据是否为异常的库存变更数据。
本申请提供的库存异常数据的检测方法、装置及电子设备,通过获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;并根据新增交易状态变更数据和待检测订单应用的库存扣减模式,检测新增库存变更数据是否为异常的库存变更数据,即:对每一次交易状态变更所引起的库存变更的正确性进行实时的分析判断,从而能够达到细粒度的检测库存变更数据,及时发现库存更新过程中的问题。
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。

Claims (29)

  1. 一种库存异常数据的检测方法,其特征在于,包括:
    获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;
    根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
  2. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
    根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;
    判断所述新增库存变更数据和所述预期值是否相同;
    若是,则判定所述新增库存变更数据为正常的库存变更数据;
    若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
  3. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
    根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
    判断所述待检测订单的当前交易状态和所述预期交易状态是否相同;
    若是,则判定所述新增库存变更数据为正常的库存变更数据;
    若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
  4. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,所述根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据,包括:
    根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
    判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同;
    若是,则判定所述新增库存变更数据为正常的库存变更数据;
    若否,则判定所述新增库存变更数据为所述异常的库存变更数据。
  5. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,如果检测到所述新增库存变更数据为所述异常的库存变更数据,还包括:
    存储所述新增库存变更数据为所述异常的库存变更数据的检测结果。
  6. 根据权利要求5所述的库存异常数据的检测方法,其特征在于,还包括:
    将所述待检测订单标记为库存更新异常的订单。
  7. 根据权利要求6所述的库存异常数据的检测方法,其特征在于,如果检测到所述新增库存变更数据为正常的库存变更数据,还包括:
    判断所述待检测订单是否被标记为所述库存更新异常的订单;
    若是,则删除所述新增库存变更数据为所述异常的库存变更数据的检测结果。
  8. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,所述获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据,采用如下方式:
    根据所述待检测订单的订单号,获取所述新增交易状态变更数据和所述新增库存变更数据。
  9. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,还包括:
    获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;
    将所述异常处理结果作为所述异常的库存变更数据的异常原因。
  10. 根据权利要求9所述的库存异常数据的检测方法,其特征在于,所述处理结果存储在所述新增交易状态变更数据中;在将所述异常处理结果存储在所述新增交易状态变更数据中之前,还包括:
    通过库存管理系统提供的库存接口,获取所述异常处理结果。
  11. 根据权利要求1所述的库存异常数据的检测方法,其特征在于,当监听到对应所述待检测订单的库存异常检测通知时,执行所述库存异常数据的检测方法。
  12. 根据权利要求11所述的库存异常数据的检测方法,其特征在于,所述库存异常数据的检测方法运行在基于实时分布式的计算处理框架构建的异常数据检测平台中。
  13. 根据权利要求12所述的库存异常数据的检测方法,其特征在于,所述库存异 常检测通知,采用如下步骤生成:
    通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台;
    在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
  14. 根据权利要求13所述的库存异常数据的检测方法,其特征在于,所述预设的发送库存异常检测通知条件包括:当前时间与接收到所述新增交易状态变更数据或所述新增库存变更数据的时间间隔达到预设的时间间隔,或者待检测订单所占用的内存空间达到预设的内存空间。
  15. 根据权利要求12所述的库存异常数据的检测方法,其特征在于,在所述将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台之后,还包括:
    根据预设的数据规范化规则,对所述新增交易状态变更数据和所述新增库存变更数据进行数据规则化处理。
  16. 一种库存异常数据的检测装置,其特征在于,包括:
    第一获取单元,用于获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;
    检测单元,用于根据所述新增交易状态变更数据和所述待检测订单应用的库存扣减模式,检测所述新增库存变更数据是否为异常的库存变更数据。
  17. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,所述检测单元包括:
    获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    计算子单元,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;
    判断子单元,用于判断所述新增库存变更数据和所述预期值是否相同;
    判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
    判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所 述异常的库存变更数据。
  18. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,所述检测单元包括:
    获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    计算子单元,用于根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
    判断子单元,用于判断所述待检测订单的当前交易状态和所述预期交易状态是否相同;
    判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
    判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
  19. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,所述检测单元包括:
    获取子单元,用于根据所述新增交易状态变更数据,获取所述待检测订单的当前交易状态;
    计算子单元,用于根据所述当前交易状态和所述待检测订单应用的库存扣减模式,计算所述新增库存变更数据的预期值;以及根据所述待检测订单应用的库存扣减模式和所述新增库存变更数据,生成所述待检测订单的预期交易状态;
    判断子单元,用于判断所述新增库存变更数据和所述预期值是否相同,以及所述待检测订单的当前交易状态和所述预期交易状态是否相同;
    判定正常子单元,用于如果上述判断结果为是,则判定所述新增库存变更数据为正常的库存变更数据;
    判定异常子单元,用于如果上述判断结果为否,则判定所述新增库存变更数据为所述异常的库存变更数据。
  20. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,如果检测到所述新增库存变更数据为所述异常的库存变更数据,还包括:
    存储结果单元,用于存储所述新增库存变更数据为所述异常的库存变更数据的检测结果。
  21. 根据权利要求20所述的库存异常数据的检测装置,其特征在于,还包括:
    标记单元,用于将所述待检测订单标记为库存更新异常的订单。
  22. 根据权利要求21所述的库存异常数据的检测装置,其特征在于,如果检测到所述新增库存变更数据为正常的库存变更数据,还包括:
    判断单元,用于判断所述待检测订单是否被标记为所述库存更新异常的订单;
    删除单元,用于如果上述判断结果为是,则删除所述新增库存变更数据为所述异常的库存变更数据的检测结果。
  23. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,还包括:
    第二获取单元,用于获取预先存储的生成所述新增库存变更数据时的异常处理结果;所述异常处理结果存储在所述新增交易状态变更数据或所述新增库存变更数据中;
    设置单元,用于将所述异常处理结果作为所述异常的库存变更数据的异常原因。
  24. 根据权利要求16所述的库存异常数据的检测装置,其特征在于,当监听到对应所述待检测订单的库存异常检测通知时,执行所述库存异常数据的检测方法。
  25. 根据权利要求24所述的库存异常数据的检测装置,其特征在于,所述库存异常数据的检测方法运行在基于实时分布式的计算处理框架构建的异常数据检测平台中。
  26. 根据权利要求25所述的库存异常数据的检测装置,其特征在于,还包括:
    生成通知单元,用于生成所述库存异常检测通知。
  27. 根据权利要求26所述的库存异常数据的检测装置,其特征在于,所述生成通知单元包括:
    同步子单元,用于通过增量数据实时同步装置,将所述新增交易状态变更数据和所述新增库存变更数据同步到所述异常数据检测平台;
    发送子单元,用于在所述异常数据检测平台接收到所述新增交易状态变更数据和所述新增库存变更数据的至少一者后,若预设的发送库存异常检测通知条件成立,则发送对应所述新增交易状态变更数据或所述新增库存变更数据所属的订单的库存异常检测通知。
  28. 根据权利要求26所述的库存异常数据的检测装置,其特征在于,所述生成通知单元还包括:
    数据处理子单元,用于根据预设的数据规范化规则,对所述新增交易状态变更数据和所述新增库存变更数据进行数据规则化处理。
  29. 一种电子设备,其特征在于,包括:
    显示器;
    处理器;以及
    存储器,所述存储器被配置成存储库存异常数据的检测装置,所述库存异常数据的检测装置被所述处理器执行时,包括如下步骤:获取待检测订单的新增交易状态变更数据及与其对应的新增库存变更数据;根据所述新增交易状态变更数据,检测所述新增库存变更数据是否为异常的库存变更数据。
PCT/CN2016/107016 2015-12-04 2016-11-24 一种库存异常数据的检测方法、装置及电子设备 WO2017092599A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510882926.2A CN106845881A (zh) 2015-12-04 2015-12-04 一种库存异常数据的检测方法、装置及电子设备
CN201510882926.2 2015-12-04

Publications (1)

Publication Number Publication Date
WO2017092599A1 true WO2017092599A1 (zh) 2017-06-08

Family

ID=58796277

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/107016 WO2017092599A1 (zh) 2015-12-04 2016-11-24 一种库存异常数据的检测方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN106845881A (zh)
WO (1) WO2017092599A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107633343A (zh) * 2017-08-09 2018-01-26 杭州洋驼网络科技有限公司 交易数据变化风险识别系统及方法
CN111125180A (zh) * 2018-10-30 2020-05-08 千寻位置网络有限公司 库存数据的统计方法及装置、服务器及分布式购买系统
CN109815262A (zh) * 2018-12-27 2019-05-28 四川驹马科技有限公司 一种基于wal模式的库存管理方法及其系统
CN109872100A (zh) * 2018-12-28 2019-06-11 航天信息股份有限公司 一种成品油库存变更管理方法及系统
CN113807923B (zh) * 2021-09-23 2024-02-09 杭州右文网络科技有限公司 一种订单处理方法、装置、电子设备及可读存储介质
CN114548952A (zh) * 2022-04-22 2022-05-27 武汉中科通达高新技术股份有限公司 交易数据校验方法、装置、计算机设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636933A (zh) * 2015-02-11 2015-05-20 广州唯品会信息科技有限公司 电子商务网站超卖原因定位的方法及装置
CN104699712A (zh) * 2013-12-09 2015-06-10 阿里巴巴集团控股有限公司 对数据库中的库存记录信息进行更新的方法及装置
CN105096065A (zh) * 2014-04-16 2015-11-25 阿里巴巴集团控股有限公司 一种库存扣减方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000163344A (ja) * 1998-11-27 2000-06-16 Nec Corp ネットワーク管理システムのデータベース復旧方式
CN102945257B (zh) * 2012-10-18 2016-08-17 北京京东世纪贸易有限公司 初始化数据库的方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699712A (zh) * 2013-12-09 2015-06-10 阿里巴巴集团控股有限公司 对数据库中的库存记录信息进行更新的方法及装置
CN105096065A (zh) * 2014-04-16 2015-11-25 阿里巴巴集团控股有限公司 一种库存扣减方法和装置
CN104636933A (zh) * 2015-02-11 2015-05-20 广州唯品会信息科技有限公司 电子商务网站超卖原因定位的方法及装置

Also Published As

Publication number Publication date
CN106845881A (zh) 2017-06-13

Similar Documents

Publication Publication Date Title
WO2017092599A1 (zh) 一种库存异常数据的检测方法、装置及电子设备
Byrne et al. How fast are semiconductor prices falling?
US10599679B2 (en) Platform data aggregation and semantic modeling
TWI673666B (zh) 資料風險控制的方法及裝置
US10521446B2 (en) System and method for dynamically refactoring business data objects
US11915195B2 (en) Systems and methods for intelligent field matching and anomaly detection
CN110874778A (zh) 异常订单检测方法及装置
US9779406B2 (en) User feature identification method and apparatus
US20210118025A1 (en) System and method for distributed, secure computing system
JP2020515935A (ja) Iot対応支払方法及びシステム
US10868741B2 (en) Anchor shortening across streaming nodes
US10073726B2 (en) Detection of outage in cloud based service using usage data based error signals
CN107633015A (zh) 一种数据处理方法、装置及设备
WO2017118318A1 (zh) 一种数据存储与业务处理的方法及装置
WO2021129104A1 (zh) 一种业务信息的处理方法、装置及电子设备
US20230359587A1 (en) Analysis of streaming data using deltas and snapshots
US9953294B2 (en) Enabling an in-memory transactional application
US20150356575A1 (en) Methods and systems for predicting online and in-store purchasing
CN105447707B (zh) 数据处理方法及装置
US20150154606A1 (en) System, method, and software for enterprise-wide complaint aggregation
US10747842B2 (en) Optimizing linear programming models using different solvers
CN111274255B (zh) 业务数据监控方法及系统、监控架构、设备、存储介质
CA3000281A1 (en) Content based message routing for supply chain information sharing
US11681670B1 (en) Systems and methods for data verification
US11768855B1 (en) Replicating data across databases by utilizing validation functions for data completeness and sequencing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16869909

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16869909

Country of ref document: EP

Kind code of ref document: A1